diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index ad89dd0c2..8617f3bec 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -801,7 +801,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("task", task); jo.put("walk_y", String.valueOf(this.walk_y)); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", StrUtil.isNotEmpty(ErrorUtil.getDictDetail("nbjhj_error_type", String.valueOf(this.getError()))) + ?ErrorUtil.getDictDetail("nbjhj_error_type", String.valueOf(this.getError())):this.getError()); jo.put("isError", this.getIserror()); jo.put("message", this.getMessage()); jo.put("is_click", true); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java index 7d96453aa..60dbc51f1 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java @@ -311,6 +311,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr mode = "单机"; } else if (this.getMode() == 2) { mode = "联机"; + } else if (this.getMode() == 3 && this.move2 == 1) { + mode = "等待人工吊卷"; } else if (this.getMode() == 3) { mode = "运行中"; } else if (this.getMode() == 4) { @@ -318,14 +320,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr } if (this.getMove1() == 0 && this.getMove2() == 0) { - move1 = "无货"; + move1 = "吊卷位"; move2 = "无货"; jo.put("hasGoods", false); } else if (this.getMove1() == 1 || this.getMove2() == 1) { if(this.getMove1() == 1){ - move1 = "有货"; + move1 = "下卷位"; }else if(this.getMove1() == 0){ - move1 = "无货"; + move2 = "吊卷位"; } if(this.getMove2() == 1){ move2 = "有货"; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 2b05d4067..0f318ce3e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -287,8 +287,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl param.put("product_area", paramService.findByCode("productArea").getValue()); acsToWmsService.sendDeviceStatus(param); - /*logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);*/ + logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); } if (status != last_status) { logServer.deviceItemValue(this.device_code, "status", String.valueOf(status)); diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue index 0aa5a9538..e5a383c6d 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -675,10 +675,10 @@ export default { const obj = { name: '重量2', value: data[val] } this.arr.push(obj) } else if (val === 'move1') { - const obj = { name: '光电信号1', value: data[val] } + const obj = { name: '设备工位', value: data[val] } this.arr.push(obj) } else if (val === 'move2') { - const obj = { name: '光电信号2', value: data[val] } + const obj = { name: '设备有无货', value: data[val] } this.arr.push(obj) } else if (val === 'material1') { const obj = { name: '物料1', value: this.dict.label.material[data[val]] } diff --git a/acs2/nladmin-system/logPath_IS_UNDEFINED/ACS请求LMS/2024-03-15.0.log b/acs2/nladmin-system/logPath_IS_UNDEFINED/ACS请求LMS/2024-03-15.0.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/acs2/nladmin-system/logPath_IS_UNDEFINED/ACS请求LMS/2024-03-18.0.log b/acs2/nladmin-system/logPath_IS_UNDEFINED/ACS请求LMS/2024-03-18.0.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/acs2/nladmin-system/logPath_IS_UNDEFINED/ACS请求LMS/2024-03-20.0.log b/acs2/nladmin-system/logPath_IS_UNDEFINED/ACS请求LMS/2024-03-20.0.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/acs2/nladmin-system/logPath_IS_UNDEFINED/LMS下发ACS/2024-03-15.0.log b/acs2/nladmin-system/logPath_IS_UNDEFINED/LMS下发ACS/2024-03-15.0.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/acs2/nladmin-system/logPath_IS_UNDEFINED/LMS下发ACS/2024-03-18.0.log b/acs2/nladmin-system/logPath_IS_UNDEFINED/LMS下发ACS/2024-03-18.0.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/acs2/nladmin-system/logPath_IS_UNDEFINED/LMS下发ACS/2024-03-20.0.log b/acs2/nladmin-system/logPath_IS_UNDEFINED/LMS下发ACS/2024-03-20.0.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index c5bca803d..e19ca48d9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -21,6 +21,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO; import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; @@ -226,18 +227,17 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements container_type = this.itemProtocol.getContainer_type(); error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); - container_no = this.itemProtocol.getContainer_no(); - material_barcode= this.itemProtocol.getMaterialBarcode(); to_command = this.itemProtocol.getTo_command(); to_target = this.itemProtocol.getTotarget(); to_task = this.itemProtocol.getTo_task(); to_container_no = this.itemProtocol.getContainer_direction(); - to_container_type = this.itemProtocol.getContainer_no(); if (mode != last_mode) { requireSucess = false; - + if(mode == 2){ + clearWrite(); + } } @@ -271,7 +271,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements break; case 2: //申请任务 - if (move == 1 && !requireSucess && task==0) { + if (move == 1 && !requireSucess) { instruction_require(); } break; @@ -320,9 +320,14 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements public void writing(int command) { String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + "." + org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - Map itemMap = new HashMap(); + itemMap.put(to_command, command); this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } @@ -479,6 +484,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements String start_device_code = taskdto.getStart_device_code(); String route_plan_code = taskdto.getRoute_plan_code(); String next_device_code = ""; + String interactionJson = taskdto.getInteraction_json(); + InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); + String containerType = interactionJsonDTO.getContainerType(); /** * 开始平均分配 */ @@ -517,7 +525,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements next_point_code = next_device_code; } Instruction instdto = new Instruction(); - packageData(instdto, route_plan_code, taskdto, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority); + packageData(instdto, route_plan_code, taskdto, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority,containerType); log.error("=================================,{}", instdto.getCreate_by()); try { instructionService.create(instdto); @@ -542,31 +550,33 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } private void writeData(String next_addr, List list, Instruction inst) { + List list1 = new ArrayList(); Map map = new HashMap(); map.put("code", "to_target"); map.put("value", next_addr); - list.add(map); + list1.add(map); + this.writing(list1); + List list2 = new ArrayList(); Map map1 = new HashMap(); map1.put("code", "to_task"); map1.put("value", inst.getInstruction_code()); - list.add(map1); - Map map2 = new HashMap(); - map2.put("code", "to_command"); - map2.put("value", "1"); - list.add(map2); + list2.add(map1); + this.writing(list2); + List list4 = new ArrayList(); Map map3 = new HashMap(); map3.put("code", "to_container_type"); map3.put("value", inst.getVehicle_type()); - list.add(map3); - Map map4 = new HashMap(); - map4.put("code", "to_container_no"); - map4.put("value", "1"); - list.add(map4); - - this.writing(list); + list4.add(map3); + this.writing(list4); + List list3 = new ArrayList(); + Map map2 = new HashMap(); + map2.put("code", "to_command"); + map2.put("value", "1"); + list3.add(map2); + this.writing(list3); } - private static void packageData(Instruction instdto, String route_plan_code, TaskDto taskdto, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String priority) { + private static void packageData(Instruction instdto, String route_plan_code, TaskDto taskdto, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String priority,String containerType) { instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(route_plan_code); instdto.setRemark(taskdto.getRemark()); @@ -584,6 +594,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements instdto.setPriority(priority); instdto.setInstruction_status("0"); instdto.setExecute_device_code(start_point_code); + instdto.setVehicle_type(containerType); } public void writeData(String next_addr, Instruction instdto, Map map) { @@ -607,6 +618,11 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } } logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); try { this.checkcontrol(itemMap); } catch (Exception e) { @@ -632,6 +648,11 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements //itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + param); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } public synchronized boolean finish_instruction() throws Exception { @@ -663,32 +684,19 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements jo.put("mode", mode); jo.put("message", LangProcess.msg(message)); jo.put("error", this.getError()); + String move = "无货"; + if(this.move == 1){ + move = "有货"; + } jo.put("move", move); + jo.put("task", task); + jo.put("type", container_type); jo.put("is_click", true); jo.put("isOnline", this.getIsonline()); jo.put("requireSucess", requireSucess); return jo; } -// /** -// * 获取任务信息 -// */ -// public JSONObject getLedMessage(Instruction instdto) { -// JSONObject json = new JSONObject(); -// json.put("task_code", instdto.getTask_code()); -// json.put("inst_code", instdto.getInstruction_code()); -// json.put("start_device_code", instdto.getStart_device_code()); -// json.put("next_device_code", instdto.getNext_device_code()); -// json.put("material_type", instdto.getMaterial()); -// json.put("quantity", instdto.getQuantity()); -// json.put("vehicle_code", instdto.getVehicle_code()); -// json.put("instruction_status", instdto.getInstruction_status()); -// json.put("entry_time", instdto.getCreate_time()); -// String acsIp = paramService.findByCode(AcsConfig.ACSIP).getValue(); -// json.put("ip", acsIp); -// return json; -// } - /** * 更新指令状态 @@ -762,4 +770,30 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } return true; } + + public void clearWrite() { + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_target"); + map.put("value", "0"); + list.add(map); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", "0"); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "0"); + list.add(map3); + Map map4 = new HashMap(); + map4.put("code", "to_container_type"); + map4.put("value", "0"); + list.add(map4); + + this.writing(list); + message = null; + vehicle_code = null; + } + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java index 9077fd383..f5f7081c4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java @@ -45,15 +45,6 @@ public class ItemProtocol { * 任务号 */ public static String item_task = "task"; - /** - * 出数字托盘号 - */ - public static String item_container_no = "container_no"; - - /** - * 子卷条码 - */ - public static String item_material_barcode = "material_barcode"; /** * 下发命令 @@ -63,10 +54,6 @@ public class ItemProtocol { * 下发托盘类型 */ public static String item_to_container_type = "to_container_type"; - /** - * 下发接纯数字托盘号 - */ - public static String item_to_container_no = "to_container_no"; /** * 下发任务号 */ @@ -76,11 +63,6 @@ public class ItemProtocol { */ public static String item_to_target = "to_target"; - /** - * 托盘条码 - */ - public static String item_barcode = "barcode"; - @@ -90,9 +72,6 @@ public class ItemProtocol { this.driver = driver; } - public String getMaterialBarcode() { - return this.getOpcStringValue(item_material_barcode); - } public int getHeartbeat() { return this.getOpcIntegerValue(item_heartbeat); } @@ -117,9 +96,6 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_action); } - public int getContainer_no() { - return this.getOpcIntegerValue(item_container_no); - } public int getError() { return this.getOpcIntegerValue(item_error); @@ -133,9 +109,6 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_task); } - public String getBarcode() { - return this.getOpcStringValue(item_barcode); - } @@ -151,9 +124,6 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_container_type); } - public int getTo_container_no() { - return this.getOpcIntegerValue(item_to_container_no); - } Boolean isonline; @@ -198,12 +168,9 @@ public class ItemProtocol { list.add(new ItemDto(item_move, "光电信号", "DB101.B3")); list.add(new ItemDto(item_container_direction, "托盘方向", "DB101.B4")); list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B5")); - list.add(new ItemDto(item_container_no, "纯数字托盘号", "DB101.D7")); list.add(new ItemDto(item_action, "动作类型", "DB101.B6")); list.add(new ItemDto(item_error, "报警", "DB101.B58")); list.add(new ItemDto(item_task, "任务号", "DB101.D68")); - list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50")); - list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50")); return list; } @@ -212,7 +179,6 @@ public class ItemProtocol { list.add(new ItemDto(item_to_target, "下发仓位号", "DB102.W2")); list.add(new ItemDto(item_to_command, "下发命令", "DB102.W4")); list.add(new ItemDto(item_to_task, "下发任务号", "DB102.D1")); - list.add(new ItemDto(item_to_container_no, "下发接纯数字托盘号", "DB102.D3")); list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB102.B5")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java index 1f9095e80..7193f6337 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java @@ -121,7 +121,7 @@ public class ItemProtocol { /** *木箱宽度 */ - public static String item_to_weight = "to_weight"; + public static String item_to_weight = "to_width"; /** *木箱高度 */ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index cf482826e..b16795c61 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -23,6 +23,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.led.led_screen.LedScreenDeviceDriver; +import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO; import org.nl.acs.enums.StorageTypeEnum; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.history.ErrorUtil; @@ -144,9 +145,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv String hand_material_barcode = null; - //数量 - int qty = 0; - int last_qty = 0; + //高度 + int height = 0; + int last_height = 0; //托盘方向 int carrier_direction = 0; @@ -219,7 +220,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv to_container_type = this.itemProtocol.getTo_container_type(); container_type = this.itemProtocol.getContainer_type(); carrier_direction = this.itemProtocol.getCarrier_direction(); - qty = this.itemProtocol.getQty(); + height = this.itemProtocol.getHeight(); weight = this.itemProtocol.getWeight(); barcode = this.itemProtocol.getBarcode(); material_barcode = this.itemProtocol.getMaterialBarcode(); @@ -306,7 +307,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv if (mode != 2) { remark = "universal_remark2"; } - if (move != 0) { + if (move != 1) { remark = "universal_remark3"; } if (task != 0) { @@ -338,7 +339,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv last_hj_task = hj_task; last_container_type = container_type; last_carrier_direction = carrier_direction; - last_qty = qty; + last_height = height; last_weight = weight; last_barcode = barcode; } @@ -475,6 +476,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv String vehiclecode = taskdto.getVehicle_code(); String priority = taskdto.getPriority(); Instruction instdto = new Instruction(); + String interactionJson = taskdto.getInteraction_json(); + InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); + String containerType = interactionJsonDTO.getContainerType(); if (TaskTypeEnum.AGV_Task.getIndex().equals(taskdto.getTask_type())){ String route_plan_code = taskdto.getRoute_plan_code(); @@ -489,17 +493,18 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv Integer start = 0; String start_device_code = pathlist.get(start); String next_device_code = pathlist.get(start+1); + //判断有无出入库任务是相同路线 TaskDto dto = taskserver.findByCodeAndExcute(taskdto.getNext_device_code(), taskdto.getStart_device_code()); if (ObjectUtil.isNotEmpty(dto)){ requireSucess = false; return false; } - packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,start_device_code,next_device_code); + packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,start_device_code,next_device_code,containerType); }else { - packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,taskdto.getStart_device_code(),taskdto.getNext_device_code()); + packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,taskdto.getStart_device_code(),taskdto.getNext_device_code(),containerType); } try { instructionService.create(instdto); @@ -525,9 +530,14 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv map2.put("value", instdto.getInstruction_code()); list.add(map2); Map map3 = new HashMap(); + map3.put("code", "to_container_type"); + map3.put("value", instdto.getVehicle_type()); + list.add(map3); + Map map4 = new HashMap(); map3.put("code", "to_command"); map3.put("value", "1"); - list.add(map3); + list.add(map4); + this.writing(list); led_message = getLedMessage(instdto); List deviceCodes = this.getExtraDeviceCodes("link_device_code"); @@ -601,7 +611,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv return json; } - private void packageInstrcutData(Instruction instdto, TaskDto taskdto, String taskid, String taskcode, String vehiclecode, String priority,String startCode, String endCode) { + private void packageInstrcutData(Instruction instdto, TaskDto taskdto, String taskid, String taskcode, String vehiclecode, String priority,String startCode, String endCode,String containerType) { instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(taskdto.getRoute_plan_code()); instdto.setRemark(taskdto.getRemark()); @@ -621,6 +631,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv instdto.setInstruction_status("0"); instdto.setExecute_device_code(device_code); instdto.setInstruction_type(taskdto.getTask_type()); + instdto.setVehicle_type(containerType); + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java index d13d403d8..092dfa643 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java @@ -32,9 +32,9 @@ public class ItemProtocol { */ public static String item_error = "error"; /** - * 数量 + * 高度 */ - public static String item_qty = "qty"; + public static String item_height = "height"; /** * 任务号 */ @@ -112,8 +112,8 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_task); } - public int getQty(){ - return this.getOpcIntegerValue(item_qty); + public int getHeight(){ + return this.getOpcIntegerValue(item_height); } public int getCarrier_direction(){ @@ -189,7 +189,7 @@ public class ItemProtocol { list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_container_type, "托盘类型", "DB1.B7")); list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1.B8")); - list.add(new ItemDto(item_qty, "数量", "DB1.B9")); + list.add(new ItemDto(item_height, "高度", "DB1.B9")); list.add(new ItemDto(item_weight, "重量", "DB1.B10")); list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50")); list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50")); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index 779c290bd..4f9a66f48 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -213,7 +213,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i List toInstructions; //行架机械手申请任务 - if (mode == 2 && move == 0 && task == 0 && !requireSucess) { + if (mode == 2 && move == 0 && !requireSucess) { boolean res = applyTask(); if (res) { notCreateInstMessage = ""; @@ -407,10 +407,10 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i ManipulatorCacheDeviceDriver manipulatorCacheDeviceDriver; if (startDevice.getDeviceDriver() instanceof ManipulatorCacheDeviceDriver) { manipulatorCacheDeviceDriver = (ManipulatorCacheDeviceDriver) startDevice.getDeviceDriver(); - if (manipulatorCacheDeviceDriver.getMode() != 2 && manipulatorCacheDeviceDriver.getAction() !=1) { - notCreateInstMessage = "universal_notCreateInstMessage3"; - return false; - } +// if (manipulatorCacheDeviceDriver.getMode() != 2) { +// notCreateInstMessage = "universal_notCreateInstMessage3"; +// return false; +// } } String taskid = taskDto.getTask_id(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java index f6dbff375..5f0622542 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java @@ -11,7 +11,7 @@ public class InteractionJsonDTO { private String maxNo; /** - *木箱最大数量 + *木箱放入数量 */ private String boxNo; @@ -31,4 +31,9 @@ public class InteractionJsonDTO { *子卷长度 */ private String len; + + /** + * 托盘类型 + */ + private String containerType; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index cfeaad9c6..700cc05e3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -233,8 +233,8 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } - //放货完成 - if (action == 4 && move == 0) { + //任务完成 + if (action == 5 && move == 0) { if (inst != null) { try { logServer.deviceExecuteLog(this.device_code, "", "", "放货完成"); @@ -351,7 +351,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i notCreateInstMessage = "universal_notCreateInstMessage1"; throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - //存在托盘才可以申请任务 + /*//存在托盘才可以申请任务 BeltConveyorDeviceDriver beltConveyorDeviceDriver; if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver(); @@ -359,7 +359,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } - } + }*/ String taskid = taskDto.getTask_id(); @@ -451,6 +451,12 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i map9.put("value", interactionJsonDTO.getLayer()); list.add(map9); } + if (ObjectUtil.isNotEmpty(interactionJsonDTO.getContainerType())) { + Map map10 = new HashMap<>(); + map10.put("code", "to_type"); + map10.put("value", interactionJsonDTO.getContainerType()); + list.add(map10); + } } this.writing(list); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/InteractionJsonDTO.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/InteractionJsonDTO.java index d791018fb..6ea0450bf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/InteractionJsonDTO.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/InteractionJsonDTO.java @@ -28,4 +28,9 @@ public class InteractionJsonDTO { */ private String layer; + /** + * 托盘类型 + */ + private String containerType; + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java index 131e769ad..4fec1bc98 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java @@ -37,6 +37,8 @@ import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.Date; @@ -69,6 +71,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); @Autowired AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); //工作模式 int mode = 0; @@ -288,6 +292,11 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr if (ObjectUtil.isNotEmpty(itemMap)) { this.control(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java index 5de581358..9b580bd11 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java @@ -532,7 +532,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = true; break; } - if (ObjectUtil.isNotNull(list)) { + if (list.size() != 0) { this.writing(list); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java index 3808bf0be..2a05cd40d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java @@ -567,7 +567,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem } LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(LangProcess.msg("universal_message10") + itemMap) + .content("下发多个电气信号" + itemMap) .build(); luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java index bd16c2c02..303ce4396 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java @@ -298,6 +298,11 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(deviceCode) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java index 9483af3e0..8239b524c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java @@ -236,6 +236,11 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(deviceCode) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java index f5f4b67e5..d9d5a3515 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java @@ -20,6 +20,8 @@ import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.system.service.param.ISysParamService; import org.nl.config.SpringContextHolder; import org.springframework.beans.factory.annotation.Autowired; @@ -52,6 +54,8 @@ public class HongXiangStationDeviceDriver extends AbstractOpcDeviceDriver implem DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); @Autowired AgvService agvService = SpringContextHolder.getBean(AgvService.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); private Date instruction_require_time = new Date(); private Date instruction_finished_time = new Date(); @@ -129,6 +133,11 @@ public class HongXiangStationDeviceDriver extends AbstractOpcDeviceDriver implem Map itemMap = new HashMap(); itemMap.put(to_command, command); this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } /** @@ -158,6 +167,11 @@ public class HongXiangStationDeviceDriver extends AbstractOpcDeviceDriver implem itemMap.put(to_param, value); this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java index b85c4b5e6..a9a469c36 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -27,6 +27,8 @@ import org.nl.acs.opc.DeviceAppService; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.*; @@ -58,6 +60,8 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple AgvService agvService = SpringContextHolder.getBean(AgvService.class); @Autowired DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); private String error_type = "hx_error_type"; @@ -243,6 +247,11 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple Map itemMap = new HashMap(); itemMap.put(to_command, command); this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } public String getToParam() { @@ -265,6 +274,11 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple if (ObjectUtil.isNotEmpty(itemMap)) { this.checkcontrol(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -299,6 +313,11 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple e.printStackTrace(); } logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java index d06d18d70..978abdc7a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java @@ -24,6 +24,8 @@ import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.HashMap; @@ -51,6 +53,8 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); @Autowired DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); //心跳 public int heartbeat = 0; @@ -128,6 +132,11 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(deviceCode) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/lamp_three_color/LampThreecolorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/lamp_three_color/LampThreecolorDeviceDriver.java index 562eafb9b..875b9e3aa 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/lamp_three_color/LampThreecolorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/lamp_three_color/LampThreecolorDeviceDriver.java @@ -9,6 +9,8 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.config.SpringContextHolder; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.Date; @@ -26,7 +28,8 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen @Autowired DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); - + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); String container; String container_type_desc; String last_container_type_desc; @@ -103,6 +106,11 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index a0da6c362..39343de36 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -776,6 +776,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (ObjectUtil.isNotEmpty(itemMap)) { this.checkcontrol(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -1157,6 +1162,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } public void writing(List list) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 813600758..d63b999d9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -520,6 +520,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } } logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(deviceCode) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); this.control(itemMap); } @@ -534,6 +539,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (ObjectUtil.isNotEmpty(itemMap)) { this.checkcontrol(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(deviceCode) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -623,6 +633,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl itemMap.put(to_param, value); // itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(deviceCode) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 09a3550ed..df65ba005 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -37,6 +37,8 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.*; @@ -65,7 +67,8 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); @Autowired DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); - + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); //工作模式 int mode = 0; int lastMode = 0; @@ -551,6 +554,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp if (ObjectUtil.isNotEmpty(itemMap)) { this.control(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java index 950a0d941..09c1e2bb5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java @@ -36,6 +36,8 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.*; @@ -63,6 +65,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); @Autowired DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); //工作模式 int mode = 0; @@ -499,6 +503,11 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp if (ObjectUtil.isNotEmpty(itemMap)) { this.control(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 4764c0828..5e359505e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -31,6 +31,8 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; @@ -58,6 +60,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); //分切行架机械手是否禁用 0否 1是 private int is_disable = 0; @@ -551,6 +555,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl this.control(itemMap); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } public boolean exe_business() { @@ -590,6 +599,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl Map itemMap = new HashMap(); itemMap.put(to_command, command); this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } @@ -615,6 +629,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); this.control(itemMap); } @@ -804,6 +823,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (ObjectUtil.isNotEmpty(itemMap)) { this.checkcontrol(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java index 46860e7d1..0fb13996c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java @@ -24,6 +24,8 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.system.service.param.ISysParamService; import org.springframework.beans.factory.annotation.Autowired; @@ -55,6 +57,8 @@ public class SubRollConveyorSiteDeviceDriver extends AbstractOpcDeviceDriver imp DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); @Autowired AgvService agvService = SpringContextHolder.getBean(AgvService.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); //工作模式 int mode = 0; @@ -191,6 +195,11 @@ public class SubRollConveyorSiteDeviceDriver extends AbstractOpcDeviceDriver imp if (ObjectUtil.isNotEmpty(itemMap)) { this.control(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -272,5 +281,10 @@ public class SubRollConveyorSiteDeviceDriver extends AbstractOpcDeviceDriver imp itemMap.put(to_param, value); // itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java index e07dbb7bf..996c3d79e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java @@ -21,6 +21,8 @@ import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.*; @@ -40,6 +42,8 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); private String error_type = "hx_error_type"; @@ -268,6 +272,11 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } public String getToParam() { @@ -290,6 +299,11 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl if (ObjectUtil.isNotEmpty(itemMap)) { this.control(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-ui/dist (2).zip b/acs2/nladmin-ui/dist (2).zip deleted file mode 100644 index 7431eb8e4..000000000 Binary files a/acs2/nladmin-ui/dist (2).zip and /dev/null differ diff --git a/acs2/nladmin-ui/dist.zip b/acs2/nladmin-ui/dist.zip deleted file mode 100644 index df068c6bb..000000000 Binary files a/acs2/nladmin-ui/dist.zip and /dev/null differ diff --git a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue index c39409845..a2858741c 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -252,8 +252,6 @@ import deviceCrud from '@/api/acs/device/device' import { getDeviceByCodes } from '@/api/acs/device/deviceStageMonitor' import '@logicflow/core/dist/style/index.css' import '@logicflow/extension/lib/style/index.css' -import paramCrud from '@/api/system/param' - import { LogicFlow } from '@logicflow/core' import { registerCustomElement } from '@/views/system/logicflow/editor/components/node' import i18n from '@/i18n' @@ -520,6 +518,9 @@ export default { } else if (val === 'last_inst_message') { const obj = { name: i18n.t('monitor.click.last_instruction_message'), value: data[val] } this.arr.push(obj) + } else if (val === 'container_type') { + const obj = { name: '托盘类型', value: data[val] } + this.arr.push(obj) } else if (val === 'barcode') { const obj = { name: i18n.t('monitor.click.barcode'), value: data[val] } this.arr.push(obj) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java index ddb2ffe01..207d6df7e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java @@ -146,13 +146,6 @@ public interface CheckOutBillService { */ void setPoint(JSONObject whereJson); - /** - * 设置一个站点 - * - * @param whereJson / - */ - void oneSetPoint(JSONObject whereJson); - /** * 设置一个站点 * diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java index a7645375e..c71d93e28 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java @@ -24,7 +24,9 @@ import org.nl.wms.basedata.st.service.StorattrService; import org.nl.wms.basedata.st.service.StructattrService; import org.nl.wms.basedata.st.service.dto.StorattrDto; import org.nl.wms.basedata.st.service.dto.StructattrDto; +import org.nl.wms.basedata.st.service.impl.StructattrServiceImpl; import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl; +import org.nl.wms.pda.mps.eum.RegionTypeEnum; import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.service.PointService; @@ -41,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** * PC端出入库新增 @@ -64,6 +67,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { private final RedissonClient redissonClient; + private JSONObject struct_jo = null; @Override public Map pageQuery(Map whereJson, Pageable page) { @@ -551,6 +555,18 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { //判断是否为主存区,主存区调用自动分配,虚拟区调用普通查询 if (StrUtil.isNotEmpty(need_sect) && !"00".equals(need_sect_jo.getString("sect_type_attr"))) { struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("sect_id = '" + need_sect + "' AND lock_type = '1' AND is_delete = '0' AND IFNULL( storagevehicle_code, '' ) = ''").uniqueResult(0); + // 如果为空则扩容 + if (ObjectUtil.isEmpty(struct_jo)) { + JSONObject jsonParam = new JSONObject(); + jsonParam.put("sect_id", whereJson.get("sect_id")); + jsonParam.put("stor_id", whereJson.get("stor_id")); + jsonParam.put("num", 50); + + StructattrServiceImpl bean = SpringContextHolder.getBean(StructattrServiceImpl.class); + bean.oneCreate(jsonParam); + + struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("sect_id = '" + need_sect + "' AND lock_type = '1' AND is_delete = '0' AND IFNULL( storagevehicle_code, '' ) = ''").uniqueResult(0); + } } else { jo_form.put("sect_id", whereJson.get("sect_id")); struct_jo = this.autoDis(jo_form); @@ -1359,8 +1375,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { * */ - JSONObject struct_jo = new JSONObject(); - String box_no = whereJson.getString("box_no"); String sect_id = whereJson.getString("sect_id"); @@ -1728,7 +1742,9 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { } if (ObjectUtil.isEmpty(struct_jo)) { - throw new BadRequestException("未查询到可用的仓位!"); + // 主存区类型更改成中转区类型:找一排主存区的更改中转区、把一排中转区的更改成主存区(只允许调用一次) + updateStructSect(col_num); + autoDisMove(whereJson); } return struct_jo; } @@ -2115,4 +2131,107 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { map.put("bill_status", "99"); dtl_wql.update(map, "iostorinv_id = '" + mst_row.get("iostorinv_id") + "'"); } + + private void updateStructSect(String layer_num) { + WQLObject attr = WQLObject.getWQLObject("st_ivt_structattr"); + WQLObject point = WQLObject.getWQLObject("sch_base_point"); + /* + * 1.将主存区的一排更改为中转区 + * 2.将中转区的一排更改为主存区 + */ + String block_num = ""; + String row_num = ""; + // 1.找主存区数量小的一排转为中转区 + // 根据块、排进行分组,优先空排 -> 有货数量少的 + List attrListAllEmp = WQL.getWO("ST_UPDATESTRUCTSECT_01").addParam("flag", "1") + .addParam("layer_num", layer_num).process().getResultJSONArray(0) + .toJavaList(JSONObject.class); + + if (ObjectUtil.isEmpty(attrListAllEmp)) { + // 如果为空则查找有空位的排 + List attrListEmp = WQL.getWO("ST_UPDATESTRUCTSECT_01").addParam("flag", "2") + .addParam("layer_num", layer_num).process().getResultJSONArray(0) + .toJavaList(JSONObject.class); + + if (ObjectUtil.isEmpty(attrListEmp)) { + throw new BadRequestException("自动扩容失败,主存区没有空位可扩容!"); + } + + // 判断是这排是否被锁住 + String block_num_in = attrListEmp.stream() + .map(row -> row.getString("block_num")) + .collect(Collectors.joining("','")); + + String row_num_in = attrListEmp.stream() + .map(row -> row.getString("row_num")) + .collect(Collectors.joining("','")); + + List rowList = attr.query("block_num in ('" + block_num_in + "') AND row_num in ('" + row_num_in + "') and layer_num = '" + layer_num + "' and sect_code = 'ZC01'") + .getResultJSONArray(0).toJavaList(JSONObject.class); + + for (int i = 0; i < attrListEmp.size(); i++) { + JSONObject json = attrListEmp.get(i); + + List collect = rowList.stream() + .filter(row -> row.getString("block_num").equals(json.getString("block_num")) && + row.getString("row_num").equals(json.getString("row_num")) + ) + .collect(Collectors.toList()); + + // 判断是否全部都为未锁定 + boolean isLock = collect.stream() + .allMatch(row -> row.getString("lock_type").equals("1")); + + if (!isLock) { + continue; + } + + block_num = json.getString("block_num"); + row_num = json.getString("row_num"); + break; + } + } else { + JSONObject json = attrListAllEmp.get(0); + block_num = json.getString("block_num"); + row_num = json.getString("row_num"); + } + + // 2.将中转区的一排更改为主存区 + // 查询中转区满的一排 + List attrListAllNoEmp = WQL.getWO("ST_UPDATESTRUCTSECT_01").addParam("flag", "3") + .addParam("layer_num", layer_num).process().getResultJSONArray(0) + .toJavaList(JSONObject.class); + + if (ObjectUtil.isNotEmpty(attrListAllNoEmp)) { + // 更新仓位为主存区 + JSONObject jsonParam2 = new JSONObject(); + jsonParam2.put("sect_id", RegionTypeEnum.ZC01.getId()); + jsonParam2.put("sect_code", "ZC01"); + jsonParam2.put("sect_name", RegionTypeEnum.ZC01.getName()); + + JSONObject json = attrListAllNoEmp.get(0); + // 更新仓位 + attr.update(jsonParam2,"sect_code = 'ZZ01' AND block_num = '"+json.getString("block_num")+"' AND row_num = '"+json.getString("row_num")+"' AND layer_num = '"+layer_num+"'"); + + // 更新点位 + jsonParam2.put("region_id", RegionTypeEnum.ZC01.getId()); + jsonParam2.put("region_code", "ZC01"); + jsonParam2.put("region_name", RegionTypeEnum.ZC01.getName()); + point.update(jsonParam2,"region_code = 'ZZ01' AND block_num = '"+json.getString("block_num")+"' AND row_num = '"+json.getString("row_num")+"' AND layer_num = '"+layer_num+"'"); + + } + + // 更新仓位为中转区 + JSONObject jsonParam = new JSONObject(); + jsonParam.put("sect_id", RegionTypeEnum.ZZ01.getId()); + jsonParam.put("sect_code", "ZZ01"); + jsonParam.put("sect_name", RegionTypeEnum.ZZ01.getName()); + attr.update(jsonParam,"sect_code = 'ZC01' AND block_num = '"+block_num+"' AND row_num = '"+row_num+"' AND layer_num = '"+layer_num+"'"); + + // 更新点位 + jsonParam.put("region_id", RegionTypeEnum.ZZ01.getId()); + jsonParam.put("region_code", "ZZ01"); + jsonParam.put("region_name", RegionTypeEnum.ZZ01.getName()); + point.update(jsonParam,"region_code = 'ZC01' AND block_num = '"+block_num+"' AND row_num = '"+row_num+"' AND layer_num = '"+layer_num+"'"); + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/ST_UPDATESTRUCTSECT_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/ST_UPDATESTRUCTSECT_01.wql new file mode 100644 index 000000000..d550707a5 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/ST_UPDATESTRUCTSECT_01.wql @@ -0,0 +1,214 @@ +[交易说明] + 交易名: 更新仓位属性查询 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.layer_num TYPEAS s_string + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + * + FROM + ( + SELECT + sa.block_num, + sa.row_num, + COUNT( sa.struct_code ) AS struct_num + FROM + st_ivt_structattr sa + WHERE + sa.is_delete = '0' + AND sa.is_used = '1' + AND sa.sect_code = 'ZC01' + OPTION 输入.layer_num <> "" + sa.layer_num = 输入.layer_num + ENDOPTION + GROUP BY + sa.block_num, + sa.row_num + ) a + WHERE + EXISTS ( + SELECT + * + FROM + ( + SELECT + block_num, + row_num, + COUNT( sa2.struct_code ) AS struct_num + FROM + st_ivt_structattr sa2 + WHERE + sa2.lock_type = '1' + AND sa2.is_used = '1' + AND sa2.is_delete = '0' + AND sa2.sect_code = 'ZC01' + AND IFNULL( sa2.storagevehicle_code, '' ) = '' + OPTION 输入.layer_num <> "" + sa2.layer_num = 输入.layer_num + ENDOPTION + GROUP BY + sa2.block_num, + sa2.row_num + ) b + WHERE + b.block_num = a.block_num + AND b.row_num = a.row_num + AND a.struct_num = b.struct_num + ) ORDER BY struct_num DESC + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + * + FROM + ( + SELECT + sa.block_num, + sa.row_num, + COUNT( sa.struct_code ) AS struct_num + FROM + st_ivt_structattr sa + WHERE + sa.is_delete = '0' + AND sa.is_used = '1' + AND sa.lock_type = '1' + AND sa.sect_code = 'ZC01' + OPTION 输入.layer_num <> "" + sa.layer_num = 输入.layer_num + ENDOPTION + GROUP BY + sa.block_num, + sa.row_num + ) a + WHERE + EXISTS ( + SELECT + * + FROM + ( + SELECT + block_num, + row_num, + COUNT( sa2.struct_code ) AS struct_num + FROM + st_ivt_structattr sa2 + WHERE + sa2.lock_type = '1' + AND sa2.is_used = '1' + AND sa2.is_delete = '0' + AND sa2.sect_code = 'ZC01' + AND IFNULL( sa2.storagevehicle_code, '' ) = '' + OPTION 输入.layer_num <> "" + sa2.layer_num = 输入.layer_num + ENDOPTION + GROUP BY + sa2.block_num, + sa2.row_num + ) b + WHERE + b.block_num = a.block_num + AND b.row_num = a.row_num + ) ORDER BY struct_num DESC + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "3" + QUERY + SELECT + * + FROM + ( + SELECT + sa.block_num, + sa.row_num, + COUNT( sa.struct_code ) AS struct_num + FROM + st_ivt_structattr sa + WHERE + sa.is_delete = '0' + AND sa.is_used = '1' + AND sa.lock_type = '1' + AND sa.sect_code = 'ZZ01' + OPTION 输入.layer_num <> "" + sa.layer_num = 输入.layer_num + ENDOPTION + GROUP BY + sa.block_num, + sa.row_num + ) a + WHERE + EXISTS ( + SELECT + * + FROM + ( + SELECT + block_num, + row_num, + COUNT( sa2.struct_code ) AS struct_num + FROM + st_ivt_structattr sa2 + WHERE + sa2.lock_type = '1' + AND sa2.is_used = '1' + AND sa2.is_delete = '0' + AND sa2.sect_code = 'ZZ01' + AND IFNULL( sa2.storagevehicle_code, '' ) <> '' + OPTION 输入.layer_num <> "" + sa2.layer_num = 输入.layer_num + ENDOPTION + GROUP BY + sa2.block_num, + sa2.row_num + ) b + WHERE + b.block_num = a.block_num + AND b.row_num = a.row_num + AND a.struct_num = b.struct_num + ) ORDER BY struct_num DESC + + ENDSELECT + ENDQUERY + ENDIF \ No newline at end of file diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java index 02535025b..1070957c1 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java @@ -150,14 +150,6 @@ public class CheckOutBillController { return new ResponseEntity<>(HttpStatus.NO_CONTENT); } - @PostMapping("/oneSetPoint") - @Log("设置一个站点") - - public ResponseEntity oneSetPoint(@RequestBody JSONObject whereJson) { - checkOutBillService.oneSetPoint(whereJson); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - @PostMapping("/oneSetPoint2") @Log("设置一个站点") diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 421770b89..c6bcf40fe 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -2454,643 +2454,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } } - @Override - @Transactional(rollbackFor = Exception.class) - public void oneSetPoint(JSONObject whereJson) { - //出库分配表 - WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); - //点位表 - WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point"); - //任务表 - WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); - //出库主表 - WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv"); - //仓位表 - WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr"); - - String struct_id = whereJson.getString("struct_id"); - String point_code = whereJson.getString("point_code"); // 终点 - String iostorinv_id = whereJson.getString("iostorinv_id"); - - //查询主表信息 - JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jo_mst)) { - throw new BadRequestException("未查到相关出库单"); - } - - JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0); - //如果终点站点被锁定或者有载具号,则不允许设置点位 - if (ObjectUtil.isEmpty(jsonPoint2)) { - throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!"); - } - - // 查询未生成和生成未下发的分配记录 - JSONObject dis = WQL.getWO("QST_IVT_CHECKOUTBILL") - .addParam("flag", "5") - .addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id")) - .addParam("struct_id", struct_id) - .addParam("iostorinv_id", iostorinv_id) - .addParam("bill_status", "01") - .addParam("is_issued", "0") - .process() - .uniqueResult(0); - if (ObjectUtil.isEmpty(dis)) { - throw new BadRequestException("分配明细不存在或已执行、完成、!"); - } - - String task_status = dis.getString("task_status"); - String task_id = dis.getString("task_id"); - - if (StrUtil.isNotEmpty(task_status) && "05,06,07".contains(task_status)) { - throw new BadRequestException("该任务已执行,不可重新设置站点!"); - } - - if (ObjectUtil.isNotEmpty(task_id)) { - //若任务不为空,则为变更出库目的站点 - JSONObject task = wo_Task.query("task_id='" + task_id + "'").uniqueResult(0); - //更新任务 - task.put("point_code2", jsonPoint2.getString("point_code")); - wo_Task.update(task); - } else { - /* - * 生成任务: - * 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ - * a.如果有:有则合并只生成一条任务 - * b.没有:则正常生成 - * 2.判断此货位是否被挡住 - * a.挡住:判断哪边的货位比较少 , 生成移库单 - * b.没挡住:正常生成 - */ - JSONObject jsonPoint1 = wo_Point.query("source_id = '" + dis.getString("struct_id") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonPoint1)) { - throw new BadRequestException("起点点位不存在"); - } - - // 创建任务 - JSONObject param = new JSONObject(); - param.put("task_type", "010503"); - param.put("vehicle_code", dis.getString("box_no")); - param.put("task_name", "task_name"); - param.put("point_code1", jsonPoint1.getString("point_code")); - param.put("point_code2", jsonPoint2.getString("point_code")); - param.put("material_id", dis.getString("material_id")); - param.put("task_group_id", ""); // 任务组 - param.put("sort_seq", ""); // 任务组顺序号 - - String create_task_id = outTask.createTask(param); - - // 更新分配状态、任务标识、出库点位 - JSONObject jsonTask = wo_Task.query("task_id = '" + create_task_id + "'").uniqueResult(0); - JSONObject jsonUpdateMap = new JSONObject(); - jsonUpdateMap.put("work_status", "01"); - jsonUpdateMap.put("task_id", jsonTask.getLong("task_id")); - jsonUpdateMap.put("point_id", jsonPoint2.getLong("point_id")); - wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + dis.getString("iostorinvdis_id") + "'"); - - // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ - JSONArray disArr = wo_dis.query("struct_id = '" + dis.getString("struct_id") + - "' and iostorinv_id = '" + dis.getString("iostorinv_id") + - "' and iostorinvdis_id <> '" + dis.getString("iostorinvdis_id") + - "' and work_status = '00'").getResultJSONArray(0); - - // 依次更新相同仓位的分配明细状态、任务标识、出库点位 - for (int i = 0; i < disArr.size(); i++) { - JSONObject jsonObject = disArr.getJSONObject(i); - jsonObject.put("work_status", "01"); - jsonObject.put("task_id", jsonTask.getLong("task_id")); - jsonObject.put("point_id", jsonPoint2.getLong("point_id")); - wo_dis.update(jsonObject); - } - - // 2.判断此货位是否被挡住 - JSONObject jsonAttr = attrTab.query("struct_id = '" + dis.getString("struct_id") + "'").uniqueResult(0); - - // 判断此仓位是‘双通’还是’单通‘ - if (StrUtil.equals(jsonAttr.getString("placement_type"), "01")) { - - JSONObject map = new JSONObject(); - map.put("flag", "2"); - map.put("struct_code", jsonAttr.getString("struct_code")); - map.put("sect_id", jsonAttr.getString("sect_id")); - - // 判断左边是否被挡住 - JSONObject jsonIsBlockL = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0); - boolean left_verify = true; - if (ObjectUtil.isEmpty(jsonIsBlockL)) { - left_verify = false; - /* String out_order_seq = NumberUtil.add(jsonAttr.getString("out_order_seq"), "1").toString(); - JSONObject json = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + jsonAttr.getString("block_num") - + "' and row_num = '" + jsonAttr.getString("row_num") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(json)) { - jsonAttr.put("placement_type","02"); - }*/ - jsonAttr.put("placement_type", "02"); - } else { - // 调用验证方法进行校验 - String out_order_seq = NumberUtil.add(jsonIsBlockL.getString("out_order_seq"), "1").toString(); - JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + jsonIsBlockL.getString("block_num") - + "' and row_num = '" + jsonIsBlockL.getString("row_num") + "'").uniqueResult(0); - - jsonParam.put("iostorinv_id", dis.getString("iostorinv_id")); - jsonParam.put("option", "2"); - left_verify = this.is_trueOrFalse(jsonParam); - - if (!left_verify) { - jsonParam.put("option", "3"); - boolean left_verify2 = this.is_trueOrFalse(jsonParam); - - if (left_verify2) { - jsonAttr.put("placement_type", "02"); - } - } else { - jsonParam.put("option", "4"); - boolean left_verify2 = this.is_trueOrFalse(jsonParam); - - if (left_verify2) { - jsonAttr.put("placement_type", "02"); - } - } - } - - // 判断右边是否被挡住 - map.put("flag", "1"); - JSONObject jsonIsBlockR = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0); - boolean right_verify = true; - if (ObjectUtil.isEmpty(jsonIsBlockR)) { - right_verify = false; - /* String out_order_seq = NumberUtil.sub(jsonAttr.getString("out_order_seq"), "1").toString(); - JSONObject json = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + jsonAttr.getString("block_num") - + "' and row_num = '" + jsonAttr.getString("row_num") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(json)) { - jsonAttr.put("placement_type","03"); - }*/ - jsonAttr.put("placement_type", "03"); - } else { - // 调用验证方法进行校验 - String out_order_seq = NumberUtil.sub(jsonIsBlockR.getString("out_order_seq"), "1").toString(); - JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + jsonIsBlockR.getString("block_num") - + "' and row_num = '" + jsonIsBlockR.getString("row_num") + "'").uniqueResult(0); - - jsonParam.put("iostorinv_id", dis.getString("iostorinv_id")); - jsonParam.put("option", "2"); - right_verify = this.is_trueOrFalse(jsonParam); - - if (!right_verify) { - jsonParam.put("option", "3"); - boolean right_verify2 = this.is_trueOrFalse(jsonParam); - - if (right_verify2) { - jsonAttr.put("placement_type", "03"); - } - } else { - jsonParam.put("option", "4"); - boolean right_verify2 = this.is_trueOrFalse(jsonParam); - - if (right_verify2) { - jsonAttr.put("placement_type", "03"); - } - } - } - - if (left_verify && right_verify) { - // 都被挡住判断哪边被挡住的货位少 - map.put("flag", "3"); - map.put("out_order_seq", jsonAttr.getString("out_order_seq")); - JSONArray jsonIsBlockAll = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0); - - int blockLeft = 0; // 左边个数 - int blockRigth = 0; // 右边个数 - for (int i = 0; i < jsonIsBlockAll.size(); i++) { - JSONObject json = jsonIsBlockAll.getJSONObject(i); - - if (i == 0) { - blockRigth = json.getIntValue("num"); - } - if (i == 1) { - blockRigth = json.getIntValue("num"); - } - } - - // 更新第一个任务 任务组、任务顺序号 - jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId()); - jsonTask.put("sort_seq", 1); - wo_Task.update(jsonTask); - - JSONArray jsonAllBlockPoint = new JSONArray(); - if (blockLeft > blockRigth) { - // 从右边生成移库单 - map.put("flag", "4"); - map.put("block_num", jsonAttr.getString("block_num")); - map.put("row_num", jsonAttr.getString("row_num")); - - jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0); - - } else { - // 从左边生成移库单 - map.put("flag", "5"); - map.put("block_num", jsonAttr.getString("block_num")); - map.put("row_num", jsonAttr.getString("row_num")); - - jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0); - } - - for (int i = 0; i < jsonAllBlockPoint.size(); i++) { - JSONObject json = jsonAllBlockPoint.getJSONObject(i); - - JSONObject mapParam = new JSONObject();// 生成移库单传入参数 - JSONArray table = new JSONArray(); // 明细参数 - mapParam.put("bill_status", "10"); - mapParam.put("bill_type", "21"); - mapParam.put("buss_type", "21"); - mapParam.put("biz_date", DateUtil.today()); - mapParam.put("stor_code", "CP01"); - mapParam.put("stor_id", "1582991156504039424"); - mapParam.put("stor_name", "成品仓库"); - mapParam.put("is_task", "1"); - - // 查询移入货位 - JSONObject moveParam = new JSONObject(); - moveParam.put("box_no", json.getString("storagevehicle_code")); - moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId()); - JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam); - // 查询移出货位的库存物料 - JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03") - .addParam("flag", "6") - .addParam("struct_id", json.getString("struct_id")) - .process().uniqueResult(0); - - // 移库单明细 - JSONObject jsonMoveDtl = new JSONObject(); - jsonMoveDtl.put("is_task", "2"); - jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id")); - jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code")); - jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name")); - jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id")); - jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code")); - jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name")); - jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id")); - jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn")); - jsonMoveDtl.put("quality_scode", "01"); - jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id")); - jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name")); - jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty")); - jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code")); - jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id")); - jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code")); - jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name")); - jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id")); - jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code")); - jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name")); - jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id")); - - // 生成任务 - JSONObject param2 = new JSONObject(); - param2.put("task_type", "010503"); - param2.put("vehicle_code", json.getString("storagevehicle_code")); - param2.put("task_name", "task_name"); - param2.put("point_code1", json.getString("point_code")); - param2.put("point_code2", jsonMove.getString("struct_code")); - param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组 - param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号 - String move_task_id = outTask.createTask(param2); - - // 回显移库明细任务id - jsonMoveDtl.put("task_id", move_task_id); - table.add(jsonMoveDtl); - // 更新任务处理类 - JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0); - jsonTaskMove.put("task_type", "010505"); - jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName()); - wo_Task.update(jsonTaskMove); - - mapParam.put("tableData", table); - // 调用移库单新增方法 - if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) { - handMoveStorService.insertDtl2(mapParam); - } - } - - } else { - if (StrUtil.equals(jsonAttr.getString("placement_type"), "01")) { - throw new BadRequestException("任务生成失败,请重新选择"); - } - map.put("struct_code", jsonAttr.getString("struct_code")); - map.put("sect_id", jsonAttr.getString("sect_id")); - map.put("out_order_seq", jsonAttr.getString("out_order_seq")); - map.put("block_num", jsonAttr.getString("block_num")); - map.put("row_num", jsonAttr.getString("row_num")); - - JSONArray jsonAllBlockPoint = new JSONArray(); - if (StrUtil.equals(jsonAttr.getString("placement_type"), "02")) { - // 02-左通 - map.put("flag", "2"); - // 判断左边是否被挡住 - JSONObject jsonIsBlockL2 = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0); - - // 如果被挡住则进行校验 - boolean verify = true; - if (ObjectUtil.isEmpty(jsonIsBlockL2)) { - verify = false; - } else { - // 调用验证方法进行校验 - String out_order_seq = NumberUtil.add(jsonIsBlockL2.getString("out_order_seq"), "1").toString(); - JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + map.getString("block_num") - + "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0); - - jsonParam.put("iostorinv_id", dis.getString("iostorinv_id")); - jsonParam.put("option", "1"); - verify = this.is_trueOrFalse(jsonParam); - } - - if (verify) { - // 更新第一个任务 任务组、任务顺序号 - jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId()); - jsonTask.put("sort_seq", 1); - wo_Task.update(jsonTask); - // 从左边生成移库单 - map.put("flag", "5"); - jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0); - } - } - - if (StrUtil.equals(jsonAttr.getString("placement_type"), "03")) { - // 03-右通 - map.put("flag", "1"); - // 判断右边是否被挡住 - JSONObject jsonIsBlockR2 = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0); - - // 如果被挡住则进行校验 - boolean verify = true; - if (ObjectUtil.isEmpty(jsonIsBlockR2)) { - verify = false; - } else { - // 调用验证方法进行校验 - String out_order_seq = NumberUtil.sub(jsonIsBlockR2.getString("out_order_seq"), "1").toString(); - JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + map.getString("block_num") - + "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0); - - jsonParam.put("iostorinv_id", dis.getString("iostorinv_id")); - jsonParam.put("option", "1"); - verify = this.is_trueOrFalse(jsonParam); - } - - if (verify) { - // 更新第一个任务 任务组、任务顺序号 - jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId()); - jsonTask.put("sort_seq", 1); - wo_Task.update(jsonTask); - // 从右边生成移库单 - map.put("flag", "4"); - jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0); - } - } - - for (int i = 0; i < jsonAllBlockPoint.size(); i++) { - JSONObject json = jsonAllBlockPoint.getJSONObject(i); - - JSONObject mapParam = new JSONObject();// 生成移库单传入参数 - JSONArray table = new JSONArray(); // 明细参数 - mapParam.put("bill_status", "10"); - mapParam.put("bill_type", "21"); - mapParam.put("buss_type", "21"); - mapParam.put("biz_date", DateUtil.today()); - mapParam.put("stor_code", "CP01"); - mapParam.put("stor_id", "1582991156504039424"); - mapParam.put("stor_name", "成品仓库"); - mapParam.put("is_task", "1"); - - // 查询移入货位 - JSONObject moveParam = new JSONObject(); - moveParam.put("box_no", json.getString("storagevehicle_code")); - moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId()); - JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam); - // 查询移出货位的库存物料 - JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03") - .addParam("flag", "6") - .addParam("struct_id", json.getString("struct_id")) - .process().uniqueResult(0); - - // 移库单明细 - JSONObject jsonMoveDtl = new JSONObject(); - jsonMoveDtl.put("is_task", "2"); - jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id")); - jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code")); - jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name")); - jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id")); - jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code")); - jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name")); - jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id")); - jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn")); - jsonMoveDtl.put("quality_scode", "01"); - jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id")); - jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name")); - jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty")); - jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code")); - jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id")); - jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code")); - jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name")); - jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id")); - jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code")); - jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name")); - jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id")); - - // 生成任务 - JSONObject param2 = new JSONObject(); - param2.put("task_type", "010503"); - param2.put("vehicle_code", json.getString("storagevehicle_code")); - param2.put("task_name", "task_name"); - param2.put("point_code1", json.getString("point_code")); - param2.put("point_code2", jsonMove.getString("struct_code")); - param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组 - param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号 - String move_task_id = outTask.createTask(param2); - - // 回显移库明细任务id - jsonMoveDtl.put("task_id", move_task_id); - table.add(jsonMoveDtl); - // 更新任务处理类 - JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0); - jsonTaskMove.put("task_type", "010505"); - jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName()); - wo_Task.update(jsonTaskMove); - - mapParam.put("tableData", table); - // 调用移库单新增方法 - if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) { - handMoveStorService.insertDtl2(mapParam); - } - } - } - } else { - JSONObject map = new JSONObject(); - map.put("struct_code", jsonAttr.getString("struct_code")); - map.put("sect_id", jsonAttr.getString("sect_id")); - map.put("out_order_seq", jsonAttr.getString("out_order_seq")); - map.put("block_num", jsonAttr.getString("block_num")); - map.put("row_num", jsonAttr.getString("row_num")); - - JSONArray jsonAllBlockPoint = new JSONArray(); - if (StrUtil.equals(jsonAttr.getString("placement_type"), "02")) { - // 02-左通 - map.put("flag", "2"); - // 判断左边是否被挡住 - JSONObject jsonIsBlockL = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0); - - // 如果被挡住则进行校验 - boolean verify = true; - if (ObjectUtil.isEmpty(jsonIsBlockL)) { - verify = false; - } else { - // 调用验证方法进行校验 - String out_order_seq = NumberUtil.add(jsonIsBlockL.getString("out_order_seq"), "1").toString(); - JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + map.getString("block_num") - + "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0); - - jsonParam.put("iostorinv_id", dis.getString("iostorinv_id")); - jsonParam.put("option", "1"); - verify = this.is_trueOrFalse(jsonParam); - } - - if (verify) { - // 更新第一个任务 任务组、任务顺序号 - jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId()); - jsonTask.put("sort_seq", 1); - wo_Task.update(jsonTask); - // 从左边生成移库单 - map.put("flag", "5"); - jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0); - } - } - - if (StrUtil.equals(jsonAttr.getString("placement_type"), "03")) { - // 03-右通 - map.put("flag", "1"); - // 判断左边是否被挡住 - JSONObject jsonIsBlockR = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0); - - // 如果被挡住则进行校验 - boolean verify = true; - if (ObjectUtil.isEmpty(jsonIsBlockR)) { - verify = false; - } else { - // 调用验证方法进行校验 - String out_order_seq = NumberUtil.sub(jsonIsBlockR.getString("out_order_seq"), "1").toString(); - JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id") - + "' and out_order_seq = '" + out_order_seq - + "' and block_num = '" + map.getString("block_num") - + "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0); - - jsonParam.put("iostorinv_id", dis.getString("iostorinv_id")); - jsonParam.put("option", "1"); - verify = this.is_trueOrFalse(jsonParam); - } - - if (verify) { - // 更新第一个任务 任务组、任务顺序号 - jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId()); - jsonTask.put("sort_seq", 1); - wo_Task.update(jsonTask); - // 从右边生成移库单 - map.put("flag", "4"); - jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0); - } - } - - for (int i = 0; i < jsonAllBlockPoint.size(); i++) { - JSONObject json = jsonAllBlockPoint.getJSONObject(i); - - JSONObject mapParam = new JSONObject();// 生成移库单传入参数 - JSONArray table = new JSONArray(); // 明细参数 - mapParam.put("bill_status", "10"); - mapParam.put("bill_type", "21"); - mapParam.put("buss_type", "21"); - mapParam.put("biz_date", DateUtil.today()); - mapParam.put("stor_code", "CP01"); - mapParam.put("stor_id", "1582991156504039424"); - mapParam.put("stor_name", "成品仓库"); - mapParam.put("is_task", "1"); - - // 查询移入货位 - JSONObject moveParam = new JSONObject(); - moveParam.put("box_no", json.getString("storagevehicle_code")); - moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId()); - JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam); - // 查询移出货位的库存物料 - JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03") - .addParam("flag", "6") - .addParam("struct_id", json.getString("struct_id")) - .process().uniqueResult(0); - - // 移库单明细 - JSONObject jsonMoveDtl = new JSONObject(); - jsonMoveDtl.put("is_task", "2"); - jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id")); - jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code")); - jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name")); - jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id")); - jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code")); - jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name")); - jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id")); - jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn")); - jsonMoveDtl.put("quality_scode", "01"); - jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id")); - jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name")); - jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty")); - jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code")); - jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id")); - jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code")); - jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name")); - jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id")); - jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code")); - jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name")); - jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id")); - - // 生成任务 - JSONObject param2 = new JSONObject(); - param2.put("task_type", "010503"); - param2.put("vehicle_code", json.getString("storagevehicle_code")); - param2.put("task_name", "task_name"); - param2.put("point_code1", json.getString("point_code")); - param2.put("point_code2", jsonMove.getString("struct_code")); - param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组 - param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号 - String move_task_id = outTask.createTask(param2); - - // 回显移库明细任务id - jsonMoveDtl.put("task_id", move_task_id); - table.add(jsonMoveDtl); - // 更新任务处理类 - JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0); - jsonTaskMove.put("task_type", "010505"); - jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName()); - wo_Task.update(jsonTaskMove); - - mapParam.put("tableData", table); - // 调用移库单新增方法 - if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) { - handMoveStorService.insertDtl2(mapParam); - } - } - } - // 下发 - outTask.immediateNotifyAcs(null); - } - } - @Override @Transactional(rollbackFor = Exception.class) public void allSetPoint(JSONObject whereJson) { @@ -3308,7 +2671,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { for (int k = 0; k < numArr.size(); k++) { JSONObject json = numArr.getJSONObject(k); - error += json.getString("struct_code") + ","; + error += json.getString("struct_code") + ", 锁定单据号:"+json.getString("inv_code"); } throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); @@ -3342,7 +2705,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { for (int k = 0; k < numArr.size(); k++) { JSONObject json = numArr.getJSONObject(k); - error += json.getString("struct_code") + ","; + error += json.getString("struct_code") + ", 锁定单据号:"+json.getString("inv_code"); } throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); @@ -3376,7 +2739,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { for (int k = 0; k < numArr.size(); k++) { JSONObject json = numArr.getJSONObject(k); - error += json.getString("struct_code") + ","; + error += json.getString("struct_code") + ", 锁定单据号:"+json.getString("inv_code"); } throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); @@ -3668,90 +3031,190 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { @Override @Transactional(rollbackFor = Exception.class) public void oneSetPoint2(JSONObject whereJson) { - //出库分配表 - WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); - //点位表 - WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point"); - //任务表 - WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); - //出库主表 - WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv"); - //仓位表 - WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr"); + TranUtil.openTransaction((req, allTransactionConsumer) -> { + allTransactionConsumer.accept("begin"); + //出库分配表 + WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); + //点位表 + WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point"); + //任务表 + WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); + //出库主表 + WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv"); + //仓位表 + WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr"); - String struct_id = whereJson.getString("struct_id"); - String point_code = whereJson.getString("point_code"); // 终点 - String iostorinv_id = whereJson.getString("iostorinv_id"); - String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id"); - String iostorinvdis_id = whereJson.getString("iostorinvdis_id"); - boolean checked = whereJson.getBoolean("checked"); // 是否异常出库 - String point_id = ""; + String struct_id = whereJson.getString("struct_id"); + String point_code = whereJson.getString("point_code"); // 终点 + String iostorinv_id = whereJson.getString("iostorinv_id"); + String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id"); + String iostorinvdis_id = whereJson.getString("iostorinvdis_id"); + boolean checked = whereJson.getBoolean("checked"); // 是否异常出库 + String point_id = ""; - //查询主表信息 - JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jo_mst)) { - throw new BadRequestException("未查到相关出库单"); - } + //查询主表信息 + JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jo_mst)) { + throw new BadRequestException("未查到相关出库单"); + } - JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0); - //如果终点站点被锁定或者有载具号,则不允许设置点位 - if (ObjectUtil.isEmpty(jsonPoint2)) { - throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!"); - } - point_id = jsonPoint2.getString("point_id"); + JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0); + //如果终点站点被锁定或者有载具号,则不允许设置点位 + if (ObjectUtil.isEmpty(jsonPoint2)) { + throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!"); + } + point_id = jsonPoint2.getString("point_id"); - // 查询未生成和生成未下发的分配记录 - JSONArray disArrOne = WQL.getWO("QST_IVT_CHECKOUTBILL") - .addParam("flag", "5") - .addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id")) - .addParam("iostorinvdis_id", whereJson.getString("iostorinvdis_id")) - .addParam("struct_id", struct_id) - .addParam("iostorinv_id", iostorinv_id) - .addParam("bill_status", "01") - .addParam("is_issued", "0") - .process() - .getResultJSONArray(0); - if (ObjectUtil.isEmpty(disArrOne)) { - throw new BadRequestException("分配明细不存在或已执行、完成、!"); - } + // 查询未生成和生成未下发的分配记录 + JSONArray disArrOne = WQL.getWO("QST_IVT_CHECKOUTBILL") + .addParam("flag", "5") + .addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id")) + .addParam("iostorinvdis_id", whereJson.getString("iostorinvdis_id")) + .addParam("struct_id", struct_id) + .addParam("iostorinv_id", iostorinv_id) + .addParam("bill_status", "01") + .addParam("is_issued", "0") + .process() + .getResultJSONArray(0); + if (ObjectUtil.isEmpty(disArrOne)) { + throw new BadRequestException("分配明细不存在或已执行、完成、!"); + } - // 取第一个 - JSONObject jsonNoe = disArrOne.getJSONObject(0); + // 取第一个 + JSONObject jsonNoe = disArrOne.getJSONObject(0); - JSONArray disRowArrNew = new JSONArray(); - String option = ""; // 1.左 2.右 - String placement_type = whereJson.getString("placement_type"); // 单通或双通 - // 双通 - if (StrUtil.equals(placement_type, "01")) { + JSONArray disRowArrNew = new JSONArray(); + String option = ""; // 1.左 2.右 + String placement_type = whereJson.getString("placement_type"); // 单通或双通 + // 双通 + if (StrUtil.equals(placement_type, "01")) { - /* - * 判断左边被挡住的个数多还是右边被挡住的个数多 - */ - // 判断右边边被挡住的个数 - JSONObject isNumMap = new JSONObject(); - isNumMap.put("flag", "3"); - isNumMap.put("block_num", jsonNoe.getString("block_num")); - isNumMap.put("row_num", jsonNoe.getString("row_num")); - isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); - JSONArray numArrFirst = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); - - // 调用共用方法计算被挡个数 - JSONArray rightNumArr = this.isNum(numArrFirst); - - // 判断左边被挡住的个数 - isNumMap.put("flag", "4"); - isNumMap.put("block_num", jsonNoe.getString("block_num")); - isNumMap.put("row_num", jsonNoe.getString("row_num")); - isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); - JSONArray numArrLast = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); - - // 调用共用方法计算被挡个数 - JSONArray leftNumArr = this.isNum(numArrLast); - // 判断哪边少 - if (rightNumArr.size() > leftNumArr.size()) { /* - * 左边开始 + * 判断左边被挡住的个数多还是右边被挡住的个数多 */ + // 判断右边边被挡住的个数 + JSONObject isNumMap = new JSONObject(); + isNumMap.put("flag", "3"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray numArrFirst = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + // 调用共用方法计算被挡个数 + JSONArray rightNumArr = this.isNum(numArrFirst); + + // 判断左边被挡住的个数 + isNumMap.put("flag", "4"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray numArrLast = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + // 调用共用方法计算被挡个数 + JSONArray leftNumArr = this.isNum(numArrLast); + // 判断哪边少 + if (rightNumArr.size() > leftNumArr.size()) { + /* + * 左边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "5"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ", 锁定单据号:"+json.getString("inv_code"); + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + } + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "22") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "1"; + + } else if (rightNumArr.size() < leftNumArr.size()) { + /* + * 右边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ", 锁定单据号:"+json.getString("inv_code"); + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "2"; + } else { + /* + * 相等默认右边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ", 锁定单据号:"+json.getString("inv_code"); + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "2"; + } + + } else if (StrUtil.equals(placement_type, "02")) { + // 左通 + + JSONObject isNumMap = new JSONObject(); // 查询仓位被锁住的货位 isNumMap.put("flag", "5"); isNumMap.put("block_num", jsonNoe.getString("block_num")); @@ -3769,7 +3232,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { error += json.getString("struct_code") + ","; } - throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + throw new BadRequestException("仓位:" + error + "被锁定请等待下发任务并等待任务完成"); } // 重新按照排序查询 disRowArrNew = WQL.getWO("ST_OUTIVT04") @@ -3780,10 +3243,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { option = "1"; - } else if (rightNumArr.size() < leftNumArr.size()) { - /* - * 右边开始 - */ + } else if (StrUtil.equals(placement_type, "03")) { + // 右通 + JSONObject isNumMap = new JSONObject(); // 查询仓位被锁住的货位 isNumMap.put("flag", "6"); isNumMap.put("block_num", jsonNoe.getString("block_num")); @@ -3801,7 +3263,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { error += json.getString("struct_code") + ","; } - throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + throw new BadRequestException("仓位:" + error + "被锁定请等待下发任务并等待任务完成!"); } // 重新按照排序查询 @@ -3812,287 +3274,195 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { .process().getResultJSONArray(0); option = "2"; + } + + /* + * 循环生成任务 + */ + boolean canOut = false; + int j = 0; + JSONObject jsonObject = disRowArrNew.getJSONObject(j); + + // 查询未被锁住的仓位 + JSONArray moveArr = new JSONArray(); + JSONObject map = new JSONObject(); + map.put("block_num", jsonObject.getString("block_num")); + map.put("row_num", jsonObject.getString("row_num")); + map.put("out_order_seq", jsonObject.getString("out_order_seq")); + + if (StrUtil.equals(option, "1")) { + // 左边 + map.put("flag", "7"); + moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); } else { - /* - * 相等默认右边开始 - */ - // 查询仓位被锁住的货位 - isNumMap.put("flag", "6"); - isNumMap.put("block_num", jsonNoe.getString("block_num")); - isNumMap.put("row_num", jsonNoe.getString("row_num")); - isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); - JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + // 右边 + map.put("flag", "8"); + moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); + } - JSONArray numArr = this.isNum(isLockArr); - // 不为空则返回报错 - if (ObjectUtil.isNotEmpty(numArr)) { - String error = ""; + // 创建任务组 + long task_group_id = IdUtil.getSnowflake(1, 1).nextId(); - for (int k = 0; k < numArr.size(); k++) { - JSONObject json = numArr.getJSONObject(k); - error += json.getString("struct_code") + ","; + // 判断是否需要生成移库 + if (ObjectUtil.isNotEmpty(moveArr)) { + JSONObject moveParam = new JSONObject(); + moveParam.put("jsonAllBlockPoint", moveArr); + moveParam.put("iostorinvdis_id", jsonObject.getString("iostorinvdis_id")); + moveParam.put("task_group_id", task_group_id); + this.createMove(moveParam, allTransactionConsumer); + } + + // 判断是否是异常出库口 + if (checked) { + JSONObject jsonStartPoint = attrTab.query("struct_code = '" + jsonObject.getString("struct_code") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonStartPoint)) { + throw new BadRequestException("起始点位异常!"); + } + + String layer_num = jsonStartPoint.getString("layer_num"); + + switch (layer_num) { + case "1": + point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_1").getValue(); + break; + case "2": + point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_2").getValue(); + break; + case "3": + point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_3").getValue(); + break; + default: + throw new BadRequestException("起点楼层异常:" + jsonStartPoint.getString("struct_code")); + } + point_id = wo_Point.query("point_code = '" + point_code + "'").uniqueResult(0).getString("point_id"); + } + allTransactionConsumer.accept(jsonObject.getString("struct_code")); + // 创建任务 + JSONObject param = new JSONObject(); + param.put("task_type", "010503"); + param.put("vehicle_code", jsonObject.getString("box_no")); + param.put("task_name", ""); + param.put("point_code1", jsonObject.getString("struct_code")); + param.put("point_code2", point_code); + param.put("material_id", jsonObject.getString("material_id")); + param.put("task_group_id", ""); // 任务组 + param.put("sort_seq", ""); // 任务组顺序号 + + String create_task_id = outTask.createTask(param); + + // 更新分配状态、任务标识、出库点位 + JSONObject jsonTask = wo_Task.query("task_id = '" + create_task_id + "'").uniqueResult(0); + JSONObject jsonUpdateMap = new JSONObject(); + jsonUpdateMap.put("work_status", "01"); + jsonUpdateMap.put("task_id", jsonTask.getLong("task_id")); + jsonUpdateMap.put("point_id", point_id); + wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + jsonObject.getString("iostorinvdis_id") + "'"); + + // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ + JSONArray disArr = wo_dis.query("struct_id = '" + jsonObject.getString("struct_id") + + "' and iostorinv_id = '" + jsonObject.getString("iostorinv_id") + + "' and iostorinvdis_id <> '" + jsonObject.getString("iostorinvdis_id") + + "' and work_status = '00'").getResultJSONArray(0); + + // 依次更新相同仓位的分配明细状态、任务标识、出库点位 + for (int n = 0; n < disArr.size(); n++) { + JSONObject jsonObject2 = disArr.getJSONObject(n); + jsonObject2.put("work_status", "01"); + jsonObject2.put("task_id", jsonTask.getLong("task_id")); + jsonObject2.put("point_id", point_id); + wo_dis.update(jsonObject2); + } + + // 更新出库任务:任务组和顺序号 + JSONObject jsonTaskLast1 = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0); + jsonTask.put("task_group_id", task_group_id); + if (ObjectUtil.isEmpty(jsonTaskLast1)) { + jsonTask.put("sort_seq", 1); + } else { + jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq") + 1); + } + wo_Task.update(jsonTask); + + /* + * 判断下一个出库仓位是否相邻 + */ + int out_order_seq = jsonObject.getIntValue("out_order_seq"); + boolean canAdd = true; + int nextNum = j + 1; + while (canAdd) { + // 判断数组是否到头 + if (nextNum <= disRowArrNew.size() - 1) { + JSONObject jsonNext = disRowArrNew.getJSONObject(nextNum); + int out_order_seq_next = jsonNext.getIntValue("out_order_seq"); + if (Math.abs(out_order_seq_next - out_order_seq) != nextNum) { + // 下发当前任务组 + outTask.immediateNotifyAcs(null); + + // 更新任务组 + task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + canAdd = false; + + } else { + // 查询此任务组最后一个生成的任务 + JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0); + // 创建任务并添加到任务组 + allTransactionConsumer.accept(jsonNext.getString("struct_code")); + JSONObject param2 = new JSONObject(); + param2.put("task_type", "010503"); + param2.put("vehicle_code", jsonNext.getString("box_no")); + param2.put("task_name", ""); + param2.put("point_code1", jsonNext.getString("struct_code")); + param2.put("point_code2", point_code); + param2.put("material_id", jsonNext.getString("material_id")); + param2.put("task_group_id", task_group_id); // 任务组 + param2.put("sort_seq", jsonTaskLast.getIntValue("sort_seq") + 1); // 任务组顺序号 + + String create_task_id2 = outTask.createTask(param2); + + outTask.immediateNotifyAcs(null); + + // 更新分配状态、任务标识、出库点位 + JSONObject jsonTask2 = wo_Task.query("task_id = '" + create_task_id2 + "'").uniqueResult(0); + JSONObject jsonUpdateMap2 = new JSONObject(); + jsonUpdateMap2.put("work_status", "01"); + jsonUpdateMap2.put("task_id", jsonTask2.getLong("task_id")); + jsonUpdateMap2.put("point_id", point_id); + wo_dis.update(jsonUpdateMap2, "iostorinvdis_id = '" + jsonNext.getString("iostorinvdis_id") + "'"); + + // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ + JSONArray disArr2 = wo_dis.query("struct_id = '" + jsonNext.getString("struct_id") + + "' and iostorinv_id = '" + jsonNext.getString("iostorinv_id") + + "' and iostorinvdis_id <> '" + jsonNext.getString("iostorinvdis_id") + + "' and work_status = '00'").getResultJSONArray(0); + + // 依次更新相同仓位的分配明细状态、任务标识、出库点位 + for (int m = 0; m < disArr2.size(); m++) { + JSONObject jsonObject3 = disArr2.getJSONObject(m); + jsonObject3.put("work_status", "01"); + jsonObject3.put("task_id", jsonTask2.getLong("task_id")); + jsonObject3.put("point_id", point_id); + wo_dis.update(jsonObject3); + } + + nextNum++; } - - throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); - } - - // 重新按照排序查询 - disRowArrNew = WQL.getWO("ST_OUTIVT04") - .addParam("flag", "2") - .addParam("iostorinvdtl_id", iostorinvdtl_id) - .addParam("iostorinvdis_id", iostorinvdis_id) - .process().getResultJSONArray(0); - - option = "2"; - } - - } else if (StrUtil.equals(placement_type, "02")) { - // 左通 - - JSONObject isNumMap = new JSONObject(); - // 查询仓位被锁住的货位 - isNumMap.put("flag", "5"); - isNumMap.put("block_num", jsonNoe.getString("block_num")); - isNumMap.put("row_num", jsonNoe.getString("row_num")); - isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); - JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); - - JSONArray numArr = this.isNum(isLockArr); - // 不为空则返回报错 - if (ObjectUtil.isNotEmpty(numArr)) { - String error = ""; - - for (int k = 0; k < numArr.size(); k++) { - JSONObject json = numArr.getJSONObject(k); - error += json.getString("struct_code") + ","; - } - - throw new BadRequestException("仓位:" + error + "被锁定请等待下发任务并等待任务完成"); - } - // 重新按照排序查询 - disRowArrNew = WQL.getWO("ST_OUTIVT04") - .addParam("flag", "22") - .addParam("iostorinvdtl_id", iostorinvdtl_id) - .addParam("iostorinvdis_id", iostorinvdis_id) - .process().getResultJSONArray(0); - - option = "1"; - - } else if (StrUtil.equals(placement_type, "03")) { - // 右通 - JSONObject isNumMap = new JSONObject(); - // 查询仓位被锁住的货位 - isNumMap.put("flag", "6"); - isNumMap.put("block_num", jsonNoe.getString("block_num")); - isNumMap.put("row_num", jsonNoe.getString("row_num")); - isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); - JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); - - JSONArray numArr = this.isNum(isLockArr); - // 不为空则返回报错 - if (ObjectUtil.isNotEmpty(numArr)) { - String error = ""; - - for (int k = 0; k < numArr.size(); k++) { - JSONObject json = numArr.getJSONObject(k); - error += json.getString("struct_code") + ","; - } - - throw new BadRequestException("仓位:" + error + "被锁定请等待下发任务并等待任务完成!"); - } - - // 重新按照排序查询 - disRowArrNew = WQL.getWO("ST_OUTIVT04") - .addParam("flag", "2") - .addParam("iostorinvdtl_id", iostorinvdtl_id) - .addParam("iostorinvdis_id", iostorinvdis_id) - .process().getResultJSONArray(0); - - option = "2"; - } - - /* - * 循环生成任务 - */ - boolean canOut = false; - int j = 0; - JSONObject jsonObject = disRowArrNew.getJSONObject(j); - - // 查询未被锁住的仓位 - JSONArray moveArr = new JSONArray(); - JSONObject map = new JSONObject(); - map.put("block_num", jsonObject.getString("block_num")); - map.put("row_num", jsonObject.getString("row_num")); - map.put("out_order_seq", jsonObject.getString("out_order_seq")); - - if (StrUtil.equals(option, "1")) { - // 左边 - map.put("flag", "7"); - moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); - } else { - // 右边 - map.put("flag", "8"); - moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); - } - - // 创建任务组 - long task_group_id = IdUtil.getSnowflake(1, 1).nextId(); - - // 判断是否需要生成移库 - if (ObjectUtil.isNotEmpty(moveArr)) { - JSONObject moveParam = new JSONObject(); - moveParam.put("jsonAllBlockPoint", moveArr); - moveParam.put("iostorinvdis_id", jsonObject.getString("iostorinvdis_id")); - moveParam.put("task_group_id", task_group_id); - this.createMove(moveParam, null); - } - - // 判断是否是异常出库口 - if (checked) { - JSONObject jsonStartPoint = attrTab.query("struct_code = '" + jsonObject.getString("struct_code") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonStartPoint)) { - throw new BadRequestException("起始点位异常!"); - } - - String layer_num = jsonStartPoint.getString("layer_num"); - - switch (layer_num) { - case "1": - point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_1").getValue(); - break; - case "2": - point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_2").getValue(); - break; - case "3": - point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_3").getValue(); - break; - default: - throw new BadRequestException("起点楼层异常:" + jsonStartPoint.getString("struct_code")); - } - point_id = wo_Point.query("point_code = '" + point_code + "'").uniqueResult(0).getString("point_id"); - } - - // 创建任务 - JSONObject param = new JSONObject(); - param.put("task_type", "010503"); - param.put("vehicle_code", jsonObject.getString("box_no")); - param.put("task_name", ""); - param.put("point_code1", jsonObject.getString("struct_code")); - param.put("point_code2", point_code); - param.put("material_id", jsonObject.getString("material_id")); - param.put("task_group_id", ""); // 任务组 - param.put("sort_seq", ""); // 任务组顺序号 - - String create_task_id = outTask.createTask(param); - - // 更新分配状态、任务标识、出库点位 - JSONObject jsonTask = wo_Task.query("task_id = '" + create_task_id + "'").uniqueResult(0); - JSONObject jsonUpdateMap = new JSONObject(); - jsonUpdateMap.put("work_status", "01"); - jsonUpdateMap.put("task_id", jsonTask.getLong("task_id")); - jsonUpdateMap.put("point_id", point_id); - wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + jsonObject.getString("iostorinvdis_id") + "'"); - - // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ - JSONArray disArr = wo_dis.query("struct_id = '" + jsonObject.getString("struct_id") + - "' and iostorinv_id = '" + jsonObject.getString("iostorinv_id") + - "' and iostorinvdis_id <> '" + jsonObject.getString("iostorinvdis_id") + - "' and work_status = '00'").getResultJSONArray(0); - - // 依次更新相同仓位的分配明细状态、任务标识、出库点位 - for (int n = 0; n < disArr.size(); n++) { - JSONObject jsonObject2 = disArr.getJSONObject(n); - jsonObject2.put("work_status", "01"); - jsonObject2.put("task_id", jsonTask.getLong("task_id")); - jsonObject2.put("point_id", point_id); - wo_dis.update(jsonObject2); - } - - // 更新出库任务:任务组和顺序号 - JSONObject jsonTaskLast1 = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0); - jsonTask.put("task_group_id", task_group_id); - if (ObjectUtil.isEmpty(jsonTaskLast1)) { - jsonTask.put("sort_seq", 1); - } else { - jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq") + 1); - } - wo_Task.update(jsonTask); - - /* - * 判断下一个出库仓位是否相邻 - */ - int out_order_seq = jsonObject.getIntValue("out_order_seq"); - boolean canAdd = true; - int nextNum = j + 1; - while (canAdd) { - // 判断数组是否到头 - if (nextNum <= disRowArrNew.size() - 1) { - JSONObject jsonNext = disRowArrNew.getJSONObject(nextNum); - int out_order_seq_next = jsonNext.getIntValue("out_order_seq"); - if (Math.abs(out_order_seq_next - out_order_seq) != nextNum) { - // 下发当前任务组 - outTask.immediateNotifyAcs(null); - - // 更新任务组 - task_group_id = IdUtil.getSnowflake(1, 1).nextId(); - canAdd = false; - } else { - // 查询此任务组最后一个生成的任务 - JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0); - // 创建任务并添加到任务组 - JSONObject param2 = new JSONObject(); - param2.put("task_type", "010503"); - param2.put("vehicle_code", jsonNext.getString("box_no")); - param2.put("task_name", ""); - param2.put("point_code1", jsonNext.getString("struct_code")); - param2.put("point_code2", point_code); - param2.put("material_id", jsonNext.getString("material_id")); - param2.put("task_group_id", task_group_id); // 任务组 - param2.put("sort_seq", jsonTaskLast.getIntValue("sort_seq") + 1); // 任务组顺序号 - - String create_task_id2 = outTask.createTask(param2); - - // 更新分配状态、任务标识、出库点位 - JSONObject jsonTask2 = wo_Task.query("task_id = '" + create_task_id2 + "'").uniqueResult(0); - JSONObject jsonUpdateMap2 = new JSONObject(); - jsonUpdateMap2.put("work_status", "01"); - jsonUpdateMap2.put("task_id", jsonTask2.getLong("task_id")); - jsonUpdateMap2.put("point_id", point_id); - wo_dis.update(jsonUpdateMap2, "iostorinvdis_id = '" + jsonNext.getString("iostorinvdis_id") + "'"); - - // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ - JSONArray disArr2 = wo_dis.query("struct_id = '" + jsonNext.getString("struct_id") + - "' and iostorinv_id = '" + jsonNext.getString("iostorinv_id") + - "' and iostorinvdis_id <> '" + jsonNext.getString("iostorinvdis_id") + - "' and work_status = '00'").getResultJSONArray(0); - - // 依次更新相同仓位的分配明细状态、任务标识、出库点位 - for (int m = 0; m < disArr2.size(); m++) { - JSONObject jsonObject3 = disArr2.getJSONObject(m); - jsonObject3.put("work_status", "01"); - jsonObject3.put("task_id", jsonTask2.getLong("task_id")); - jsonObject3.put("point_id", point_id); - wo_dis.update(jsonObject3); - } - - nextNum++; + canAdd = false; + canOut = true; } - } else { - canAdd = false; - canOut = true; } - } - if (canOut) { - // 下发当前任务组 - outTask.immediateNotifyAcs(null); - disRowArrNew.clear(); + if (canOut) { + // 下发当前任务组 + outTask.immediateNotifyAcs(null); + disRowArrNew.clear(); - // 更新任务组 - task_group_id = IdUtil.getSnowflake(1, 1).nextId(); - } else { - } + // 更新任务组 + task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + } else { + } + return null; + }, new JSONArray()); } @Transactional(rollbackFor = Exception.class) diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue index 0b562af42..4c1801ede 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue @@ -601,29 +601,6 @@ export default { }) } }, - oneSetPoint() { - if (this.form2.point_code === '') { - this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO) - return - } - if (this.currentDis.point_code) { - this.crud.notify('站点已设置!', CRUD.NOTIFICATION_TYPE.INFO) - return - } - if (this.currentDis.work_status !== '00') { - this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO) - return - } - if (this.currentDis.iostorinvdis_id !== null) { - this.currentDis.point_code = this.form2.point_code - checkoutbill.oneSetPoint(this.currentDis).then(res => { - this.queryTableDdis(this.currentDis.iostorinvdtl_id) - this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO) - }).catch(() => { - this.currentDis.point_code = '' - }) - } - }, oneSetPoint2() { if (this.form2.point_code === '') { this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)