From 0b302ed86e1590db31fa1b73320d022afacc232c Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 26 Dec 2023 16:06:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=A3=80=E9=AA=8C=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3+=E5=B7=A1=E6=A3=80=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/open/service/impl/OpenServiceImpl.java | 6 ++ .../impl/QcCheckTaskIncomeServiceImpl.java | 6 ++ .../impl/QcCheckTaskProduceServiceImpl.java | 75 +++++++++++++------ 3 files changed, 66 insertions(+), 21 deletions(-) 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 11dc854f..51fb2cb4 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 @@ -307,6 +307,12 @@ public class OpenServiceImpl implements OpenService { List users = openMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode()); if(CollectionUtils.isEmpty(users)){ QcUserMaterialDTO dto0 = new QcUserMaterialDTO(); + dto0.setId(IdUtils.fastSimpleUUID()); + dto0.setBelongTo(beLongId); + dto0.setCheckNo(qcCheckTaskProduce.getCheckNo()); + dto0.setCreateBy(createBy); + dto0.setFactoryCode(factoryCode); + dto0.setCreateTime(nowDate); dto0.setUserCode("mobile"); dto0.setUserName("手持测试用户"); users.add(dto0); 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 6aaf0ed8..9c9cccb6 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 @@ -170,6 +170,12 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { List users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskIncome.getMaterialCode()); if(CollectionUtils.isEmpty(users)){ QcUserMaterialDTO dto0 = new QcUserMaterialDTO(); + dto0.setId(IdUtils.fastSimpleUUID()); + dto0.setBelongTo(beLongId); + dto0.setCheckNo(qcCheckTaskIncome.getCheckNo()); + dto0.setCreateBy(createBy); + dto0.setFactoryCode(factoryCode); + dto0.setCreateTime(nowDate); dto0.setUserCode("mobile"); dto0.setUserName("手持测试用户"); users.add(dto0); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java index 1c4b04a0..f609dcfd 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java @@ -20,18 +20,16 @@ import com.op.common.core.utils.uuid.IdUtils; 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.QcCheckTaskDetailMapper; -import com.op.quality.mapper.QcCheckTypeProjectMapper; -import com.op.quality.mapper.QcMaterialGroupDetailMapper; +import com.op.quality.mapper.*; import com.op.quality.service.IQcCheckTaskUserService; import com.op.system.api.RemoteUserService; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; +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.mapper.QcCheckTaskProduceMapper; import com.op.quality.service.IQcCheckTaskProduceService; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -73,6 +71,9 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService @Autowired private IQcCheckTaskUserService qcCheckTaskUserService; + @Autowired + private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper; + /** * 查询生产过程检验任务 * @@ -167,24 +168,56 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService qcCheckTaskProduce.setCreateTime(nowDate); qcCheckTaskProduce.setTypeCode("produce");//大检验节点 /**qc_task_user start**/ - String checkManName = qcCheckTaskProduce.getCheckManName(); - String checkManCode = qcCheckTaskProduce.getCheckManCode(); - qcCheckTaskProduce.setCheckManName(""); - qcCheckTaskProduce.setCheckManCode(""); - String[] splitNames = checkManName.split(","); - String[] splitCodes = checkManCode.split(","); - List qcCheckTaskUserList = new ArrayList<>(); - for (int i = 0; i < splitNames.length; i++) { - QcCheckTaskUser qcCheckTaskUser = new QcCheckTaskUser(); - qcCheckTaskUser.setCheckManName(splitNames[i]); - qcCheckTaskUser.setCheckManCode(splitCodes[i]); - qcCheckTaskUser.setCheckNo(qcCheckTaskProduce.getCheckNo()); - qcCheckTaskUser.setBelongTo(beLongId); - qcCheckTaskUserList.add(qcCheckTaskUser); - } + if(StringUtils.isNotBlank(qcCheckTaskProduce.getCheckManName())){ + String checkManName = qcCheckTaskProduce.getCheckManName(); + String checkManCode = qcCheckTaskProduce.getCheckManCode(); + qcCheckTaskProduce.setCheckManName(""); + qcCheckTaskProduce.setCheckManCode(""); + String[] splitNames = checkManName.split(","); + String[] splitCodes = checkManCode.split(","); + List qcCheckTaskUserList = new ArrayList<>(); + for (int i = 0; i < splitNames.length; i++) { + QcCheckTaskUser qcCheckTaskUser = new QcCheckTaskUser(); + qcCheckTaskUser.setCheckManName(splitNames[i]); + qcCheckTaskUser.setCheckManCode(splitCodes[i]); + qcCheckTaskUser.setCheckNo(qcCheckTaskProduce.getCheckNo()); + qcCheckTaskUser.setBelongTo(beLongId); + qcCheckTaskUserList.add(qcCheckTaskUser); + } + //检验人插入 + qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList); + }else{//上位机 + qcCheckTaskProduce.setCheckManName(""); + qcCheckTaskProduce.setCheckManCode(""); + /**qc_user_material取默认检查人**/ + List users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode()); + if(CollectionUtils.isEmpty(users)){ + QcUserMaterialDTO dto0 = new QcUserMaterialDTO(); + dto0.setId(IdUtils.fastSimpleUUID()); + dto0.setBelongTo(beLongId); + dto0.setCheckNo(qcCheckTaskProduce.getCheckNo()); + dto0.setCreateBy(createBy); + dto0.setFactoryCode(factoryCode); + dto0.setCreateTime(nowDate); + dto0.setUserCode("mobile"); + dto0.setUserName("手持测试用户"); + users.add(dto0); + }else{ + for(QcUserMaterialDTO user:users){ + user.setId(IdUtils.fastSimpleUUID()); + user.setBelongTo(beLongId); + user.setCheckNo(qcCheckTaskProduce.getCheckNo()); + user.setCreateBy(createBy); + user.setFactoryCode(factoryCode); + user.setCreateTime(nowDate); + } + } + int m=qcCheckTaskIncomeMapper.addCheckUsers(users); + logger.info("检查人新增"+m+"成功"); + } + qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce); - //检验人插入 - qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList); + /**qc_check_task_detail**/ for (QcCheckTaskDetail item : items) { item.setRecordId(IdUtils.fastSimpleUUID());