diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 50f2e53d..03f5eccd 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -480,6 +480,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { } @Override + @DS("#header.poolName") public LineChartDto getMonthProData(MesReportProduction mesReportProduction) { LineChartDto lineChartDto = new LineChartDto(); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 5b6735bf..b9bb770b 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -294,7 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sum(mrw.quantity) quantity from( select - product_name+CONVERT(varchar(10),feedback_time, 120) nameDate, + CONVERT(varchar(10),feedback_time, 120) nameDate, product_code productCode, product_name productName, CONVERT(varchar(10),feedback_time, 120) feedbackTime, @@ -726,7 +726,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" be.equipment_name machineName from pro_order_workorder pow left join base_equipment be on be.equipment_code = pow.workorder_name - where pow.product_date = #{productDate} and pow.parent_order = '0' and pow.del_flag='0' and pow.workorder_name is not null + where CONVERT(varchar(10),pow.product_date, 120) = #{productDate} and pow.parent_order = '0' and pow.del_flag='0' and pow.workorder_name is not null GROUP BY pow.workorder_name,be.equipment_name ) t order by t.quantitySplit desc @@ -736,7 +736,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sum(pow.quantity_split) quantitySplit, pow.product_name productName from pro_order_workorder pow - where pow.product_date = CONVERT(DATE, GETDATE()) and pow.parent_order = '0' and pow.del_flag='0' + where CONVERT(varchar(10),pow.product_date, 120) = CONVERT(DATE, GETDATE()) and pow.parent_order = '0' and pow.del_flag='0' GROUP BY pow.product_code,pow.product_name diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java index 117a8227..27291ef2 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java @@ -195,9 +195,9 @@ public class QuaController extends BaseController { if(StringUtils.isBlank(qcCheckTaskIncome.getUpdateByName())){ return error("[updateByName]不能为空"); } - if(StringUtils.isBlank(qcCheckTaskIncome.getCheckResult())){ - return error("[checkResult]不能为空"); - } +// if(StringUtils.isBlank(qcCheckTaskIncome.getCheckResult())){ +// return error("[checkResult]不能为空"); +// } return toAjax(qcCheckTaskIncomeService.commitCheckResults(qcCheckTaskIncome)); } /** diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java index c8fb94d9..99397fa8 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java @@ -29,6 +29,7 @@ public class QcCheckTaskIncome extends BaseEntity { */ @Excel(name = "检验任务编号") private String checkNo; + private String orderCode; private String workorderCode; private String workorderCodeSap; @@ -198,6 +199,14 @@ public class QcCheckTaskIncome extends BaseEntity { private String materialFrom;//物料来源 private String startOA;//发起oa 1是 0否 + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + public String getStartOA() { return startOA; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java index 2d31f096..79332706 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java @@ -122,6 +122,24 @@ public class QcCheckUnqualified extends BaseEntity { private String oaFactory;//oa厂区 private String czbjr;//仓储报检人 private String qczg;//QC主管 + private String user; + private String sqr; + + public String getSqr() { + return sqr; + } + + public void setSqr(String sqr) { + this.sqr = sqr; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } public String getQczg() { return qczg; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index 71efeaa0..1a7478e8 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -16,17 +16,13 @@ import com.op.common.core.web.domain.AjaxResult; import com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.*; import com.op.quality.mapper.*; -import com.op.quality.service.IQcCheckTaskDefectService; -import com.op.quality.service.IQcCheckTaskProduceService; -import com.op.quality.service.IQcCheckTaskUserService; -import com.op.system.api.RemoteOpenService; +import com.op.quality.service.*; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.quality.QcUserMaterialDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.op.quality.service.IQcCheckTaskIncomeService; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.web.context.request.RequestContextHolder; @@ -70,8 +66,8 @@ public class QcCheckTaskIncomeServiceImpl implements @Autowired private IQcCheckTaskUserService qcCheckTaskUserService; - @Autowired - private RemoteOpenService remoteOpenService; +// @Autowired +// private RemoteOpenService remoteOpenService; @Autowired private QMSFileMapper qmsFileMapper; @@ -85,8 +81,8 @@ public class QcCheckTaskIncomeServiceImpl implements @Autowired private QcCheckTaskDefectMapper qcCheckTaskDefectMapper; -// @Autowired -// private QcCheckUnqualifiedService qcCheckUnqualifiedService; + @Autowired + private IQcCheckUnqualifiedService qcCheckUnqualifiedService; /** * 查询来料检验 @@ -447,11 +443,11 @@ public class QcCheckTaskIncomeServiceImpl implements qcCheckTaskProduce.setCheckTime(DateUtils.getNowDate()); qcCheckTaskProduce.setCheckManCode(SecurityUtils.getUsername()); n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce); - - - /**pro_order_workorder_batch-->qc_status->2**/ - qcCheckTaskIncome.setStatus("2"); - qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome); + /**pro_order_workorder_batch-->首检qc_status->2**/ + if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())){ + qcCheckTaskIncome.setStatus("2"); + qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome); + } }else if("product".equals(qcCheckTaskIncome.getTypeCode())){ QcCheckTaskWarehousing warehousing = new QcCheckTaskWarehousing(); warehousing.setCheckStatus("2"); @@ -598,14 +594,22 @@ public class QcCheckTaskIncomeServiceImpl implements String checkType = qcCheckTaskIncome.getCheckType(); qcCheckTaskIncome.setFactoryCode(qcCheckTaskIncome.getFactoryCode().replace("ds_","")); //默认合格 - String result = "Y"; - for(QcCheckTaskDetail detail:details){ - if("N".equals(detail.getStatus())){ - result = "N";//不合格 - break; + + String result=null; + if(StringUtils.isBlank(qcCheckTaskIncome.getCheckResult())){ + result = "Y"; + for(QcCheckTaskDetail detail:details){ + if("N".equals(detail.getStatus())){ + result = "N";//不合格 + break; + } } + }else{ + //有最终判定的情况 + result = qcCheckTaskIncome.getCheckResult(); } + int n = 0; QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome(); qcCheckTask.setUpdateBy(updateBy); @@ -613,6 +617,7 @@ public class QcCheckTaskIncomeServiceImpl implements qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成 qcCheckTask.setUpdateTime(nowTime); qcCheckTask.setCheckTime(nowTime); + qcCheckTask.setRemark(qcCheckTaskIncome.getRemark()); qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格 qcCheckTask.setIncomeBatchNo(qcCheckTaskIncome.getIncomeBatchNo()); BigDecimal noOkQquality = new BigDecimal("0"); @@ -690,6 +695,7 @@ public class QcCheckTaskIncomeServiceImpl implements if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())){ /**pro_order_workorder_batch-->qc_status->2**/ qcCheckTaskIncome.setStatus("2"); + qcCheckTaskIncome.setCheckResult(result); qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome); } if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())&&"N".equals(result)){ @@ -732,8 +738,48 @@ public class QcCheckTaskIncomeServiceImpl implements unqualified.setType(checkType); n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified); logger.info("qc_check_unqualified:" + n); - - //qcCheckUnqualifiedService.updateQcCheckUnqualified(qcCheckUnqualified); + if("1".equals(qcCheckTaskIncome.getStartOA())){ + + unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode()); + //不合格描述 + unqualified.setRemark(qcCheckTaskIncome.getRemark()); + //厂区(小榄固定值) + unqualified.setOaFactory("0"); + //来料类别 + unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType()); + //物料来源 + unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom()); + //物料编号 + unqualified.setMaterialCode(qcCheckTaskIncome.getMaterialCode()); + //物料名称 + unqualified.setMaterialName(qcCheckTaskIncome.getMaterialName()); + //供应商编码 + unqualified.setSupplierCode(qcCheckTaskIncome.getSupplierCode()); + //供应商名称 + unqualified.setSupplierName(qcCheckTaskIncome.getSupplierName()); + //供应商名称 + unqualified.setSupplierName(qcCheckTaskIncome.getSupplierName()); + //生产批号 + unqualified.setIncomeBatchNo(qcCheckTaskIncome.getIncomeBatchNo()); + //来料数量 + unqualified.setQuality(qcCheckTaskIncome.getQuality().toString()); + //来料单位 + unqualified.setUnit(qcCheckTaskIncome.getUnit()); + //检验编号 + unqualified.setCheckNo(qcCheckTaskIncome.getCheckNo()); + //仓储报检人-李爱娟 + unqualified.setCzbjr("284"); + //物料类别 + unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType()); + //物料来源 + unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom()); + //QC主管-朱继新 + unqualified.setQczg("660"); + //申请人-朱继新 + unqualified.setSqr("660"); + unqualified.setUser("660"); + qcCheckUnqualifiedService.updateQcCheckUnqualified(unqualified); + } } return 1 ; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java index 30ff553d..dc05d8f7 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java @@ -164,39 +164,33 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService } /*来料检验不良OA流程 - * CQ 厂区、 OEMCM 厂名 、 LLLB 来料类别【0、1】、MATNR 物料编号、MAKTX 物料名称、suppliernum 供应商编码 + * SQR申请人 CQ 厂区、 OEMCM 厂名 、 LLLB 来料类别【0、1】、MATNR 物料编号、MAKTX 物料名称、suppliernum 供应商编码 * supplier 供应商名称、CHARG 生产批号、comeQty 来料数量、DW 单位、testDate 检验日期 、 JYBH 检验编号、 * BJY 仓储报检人(OEM产品提报人)、WLLY 物料来源、ZCF 转出方、 ZCOEMCM 转出OEM厂名、 * memo 不合格情况描述 、PZGLBZG QC主管 + * 例子:{"requestName":"ZL0010-来料检验不合格控制流程", + * "mainObject":"{\"SQR\":\"13127\",\"CQ\":0,\"LLLB\":0,\"MATNR\":\"000000040000015062\", + * \"MAKTX\":\"榄菊加大盘强力型蚊香(60装)现货纸箱(2201)\",\"suppliernum\":\"0000102951\", + * \"supplier\":\"广东高顺印刷包装有限公司\",\"CHARG\":\"null\",\"comeQty\":\"1117\", + * \"DW\":\"ST\",\"JYBH\":\"202404180042\",\"BJY\":\"202404180042\",\"WLLY\":\"2\", + * \"memo\":\"不合格\",\"PZGLBZG\":\"不合格\"}","user":"999999","requestLevel":0,"workflowId":26235} + */ private AjaxResult createLLOA(QcCheckUnqualified task){ //QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId()); //发起来料检验OA流程 Map paramMap = new HashMap<>(); - paramMap.put("user",SecurityUtils.getUsername());//提交人工号 + paramMap.put("user",task.getUser());//提交人工号 paramMap.put("requestLevel",0);//流程紧急度 paramMap.put("requestName","ZL0010-来料检验不合格控制流程");//流程名称 paramMap.put("workflowId",26235);//该流程对应的唯- workFlowld StringBuffer mainObject = new StringBuffer(); -// mainObject.append("{"); -// mainObject.append("CQ:"+task.getOaFactory());//厂区 -// mainObject.append(",LLLB:"+task.getMaterialType());//来料类别【0、1】 -// mainObject.append(",MATNR:"+task.getMaterialCode());//物料编码 -// mainObject.append(",MAKTX"+task.getMaterialName());//物料名称 -// mainObject.append(",suppliernum"+task.getSupplierCode());//供应商编码 -// mainObject.append(",supplier"+task.getSupplierName());//供应商名称 -// mainObject.append(",CHARG:"+task.getIncomeBatchNo());//生产批号 -// mainObject.append(",comeQty:"+task.getQuality()+"\"");//来料数量 -// mainObject.append(",DW:"+task.getUnit()+"\"");//来料单位 -// mainObject.append(",JYBH:"+task.getCheckNo());//检验编码 -// mainObject.append(",BJY:"+task.getCheckNo());//仓储报检人 -// mainObject.append(",WLLY:"+task.getMaterialFrom());//物料来源 -// mainObject.append(",memo:"+task.getRemark());//不合格描述 -// mainObject.append(",PZGLBZG:"+task.getRemark());//qc主管 - mainObject.append("\"CQ\":"+task.getOaFactory());//厂区 - mainObject.append("\"LLLB\":"+task.getMaterialType());//来料类别【0、1】 + mainObject.append("{"); + mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人 + mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区 + mainObject.append(",\"LLLB\":"+task.getMaterialType());//来料类别【0、1】 mainObject.append(",\"MATNR\":"+"\""+task.getMaterialCode()+"\"");//物料编码 mainObject.append(",\"MAKTX\":"+"\""+task.getMaterialName()+"\"");//物料名称 mainObject.append(",\"suppliernum\":"+"\""+task.getSupplierCode()+"\"");//供应商编码 @@ -205,10 +199,10 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService mainObject.append(",\"comeQty\":"+"\""+task.getQuality()+"\"");//来料数量 mainObject.append(",\"DW\":"+"\""+task.getUnit()+"\"");//来料单位 mainObject.append(",\"JYBH\":"+"\""+task.getCheckNo()+"\"");//检验编码 - mainObject.append(",\"BJY\":"+"\""+task.getCheckNo()+"\"");//仓储报检人 + mainObject.append(",\"BJY\":"+"\""+task.getCzbjr()+"\"");//仓储报检人 mainObject.append(",\"WLLY\":"+"\""+task.getMaterialFrom()+"\"");//物料来源 mainObject.append(",\"memo\":"+"\""+task.getRemark()+"\"");//不合格描述 - mainObject.append(",\"PZGLBZG\":"+"\""+task.getRemark()+"\"");//qc主管 + mainObject.append(",\"PZGLBZG\":"+"\""+task.getQczg()+"\"");//qc主管 mainObject.append("}"); paramMap.put("mainObject",mainObject.toString()); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java index 05898b16..0929a730 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java @@ -138,7 +138,7 @@ public class QcProCheckServiceImpl implements QcProCheckService { @Override public QcCheckTaskIncome getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail) { DynamicDataSourceContextHolder.push(qcCheckTaskDetail.getFactoryCode()); - QcCheckTaskIncome dto = new QcCheckTaskIncome(); + QcCheckTaskIncome dto = qcCheckTaskIncomeMapper.getTaskInfo(qcCheckTaskDetail.getBelongTo()); List qcCheckTaskDetails = qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); /**qc_check_task_defect**/ Map defectMap = qcCheckTaskDefectMapper.getDefectMap(qcCheckTaskDetail); diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml index f639d3f0..ce152437 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml @@ -304,6 +304,7 @@ bNoOkquality = #{bNoOkquality}, cNoOkquality = #{cNoOkquality}, income_batch_no = #{incomeBatchNo}, + remark = #{remark}, check_result = #{checkResult}, update_by = #{updateBy}, update_time = #{updateTime} @@ -398,7 +399,8 @@ qct.check_time checkTime, qct.check_result checkResult, qct.income_time incomeTime, - qct.check_loc checkLoc + qct.check_loc checkLoc, + qct.remark from qc_check_task qct left join pro_order_workorder pow on pow.workorder_code = qct.order_no where qct.record_id = #{recordId} diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml index e2309d5e..1e99ea48 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml @@ -284,7 +284,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where order_no = #{orderNo} - update pro_order_workorder_batch set qc_status = #{status} where batch_code = #{incomeBatchNo} + update pro_order_workorder_batch + set qc_status = #{status} + + ,qc_result = #{checkResult} + + where batch_code = #{incomeBatchNo} and del_flag ='0' + and workorder_id in(select workorder_id from pro_order_workorder pow + where pow.belong_work_order = #{orderCode} and del_flag = '0') + update wms_product_put set check_status = #{status} where batch_number = #{incomeBatchNo}