diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/hongfeng/hf_two_rgv/HfTwoRGVDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/hongfeng/hf_two_rgv/HfTwoRGVDeviceDriver.java index a1ce302..ba31fe4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/hongfeng/hf_two_rgv/HfTwoRGVDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/hongfeng/hf_two_rgv/HfTwoRGVDeviceDriver.java @@ -366,14 +366,16 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev logServer.queryTask("RGV申请后工位任务", this.getDevice_code(), "RGV开始申请后工位任务!满足信号->mode == 2 && move2 == 0 && action2 == 0"); instruction_require2(); } else { - logServer.queryTask("RGV申请后工位任务", this.getDevice_code(), "RGV不满足申请后工位任务!此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "requireBackSucess = " + requireBackSucess); + if (!requireBackSucess) + logServer.queryTask("RGV申请后工位任务", this.getDevice_code(), "RGV不满足申请后工位任务!此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "requireBackSucess = " + requireBackSucess); } //前工位申请任务 if (mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && !requireHeadSucess) { logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV开始申请前工位任务!满足信号->mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0"); instruction_require(); } else { - logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV不满足申请前工位任务!此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "task2 = " + task2 + "move1 = " + move1 + "requireHeadSucess = " + requireHeadSucess); + if (!requireHeadSucess) + logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV不满足申请前工位任务!此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "task2 = " + task2 + "move1 = " + move1 + "requireHeadSucess = " + requireHeadSucess); } break; case 3: @@ -382,7 +384,8 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV开始申请前工位任务!满足信号->mode == 3 && move2 == 1 && action2 == 1 && move1 == 0"); instruction_require(); } else { - logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV不满足申请前工位任务!此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "move1 = " + move1 + "requireHeadSucess = " + requireHeadSucess); + if (!requireHeadSucess) + logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV不满足申请前工位任务!此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "move1 = " + move1 + "requireHeadSucess = " + requireHeadSucess); } } @@ -444,6 +447,8 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev if (repeatDeviceCodeList.contains(startDeviceCode)) { if (!repeatPutDeviceCodeList.contains(next_device_code)) { continue; + } else { + if (ObjectUtil.isNotEmpty(task)) break; } } } @@ -548,10 +553,12 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev if (repeatDeviceCodeList.contains(startDeviceCode)) { if (!repeatPutDeviceCodeList.contains(next_device_code)) { continue; + } else { + if (ObjectUtil.isNotEmpty(task)) break; } } } - if (ObjectUtil.isNotEmpty(task)) break; + if (ObjectUtil.isNotEmpty(task)); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/handling/HandlingTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/handling/HandlingTask.java index 53f90a3..ac8b9ea 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/handling/HandlingTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/handling/HandlingTask.java @@ -102,7 +102,7 @@ public class HandlingTask extends AbstractAcsTask { KlzhcwUtil klzhcwUtil = SpringContextHolder.getBean(KlzhcwUtil.class); //更新终点的库存 if (!StrUtil.equals(region_codeE, RegionTypeEnum.KLZHCQ.getCode())) { - MaterialbaseDto materialbaseDto = materialbaseService.findById(Long.parseLong(jsonTask.getString("material_id"))); + MaterialbaseDto materialbaseDto = materialbaseService.findById(jsonTask.getLong("material_id")); LinkedList ll = MyLinkedListService.getLinkedList(); JSONObject param = new JSONObject(); param.put("vehicle_type", jsonTask.getString("vehicle_type")); @@ -126,7 +126,7 @@ public class HandlingTask extends AbstractAcsTask { //修改终点库存信息 jsonObject.put("vehicle_type", jsonTask.getString("vehicle_type")); jsonObject.put("vehicle_code", jsonTask.getString("vehicle_code")); - jsonObject.put("material_id", jsonTask.getString("material_id")); + jsonObject.put("material_id", jsonTask.getLong("material_id")); jsonObject.put("instorage_time", DateUtil.now()); ivtTab.update(jsonObject); //解锁终点 @@ -136,6 +136,45 @@ public class HandlingTask extends AbstractAcsTask { jsonEnd.put("update_time", DateUtil.now()); pointTab.update(jsonEnd); } + } else if (StrUtil.equals(region_codeS, RegionTypeEnum.KLZHCQ.getCode()) && StrUtil.equals(region_codeE, RegionTypeEnum.GT1.getCode())) { + MaterialbaseServiceImpl materialbaseService = SpringContextHolder.getBean(MaterialbaseServiceImpl.class); + KlzhcwUtil klzhcwUtil = SpringContextHolder.getBean(KlzhcwUtil.class); + + MaterialbaseDto materialbaseDto = materialbaseService.findById(ivtStart.getLong("material_id")); + LinkedList ll = MyLinkedListService.getLinkedList(); + JSONObject param = new JSONObject(); + param.put("vehicle_type", ivtStart.getString("vehicle_type")); + param.put("vehicle_code", ivtStart.getString("vehicle_code")); + if (ObjectUtil.isNotEmpty(materialbaseDto)) { + param.put("material_code", materialbaseDto.getMaterial_code()); + } + boolean flag = klzhcwUtil.judge(ll, param); + if (flag) { + jsonEnd.put("lock_type", "1"); + jsonEnd.put("task_id", ""); + jsonEnd.put("vehicle_type", ""); + jsonEnd.put("vehicle_code", ""); + jsonEnd.put("material_id", ""); + jsonEnd.put("point_status", "1"); + jsonEnd.put("update_time", DateUtil.now()); + pointTab.update(jsonEnd); + } + + //修改起点库存 + ivtStart.put("vehicle_type", ""); + ivtStart.put("vehicle_code", ""); + ivtStart.put("material_id", ""); + ivtStart.put("instorage_time", DateUtil.now()); + ivtTab.update(ivtStart); + //解锁起点 + jsonStart.put("lock_type", "1"); + jsonStart.put("point_status", "1"); + jsonStart.put("task_id", ""); + jsonStart.put("vehicle_type", ""); + jsonStart.put("vehicle_code", ""); + jsonStart.put("material_id", ""); + jsonStart.put("update_time", DateUtil.now()); + pointTab.update(jsonStart); } else if (StrUtil.equals(region_codeE, RegionTypeEnum.YLJQ.getCode())) { //修改起点库存 ivtStart.put("vehicle_type", "");