From 3671723f7e731ac704e80deb00303c494b7985f8 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Thu, 21 Dec 2023 08:28:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E7=9C=8B=E6=9D=BF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/quality/QcCheckTaskProduceDTO.java | 28 ++ .../api/domain/quality/QcUserMaterialDTO.java | 258 ++++++++++++++++++ .../op/open/controller/OpenController.java | 2 +- .../java/com/op/open/mapper/OpenMapper.java | 7 +- .../op/open/service/impl/OpenServiceImpl.java | 19 +- .../main/resources/mapper/open/OpenMapper.xml | 6 + .../com/op/quality/domain/QcCheckType.java | 9 + .../service/impl/QcCheckTypeServiceImpl.java | 4 +- .../impl/QcUserMaterialServiceImpl.java | 6 + .../mapper/quality/QcCheckTypeMapper.xml | 22 +- .../mapper/quality/QcProCheckMapper.xml | 8 +- .../mapper/quality/QcUserMaterialMapper.xml | 10 +- 12 files changed, 348 insertions(+), 31 deletions(-) create mode 100644 op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcUserMaterialDTO.java diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcCheckTaskProduceDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcCheckTaskProduceDTO.java index 5ea4b6b6..2e6cf0da 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcCheckTaskProduceDTO.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcCheckTaskProduceDTO.java @@ -128,6 +128,10 @@ public class QcCheckTaskProduceDTO extends BaseEntity { private String checkTimeEnd; private String typeCode; private String checkType; + private String carName; + private String carCode; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date produceDate; @Excel(name = "抽样数量") private BigDecimal sampleQuality; @@ -144,6 +148,30 @@ public class QcCheckTaskProduceDTO extends BaseEntity { @Excel(name = "C类不合格数量") private BigDecimal cNoOkquality; + public Date getProduceDate() { + return produceDate; + } + + public void setProduceDate(Date produceDate) { + this.produceDate = produceDate; + } + + public String getCarName() { + return carName; + } + + public void setCarName(String carName) { + this.carName = carName; + } + + public String getCarCode() { + return carCode; + } + + public void setCarCode(String carCode) { + this.carCode = carCode; + } + public BigDecimal getaNoOkquality() { return aNoOkquality; } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcUserMaterialDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcUserMaterialDTO.java new file mode 100644 index 00000000..526c9dce --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/QcUserMaterialDTO.java @@ -0,0 +1,258 @@ +package com.op.system.api.domain.quality; + +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.List; + +/** + * 人员物料绑定对象 qc_user_material + * + * @author Open Platform + * @date 2023-10-09 + */ +public class QcUserMaterialDTO extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String id; + + /** 员工编码 */ + @Excel(name = "员工编码") + private String userCode; + + /** 员工名称 */ + @Excel(name = "员工名称") + private String userName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private String attr4; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + /** 编号 */ + private String userId; + /** 手机号 */ + private String phonenumber; + private String email; + private String materialNames; + /** 状态 */ + private String status; + + private String materialId; + + private String[] userCodes; + private String label; + private String key; + + private List selectedValues; + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setUserCode(String userCode) { + this.userCode = userCode; + } + + public String getUserCode() { + return userCode; + } + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserName() { + return userName; + } + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + public void setAttr4(String attr4) { + this.attr4 = attr4; + } + + public String getAttr4() { + return attr4; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getPhonenumber() { + return phonenumber; + } + + public void setPhonenumber(String phonenumber) { + this.phonenumber = phonenumber; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getMaterialNames() { + return materialNames; + } + + public void setMaterialNames(String materialNames) { + this.materialNames = materialNames; + } + + public String getMaterialId() { + return materialId; + } + + public void setMaterialId(String materialId) { + this.materialId = materialId; + } + public String[] getUserCodes() { + return userCodes; + } + + public void setUserCodes(String[] userCodes) { + this.userCodes = userCodes; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public List getSelectedValues() { + return selectedValues; + } + + public void setSelectedValues(List selectedValues) { + this.selectedValues = selectedValues; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userCode", getUserCode()) + .append("userName", getUserName()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("userId", getUserId()) + .append("phonenumber", getPhonenumber()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java b/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java index f5613f8d..125378e7 100644 --- a/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java +++ b/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java @@ -83,7 +83,7 @@ public class OpenController extends BaseController { } /**创建生产过程(烘房 首检)检验*/ - @PostMapping(value = "createCheckProduceTask") + @PostMapping(value = "/createCheckProduceTask") public AjaxResult createCheckProduceTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) { if(StringUtils.isBlank(qcCheckTaskProduce.getIncomeBatchNo())){ return error("[IncomeBatchNo]不能为空"); diff --git a/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java b/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java index dd58e6f2..07ca7e42 100644 --- a/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java +++ b/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java @@ -7,10 +7,7 @@ import com.op.system.api.domain.mes.MesReportWorkConsumeDTO; import com.op.system.api.domain.mes.MesReportWorkDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProRfidProcessDetail; -import com.op.system.api.domain.quality.QcCheckTaskDetailDTO; -import com.op.system.api.domain.quality.QcCheckTaskProduceDTO; -import com.op.system.api.domain.quality.QcCheckTypeProjectDTO; -import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO; +import com.op.system.api.domain.quality.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -78,5 +75,7 @@ public interface OpenMapper { void insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce); public int addBatch(@Param("list") List items); + + QcUserMaterialDTO getUserByMaterial(String materialCode); } diff --git a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java index 9a77787c..d1ecd5f1 100644 --- a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java +++ b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java @@ -23,10 +23,7 @@ import com.op.system.api.domain.mes.MesReportWorkConsumeDTO; import com.op.system.api.domain.mes.MesReportWorkDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProRfidProcessDetail; -import com.op.system.api.domain.quality.QcCheckTaskDetailDTO; -import com.op.system.api.domain.quality.QcCheckTaskProduceDTO; -import com.op.system.api.domain.quality.QcCheckTypeProjectDTO; -import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO; +import com.op.system.api.domain.quality.*; import com.op.system.api.domain.sap.SapCloseOrderQuery; import com.op.system.api.domain.sap.SapRFW; import org.apache.commons.lang.StringUtils; @@ -305,6 +302,17 @@ public class OpenServiceImpl implements OpenService { QcCheckTypeProjectDTO qctp= new QcCheckTypeProjectDTO(); qctp.setTypeId(qcCheckTaskProduce.getCheckType());//生产过程检验 qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性 + + /**qc_user_material取默认检查人**/ + QcUserMaterialDTO qcUserMaterialDTO = openMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode()); + if(qcUserMaterialDTO == null){ + qcCheckTaskProduce.setCheckManCode("mobile"); + qcCheckTaskProduce.setCheckManName("手持测试用户"); + }else{ + qcCheckTaskProduce.setCheckManCode(qcUserMaterialDTO.getUserCode()); + qcCheckTaskProduce.setCheckManName(qcUserMaterialDTO.getUserName()); + } + /**qc_check_type_project**/ List items = openMapper.getTPByTypeMaterial(qctp); if(CollectionUtils.isEmpty(items)){ @@ -328,6 +336,9 @@ public class OpenServiceImpl implements OpenService { qcCheckTaskProduce.setFactoryCode(factoryCode); qcCheckTaskProduce.setCreateTime(nowDate); qcCheckTaskProduce.setTypeCode("produce");//大检验节点 + qcCheckTaskProduce.setIncomeTime(qcCheckTaskProduce.getProduceDate()); + qcCheckTaskProduce.setSupplierCode(qcCheckTaskProduce.getCarCode()); + qcCheckTaskProduce.setSupplierName(qcCheckTaskProduce.getCarName()); openMapper.insertQcCheckTaskProduce(qcCheckTaskProduce); /**qc_check_task_detail**/ for(QcCheckTaskDetailDTO item:items){ diff --git a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml index a49649be..b12931ec 100644 --- a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml +++ b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml @@ -195,6 +195,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and qctp.type_id = #{typeId} order by qctp.sort + insert into equ_repair_order diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckType.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckType.java index 79249d12..cb3bbbe3 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckType.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckType.java @@ -45,6 +45,15 @@ public class QcCheckType extends BaseEntity { private String delFlag; private int taskNum; + private String checkManCode; + + public String getCheckManCode() { + return checkManCode; + } + + public void setCheckManCode(String checkManCode) { + this.checkManCode = checkManCode; + } public int getTaskNum() { return taskNum; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeServiceImpl.java index 88ee8cb9..d7a9bc58 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeServiceImpl.java @@ -2,6 +2,7 @@ package com.op.quality.service.impl; import java.util.List; +import com.alibaba.nacos.common.utils.CollectionUtils; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; @@ -123,7 +124,8 @@ public class QcCheckTypeServiceImpl implements IQcCheckTypeService { @Override public List getTopTaskInfo(QcCheckType qcCheckType) { DynamicDataSourceContextHolder.push(qcCheckType.getFactoryCode());// 这是数据源的key - return qcCheckTypeMapper.getTopTaskInfo(qcCheckType); + List dtos = qcCheckTypeMapper.getTopTaskInfo(qcCheckType);//检验任务 + return dtos; } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcUserMaterialServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcUserMaterialServiceImpl.java index 3c01ce35..e937c8c4 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcUserMaterialServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcUserMaterialServiceImpl.java @@ -1,5 +1,7 @@ package com.op.quality.service.impl; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -73,6 +75,10 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService { @Override @DS("#header.poolName") public int insertQcUserMaterial(QcUserMaterial qcUserMaterial) { + List userCodes = new ArrayList<>(); + userCodes.add(qcUserMaterial.getUserCode()); + qcUserMaterial.setUserCodes(userCodes.toArray(new String[userCodes.size()])); + Date now = DateUtils.getNowDate(); if (StringUtils.isNotEmpty(qcUserMaterial.getUserCodes())) { //删除之前的关联关系 diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeMapper.xml index e234127c..ac85dcb5 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeMapper.xml @@ -47,21 +47,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" count(0) taskNum, '检验任务' attr1 from qc_check_task qct - left join qc_check_type qc on qct.check_type = qc.order_code - where qct.check_status = '0' + left join qc_check_type qc on qct.check_type = qc.order_code + left join qc_user_material qum on qum.material_code = qct.material_code + where qct.check_status = '0' and qum.user_code = #{checkManCode} group by qct.check_type,qc.check_name - union ALL - select qcu.type, - qc.check_name, - count(0) taskNum, - '不合格处理' + union all + select '','', + count(0) taskNum, + '不合格处理' attr1 from qc_check_unqualified qcu - left join qc_check_type qc on qcu.type = qc.order_code - where qcu.status != '2' - group by qcu.type,qc.check_name + left join qc_check_task qct on qcu.task_id = qct.record_id + left join qc_user_material qum on qum.material_code = qct.material_code + where qcu.status != '2' and qum.user_code = #{checkManCode} - - insert into qc_check_type diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml index 7693fcec..c08df09b 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml @@ -66,6 +66,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,file_id,attr1,attr2, @@ -248,7 +253,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" qct.material_code, qct.material_name, qct.quality, qct.unit, qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status, qct.check_man_code,qct.check_man_name, qct.check_time, qct.check_result, - qct.status,qct.create_by,qct.create_time,qct.check_type + qct.status,qct.create_by,qct.create_time,qct.check_type, + qct.noOk_quality,qct.aNoOkquality,qct.bNoOkquality,qct.cNoOkquality,qct.sample_quality from qc_check_task qct and qct.del_flag = '0' diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml index df89fef3..6d55176d 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml @@ -81,10 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bp.product_code not in ( select um.material_code from qc_user_material um - where um.user_code in - - #{userCode} - + where um.user_code =#{userCode} ) and bp.product_desc_zh like concat('%', #{materialName}, '%') @@ -94,10 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" concat(bp.product_desc_zh,'(',bp.product_code,')') label from qc_user_material um left join base_product bp on um.material_code = bp.product_code - where um.user_code in - - #{userCode} - + where um.user_code = #{userCode} and bp.product_desc_zh like concat('%', #{materialName}, '%')