diff --git a/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java b/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java index fb387861..394e2fbc 100644 --- a/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java +++ b/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java @@ -157,9 +157,15 @@ public class RyTask { /************质量管理系统定时任务开始*****************/ //过程巡检,每3分钟执行检查一次 public void createProduceXJTask(){ - logger.info("++质量管理系统+过程巡检+开始++createProduceXJTask+++++"); + logger.info("++质量管理系统+过程巡检任务创建+开始++createProduceXJTask+++++"); remoteQualityService.createProduceXJTask(); } + + //来料检验批量检验任务创建,每30分钟执行一次 + public void createIncomeBatchTask(){ + logger.info("++质量管理系统+来料检验任务创建+开始++createIncomeBatchTask+++++"); + remoteQualityService.createIncomeBatchTask(); + } /************质量管理系统定时任务结束*****************/ /************hr 人力基础数据定时任务开始*****************/ @@ -182,12 +188,5 @@ public class RyTask { } /************部门基础数据定时任务开始*****************/ - /************质量管理系统-来料检验批量检验任务创建-定时任务开始*****************/ - //来料检验批量检验任务创建,每30分钟执行一次 - public void createIncomeBatchTask(){ - logger.info("++质量管理系统+来料检验批量检验任务创建+开始++createIncomeBatchTask+++++"); - remoteQualityService.createIncomeBatchTask(); - } - /************质量管理系统-来料检验批量检验任务创建-定时任务结束*****************/ } 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 85ccc6cf..3bd8ad5f 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 @@ -80,5 +80,7 @@ public interface OpenMapper { List getCheckUsers(String checkType); public int addCheckUsers(@Param("list") List users); + + String getSampNum(QcCheckTaskProduceDTO sampQua); } 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 da094dcb..52b75d54 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 @@ -372,24 +372,33 @@ public class OpenServiceImpl implements OpenService { int m = openMapper.addCheckUsers(users); logger.info(qcCheckTaskProduce.getOrderNo()+":检查人新增" + m + "成功"); - /**qc_check_type_project**/ + /**qc_check_type_project**///个性 List items = openMapper.getTPByTypeMaterial(qctp); - if (CollectionUtils.isEmpty(items)) { - /**qc_material_group_detail**/ - QcMaterialGroupDetailDTO group = openMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode()); - if (group == null) { - logger.info(qcCheckTaskProduce.getOrderNo()+":"+qcCheckTaskProduce.getMaterialCode()+"没有维护物料组检测项,检验任务生成失败"); - return 0;//没有找到检测项目 - } - qctp.setGroupId(group.getGroupId());//共性 - items = openMapper.getTPByTypeGroup(qctp); + + /**qc_material_group_detail**/ + QcMaterialGroupDetailDTO group = openMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode()); + if (group == null) { + group = new QcMaterialGroupDetailDTO(); + group.setGroupId("3dc0655fea3449c59c76a01cc5b91565"); } + qctp.setGroupId(group.getGroupId());//共性 + List itemsGG = openMapper.getTPByTypeGroup(qctp); + items.addAll(itemsGG); /**qc_check_task_detail**/ if (CollectionUtils.isEmpty(items)) { return 0;//没有找到检测项目 } + /**qc_sample_rule**/ + QcCheckTaskProduceDTO sampQua = new QcCheckTaskProduceDTO(); + sampQua.setCheckType(qcCheckTaskProduce.getCheckType()); + sampQua.setQuality(qcCheckTaskProduce.getQuality()); + String sampNum = openMapper.getSampNum(sampQua); + if(StringUtils.isNotBlank(sampNum)){ + qcCheckTaskProduce.setSampleQuality(new BigDecimal(sampNum)); + } + /**qc_check_task**/ qcCheckTaskProduce.setRecordId(beLongId); qcCheckTaskProduce.setFactoryCode(factoryCode); 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 6e780f62..aa7436fe 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 @@ -201,6 +201,12 @@ from qc_user_material qum where qum.material_code = #{checkType} and pow.del_flag = '0' and qum.del_flag = '0' + insert into equ_repair_order diff --git a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java index f3915d6f..08a18768 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java @@ -292,7 +292,6 @@ public class ProOrderController extends BaseController { return proOrderService.syncSAPOrders(); } /** - * 下发生产工单。workorderIds:母工单号 * 如果改成复选,需要考虑很多中订单组合情况 * 所以尽量不要动 */ diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java index b9e518f0..72fc7853 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java @@ -197,5 +197,9 @@ public interface ProOrderWorkorderMapper { List getOrderByOrders(@Param("orderIds") String[] orderIds); List checkBatchCodes(@Param("batchs") List formFields); + + List getUnSplitOrder(@Param("orderIds") String[] orderIds); + + ProOrderWorkorder selectSonOrder(String parentOrder); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 5ae7f845..c76adc38 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -1094,10 +1094,27 @@ public class ProOrderServiceImpl implements IProOrderService { @Transactional(rollbackFor = Exception.class) public int deleteOrder(String[] orderIds) { - //未拆分,直接关闭订单 + //未拆分、部分拆分,直接关闭订单 List checkOrders = proOrderWorkorderMapper.getOrderByOrders(orderIds); if(!CollectionUtils.isEmpty(checkOrders)){ - int m0 = proOrderMapper.deleteProOrderByIds(orderIds); + List allOrderIds = new ArrayList<>(); + for(ProOrderWorkorder order:checkOrders){ + String topOrderCode = order.getOrderCode(); + allOrderIds.add(order.getOrderId()); + Boolean run = true; + while (run) { + //下级 + ProOrderWorkorder sonOrder = proOrderWorkorderMapper.selectSonOrder(topOrderCode); + //有下级code + if (sonOrder != null) { + allOrderIds.add(sonOrder.getOrderId()); + topOrderCode = sonOrder.getOrderCode(); + } else { + run = false; + } + } + } + int m0 = proOrderMapper.deleteProOrderByIds(allOrderIds.toArray(new String[allOrderIds.size()])); logger.info(orderIds[0]+"删除订单m0:"+m0); return 1; } @@ -1107,6 +1124,7 @@ public class ProOrderServiceImpl implements IProOrderService { if(checkWorkOrders.size() != orderIds.length){ return 2; } + for(ProOrderWorkorder workorder:checkWorkOrders){ //要删除的工单id们 List delteIds = new ArrayList<>(); @@ -1178,7 +1196,7 @@ public class ProOrderServiceImpl implements IProOrderService { if(!CollectionUtils.isEmpty(repeatBatchCodes)){ return StringUtils.join(repeatBatchCodes, ","); } - return ""; + return ""; } public static void main(String args[]){ diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml index 583eb34c..8fdca2a1 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml @@ -535,7 +535,7 @@ and pow.del_flag = '0' + + insert into mes_prepare_detail 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 9ac1a3f5..e88e9018 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 @@ -150,22 +150,17 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { QcCheckTypeProject qctp= new QcCheckTypeProject(); qctp.setTypeId(qcCheckTaskIncome.getCheckType());//生产过程检验 qctp.setMaterialCode(qcCheckTaskIncome.getMaterialCode());//特性 - /**qc_check_type_project**/ + /**qc_check_type_project**///个性 List items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp); - /**qc_material_group_detail**/ - //个性 QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskIncome.getMaterialCode()); -// if(group == null){ -// return 0;//没有找到检测项目 -// } - if(Objects.isNull(group)){ - return 0;//没有找到检测项目 - } //共性 + if(group == null){//默认 + group = new QcMaterialGroupDetail(); + group.setGroupId("729971295b734782b544f9d6d06fb8b9"); + } qctp.setGroupId(group.getGroupId()); List itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); - items.addAll(itemsGG); /**qc_check_task_detail**/ 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 0d6572cd..ee0810c1 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 @@ -27,6 +27,7 @@ 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.QcMaterialGroupDetailDTO; import com.op.system.api.domain.quality.QcUserMaterialDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -158,17 +159,18 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService QcCheckTypeProject qctp= new QcCheckTypeProject(); qctp.setTypeId(qcCheckTaskProduce.getCheckType());//生产过程检验 qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性 - /**qc_check_type_project**/ + /**qc_check_type_project**///个性 List items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp); - if(CollectionUtils.isEmpty(items)){ - /**qc_material_group_detail**/ - QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode()); - if(group == null){ - return 0;//没有找到检测项目 - } - qctp.setGroupId(group.getGroupId());//共性 - items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); + + /**qc_material_group_detail**/ + QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode()); + if(group == null){ + group = new QcMaterialGroupDetail(); + group.setGroupId("3dc0655fea3449c59c76a01cc5b91565"); } + qctp.setGroupId(group.getGroupId());//共性 + List itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); + items.addAll(itemsGG); /**qc_check_task_detail**/ if(CollectionUtils.isEmpty(items)){