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 index 526c9dce..4d593d40 100644 --- 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 @@ -18,7 +18,8 @@ public class QcUserMaterialDTO extends BaseEntity { /** id */ private String id; - + private String belongTo; + private String checkNo; /** 员工编码 */ @Excel(name = "员工编码") private String userCode; @@ -75,6 +76,22 @@ public class QcUserMaterialDTO extends BaseEntity { private List selectedValues; + public String getBelongTo() { + return belongTo; + } + + public void setBelongTo(String belongTo) { + this.belongTo = belongTo; + } + + public String getCheckNo() { + return checkNo; + } + + public void setCheckNo(String checkNo) { + this.checkNo = checkNo; + } + public void setId(String id) { this.id = id; } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index a20c67ac..7abda12e 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -327,15 +327,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { logger.info("==========================母工单报工结束"+JSONObject.toJSONString(sapR)); //最终报工标识且sap报工成功:关闭子母工单 MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork); - if("1".equals(endReport.getEndReport())&&sapR.getCode()==200){ - MesReportWork rworkVo = new MesReportWork(); - rworkVo.setStatus("w3"); - rworkVo.setUpdateTime(DateUtils.getNowDate()); - rworkVo.setUpdateBy(SecurityUtils.getUsername()); - rworkVo.setWorkorderCode(belongWorkOrder); - //pro_work_order status->w3报工--belong_work_order - mesReportWorkMapper.updateOrderWorkStatus(rworkVo); - } +//-----改为由上位机触发 +// if("1".equals(endReport.getEndReport())&&sapR.getCode()==200){ +// MesReportWork rworkVo = new MesReportWork(); +// rworkVo.setStatus("w3"); +// rworkVo.setUpdateTime(DateUtils.getNowDate()); +// rworkVo.setUpdateBy(SecurityUtils.getUsername()); +// rworkVo.setWorkorderCode(belongWorkOrder); +// //pro_work_order status->w3报工--belong_work_order +// mesReportWorkMapper.updateOrderWorkStatus(rworkVo); +// } } return R.ok(); } 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 0196be05..2c11f765 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 @@ -435,8 +435,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from pro_order_workorder pow left join base_shifts_t s on pow.shift_id = s.Shift_Id left join pro_order_workorder pows on pows.parent_order = pow.workorder_code + left join mes_report_work mrw on mrw.workorder_code = pow.workorder_code where pow.del_flag = '0' and pow.status = 'w2' and pow.parent_order ='0' - + and mrw.upload_status != '1' and pow.workorder_code like concat('%', #{workorderCode}, '%') 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 07ca7e42..f363686b 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 @@ -76,6 +76,8 @@ public interface OpenMapper { public int addBatch(@Param("list") List items); - QcUserMaterialDTO getUserByMaterial(String materialCode); + List getUserByMaterial(String materialCode); + + public int addCheckUsers(@Param("list") List users); } 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 d1ecd5f1..11dc854f 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 @@ -295,7 +295,7 @@ public class OpenServiceImpl implements OpenService { Date nowDate= DateUtils.getNowDate(); //获取当前所选工厂 String factoryCode = qcCheckTaskProduce.getFactoryCode(); - + String beLongId = IdUtils.fastSimpleUUID(); qcCheckTaskProduce.setCheckNo(bpDD+liushuiStr); /**取检测项**/ @@ -304,14 +304,24 @@ public class OpenServiceImpl implements OpenService { qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性 /**qc_user_material取默认检查人**/ - QcUserMaterialDTO qcUserMaterialDTO = openMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode()); - if(qcUserMaterialDTO == null){ - qcCheckTaskProduce.setCheckManCode("mobile"); - qcCheckTaskProduce.setCheckManName("手持测试用户"); + List users = openMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode()); + if(CollectionUtils.isEmpty(users)){ + QcUserMaterialDTO dto0 = new QcUserMaterialDTO(); + dto0.setUserCode("mobile"); + dto0.setUserName("手持测试用户"); + users.add(dto0); }else{ - qcCheckTaskProduce.setCheckManCode(qcUserMaterialDTO.getUserCode()); - qcCheckTaskProduce.setCheckManName(qcUserMaterialDTO.getUserName()); + 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=openMapper.addCheckUsers(users); + logger.info("检查人新增"+m+"成功"); /**qc_check_type_project**/ List items = openMapper.getTPByTypeMaterial(qctp); @@ -331,7 +341,7 @@ public class OpenServiceImpl implements OpenService { } /**qc_check_task**/ - String beLongId = IdUtils.fastSimpleUUID(); + qcCheckTaskProduce.setRecordId(beLongId); qcCheckTaskProduce.setFactoryCode(factoryCode); qcCheckTaskProduce.setCreateTime(nowDate); 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 b12931ec..376db7d3 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 @@ -196,10 +196,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by qctp.sort @@ -358,5 +357,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + + insert into qc_check_task_user( + record_id,belong_to,check_no, + check_man_code,check_man_name, + create_by,create_time,factory_code + ) values + + ( + #{item.id},#{item.belongTo},#{item.checkNo}, + #{item.userCode},#{item.userName}, + #{item.createBy},#{item.createTime},#{item.factoryCode} + ) + + diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskUser.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskUser.java new file mode 100644 index 00000000..a914f905 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskUser.java @@ -0,0 +1,212 @@ +package com.op.quality.domain; + +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; + + +public class QcCheckTaskUser extends BaseEntity { + + + /** + * 生产过程检验任务--检验人 qc_check_task_user + * + * @author Open Platform + * @date 2023-12-22 + */ + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String recordId; + + /** + * 检验任务编号 + */ + @Excel(name = "检验任务编号") + private String checkNo; + + /** + * 检测人工号 + */ + @Excel(name = "检测人工号") + private String checkManCode; + + /** + * 检测人姓名 + */ + @Excel(name = "检测人姓名") + private String checkManName; + + /** + * 预留字段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 belongTo; + + private String manNames; + private String manCodes; + + public String getManNames() { + return manNames; + } + + public void setManNames(String manNames) { + this.manNames = manNames; + } + + public String getManCodes() { + return manCodes; + } + + public void setManCodes(String manCodes) { + this.manCodes = manCodes; + } + + public String getRecordId() { + return recordId; + } + + public void setRecordId(String recordId) { + this.recordId = recordId; + } + + public String getCheckNo() { + return checkNo; + } + + public void setCheckNo(String checkNo) { + this.checkNo = checkNo; + } + + public String getCheckManCode() { + return checkManCode; + } + + public void setCheckManCode(String checkManCode) { + this.checkManCode = checkManCode; + } + + public String getCheckManName() { + return checkManName; + } + + public void setCheckManName(String checkManName) { + this.checkManName = checkManName; + } + + public String getAttr1() { + return attr1; + } + + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr2() { + return attr2; + } + + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr3() { + return attr3; + } + + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr4() { + return attr4; + } + + public void setAttr4(String attr4) { + this.attr4 = attr4; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getBelongTo() { + return belongTo; + } + + public void setBelongTo(String belongTo) { + this.belongTo = belongTo; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("recordId", getRecordId()) + .append("checkNo", getCheckNo()) + .append("checkManCode", getCheckManCode()) + .append("checkManName", getCheckManName()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .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-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java index 92fb3a7f..8ca91408 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java @@ -8,6 +8,7 @@ import com.op.quality.domain.QcCheckTaskIncome; import com.op.quality.domain.QcSupplier; import com.op.system.api.domain.SysDictData; import com.op.system.api.domain.SysUser; +import com.op.system.api.domain.quality.QcUserMaterialDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -86,4 +87,10 @@ public interface QcCheckTaskIncomeMapper { List getBatchList(QcCheckTaskIncome qcCheckTaskIncome); String getTypeCode(String checkType); + + List selectQcCheckTaskCheckNoByRecordIds(String[] recordIds); + + List getUserByMaterial(String materialCode); + + int addCheckUsers(@Param("list") List users); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskProduceMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskProduceMapper.java index 958b8dad..4fb4a4af 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskProduceMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskProduceMapper.java @@ -71,4 +71,6 @@ public interface QcCheckTaskProduceMapper { List getCheckTypes(QcCheckType qcCheckType); List getOrderWorks(ProOrderWorkorderDTO qoWork); + + List selectQcCheckTaskCheckNoByRecordIds(String[] recordIds); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskUserMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskUserMapper.java new file mode 100644 index 00000000..28eb3772 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskUserMapper.java @@ -0,0 +1,74 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcCheckTaskUser; +import org.apache.ibatis.annotations.Mapper; + +/** + * 来料检验任务--检查人Mapper接口 + * + * @author Open Platform + * @date 2023-12-22 + */ +@Mapper +public interface QcCheckTaskUserMapper { + /** + * 查询来料检验任务--检查人 + * + * @param recordId 来料检验任务--检查人主键 + * @return 来料检验任务--检查人 + */ + public QcCheckTaskUser selectQcCheckTaskUserByRecordId(String recordId); + + /** + * 查询来料检验任务--检查人列表 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 来料检验任务--检查人集合 + */ + public List selectQcCheckTaskUserList(QcCheckTaskUser qcCheckTaskUser); + + /** + * 新增来料检验任务--检查人 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 结果 + */ + public int insertQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser); + + /** + * 修改来料检验任务--检查人 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 结果 + */ + public int updateQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser); + + /** + * 删除来料检验任务--检查人 + * + * @param recordId 来料检验任务--检查人主键 + * @return 结果 + */ + public int deleteQcCheckTaskUserByRecordId(String recordId); + + /** + * 批量删除来料检验任务--检查人 + * + * @param recordIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcCheckTaskUserByRecordIds(String[] recordIds); + + /** + * 批量插入检验人数据 + */ + public int insertQcCheckTaskUserList(List qcCheckTaskUserList); + + public int deleteQcCheckTaskUserByBelongTo(String belongTo); + + public QcCheckTaskUser selectQcCheckTaskUserByBelongTo(String belongTo); + + public int deleteQcCheckTaskUserByBelongTos(String[] belongToArray); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskUserService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskUserService.java new file mode 100644 index 00000000..c588ab9f --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskUserService.java @@ -0,0 +1,71 @@ +package com.op.quality.service; + +import java.util.List; +import com.op.quality.domain.QcCheckTaskUser; + +/** + * 来料检验任务--检查人Service接口 + * + * @author Open Platform + * @date 2023-12-22 + */ +public interface IQcCheckTaskUserService { + /** + * 查询来料检验任务--检查人 + * + * @param recordId 来料检验任务--检查人主键 + * @return 来料检验任务--检查人 + */ + public QcCheckTaskUser selectQcCheckTaskUserByRecordId(String recordId); + + /** + * 查询来料检验任务--检查人列表 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 来料检验任务--检查人集合 + */ + public List selectQcCheckTaskUserList(QcCheckTaskUser qcCheckTaskUser); + + /** + * 新增来料检验任务--检查人 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 结果 + */ + public int insertQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser); + + /** + * 修改来料检验任务--检查人 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 结果 + */ + public int updateQcCheckTaskUser(List qcCheckTaskUser); + + /** + * 批量删除来料检验任务--检查人 + * + * @param recordIds 需要删除的来料检验任务--检查人主键集合 + * @return 结果 + */ + public int deleteQcCheckTaskUserByRecordIds(String[] recordIds); + + public int deleteQcCheckTaskUserByBelongTos(String[] belongToArray); + + /** + * 删除来料检验任务--检查人信息 + * + * @param recordId 来料检验任务--检查人主键 + * @return 结果 + */ + public int deleteQcCheckTaskUserByRecordId(String recordId); + + /** + * 用户数据批量插入 + */ + public int insertQcCheckTaskUserList(List qcCheckTaskUserList); + /** + * 根据任务编号查询检验人 + */ + public QcCheckTaskUser selectQcCheckTaskUserByBelongTo(String belongTo); +} 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 767fffdf..6aaf0ed8 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 @@ -15,7 +15,9 @@ import com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.*; import com.op.quality.mapper.*; import com.op.quality.service.IQcCheckTaskProduceService; +import com.op.quality.service.IQcCheckTaskUserService; 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; @@ -58,6 +60,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { @Autowired private QcCheckUnqualifiedMapper qcCheckUnqualifiedMapper; + @Autowired + private IQcCheckTaskUserService qcCheckTaskUserService; + /** * 查询来料检验 * @@ -139,7 +144,50 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { qcCheckTaskIncome.setCreateTime(nowDate); //String typeCode = qcCheckTaskIncomeMapper.getTypeCode(qcCheckTaskIncome.getCheckType()); qcCheckTaskIncome.setTypeCode("material");//大检验节点 + /**qc_task_user start**/ + if(StringUtils.isNotBlank(qcCheckTaskIncome.getCheckManName())){//管理系统创建任务 + String checkManName = qcCheckTaskIncome.getCheckManName(); + String checkManCode = qcCheckTaskIncome.getCheckManCode(); + qcCheckTaskIncome.setCheckManName(""); + qcCheckTaskIncome.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(qcCheckTaskIncome.getCheckNo()); + qcCheckTaskUser.setBelongTo(beLongId); + qcCheckTaskUserList.add(qcCheckTaskUser); + } + //检验人插入 + qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList); + }else{//上位机触发 + qcCheckTaskIncome.setCheckManName(""); + qcCheckTaskIncome.setCheckManCode(""); + /**qc_user_material取默认检查人**/ + List users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskIncome.getMaterialCode()); + if(CollectionUtils.isEmpty(users)){ + QcUserMaterialDTO dto0 = new QcUserMaterialDTO(); + dto0.setUserCode("mobile"); + dto0.setUserName("手持测试用户"); + users.add(dto0); + }else{ + for(QcUserMaterialDTO user:users){ + user.setId(IdUtils.fastSimpleUUID()); + user.setBelongTo(beLongId); + user.setCheckNo(qcCheckTaskIncome.getCheckNo()); + user.setCreateBy(createBy); + user.setFactoryCode(factoryCode); + user.setCreateTime(nowDate); + } + } + int m=qcCheckTaskIncomeMapper.addCheckUsers(users); + logger.info("检查人新增"+m+"成功"); + } qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome); + /**qc_check_task_detail**/ for(QcCheckTaskDetail item:items){ item.setRecordId(IdUtils.fastSimpleUUID()); @@ -162,6 +210,24 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { @DS("#header.poolName") public int updateQcCheckTaskIncome(QcCheckTaskIncome qcCheckTaskIncome) { qcCheckTaskIncome.setUpdateTime(DateUtils.getNowDate()); + /**qc_task_user**/ + String checkManName = qcCheckTaskIncome.getCheckManName(); + String checkManCode = qcCheckTaskIncome.getCheckManCode(); + qcCheckTaskIncome.setCheckManName(""); + qcCheckTaskIncome.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(qcCheckTaskIncome.getCheckNo()); + qcCheckTaskUser.setBelongTo(qcCheckTaskIncome.getRecordId()); + qcCheckTaskUserList.add(qcCheckTaskUser); + } + qcCheckTaskUserService.updateQcCheckTaskUser(qcCheckTaskUserList); return qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome); } @@ -174,6 +240,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { @Override @DS("#header.poolName") public int deleteQcCheckTaskIncomeByRecordIds(String[] recordIds) { + qcCheckTaskUserService.deleteQcCheckTaskUserByBelongTos(recordIds); return qcCheckTaskIncomeMapper.deleteQcCheckTaskIncomeByRecordIds(recordIds); } @@ -271,10 +338,11 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { qcCheckTaskIncome.setCheckStatus("2"); qcCheckTaskIncome.setCheckResult(result); qcCheckTaskIncome.setCheckTime(DateUtils.getNowDate()); + qcCheckTaskIncome.setCheckManCode(SecurityUtils.getUsername()); n = qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome); /**wms_raw_order_in-->quality_status->**/ - qcCheckTaskIncome.setCheckResult(result.equals("Y")?"1":"0"); + qcCheckTaskIncome.setCheckResult(result.equals("Y")?"1":"2"); qcCheckUnqualifiedMapper.updateQualityStatus(qcCheckTaskIncome); }else if("produce".equals(qcCheckTaskIncome.getTypeCode())){ QcCheckTaskProduce qcCheckTaskProduce = new QcCheckTaskProduce(); @@ -282,6 +350,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { qcCheckTaskProduce.setRecordId(recordId); qcCheckTaskProduce.setCheckResult(result); qcCheckTaskProduce.setCheckTime(DateUtils.getNowDate()); + qcCheckTaskProduce.setCheckManCode(SecurityUtils.getUsername()); n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce); @@ -294,6 +363,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { warehousing.setRecordId(recordId); warehousing.setCheckResult(result); warehousing.setCheckTime(DateUtils.getNowDate()); + warehousing.setCheckManCode(SecurityUtils.getUsername()); n = qcCheckTaskWarehousingMapper.updateQcCheckTaskWarehousing(warehousing); } 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 769112fb..32e76b3d 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 @@ -1,5 +1,6 @@ package com.op.quality.service.impl; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -22,6 +23,7 @@ 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.service.IQcCheckTaskUserService; import com.op.system.api.RemoteUserService; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; @@ -31,7 +33,11 @@ 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; import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -52,42 +58,55 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService @Autowired private QcCheckTaskProduceMapper qcCheckTaskProduceMapper; - @Autowired - private QcCheckTypeProjectMapper qcCheckTypeProjectMapper; + @Autowired + private QcCheckTypeProjectMapper qcCheckTypeProjectMapper; - @Autowired - private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper; + @Autowired + private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper; + + @Autowired + private QcCheckTaskDetailMapper qcCheckTaskDetailMapper; - @Autowired - private QcCheckTaskDetailMapper qcCheckTaskDetailMapper; @Autowired private RemoteUserService remoteUserService; - /** - * 查询生产过程检验任务 - * - * @param recordId 生产过程检验任务主键 - * @return 生产过程检验任务 - */ - @Override - @DS("#header.poolName") - public QcCheckTaskProduce selectQcCheckTaskProduceByRecordId(String recordId) { - return qcCheckTaskProduceMapper.selectQcCheckTaskProduceByRecordId(recordId); - } + @Autowired + private IQcCheckTaskUserService qcCheckTaskUserService; - /** - * 查询生产过程检验任务列表 - * - * @param qcCheckTaskProduce 生产过程检验任务 - * @return 生产过程检验任务 - */ - @Override - @DS("#header.poolName") - public List selectQcCheckTaskProduceList(QcCheckTaskProduce qcCheckTaskProduce) { - qcCheckTaskProduce.setDelFlag("0"); - qcCheckTaskProduce.setTypeCode("produce"); - return qcCheckTaskProduceMapper.selectQcCheckTaskProduceList(qcCheckTaskProduce); - } + /** + * 查询生产过程检验任务 + * + * @param recordId 生产过程检验任务主键 + * @return 生产过程检验任务 + */ + @Override + @DS("#header.poolName") + public QcCheckTaskProduce selectQcCheckTaskProduceByRecordId(String recordId) { + QcCheckTaskProduce qcCheckTaskProduce = qcCheckTaskProduceMapper.selectQcCheckTaskProduceByRecordId(recordId); + //获取拼接好的检验人员信息 + QcCheckTaskUser qcCheckTaskUser = qcCheckTaskUserService.selectQcCheckTaskUserByBelongTo(recordId); + if (StringUtils.isNotBlank(qcCheckTaskUser.getManNames())) { + qcCheckTaskProduce.setCheckManName(qcCheckTaskUser.getManNames()); + } + if (StringUtils.isNotBlank(qcCheckTaskUser.getManCodes())) { + qcCheckTaskProduce.setCheckManCode(qcCheckTaskUser.getManCodes()); + } + return qcCheckTaskProduce; + } + + /** + * 查询生产过程检验任务列表 + * + * @param qcCheckTaskProduce 生产过程检验任务 + * @return 生产过程检验任务 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckTaskProduceList(QcCheckTaskProduce qcCheckTaskProduce) { + qcCheckTaskProduce.setDelFlag("0"); + qcCheckTaskProduce.setTypeCode("produce"); + return qcCheckTaskProduceMapper.selectQcCheckTaskProduceList(qcCheckTaskProduce); + } /** * 新增生产过程检验任务 @@ -115,8 +134,8 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService int liushuiNum = qcCheckTaskProduceMapper.getTodayMaxNum(qcCheckTaskProduce); String liushuiStr = String.format("%04d", liushuiNum); - String createBy = SecurityUtils.getUsername(); - Date nowDate= DateUtils.getNowDate(); + String createBy = SecurityUtils.getUsername(); + Date nowDate = DateUtils.getNowDate(); qcCheckTaskProduce.setCheckNo(bpDD+liushuiStr); @@ -141,37 +160,72 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService return 0;//没有找到检测项目 } - /**qc_check_task**/ - String beLongId = IdUtils.fastSimpleUUID(); - qcCheckTaskProduce.setRecordId(beLongId); - qcCheckTaskProduce.setFactoryCode(factoryCode); - qcCheckTaskProduce.setCreateTime(nowDate); - qcCheckTaskProduce.setTypeCode("produce");//大检验节点 - qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce); - /**qc_check_task_detail**/ - for(QcCheckTaskDetail item:items){ - item.setRecordId(IdUtils.fastSimpleUUID()); - item.setBelongTo(beLongId); - item.setCreateTime(nowDate); - item.setCreateBy(createBy); - item.setFactoryCode(factoryCode); - item.setStatus("Y"); - } - return qcCheckTaskDetailMapper.addBatch(items); - } + /**qc_check_task**/ + String beLongId = IdUtils.fastSimpleUUID(); + qcCheckTaskProduce.setRecordId(beLongId); + qcCheckTaskProduce.setFactoryCode(factoryCode); + 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); + } + qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce); + //检验人插入 + qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList); + /**qc_check_task_detail**/ + for (QcCheckTaskDetail item : items) { + item.setRecordId(IdUtils.fastSimpleUUID()); + item.setBelongTo(beLongId); + item.setCreateTime(nowDate); + item.setCreateBy(createBy); + item.setFactoryCode(factoryCode); + item.setStatus("Y"); + } + return qcCheckTaskDetailMapper.addBatch(items); + } - /** - * 修改生产过程检验任务 - * - * @param qcCheckTaskProduce 生产过程检验任务 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int updateQcCheckTaskProduce(QcCheckTaskProduce qcCheckTaskProduce) { - qcCheckTaskProduce.setUpdateTime(DateUtils.getNowDate()); - return qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce); - } + /** + * 修改生产过程检验任务 + * + * @param qcCheckTaskProduce 生产过程检验任务 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckTaskProduce(QcCheckTaskProduce qcCheckTaskProduce) { + qcCheckTaskProduce.setUpdateTime(DateUtils.getNowDate()); + /**qc_task_user**/ + 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(qcCheckTaskProduce.getRecordId()); + qcCheckTaskUserList.add(qcCheckTaskUser); + } + qcCheckTaskUserService.updateQcCheckTaskUser(qcCheckTaskUserList); + return qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce); + } /** * 批量删除生产过程检验任务 @@ -182,6 +236,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService @Override @DS("#header.poolName") public int deleteQcCheckTaskProduceByRecordIds(String[] recordIds) { + qcCheckTaskUserService.deleteQcCheckTaskUserByBelongTos(recordIds); return qcCheckTaskProduceMapper.deleteQcCheckTaskProduceByRecordIds(recordIds); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskUserServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskUserServiceImpl.java new file mode 100644 index 00000000..ef37013c --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskUserServiceImpl.java @@ -0,0 +1,157 @@ +package com.op.quality.service.impl; + +import java.util.Date; +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.StringUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.quality.mapper.QcCheckTaskUserMapper; +import com.op.quality.domain.QcCheckTaskUser; +import com.op.quality.service.IQcCheckTaskUserService; +import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 来料检验任务--检查人Service业务层处理 + * + * @author Open Platform + * @date 2023-12-22 + */ +@Service +public class QcCheckTaskUserServiceImpl implements IQcCheckTaskUserService { + @Autowired + private QcCheckTaskUserMapper qcCheckTaskUserMapper; + + /** + * 查询来料检验任务--检查人 + * + * @param recordId 来料检验任务--检查人主键 + * @return 来料检验任务--检查人 + */ + @Override + @DS("#header.poolName") + public QcCheckTaskUser selectQcCheckTaskUserByRecordId(String recordId) { + return qcCheckTaskUserMapper.selectQcCheckTaskUserByRecordId(recordId); + } + + /** + * 查询来料检验任务--检查人列表 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 来料检验任务--检查人 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckTaskUserList(QcCheckTaskUser qcCheckTaskUser) { + return qcCheckTaskUserMapper.selectQcCheckTaskUserList(qcCheckTaskUser); + } + + /** + * 新增来料检验任务--检查人 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser) { + qcCheckTaskUser.setCreateTime(DateUtils.getNowDate()); + return qcCheckTaskUserMapper.insertQcCheckTaskUser(qcCheckTaskUser); + } + + /** + * 修改来料检验任务--检查人 + * + * @param qcCheckTaskUser 来料检验任务--检查人 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckTaskUser(List qcCheckTaskUserList) { + if (CollectionUtils.isEmpty(qcCheckTaskUserList)){ + return 0; + } + String belongTo = qcCheckTaskUserList.get(0).getBelongTo(); + //根据belongTo删除 + qcCheckTaskUserMapper.deleteQcCheckTaskUserByBelongTo(belongTo); + + //获取当前所选工厂 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String factoryCode = request.getHeader(key.substring(8)).replace("ds_", ""); + //遍历赋值 + for (QcCheckTaskUser qcCheckTaskUser : qcCheckTaskUserList){ + qcCheckTaskUser.setRecordId(IdUtils.fastSimpleUUID()); + qcCheckTaskUser.setCreateTime(DateUtils.getNowDate()); + qcCheckTaskUser.setCreateBy(SecurityUtils.getUsername()); + qcCheckTaskUser.setFactoryCode(factoryCode); + } + //重新插入数据 + return qcCheckTaskUserMapper.insertQcCheckTaskUserList(qcCheckTaskUserList); + } + + /** + * 批量删除来料检验任务--检查人 + * + * @param recordIds 需要删除的来料检验任务--检查人主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckTaskUserByRecordIds(String[] recordIds) { + return qcCheckTaskUserMapper.deleteQcCheckTaskUserByRecordIds(recordIds); + } + + @Override + @DS("#header.poolName") + public int deleteQcCheckTaskUserByBelongTos(String[] belongToArray) { + return qcCheckTaskUserMapper.deleteQcCheckTaskUserByBelongTos(belongToArray); + } + + /** + * 删除来料检验任务--检查人信息 + * + * @param recordId 来料检验任务--检查人主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckTaskUserByRecordId(String recordId) { + return qcCheckTaskUserMapper.deleteQcCheckTaskUserByRecordId(recordId); + } + + @Override + @DS("#header.poolName") + public int insertQcCheckTaskUserList(List qcCheckTaskUserList) { + if (CollectionUtils.isEmpty(qcCheckTaskUserList)){ + return 0; + } + //获取当前所选工厂 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String factoryCode = request.getHeader(key.substring(8)).replace("ds_", ""); + //遍历赋值 + Date nowTime = DateUtils.getNowDate(); + for (QcCheckTaskUser qcCheckTaskUser : qcCheckTaskUserList){ + qcCheckTaskUser.setRecordId(IdUtils.fastSimpleUUID()); + qcCheckTaskUser.setCreateTime(nowTime); + qcCheckTaskUser.setCreateBy(SecurityUtils.getUsername()); + qcCheckTaskUser.setFactoryCode(factoryCode); + } + return qcCheckTaskUserMapper.insertQcCheckTaskUserList(qcCheckTaskUserList); + } + + @Override + @DS("#header.poolName") + public QcCheckTaskUser selectQcCheckTaskUserByBelongTo(String belongTo) { + return qcCheckTaskUserMapper.selectQcCheckTaskUserByBelongTo(belongTo); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskWarehousingServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskWarehousingServiceImpl.java index 3fd4328e..bdc73e26 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskWarehousingServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskWarehousingServiceImpl.java @@ -1,24 +1,24 @@ package com.op.quality.service.impl; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import ch.qos.logback.core.net.SyslogOutputStream; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.security.utils.SecurityUtils; -import com.op.quality.domain.QcCheckTaskDetail; -import com.op.quality.domain.QcCheckTypeProject; -import com.op.quality.domain.QcMaterialGroupDetail; +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.service.IQcCheckTaskUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.quality.mapper.QcCheckTaskWarehousingMapper; -import com.op.quality.domain.QcCheckTaskWarehousing; import com.op.quality.service.IQcCheckTaskWarehousingService; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -47,6 +47,9 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin @Autowired private QcCheckTaskDetailMapper qcCheckTaskDetailMapper; + @Autowired + private IQcCheckTaskUserService qcCheckTaskUserService; + /** * 查询成品入库检验任务 * @@ -128,7 +131,25 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin qcCheckTaskWarehousing.setFactoryCode(factoryCode); qcCheckTaskWarehousing.setCreateTime(nowDate); qcCheckTaskWarehousing.setTypeCode("product");//大检验节点 + /**qc_task_user start**/ + String checkManName = qcCheckTaskWarehousing.getCheckManName(); + String checkManCode = qcCheckTaskWarehousing.getCheckManCode(); + qcCheckTaskWarehousing.setCheckManName(""); + qcCheckTaskWarehousing.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(qcCheckTaskWarehousing.getCheckNo()); + qcCheckTaskUser.setBelongTo(beLongId); + qcCheckTaskUserList.add(qcCheckTaskUser); + } qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing); + //检验人插入 + qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList); /**qc_check_task_detail**/ for(QcCheckTaskDetail item:items){ item.setRecordId(IdUtils.fastSimpleUUID()); @@ -151,6 +172,23 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin @DS("#header.poolName") public int updateQcCheckTaskWarehousing(QcCheckTaskWarehousing qcCheckTaskWarehousing) { qcCheckTaskWarehousing.setUpdateTime(DateUtils.getNowDate()); + /**qc_task_user**/ + String checkManName = qcCheckTaskWarehousing.getCheckManName(); + String checkManCode = qcCheckTaskWarehousing.getCheckManCode(); + qcCheckTaskWarehousing.setCheckManName(""); + qcCheckTaskWarehousing.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(qcCheckTaskWarehousing.getCheckNo()); + qcCheckTaskUser.setBelongTo(qcCheckTaskWarehousing.getRecordId()); + qcCheckTaskUserList.add(qcCheckTaskUser); + } + qcCheckTaskUserService.updateQcCheckTaskUser(qcCheckTaskUserList); return qcCheckTaskWarehousingMapper.updateQcCheckTaskWarehousing(qcCheckTaskWarehousing); } @@ -163,6 +201,7 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin @Override @DS("#header.poolName") public int deleteQcCheckTaskWarehousingByRecordIds(String[] recordIds) { + qcCheckTaskUserService.deleteQcCheckTaskUserByBelongTos(recordIds); return qcCheckTaskWarehousingMapper.deleteQcCheckTaskWarehousingByRecordIds(recordIds); } 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 429cf9f7..53b401f5 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 @@ -230,6 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + update qc_check_task @@ -270,6 +271,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update qc_check_task set check_status = #{checkStatus}, + check_man_code = #{updateBy}, check_time = #{checkTime}, sample_quality = #{sampleQuality}, noOk_quality = #{noOkQuality}, @@ -304,4 +306,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{recordId} + + + + + insert into qc_check_task_user( + record_id,belong_to,check_no, + check_man_code,check_man_name, + create_by,create_time,factory_code + ) values + + ( + #{item.id},#{item.belongTo},#{item.checkNo}, + #{item.userCode},#{item.userName}, + #{item.createBy},#{item.createTime},#{item.factoryCode} + ) + + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml index 9d311227..1ad7a320 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml @@ -119,15 +119,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" e.workshop_code supplierCode, e.workshop_name supplierName, pow.product_date incomeTime, - task.createTime + task.createTime, + task.order_no orderNo, + task.check_loc checkLoc from pro_order_workorder pow left join pro_order_workorder_batch powb on powb.workorder_id = pow.workorder_id left join base_equipment e on e.equipment_code = pow.workorder_name left join ( - select max(create_time) createTime,income_batch_no from qc_check_task - where type_code = 'produce' and income_batch_no='20270104LJ20240105CBRA0L' - - GROUP BY income_batch_no + select max(create_time) createTime,income_batch_no,order_no,check_loc + from qc_check_task + where type_code = 'produce' + and CONVERT(varchar(10),income_time, 120) = CONVERT(varchar(10),GETDATE(), 120) + GROUP BY income_batch_no,order_no,check_loc ) task on task.income_batch_no = powb.batch_code where pow.status = 'w2' and pow.parent_order = '0' and pow.del_flag ='0' and powb.del_flag = '0' and pow.product_date >= '2023-12-22' @@ -172,7 +175,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, check_type, type_code, - sample_quality, #{recordId}, @@ -210,7 +212,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{delFlag}, #{checkType}, #{typeCode}, - #{sampleQuality}, @@ -249,7 +250,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time = #{updateTime}, factory_code = #{factoryCode}, del_flag = #{delFlag}, - sample_quality = #{sampleQuality}, where record_id = #{recordId} @@ -264,4 +264,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{recordId} + + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskUserMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskUserMapper.xml new file mode 100644 index 00000000..06375fb7 --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskUserMapper.xml @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + select record_id, check_no, check_man_code, check_man_name, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_task_user + + + + + + + + insert into qc_check_task_user + + record_id, + check_no, + check_man_code, + check_man_name, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + belong_to, + + + #{recordId}, + #{checkNo}, + #{checkManCode}, + #{checkManName}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + #{belongTo}, + + + + + update qc_check_task_user + + check_no = #{checkNo}, + check_man_code = #{checkManCode}, + check_man_name = #{checkManName}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + del_flag = #{delFlag}, + belong_to = #{belongTo}, + + where record_id = #{recordId} + + + + delete from qc_check_task_user where record_id = #{recordId} + + + + delete from qc_check_task_user where record_id in + + #{recordId} + + + + + delete from qc_check_task_user where belong_to = #{belongTo} + + + + insert into qc_check_task_user( + record_id, + check_no, + check_man_code, + check_man_name, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + belong_to + ) + values + + ( + #{item.recordId}, + #{item.checkNo}, + #{item.checkManCode}, + #{item.checkManName}, + #{item.attr1}, + #{item.attr2}, + #{item.attr3}, + #{item.attr4}, + #{item.createBy}, + #{item.createTime}, + #{item.updateBy}, + #{item.updateTime}, + #{item.factoryCode}, + #{item.delFlag}, + #{item.belongTo} + ) + + + + + + + delete from qc_check_task_user where belong_to in + + #{belongTo} + + + + \ No newline at end of file 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 298e7dfc..79d64143 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 @@ -48,7 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" '检验任务' attr1 from qc_check_task qct left join qc_check_type qc on qct.check_type = qc.order_code - where qct.check_status = '0' and qct.check_man_code = #{checkManCode} + left join qc_check_task_user qctu on qctu.belong_to = qct.record_id + where qct.check_status = '0' and qctu.check_man_code = #{checkManCode} group by qct.check_type,qc.check_name union all select '','', 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 c08df09b..6eaf1b82 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 @@ -256,10 +256,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 + left join qc_check_task_user qctu on qctu.belong_to = qct.record_id and qct.del_flag = '0' and qct.check_type = #{checkType} - and qct.check_man_code = #{checkManCode} + and qctu.check_man_code = #{checkManCode} and qct.check_status in (${checkStatus}) order by qct.create_time desc