From ef0bd02de324beb1f0478d7ebbbaf6f14e2130f0 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Sun, 29 Dec 2024 16:40:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=86=E5=88=87=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=B8=8E=E8=AE=BE=E5=A4=87=E4=B8=8D=E5=AF=B9=E5=BA=94=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SlitterServiceImpl.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/service/impl/SlitterServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/service/impl/SlitterServiceImpl.java index dc0eb1177..ea143d46f 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/service/impl/SlitterServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/service/impl/SlitterServiceImpl.java @@ -473,6 +473,7 @@ public class SlitterServiceImpl implements SlitterService { // @Transactional(rollbackFor = Exception.class) public JSONObject mesSlittingMachineSendMaterial(JSONObject param) { log.info("分切机下料的输入参数为:{}", param); + String actualDeviceCode = param.getString("device_code"); JSONObject res = new JSONObject(); // 获取子卷号数组 JSONArray containers = param.getJSONArray("container"); @@ -501,6 +502,12 @@ public class SlitterServiceImpl implements SlitterService { // 获得设备 StIvtCutpointivt device = cutpointivtService.getOne(new LambdaQueryWrapper() .eq(StIvtCutpointivt::getExt_code, demoPlan.getResource_name())); + StIvtCutpointivt actualDevice = device; + if (!actualDeviceCode.equals(demoPlan.getResource_name())) { + // 如果设备与指定的设备不同 + actualDevice = cutpointivtService.getOne(new LambdaQueryWrapper() + .eq(StIvtCutpointivt::getExt_code, actualDeviceCode)); + } String area = device.getProduct_area(); // 获取当前分切机的下一组分切计划(最多四条分切计划) // hint: 获取到的分切可能是不同组的但具有一定时间顺序 @@ -535,16 +542,16 @@ public class SlitterServiceImpl implements SlitterService { // 创建任务 if (currentUpPlan != null && currentDownPlan != null) { // 双轴任务 下双 - taskParam.put("point_code1", device.getUp_point_code()); + taskParam.put("point_code1", actualDevice.getUp_point_code()); taskParam.put("point_code2", emptyPoint.getTruss_point_code1()); - taskParam.put("point_code3", device.getDown_point_code()); + taskParam.put("point_code3", actualDevice.getDown_point_code()); taskParam.put("point_code4", emptyPoint.getTruss_point_code2()); taskParam.put("truss_type", "1"); taskParam.put("empty_site", "0"); } else { // 单轴任务 下单 taskParam.put("point_code1", currentUpPlan == null - ? device.getDown_point_code() : device.getUp_point_code()); + ? actualDevice.getDown_point_code() : actualDevice.getUp_point_code()); taskParam.put("point_code2", currentUpPlan == null ? emptyPoint.getTruss_point_code2() : emptyPoint.getTruss_point_code1()); taskParam.put("truss_type", "1"); @@ -590,9 +597,9 @@ public class SlitterServiceImpl implements SlitterService { taskParam.put("point_code1", nextUpPlan != null ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); taskParam.put("point_code2", nextUpPlan != null - ? device.getUp_point_code() : device.getDown_point_code()); + ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code()); taskParam.put("point_code3", currentUpPlan != null - ? device.getUp_point_code() : device.getDown_point_code()); + ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code()); taskParam.put("point_code4", currentUpPlan != null ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); taskParam.put("truss_type", "1"); @@ -601,11 +608,11 @@ public class SlitterServiceImpl implements SlitterService { case "01": // 下单上双 taskParam.put("point_code1", currentUpPlan != null - ? device.getUp_point_code() : device.getDown_point_code()); + ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code()); taskParam.put("point_code2", currentUpPlan != null ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); taskParam.put("point_code3", currentUpPlan == null - ? device.getUp_point_code() : device.getDown_point_code()); + ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code()); taskParam.put("point_code4", currentUpPlan == null ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); taskParam.put("truss_type", "3"); @@ -613,18 +620,18 @@ public class SlitterServiceImpl implements SlitterService { break; case "10": // 下双上单 - taskParam.put("point_code1", device.getUp_point_code()); + taskParam.put("point_code1", actualDevice.getUp_point_code()); taskParam.put("point_code2", newCutPoint.getTruss_point_code1()); - taskParam.put("point_code3", device.getDown_point_code()); + taskParam.put("point_code3", actualDevice.getDown_point_code()); taskParam.put("point_code4", newCutPoint.getTruss_point_code2()); taskParam.put("truss_type", "4"); taskParam.put("empty_site", nextUpPlan == null ? "2" : "1"); break; case "11": // 下双上双 - taskParam.put("point_code1", device.getUp_point_code()); + taskParam.put("point_code1", actualDevice.getUp_point_code()); taskParam.put("point_code2", newCutPoint.getTruss_point_code1()); - taskParam.put("point_code3", device.getDown_point_code()); + taskParam.put("point_code3", actualDevice.getDown_point_code()); taskParam.put("point_code4", newCutPoint.getTruss_point_code2()); taskParam.put("truss_type", "2"); taskParam.put("empty_site", "3"); @@ -1140,6 +1147,7 @@ public class SlitterServiceImpl implements SlitterService { // 调接口创建任务 JSONObject taskParam = new JSONObject(); taskParam.put("container", cons); + taskParam.put("device_code", outPlan.getResource_name()); try { mesSlittingMachineSendMaterial(taskParam); } catch (Exception e) {