From f3dda753a491144560bde33efb32a16c3000a160 Mon Sep 17 00:00:00 2001 From: lgh Date: Mon, 11 Jul 2022 16:48:20 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empty/service/impl/CurrTaskDetServiceImpl.java | 1 + .../com/mt/wms/empty/task/AsynRunTaskService.java | 14 ++++++++------ .../java/com/mt/wms/empty/task/ScheduledTask.java | 11 ++++++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java index 51e90e9..e316880 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java @@ -78,6 +78,7 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe OrderInfo one = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, e.getIdenCardNum())); e.setProductModel(one.getProductModel()); e.setCustomer(one.getCustomerName()); + e.setCraftIll(orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM,e.getIdenCardNum())).getCraftIll()); } ); return successful(currTaskDetVo); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java index 1207977..e1a7785 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java @@ -663,7 +663,7 @@ public class AsynRunTaskService extends BaseService { //氮气量 nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow"); //二氧化碳量 - Double carbonDioxideFlow = readPlc(nameSpaceNote, "CarbonDioxideFlow"); + Double carbonDioxideFlow = readPlc(nameSpaceNote, "CO2Flow"); ParGasValue parGasValue3 = new ParGasValue(); parGasValue3.setNitFlowValue(nitrogenFlow.floatValue()); parGasValue3.setAmmoniaFlowValue(ammoniaFlow.floatValue()); @@ -856,7 +856,7 @@ public class AsynRunTaskService extends BaseService { //氮气量 nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow"); //二氧化碳量 - Double carbonDioxideFlow = readPlc(nameSpaceNote, "CarbonDioxideFlow"); + Double carbonDioxideFlow = readPlc(nameSpaceNote, "CO2Flow"); ParGasValue parGasValue3 = new ParGasValue(); parGasValue3.setNitFlowValue(nitrogenFlow.floatValue()); parGasValue3.setAmmoniaFlowValue(ammoniaFlow.floatValue()); @@ -960,7 +960,7 @@ public class AsynRunTaskService extends BaseService { json.put("taskType", 4); json.put("sendRow", sendRow); json.put("pickRow", 0); - json.put("taskNo", 1); + json.put("taskNo", currTaskId); json.put("ideNumber", currTaskId); json.put("processNumber", processNumber); String taskJson = JSON.toJSONString(json); @@ -1000,7 +1000,7 @@ public class AsynRunTaskService extends BaseService { json.put("sendRow", endPoint); json.put("pickRow", startPoint); json.put("taskNo", currTaskId); - json.put("ideNumber", 1); + json.put("ideNumber", currTaskId); json.put("processNumber", processNumber); String taskJson = JSON.toJSONString(json); String result = null; @@ -1029,6 +1029,7 @@ public class AsynRunTaskService extends BaseService { */ private Boolean apmsCreateProcess(CurrTask currTask) throws IOException { List currTaskDetList = currTaskDetServiceBiz.list(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID, currTask.getId())); + String code = kilnInfoServiceBiz.getById(currTask.getKilnId()).getCode(); //通知apms创建一个生产单 ApmsCreateProcessSheet apmsCreateSheet = new ApmsCreateProcessSheet(); apmsCreateSheet.setWorkShopCode("BM"); @@ -1044,7 +1045,7 @@ public class AsynRunTaskService extends BaseService { createItem.setWeight(e.getWeight().doubleValue()); createItems.add(createItem); }); - apmsCreateSheet.setStoveCode(CodeGeneratorHelper.getStoveCode(currTask.getKilnName() + String.format("%02d", currTask.getCraftCodeId()))); + apmsCreateSheet.setStoveCode(code); apmsCreateSheet.setItems(createItems); logger.info(currTask.getId() + "开始创建apms生产单号"); R processSheet = apmsController.createProcessSheet(apmsCreateSheet); @@ -1066,12 +1067,13 @@ public class AsynRunTaskService extends BaseService { * @return */ private Boolean apmsStartProcess(CurrTask currTask) { + String code = kilnInfoServiceBiz.getById(currTask.getKilnId()).getCode(); ApmsStartProcess apmsStartProcess=new ApmsStartProcess(); apmsStartProcess.setStartUser("QJJP03"); apmsStartProcess.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); apmsStartProcess.setTechName(currTask.getCraftCodeId().toString()); apmsStartProcess.setSheetNo(currTask.getSheetNo()); - apmsStartProcess.setStoveCode(CodeGeneratorHelper.getStoveCode(currTask.getKilnName()+String.format("%02d",currTask.getCraftCodeId()))); + apmsStartProcess.setStoveCode(code); R apmsStartProcessR = apmsController.startProcess(apmsStartProcess); if (apmsStartProcessR.getCode() != 0) { logger.info("任务号" + currTask.getTaskCode() + "生产单号:" + currTask.getSheetNo() + "生产单开始生产上报apms失败"); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java index b1ccf48..8922234 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java @@ -112,7 +112,7 @@ public class ScheduledTask extends BaseService { List currTaskDetVoList = BeanUtils.copyList(currTaskDetList, CurrTaskDetVo.class); for (CurrTaskDetVo currTaskDetVo:currTaskDetVoList ) { - String customerName = orderInfoServiceBiz.getOne(new QueryWrapper().eq(OrderInfo.ORDER_NO, currTaskDetVo.getOrderNo())).getCustomerName(); + String customerName = orderInfoServiceBiz.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, currTaskDetVo.getIdenCardNum())).getCustomerName(); currTaskDetVo.setCustomer(customerName); } nowCurrTask.setCurrTaskDetVoList(currTaskDetVoList); @@ -151,7 +151,12 @@ public class ScheduledTask extends BaseService { //剩余时间 Integer remainingTime=0; if (kilnInfo.getType()!=4){ - remainingTime = readPlc(nameSpace, "ProgramTimeRemain").intValue(); + if (kilnInfo.getType()==3){ + remainingTime = readPlc(nameSpace, "ProgramTimeRemaining").intValue(); + }else { + remainingTime = readPlc(nameSpace, "ProgramTimeRemain").intValue(); + } + } if(kilnInfo.getType()==1||kilnInfo.getType()==3){ //运行时间 @@ -171,7 +176,7 @@ public class ScheduledTask extends BaseService { List currTaskDetVoList = BeanUtils.copyList(currTaskDetList, CurrTaskDetVo.class); for (CurrTaskDetVo currTaskDetVo:currTaskDetVoList ) { - String customerName = orderInfoServiceBiz.getOne(new QueryWrapper().eq(OrderInfo.ORDER_NO, currTaskDetVo.getOrderNo())).getCustomerName(); + String customerName = orderInfoServiceBiz.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, currTaskDetVo.getIdenCardNum())).getCustomerName(); currTaskDetVo.setCustomer(customerName); } nowCurrTask.setCurrTaskDetVoList(currTaskDetVoList);