From c728ceb80011a63e5fb5e88045014dcdc392b167 Mon Sep 17 00:00:00 2001 From: psh Date: Mon, 15 Jan 2024 10:42:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E6=9E=81=E6=9D=BF=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E4=BD=8D=E5=A0=86=E5=8F=A03=E5=B1=82=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cw_site/CwSiteDeviceDriver.java | 20 ++++++++++++------- .../ext/service/impl/AcsToWmsServiceImpl.java | 4 +--- .../sch/task_manage/task/tasks/BPSLTask.java | 18 +++++++++++------ 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java index 5a2913b..3cd8b20 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java @@ -105,6 +105,8 @@ public class CwSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devic private int instruction_require_time_out; boolean requireSucess = false; + boolean resultSucess = false; + private int instruction_finished_time_out; int branchProtocol = 0; @@ -155,21 +157,25 @@ public class CwSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devic this.writing(0); } } - if (move != last_move && this.getDeviceCode().startsWith("ZJBDJW")) { - //点位数量变更后通知lms + if (move !=last_move||tier!=last_tier){ + resultSucess=false; + } + if (tier != last_tier&&move!=0 && this.getDeviceCode().endsWith("0101")||this.getDeviceCode().endsWith("0201") &&!resultSucess) { + //高度数量变更后通知lms FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); - request.setState(String.valueOf(move)); + request.setState(String.valueOf(tier)); request.setDevice_code(this.getDeviceCode()); request.setType("2"); acsToWmsService.notify(request); - } - if (tier != last_tier&&move!=0 && this.getDeviceCode().startsWith("ZJBDJW")) { - //高度数量变更后通知lms + resultSucess=true; + }else if (move ==1 && this.getDeviceCode().startsWith("ZJBDJW") &&!resultSucess) { + //点位数量变更后通知lms FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); - request.setState(String.valueOf(tier)); + request.setState("3"); request.setDevice_code(this.getDeviceCode()); request.setType("2"); acsToWmsService.notify(request); + resultSucess=true; } if (error != last_error) { } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java index d22c289..d19bcd3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java @@ -176,9 +176,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { break; case 2: //正极板对接位反馈设备有无货 - if("ZJBDJW0101".equals(device_code)||"ZJBDJW0201".equals(device_code)){ - device_code=device_code.substring(0,device_code.length()-2); - } + device_code=device_code.substring(0,device_code.length()-2); pointMapper.updatePointVehicleQty(device_code,state); break; default: diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java index a74a618..65651f4 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java @@ -194,7 +194,9 @@ public class BPSLTask extends AbstractTask { } startPointObj.setVehicle_code(vehicle_code.toString()); } - startPointObj.setVehicle_qty(startPointObj.getVehicle_qty() - 1); + if (!startPointObj.getPoint_code().startsWith("ZJBDJW")) { + startPointObj.setVehicle_qty(startPointObj.getVehicle_qty() - 1); + } startPointObj.setIng_task_code(""); startPointObj.setUpdate_time(DateUtil.now()); pointService.updateById(startPointObj); @@ -214,7 +216,9 @@ public class BPSLTask extends AbstractTask { // 起点解锁 if (ObjectUtil.isNotEmpty(startPointObj)) { startPointObj.setIng_task_code(""); -// startPointObj.setVehicle_qty(startPointObj.getVehicle_qty()+1); + if (startPointObj.getPoint_code().startsWith("ZJBDJW")) { + startPointObj.setVehicle_qty(startPointObj.getVehicle_qty() + 1); + } pointService.update(endPointObj); } taskObj.setRemark("任务取消"); @@ -235,7 +239,7 @@ public class BPSLTask extends AbstractTask { @Override protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { - //todo 重算最优点 + //重算最优点 JSONObject jsonObject = JSONObject.parseObject(schBaseTask.getExt_group_data()); SchBasePoint point = this.findNextPoint(jsonObject,schBaseTask); //正极板现在不堆叠 @@ -246,8 +250,10 @@ public class BPSLTask extends AbstractTask { } //重算点位时把点位占用 point.setIng_task_code(schBaseTask.getTask_code()); -// point.setVehicle_qty(point.getVehicle_qty() - 1); -// point.setVehicle_type(materialType); - pointService.update(point); + //如果是正极板对接位则直接减库存 + if ((point.getPoint_code().startsWith("ZJBDJW"))) { + point.setVehicle_qty(point.getVehicle_qty() - 1); + } + pointService.update(point); } }