Commit 40a655c1 authored by 温志超's avatar 温志超

更新报表

parent ede6e3cf
...@@ -69,29 +69,34 @@ public class ProFeedback extends BaseEntity { ...@@ -69,29 +69,34 @@ public class ProFeedback extends BaseEntity {
* 工作中心ID * 工作中心ID
*/ */
@Excel(name = "工作中心ID") @Excel(name = "工作中心ID")
@ApiModelProperty( "工单类型")
private Long workstationId; private Long workstationId;
/** /**
* 工作中心编号 * 工作中心编号
*/ */
@Excel(name = "工作中心编号") @Excel(name = "工作中心编号")
@ApiModelProperty( "工单类型")
private String workstationCode; private String workstationCode;
/** /**
* 工作中心名称 * 工作中心名称
*/ */
@Excel(name = "工作中心名称") @Excel(name = "工作中心名称")
@ApiModelProperty( "工单类型")
private String workstationName; private String workstationName;
/** /**
* 工序ID * 工序ID
*/ */
@ApiModelProperty( "工单类型")
private Long processId; private Long processId;
/** /**
* 工序编码 * 工序编码
*/ */
@Excel(name = "工序编码") @Excel(name = "工序编码")
@ApiModelProperty( "工单类型")
private String processCode; private String processCode;
/** /**
...@@ -114,12 +119,14 @@ public class ProFeedback extends BaseEntity { ...@@ -114,12 +119,14 @@ public class ProFeedback extends BaseEntity {
* 生产工单编号 * 生产工单编号
*/ */
@Excel(name = "生产工单编号") @Excel(name = "生产工单编号")
@ApiModelProperty( "生产工单编号")
private String workorderCode; private String workorderCode;
/** /**
* 生产工单名称 * 生产工单名称
*/ */
@Excel(name = "生产工单名称") @Excel(name = "生产工单名称")
@ApiModelProperty( "生产工单名称")
private String workorderName; private String workorderName;
/** /**
...@@ -132,6 +139,7 @@ public class ProFeedback extends BaseEntity { ...@@ -132,6 +139,7 @@ public class ProFeedback extends BaseEntity {
* 生产任务编号 * 生产任务编号
*/ */
@Excel(name = "生产任务编号") @Excel(name = "生产任务编号")
@ApiModelProperty( "生产任务编号")
private String taskCode; private String taskCode;
/** /**
...@@ -144,30 +152,35 @@ public class ProFeedback extends BaseEntity { ...@@ -144,30 +152,35 @@ public class ProFeedback extends BaseEntity {
* 产品物料编码 * 产品物料编码
*/ */
@Excel(name = "产品物料编码") @Excel(name = "产品物料编码")
@ApiModelProperty( "产品物料编码")
private String itemCode; private String itemCode;
/** /**
* sap产品物料编码 * sap产品物料编码
*/ */
@Excel(name = "sap产品物料编码") @Excel(name = "sap产品物料编码")
@ApiModelProperty( "sap产品物料编码")
private String sapItemCode; private String sapItemCode;
/** /**
* 产品物料名称 * 产品物料名称
*/ */
@Excel(name = "产品物料名称") @Excel(name = "产品物料名称")
@ApiModelProperty( "产品物料名称")
private String itemName; private String itemName;
/** /**
* 规格型号 * 规格型号
*/ */
@Excel(name = "规格型号") @Excel(name = "规格型号")
@ApiModelProperty( "规格型号")
private String specification; private String specification;
/** /**
* 单位 * 单位
*/ */
@Excel(name = "单位") @Excel(name = "单位")
@ApiModelProperty( "单位")
private String unitOfMeasure; private String unitOfMeasure;
...@@ -175,40 +188,47 @@ public class ProFeedback extends BaseEntity { ...@@ -175,40 +188,47 @@ public class ProFeedback extends BaseEntity {
* 排产数量 * 排产数量
*/ */
@Excel(name = "排产数量") @Excel(name = "排产数量")
@ApiModelProperty( "排产数量")
private BigDecimal quantity; private BigDecimal quantity;
/** /**
* 本次报工数量 * 本次报工数量
*/ */
@Excel(name = "本次报工数量") @Excel(name = "本次报工数量")
@ApiModelProperty( "本次报工数量")
private BigDecimal quantityFeedback; private BigDecimal quantityFeedback;
/** /**
* 合格品数量 * 合格品数量
*/ */
@Excel(name = "合格品数量") @Excel(name = "合格品数量")
@ApiModelProperty( "合格品数量")
private BigDecimal quantityQualify; private BigDecimal quantityQualify;
/** /**
* 不良品数量 * 不良品数量
*/ */
@Excel(name = "不良品数量") @Excel(name = "不良品数量")
@ApiModelProperty( "不良品数量")
private BigDecimal quantityUnqualify; private BigDecimal quantityUnqualify;
@Excel(name = "待检测数量") @Excel(name = "待检测数量")
@ApiModelProperty( "待检测数量")
private BigDecimal quantityUncheck; private BigDecimal quantityUncheck;
/** /**
* 报工用户名 * 报工用户名
*/ */
@Excel(name = "报工用户名") @Excel(name = "报工用户名")
@ApiModelProperty( "报工用户名")
private String userName; private String userName;
private String userId; private String userId;
/** /**
* 昵称 * 昵称
*/ */
@Excel(name = "昵称") @Excel(name = "报工用户昵称")
@ApiModelProperty( "报工用户昵称")
private String nickName; private String nickName;
/** /**
...@@ -230,12 +250,14 @@ public class ProFeedback extends BaseEntity { ...@@ -230,12 +250,14 @@ public class ProFeedback extends BaseEntity {
* 审批人员 * 审批人员
*/ */
@Excel(name = "审批人员") @Excel(name = "审批人员")
@ApiModelProperty( "审批人员")
private String recordUser; private String recordUser;
/** /**
* 审批人员名称 * 审批人员名称
*/ */
@Excel(name = "审批人员名称") @Excel(name = "审批人员名称")
@ApiModelProperty( "审批人员名称")
private String recordNick; private String recordNick;
/** /**
...@@ -314,16 +336,21 @@ public class ProFeedback extends BaseEntity { ...@@ -314,16 +336,21 @@ public class ProFeedback extends BaseEntity {
private String sapRequestParam; private String sapRequestParam;
private String sapResponse; private String sapResponse;
@ApiModelProperty( "异常原因ID")
private Long abnormalId; private Long abnormalId;
/** 异常类型 */ /** 异常类型 */
@ApiModelProperty( "异常类型")
private String abnormalType; private String abnormalType;
/** 异常原因 */ /** 异常原因 */
@ApiModelProperty( "异常原因")
private String abnormalReason; private String abnormalReason;
/** 异常原因 备注*/ /** 异常原因 备注*/
@ApiModelProperty( "异常原因 备注")
private String abnormalRemark; private String abnormalRemark;
@ApiModelProperty( "是否最后一次报工")
private Boolean lastFeedback; private Boolean lastFeedback;
......
...@@ -7,6 +7,7 @@ import com.ximai.mes.pro.domain.vo.ProProcessTaskVo; ...@@ -7,6 +7,7 @@ import com.ximai.mes.pro.domain.vo.ProProcessTaskVo;
import com.ximai.mes.pro.dto.ProFeedbackDto; import com.ximai.mes.pro.dto.ProFeedbackDto;
import com.ximai.mes.report.request.FeedbackRequest; import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.response.FeedbackResponse; import com.ximai.mes.report.response.FeedbackResponse;
import com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P; import org.springframework.security.core.parameters.P;
...@@ -139,4 +140,6 @@ public interface ProFeedbackMapper { ...@@ -139,4 +140,6 @@ public interface ProFeedbackMapper {
List<FeedbackResponse> getListByUser(FeedbackRequest feedbackRequest); List<FeedbackResponse> getListByUser(FeedbackRequest feedbackRequest);
int selectCount(@Param("taskIds")List<Long> taskIds); int selectCount(@Param("taskIds")List<Long> taskIds);
List<WorkOrderProgressFeedbackListResponse> getFeedbackList(@Param("workorderCode")String workorderCode,@Param("taskId") Long taskId);
} }
...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder; import com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder;
import com.ximai.mes.pro.domain.task.ProTask; import com.ximai.mes.pro.domain.task.ProTask;
import com.ximai.mes.pro.domain.vo.*; import com.ximai.mes.pro.domain.vo.*;
import com.ximai.mes.report.request.WorkOrderProgressRequest;
import com.ximai.mes.report.response.WorkOrderProgressListResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -150,4 +152,6 @@ public interface ProWorkorderMapper extends BaseMapper<ProWorkorder> { ...@@ -150,4 +152,6 @@ public interface ProWorkorderMapper extends BaseMapper<ProWorkorder> {
int updateProductionSolution(@Param("productionSolutionId") Long productionSolutionId, @Param("productionSolutionCode")String productionSolutionCode, @Param("productionSolutionName")String productionSolutionName,@Param("workorderId")Long workorderId); int updateProductionSolution(@Param("productionSolutionId") Long productionSolutionId, @Param("productionSolutionCode")String productionSolutionCode, @Param("productionSolutionName")String productionSolutionName,@Param("workorderId")Long workorderId);
void rollBACKschedule(@Param("workorderCode")String workorderCode, @Param("quantity")BigDecimal quantity, @Param("username")String username); void rollBACKschedule(@Param("workorderCode")String workorderCode, @Param("quantity")BigDecimal quantity, @Param("username")String username);
List<WorkOrderProgressListResponse> getWorkOrderProgressServiceList(WorkOrderProgressRequest workOrderProgressRequest);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.pro.domain.task.ProTask; import com.ximai.mes.pro.domain.task.ProTask;
import com.ximai.mes.pro.domain.vo.ProTaskVo; import com.ximai.mes.pro.domain.vo.ProTaskVo;
import com.ximai.mes.report.response.WorkOrderProgressProcessListResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -197,4 +198,6 @@ public interface ProTaskMapper extends BaseMapper<ProTask> { ...@@ -197,4 +198,6 @@ public interface ProTaskMapper extends BaseMapper<ProTask> {
List<ProTask> selectByTaskBatch(@Param("taskBatch")String taskBatch); List<ProTask> selectByTaskBatch(@Param("taskBatch")String taskBatch);
void deleteByTaskBatch(@Param("taskBatch")String taskBatch); void deleteByTaskBatch(@Param("taskBatch")String taskBatch);
List<WorkOrderProgressProcessListResponse> getProcessList(@Param("workorderCode")String workorderCode);
} }
...@@ -16,6 +16,7 @@ import com.ximai.mes.pro.dto.ProProductQrcodeRecordCreate; ...@@ -16,6 +16,7 @@ import com.ximai.mes.pro.dto.ProProductQrcodeRecordCreate;
import com.ximai.mes.pro.dto.ProProductQrcodeRecordUpdate; import com.ximai.mes.pro.dto.ProProductQrcodeRecordUpdate;
import com.ximai.mes.pro.dto.ProProductQrcodeRecordDto; import com.ximai.mes.pro.dto.ProProductQrcodeRecordDto;
import com.ximai.mes.pro.service.IProProductQrcodeRecordService; import com.ximai.mes.pro.service.IProProductQrcodeRecordService;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 产品序列号打印记录Service业务层处理 * 产品序列号打印记录Service业务层处理
...@@ -138,6 +139,7 @@ public class ProProductQrcodeRecordServiceImpl implements IProProductQrcodeRecor ...@@ -138,6 +139,7 @@ public class ProProductQrcodeRecordServiceImpl implements IProProductQrcodeRecor
} }
@Override @Override
@Transactional
public int addPrintTime(List<Long> proProductQrcodeRecordUpdateList) { public int addPrintTime(List<Long> proProductQrcodeRecordUpdateList) {
if(proProductQrcodeRecordUpdateList.size() < 1) if(proProductQrcodeRecordUpdateList.size() < 1)
return 0; return 0;
......
...@@ -28,6 +28,7 @@ import com.ximai.system.strategy.AutoCodeUtil; ...@@ -28,6 +28,7 @@ import com.ximai.system.strategy.AutoCodeUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -183,6 +184,7 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService { ...@@ -183,6 +184,7 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional
public void updateQcAbnormalReportAbmornalStatud(QcAbnormalReport qcAbnormalReportInput) { public void updateQcAbnormalReportAbmornalStatud(QcAbnormalReport qcAbnormalReportInput) {
QcAbnormalReport qcAbnormalReport = qcAbnormalReportMapper.selectQcAbnormalReportByAbnormalReportId(qcAbnormalReportInput.getAbnormalReportId()); QcAbnormalReport qcAbnormalReport = qcAbnormalReportMapper.selectQcAbnormalReportByAbnormalReportId(qcAbnormalReportInput.getAbnormalReportId());
if(qcAbnormalReportInput.getAbnormalStatus().equals("CLOSE")){ if(qcAbnormalReportInput.getAbnormalStatus().equals("CLOSE")){
...@@ -221,6 +223,7 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService { ...@@ -221,6 +223,7 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
} }
@Override @Override
@Transactional
public void start(Long abnormalReportIds) { public void start(Long abnormalReportIds) {
QcAbnormalReport qcAbnormalReport = qcAbnormalReportMapper.selectQcAbnormalReportByAbnormalReportId(abnormalReportIds); QcAbnormalReport qcAbnormalReport = qcAbnormalReportMapper.selectQcAbnormalReportByAbnormalReportId(abnormalReportIds);
if(qcAbnormalReport == null) if(qcAbnormalReport == null)
......
...@@ -16,10 +16,11 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -16,10 +16,11 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.List; import java.util.List;
@Api("生产报工") @Api("生产报工报表")
@RestController @RestController
@RequestMapping("/report/pro/feedback") @RequestMapping("/report/pro/feedback")
public class FeedbackController extends BaseController { public class FeedbackController extends BaseController {
...@@ -33,7 +34,7 @@ public class FeedbackController extends BaseController { ...@@ -33,7 +34,7 @@ public class FeedbackController extends BaseController {
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录", businessType = BusinessType.QUERY) @Log(title = "生产报工记录", businessType = BusinessType.QUERY)
@GetMapping("/getList") @GetMapping("/getList")
public TableDataInfo getList(@RequestBody FeedbackRequest feedbackRequest) { public TableDataInfo<FeedbackResponse> getList( FeedbackRequest feedbackRequest) {
startPage(); startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getList(feedbackRequest); List<FeedbackResponse> feedbackResponseList = feedbackService.getList(feedbackRequest);
return getDataTable(feedbackResponseList); return getDataTable(feedbackResponseList);
...@@ -41,11 +42,11 @@ public class FeedbackController extends BaseController { ...@@ -41,11 +42,11 @@ public class FeedbackController extends BaseController {
@ApiOperation("生产报工记录") @ApiOperation("生产报工记录:统计方式工单")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工单", businessType = BusinessType.QUERY) @Log(title = "生产报工记录:统计方式工单", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkOrder") @GetMapping("/getListByWorkOrder")
public TableDataInfo getListByWorkOrder(@RequestBody FeedbackRequest feedbackRequest) { public TableDataInfo<FeedbackResponse> getListByWorkOrder( FeedbackRequest feedbackRequest) {
startPage(); startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkOrder(feedbackRequest); List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkOrder(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%"); DecimalFormat df = new DecimalFormat("0.00%");
...@@ -53,7 +54,7 @@ public class FeedbackController extends BaseController { ...@@ -53,7 +54,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -65,7 +66,7 @@ public class FeedbackController extends BaseController { ...@@ -65,7 +66,7 @@ public class FeedbackController extends BaseController {
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式车间", businessType = BusinessType.QUERY) @Log(title = "生产报工记录:统计方式车间", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkshop") @GetMapping("/getListByWorkshop")
public TableDataInfo getListByWorkshop(@RequestBody FeedbackRequest feedbackRequest) { public TableDataInfo<FeedbackResponse> getListByWorkshop( FeedbackRequest feedbackRequest) {
startPage(); startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkshop(feedbackRequest); List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkshop(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%"); DecimalFormat df = new DecimalFormat("0.00%");
...@@ -73,7 +74,7 @@ public class FeedbackController extends BaseController { ...@@ -73,7 +74,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -85,7 +86,7 @@ public class FeedbackController extends BaseController { ...@@ -85,7 +86,7 @@ public class FeedbackController extends BaseController {
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工作中心", businessType = BusinessType.QUERY) @Log(title = "生产报工记录:统计方式工作中心", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkstation") @GetMapping("/getListByWorkstation")
public TableDataInfo getListByWorkstation(@RequestBody FeedbackRequest feedbackRequest) { public TableDataInfo<FeedbackResponse> getListByWorkstation( FeedbackRequest feedbackRequest) {
startPage(); startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkstation(feedbackRequest); List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkstation(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%"); DecimalFormat df = new DecimalFormat("0.00%");
...@@ -93,7 +94,7 @@ public class FeedbackController extends BaseController { ...@@ -93,7 +94,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -106,7 +107,7 @@ public class FeedbackController extends BaseController { ...@@ -106,7 +107,7 @@ public class FeedbackController extends BaseController {
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工作单元", businessType = BusinessType.QUERY) @Log(title = "生产报工记录:统计方式工作单元", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkunit") @GetMapping("/getListByWorkunit")
public TableDataInfo getListByWorkunit(@RequestBody FeedbackRequest feedbackRequest) { public TableDataInfo<FeedbackResponse> getListByWorkunit( FeedbackRequest feedbackRequest) {
startPage(); startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkunit(feedbackRequest); List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkunit(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%"); DecimalFormat df = new DecimalFormat("0.00%");
...@@ -114,7 +115,7 @@ public class FeedbackController extends BaseController { ...@@ -114,7 +115,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -130,7 +131,7 @@ public class FeedbackController extends BaseController { ...@@ -130,7 +131,7 @@ public class FeedbackController extends BaseController {
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工序", businessType = BusinessType.QUERY) @Log(title = "生产报工记录:统计方式工序", businessType = BusinessType.QUERY)
@GetMapping("/getListByProcess") @GetMapping("/getListByProcess")
public TableDataInfo getListByProcess(@RequestBody FeedbackRequest feedbackRequest) { public TableDataInfo<FeedbackResponse> getListByProcess( FeedbackRequest feedbackRequest) {
startPage(); startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByProcess(feedbackRequest); List<FeedbackResponse> feedbackResponseList = feedbackService.getListByProcess(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%"); DecimalFormat df = new DecimalFormat("0.00%");
...@@ -138,7 +139,7 @@ public class FeedbackController extends BaseController { ...@@ -138,7 +139,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -147,11 +148,11 @@ public class FeedbackController extends BaseController { ...@@ -147,11 +148,11 @@ public class FeedbackController extends BaseController {
} }
@ApiOperation("生产报工记录:统计方式工序") @ApiOperation("生产报工记录:统计方式用户")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工序", businessType = BusinessType.QUERY) @Log(title = "生产报工记录:统计方式用户", businessType = BusinessType.QUERY)
@GetMapping("/getListByUser") @GetMapping("/getListByUser")
public TableDataInfo getListByUser(@RequestBody FeedbackRequest feedbackRequest) { public TableDataInfo<FeedbackResponse> getListByUser( FeedbackRequest feedbackRequest) {
startPage(); startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByUser(feedbackRequest); List<FeedbackResponse> feedbackResponseList = feedbackService.getListByUser(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%"); DecimalFormat df = new DecimalFormat("0.00%");
...@@ -159,7 +160,7 @@ public class FeedbackController extends BaseController { ...@@ -159,7 +160,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
......
package com.ximai.mes.report.controller;
import com.ximai.common.annotation.Log;
import com.ximai.common.core.controller.BaseController;
import com.ximai.common.core.page.TableDataInfo;
import com.ximai.common.enums.BusinessType;
import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.request.WorkOrderProgressRequest;
import com.ximai.mes.report.response.FeedbackResponse;
import com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse;
import com.ximai.mes.report.response.WorkOrderProgressListResponse;
import com.ximai.mes.report.response.WorkOrderProgressProcessListResponse;
import com.ximai.mes.report.service.WorkOrderProgressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api("生产进度")
@RestController
@RequestMapping("/report/pro/workOrderProgress")
public class WorkOrderProgressController extends BaseController {
@Autowired
WorkOrderProgressService workOrderProgressService;
@ApiOperation("生产进度:明细界面")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产进度:明细界面", businessType = BusinessType.QUERY)
@GetMapping("/getList")
public TableDataInfo<WorkOrderProgressListResponse> getList( WorkOrderProgressRequest workOrderProgressRequest) {
startPage();
List<WorkOrderProgressListResponse> workOrderProgressListResponses = workOrderProgressService.getList(workOrderProgressRequest);
return getDataTable(workOrderProgressListResponses);
}
@ApiOperation("生产进度:工序明细")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产进度:工序明细", businessType = BusinessType.QUERY)
@GetMapping("/getProcessList")
public TableDataInfo<WorkOrderProgressProcessListResponse> getProcessList(@RequestParam("workorderCode") String workorderCode) {
List<WorkOrderProgressProcessListResponse> workOrderProgressListResponses = workOrderProgressService.getProcessList(workorderCode);
return getDataTable(workOrderProgressListResponses);
}
@ApiOperation("生产进度:报工明细")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产进度:报工明细", businessType = BusinessType.QUERY)
@GetMapping("/getFeedbackList")
public TableDataInfo<WorkOrderProgressFeedbackListResponse> getFeedbackList(@RequestParam("taskId") Long taskId,@RequestParam("workorderCode") String workorderCode) {
List<WorkOrderProgressFeedbackListResponse> workOrderProgressFeedbackListResponses = workOrderProgressService.getFeedbackList(workorderCode,taskId);
return getDataTable(workOrderProgressFeedbackListResponses);
}
}
...@@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ximai.common.annotation.Excel; import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date; import java.util.Date;
@Data
public class FeedbackRequest { public class FeedbackRequest {
// 工单类型(下拉选择工单类型) // 工单类型(下拉选择工单类型)
// 项目号(工单项目号) // 项目号(工单项目号)
...@@ -26,7 +27,7 @@ public class FeedbackRequest { ...@@ -26,7 +27,7 @@ public class FeedbackRequest {
/** /**
* 工单类型 * 工单类型
*/ */
@ApiModelProperty(name = "工单类型") @ApiModelProperty( "工单类型")
private String workorderType; private String workorderType;
...@@ -40,45 +41,51 @@ public class FeedbackRequest { ...@@ -40,45 +41,51 @@ public class FeedbackRequest {
/** /**
* 工单编码 * 工单编码
*/ */
@ApiModelProperty(name = "工单编码") @ApiModelProperty( "工单编码")
private String workorderCode; private String workorderCode;
/** /**
* 任务编号 * 任务编号
*/ */
@ApiModelProperty(name = "工序任务号") @ApiModelProperty( "工序任务号")
private String taskCode; private String taskCode;
/** /**
* 产品编号 * 产品编号
*/ */
@ApiModelProperty(name = "产品编号") @ApiModelProperty( "产品编号")
private String productCode; private String productCode;
/** /**
* 产品编号 * 产品编号
*/ */
@ApiModelProperty(name = "产品编号") @ApiModelProperty( "产品编号")
private String productId; private String productId;
/** /**
* 产品名称 * 产品名称
*/ */
@ApiModelProperty(name = "产品名称") @ApiModelProperty( "产品名称")
private String productName; private String productName;
/** /**
* 工序ID * 工序ID
*/ */
@ApiModelProperty(name = "工序ID") @ApiModelProperty( "工序ID")
private Long processId; private Long processId;
/** /**
* 工序编码 * 工序编码
*/ */
@ApiModelProperty(name = "工序编码") @ApiModelProperty( "工序编码")
private String processCode; private String processCode;
/**
* 工序编码
*/
@ApiModelProperty( "工序名称")
private String processName;
/** /**
* 车间ID * 车间ID
*/ */
...@@ -90,14 +97,14 @@ public class FeedbackRequest { ...@@ -90,14 +97,14 @@ public class FeedbackRequest {
/** /**
* 工作中心ID * 工作中心ID
*/ */
@ApiModelProperty(name = "工作中心ID") @ApiModelProperty( "工作中心ID")
private Long workstationId; private Long workstationId;
/** /**
* 工作中心名称 * 工作中心名称
*/ */
@ApiModelProperty(name = "工作中心名称") @ApiModelProperty( "工作中心名称")
private String workstationName; private String workstationName;
/** /**
......
package com.ximai.mes.report.request;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class WorkOrderProgressRequest {
/**
* 项目号(工单项目号)
* 订单号(工单订单号)
* 生产工单(生产工单号)
* 产品编码(产品编码)
* 产品名称(点击放大镜单选产品信息,也可直接输入名称执行搜索)
*/
@ApiModelProperty("客户项目号")
private String customerProjectNo;
@ApiModelProperty("订单单号")
private String orderCode;
@ApiModelProperty( "工单编码")
private String workorderCode;
/**
* 产品ID
*/
@ApiModelProperty( "产品ID")
private Long productId;
/**
* 产品编号
*/
@Excel(name = "产品编号")
@ApiModelProperty( "产品编号")
private String productCode;
/**
* 产品名称
*/
@ApiModelProperty( "产品名称")
private String productName;
}
...@@ -27,7 +27,7 @@ public class FeedbackResponse extends ProFeedback { ...@@ -27,7 +27,7 @@ public class FeedbackResponse extends ProFeedback {
/** /**
* 工单类型 * 工单类型
*/ */
@ApiModelProperty(name = "工单类型") @ApiModelProperty( "工单类型")
private String workorderType; private String workorderType;
@ApiModelProperty("客户项目号") @ApiModelProperty("客户项目号")
...@@ -36,27 +36,27 @@ public class FeedbackResponse extends ProFeedback { ...@@ -36,27 +36,27 @@ public class FeedbackResponse extends ProFeedback {
@ApiModelProperty("订单单号") @ApiModelProperty("订单单号")
private String orderCode; private String orderCode;
@ApiModelProperty(name = "工单编码") @ApiModelProperty( "工单编码")
private String workorderCode; private String workorderCode;
@ApiModelProperty(name = "工单名称") @ApiModelProperty( "工单名称")
private String workorderName; private String workorderName;
/** /**
* 产品编号 * 产品编号
*/ */
@ApiModelProperty(name = "产品编号") @ApiModelProperty( "产品编号")
private String productCode; private String productCode;
/** /**
* 产品名称 * 产品名称
*/ */
@ApiModelProperty(name = "产品名称") @ApiModelProperty( "产品名称")
private String productName; private String productName;
/** /**
* 任务编号 * 任务编号
*/ */
@ApiModelProperty(name = "工序任务号") @ApiModelProperty( "工序任务号")
private String taskCode; private String taskCode;
...@@ -64,25 +64,25 @@ public class FeedbackResponse extends ProFeedback { ...@@ -64,25 +64,25 @@ public class FeedbackResponse extends ProFeedback {
/** /**
* 工序名称 * 工序名称
*/ */
@ApiModelProperty(name = "工序编码") @ApiModelProperty( "工序编码")
private String processCode; private String processCode;
/** /**
* 工序名称 * 工序名称
*/ */
@ApiModelProperty(name = "工序名称") @ApiModelProperty( "工序名称")
private String processName; private String processName;
/** /**
* 工作中心编号 * 工作中心编号
*/ */
@ApiModelProperty(name = "工作中心编号") @ApiModelProperty( "工作中心编号")
private String workstationCode; private String workstationCode;
/** /**
* 工作中心名称 * 工作中心名称
*/ */
@ApiModelProperty(name = "工作中心名称") @ApiModelProperty( "工作中心名称")
private String workstationName; private String workstationName;
...@@ -110,30 +110,30 @@ public class FeedbackResponse extends ProFeedback { ...@@ -110,30 +110,30 @@ public class FeedbackResponse extends ProFeedback {
/** /**
* 排产数量 * 排产数量
*/ */
@ApiModelProperty(name = "派工数量") @ApiModelProperty( "派工数量")
private BigDecimal quantity; private BigDecimal quantity;
/** /**
* 本次报工数量 * 本次报工数量
*/ */
@ApiModelProperty(name = "本次报工数量") @ApiModelProperty( "本次报工数量")
private BigDecimal quantityFeedback; private BigDecimal quantityFeedback;
/** /**
* 合格品数量 * 合格品数量
*/ */
@ApiModelProperty(name = "合格品数量") @ApiModelProperty( "合格品数量")
private BigDecimal quantityQualify; private BigDecimal quantityQualify;
/** /**
* 不良品数量 * 不良品数量
*/ */
@ApiModelProperty(name = "不良品数量") @ApiModelProperty( "不良品数量")
private BigDecimal quantityUnqualify; private BigDecimal quantityUnqualify;
/** 异常原因 */ /** 异常原因 */
@ApiModelProperty(name = "异常原因") @ApiModelProperty( "异常原因")
private String abnormalReason; private String abnormalReason;
@ApiModelProperty("标准工时") @ApiModelProperty("标准工时")
...@@ -152,7 +152,7 @@ public class FeedbackResponse extends ProFeedback { ...@@ -152,7 +152,7 @@ public class FeedbackResponse extends ProFeedback {
* 报工时间 * 报工时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(name = "报工时间") @ApiModelProperty( "报工时间")
private Date feedbackTime; private Date feedbackTime;
......
package com.ximai.mes.report.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class WorkOrderProgressFeedbackListResponse {
//报工人员,报工数量,合格数量,不合格数量,标准工时,实际工时,报工时间
@ApiModelProperty("报工人员")
private String nickName;
@ApiModelProperty("报工数量")
private BigDecimal quantityFeedback;
@ApiModelProperty("合格数量")
private BigDecimal quantityQualify;
@ApiModelProperty("不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("标准工时")
private BigDecimal stdWorkingTime;
@ApiModelProperty("实际工时")
private BigDecimal machineTime;
@ApiModelProperty("报工时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime;
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class WorkOrderProgressListResponse {
private Long workorderId;
/**
* 项目号,订单号,生产工单,工单类型,产品编码,产品名称,计划数量,完工数量,在制进度(百分比),需求实际
*/
@ApiModelProperty("客户项目号")
private String customerProjectNo;
@ApiModelProperty("订单单号")
private String orderCode;
@ApiModelProperty( "工单编码")
private String workorderCode;
/**
* 工单类型
*/
@ApiModelProperty( "工单类型")
private String workorderType;
/**
* 产品编号
*/
@ApiModelProperty( "产品编号")
private String productCode;
/**
* 产品名称
*/
@ApiModelProperty( "产品名称")
private String productName;
@ApiModelProperty("计划数量")
private BigDecimal quantity;
/**
* 已生产数量
*/
@ApiModelProperty("已生产数量")
private BigDecimal quantityProduced;
/**
* 已生产数量
*/
@ApiModelProperty("在制进度")
private BigDecimal quantityMu;
}
package com.ximai.mes.report.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class WorkOrderProgressProcessListResponse {
//状态(未开始,加工中,已完成)工序名称,派工数量,报工数量,合格数量,不合格数量,合格率
@ApiModelProperty("状态")
private String status;
@ApiModelProperty("工序名称")
private String processName;
@ApiModelProperty("派工数量")
private BigDecimal quantity;
@ApiModelProperty("报工数量")
private BigDecimal quantityProduced;
@ApiModelProperty("合格数量")
private BigDecimal quantityQualify;
@ApiModelProperty("不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("合格率")
private BigDecimal passRate;
private Long taskId;
}
package com.ximai.mes.report.service;
import com.ximai.mes.report.request.WorkOrderProgressRequest;
import com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse;
import com.ximai.mes.report.response.WorkOrderProgressListResponse;
import com.ximai.mes.report.response.WorkOrderProgressProcessListResponse;
import java.util.List;
public interface WorkOrderProgressService {
List<WorkOrderProgressListResponse> getList(WorkOrderProgressRequest workOrderProgressRequest);
List<WorkOrderProgressProcessListResponse> getProcessList(String workorderCode);
List<WorkOrderProgressFeedbackListResponse> getFeedbackList(String workorderCode,Long taskId);
}
package com.ximai.mes.report.service.impl;
import com.ximai.mes.constant.TaskStatusEnum;
import com.ximai.mes.pro.domain.ProFeedback;
import com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder;
import com.ximai.mes.pro.mapper.ProFeedbackMapper;
import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkorderMapper;
import com.ximai.mes.pro.mapper.task.ProTaskMapper;
import com.ximai.mes.report.request.WorkOrderProgressRequest;
import com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse;
import com.ximai.mes.report.response.WorkOrderProgressListResponse;
import com.ximai.mes.report.response.WorkOrderProgressProcessListResponse;
import com.ximai.mes.report.service.WorkOrderProgressService;
import com.ximai.system.service.ISysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.List;
@Service
public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
@Autowired
ProWorkorderMapper proWorkorderMapper;
@Autowired
private ISysDictDataService dictDataService;
@Autowired
private ProTaskMapper proTaskMapper;
@Autowired
private ProFeedbackMapper proFeedbackMapper;
@Override
@Transactional
public List<WorkOrderProgressListResponse> getList(WorkOrderProgressRequest workOrderProgressRequest) {
List<WorkOrderProgressListResponse> workOrderProgressListResponses = proWorkorderMapper.getWorkOrderProgressServiceList(workOrderProgressRequest);
for (WorkOrderProgressListResponse workOrderProgressListResponse : workOrderProgressListResponses){
workOrderProgressListResponse.setWorkorderType(dictDataService.getDictLabel("mes_workorder_type", workOrderProgressListResponse.getWorkorderType()));
if(workOrderProgressListResponse.getQuantity() != null && workOrderProgressListResponse.getQuantity().compareTo(BigDecimal.ZERO) >0){
workOrderProgressListResponse.setQuantityProduced(workOrderProgressListResponse.getQuantityProduced() != null ? workOrderProgressListResponse.getQuantityProduced() : BigDecimal.ZERO);
workOrderProgressListResponse.setQuantityMu(workOrderProgressListResponse.getQuantityProduced().divide(workOrderProgressListResponse.getQuantity()).setScale(2, RoundingMode.HALF_UP));
}else{
workOrderProgressListResponse.setQuantityMu(new BigDecimal(100));
}
}
return proWorkorderMapper.getWorkOrderProgressServiceList(workOrderProgressRequest);
}
@Override
public List<WorkOrderProgressProcessListResponse> getProcessList(String workorderCode) {
List<WorkOrderProgressProcessListResponse> workOrderProgressProcessListResponses = proTaskMapper.getProcessList(workorderCode);
for (WorkOrderProgressProcessListResponse workOrderProgressProcessListResponse : workOrderProgressProcessListResponses){
if(workOrderProgressProcessListResponse.equals(TaskStatusEnum.BEGINNING.getStatus())){
workOrderProgressProcessListResponse.setStatus("已开工");
}else if(workOrderProgressProcessListResponse.equals(TaskStatusEnum.FINISHED.getStatus())){
workOrderProgressProcessListResponse.setStatus("已完工");
}else{
workOrderProgressProcessListResponse.setStatus("未开工");
}
workOrderProgressProcessListResponse.setPassRate(workOrderProgressProcessListResponse.getQuantityQualify().
divide(workOrderProgressProcessListResponse.getQuantityProduced()).setScale(2, RoundingMode.HALF_UP));
}
return workOrderProgressProcessListResponses;
}
@Override
public List<WorkOrderProgressFeedbackListResponse> getFeedbackList(String workorderCode,Long taskId) {
List<WorkOrderProgressFeedbackListResponse> workOrderProgressFeedbackListResponses = proFeedbackMapper.getFeedbackList( workorderCode,taskId);
return workOrderProgressFeedbackListResponses;
}
}
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if> <if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if> <if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if> <if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if> <if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if> <if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where> </where>
</select> </select>
...@@ -248,8 +248,18 @@ ...@@ -248,8 +248,18 @@
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if> <if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if> <if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if> <if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if> <if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if> <if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
</where> </where>
group by group by
workorder.workorder_Type, workorder.workorder_Type,
...@@ -287,8 +297,14 @@ ...@@ -287,8 +297,14 @@
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if> <if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if> <if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if> <if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if> <if test=" userName != null and userName != '' ">and f.user_Name like '% ${userName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if> <if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
</where> </where>
group by group by
workstation.workshop_code, workstation.workshop_code,
...@@ -321,8 +337,14 @@ ...@@ -321,8 +337,14 @@
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if> <if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if> <if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if> <if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if> <if test=" userName != null and userName != '' ">and f.user_Name like '% ${userName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if> <if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
</where> </where>
group by group by
workstation.workstation_code, workstation.workstation_code,
...@@ -355,8 +377,15 @@ ...@@ -355,8 +377,15 @@
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if> <if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if> <if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if> <if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if> <if test=" userName != null and userName != '' ">and f.user_Name like '% ${userName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if> <if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
</where> </where>
group by group by
workunit.workunit_code, workunit.workunit_code,
...@@ -389,8 +418,16 @@ ...@@ -389,8 +418,16 @@
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if> <if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if> <if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if> <if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if> <if test=" userName != null and userName != '' ">and f.user_Name like '% ${userName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if> <if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
</where> </where>
group by group by
pt.process_code, pt.process_code,
...@@ -423,8 +460,16 @@ ...@@ -423,8 +460,16 @@
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if> <if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if> <if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if> <if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if> <if test=" userName != null and userName != '' ">and f.user_Name like '% ${userName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if> <if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
</where> </where>
group by group by
f.user_name, f.user_name,
...@@ -437,6 +482,14 @@ ...@@ -437,6 +482,14 @@
#{taskId} #{taskId}
</foreach> </foreach>
</select> </select>
<select id="getFeedbackList"
resultType="com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse">
select feedback.*,workunit.std_working_time from pro_task_workunit workunit join pro_feedback feedback on feedback.task_workunit_id = workunit.task_workunit_id
<where>
workorder_code = #{workorderCode}
<if test="taskId != null">and feedback.task_id = #{taskId}</if>
</where>
</select>
<insert id="insertProFeedback" parameterType="ProFeedback" useGeneratedKeys="true" keyProperty="recordId"> <insert id="insertProFeedback" parameterType="ProFeedback" useGeneratedKeys="true" keyProperty="recordId">
insert into pro_feedback insert into pro_feedback
......
...@@ -183,6 +183,17 @@ ...@@ -183,6 +183,17 @@
tw.idx tw.idx
ORDER BY tw.idx ASC ORDER BY tw.idx ASC
</select> </select>
<select id="getWorkOrderProgressServiceList"
resultType="com.ximai.mes.report.response.WorkOrderProgressListResponse">
select * from pro_workorder pw
<where>
<if test="workorderCode != null and workorderCode != ''">and pw.workorder_code = #{workorderCode}</if>
<if test="productId != null ">and pw.product_id = #{productId}</if>
<if test="productCode != null and productCode != ''">and pw.product_code = #{productCode}</if>
<if test="orderCode != null and orderCode !=''">and pw.order_code = #{orderCode}</if>
<if test="customerProjectNo != null and customerProjectNo !=''">and pw.customer_project_no = #{customerProjectNo}</if>
</where>
</select>
<insert id="insertProWorkorder" parameterType="ProWorkorder" useGeneratedKeys="true" keyProperty="workorderId"> <insert id="insertProWorkorder" parameterType="ProWorkorder" useGeneratedKeys="true" keyProperty="workorderId">
insert into pro_workorder insert into pro_workorder
......
...@@ -351,6 +351,10 @@ ...@@ -351,6 +351,10 @@
t.task_batch = #{taskBatch} t.task_batch = #{taskBatch}
</where> </where>
</select> </select>
<select id="getProcessList"
resultType="com.ximai.mes.report.response.WorkOrderProgressProcessListResponse">
select * from pro_task where arrange_code = #{workorderCode} order by task_id
</select>
<insert id="insertProTask" parameterType="ProTask" useGeneratedKeys="true" keyProperty="taskId"> <insert id="insertProTask" parameterType="ProTask" useGeneratedKeys="true" keyProperty="taskId">
insert into pro_task insert into pro_task
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment