diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index a95b26b33..0c4918c28 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -213,50 +213,50 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } } //普通站点 - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - //废泊处理的时候要判断是否允许任务完成 - if (ObjectUtil.isNotEmpty(device.getExtraValue().get("finish_task")) - && StrUtil.equals("true", device.getExtraValue().get("finish_task").toString())) { - if (standardOrdinarySiteDeviceDriver.getOption() == 3) { - inst.setInstruction_status("2"); - try { - instructionService.finish(inst); - } catch (Exception e) { - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - } else { - log.info("等待LMS系统进行确认允许任务完成信号,设备号{},option值{}", standardOrdinarySiteDeviceDriver.getDevice_code(), standardOrdinarySiteDeviceDriver.getOption()); - logServer.deviceExecuteLog(device.getDevice_code(), "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) - .content("等待LMS系统进行确认允许任务完成信号,设备号" + standardOrdinarySiteDeviceDriver.getDevice_code() + ",option当前值" + standardOrdinarySiteDeviceDriver.getOption()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else { - inst.setInstruction_status("2"); - try { - instructionService.finish(inst); - } catch (Exception e) { - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - - } - } else { - - inst.setInstruction_status("2"); - try { - instructionService.finish(inst); - } catch (Exception e) { - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); +// StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; +// if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { +// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); +// //废泊处理的时候要判断是否允许任务完成 +// if (ObjectUtil.isNotEmpty(device.getExtraValue().get("finish_task")) +// && StrUtil.equals("true", device.getExtraValue().get("finish_task").toString())) { +// if (standardOrdinarySiteDeviceDriver.getOption() == 3) { +// inst.setInstruction_status("2"); +// try { +// instructionService.finish(inst); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); +// } else { +// log.info("等待LMS系统进行确认允许任务完成信号,设备号{},option值{}", standardOrdinarySiteDeviceDriver.getDevice_code(), standardOrdinarySiteDeviceDriver.getOption()); +// logServer.deviceExecuteLog(device.getDevice_code(), "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) +// .content("等待LMS系统进行确认允许任务完成信号,设备号" + standardOrdinarySiteDeviceDriver.getDevice_code() + ",option当前值" + standardOrdinarySiteDeviceDriver.getOption()) +// .build(); +// logDto.setLog_level(4); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// } +// } else { +// inst.setInstruction_status("2"); +// try { +// instructionService.finish(inst); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); +// +// } +// } else { +// +// } + inst.setInstruction_status("2"); + try { + instructionService.finish(inst); + } catch (Exception e) { + e.printStackTrace(); } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } } //请求删除任务 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 3a3db465b..2b13d0b48 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -1019,7 +1019,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic RollUpRollerManipulatorDeviceDriver rollUpRollerManipulatorDeviceDriver; if (linkDevice.getDeviceDriver() instanceof RollUpRollerManipulatorDeviceDriver) { rollUpRollerManipulatorDeviceDriver = (RollUpRollerManipulatorDeviceDriver) linkDevice.getDeviceDriver(); - if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1 && rollUpRollerManipulatorDeviceDriver.getMode() != 3)) { + if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1 && rollUpRollerManipulatorDeviceDriver.getMode() != 3)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(this.getDeviceCode()) @@ -1038,8 +1038,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } - }else { - if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1 )) { + } else { + if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(this.getDeviceCode()) @@ -1510,34 +1510,53 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - //申请烘箱行架任务 if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task")) && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) { - if (manipulatorAgvStationDeviceDriver.getTo_command() != 4) { + if (manipulatorAgvStationDeviceDriver.getTo_command() != 4 && !manipulatorAgvStationDeviceDriver.getOvenGantryTask()) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); String task_code = inst.getTask_code(); JSONObject jsonObject = new JSONObject(); jsonObject.put("task_code", task_code); - acsToWmsService.applyOvenGantryTask(jsonObject); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请烘箱行架任务,参数:" + jsonObject) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String response = acsToWmsService.applyOvenGantryTask(jsonObject); + JSONObject jo = JSON.parseObject(response); + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请烘箱行架任务,参数,接口返回:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + if (jo.getInteger("status") == 200) { + manipulatorAgvStationDeviceDriver.setOvenGantryTask(true); + manipulatorAgvStationDeviceDriver.writing(4); + + } } //行架取货完成后反馈ndc - if ((manipulatorAgvStationDeviceDriver.getAction() == 4)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(manipulatorAgvStationDeviceDriver.getDeviceCode()) - .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } +// if ((manipulatorAgvStationDeviceDriver.getAction() == 4)) { +// +// manipulatorAgvStationDeviceDriver.setOvenGantryTask(false); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(this.getDeviceCode()) +// .content("agvphase:" + phase + "反馈:" + data) +// .build(); +// logDto.setLog_level(4); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// } else { +// log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(manipulatorAgvStationDeviceDriver.getDeviceCode()) +// .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") +// .build(); +// logDto.setLog_level(4); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// } } else { // try { // manipulatorAgvStationDeviceDriver.writing(4); @@ -1800,6 +1819,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + manipulatorAgvStationDeviceDriver.setOvenGantryTask(true); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) @@ -2014,52 +2034,33 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - //申请烘箱行架任务 - if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task")) - && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) { - String task_code = inst.getTask_code(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("task_code", task_code); - String response = acsToWmsService.applyOvenGantryTask(jsonObject); - JSONObject jo = JSON.parseObject(response); - if (jo.getInteger("status") == 200) { - log.info("申请烘箱行架任务成功返回参数:" + jo); - try { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - } catch (Exception e) { - e.printStackTrace(); - } - } else { - log.info("申请烘箱行架任务失败返回参数:" + jo); - } - manipulatorAgvStationDeviceDriver.writing(4); - } else { - try { - manipulatorAgvStationDeviceDriver.writing(4); - } catch (Exception e) { - e.printStackTrace(); - } - //收卷辊放货忽略取货校验 - if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check")) - && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); } + //收卷辊放货忽略取货校验 + if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check")) + && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + + } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { 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 c7d5e0b99..407e5a2af 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 @@ -79,7 +79,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple public int action = 0; public int error = 0; public int door = 0; - public int temperature = 0; + public float temperature = 0; public int to_temperature = 0; public int countdown_house = 0; public int countdown_min = 0; @@ -102,7 +102,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple public int last_action = 0; public int last_error = 0; public int last_door = 0; - public int last_temperature = 0; + public float last_temperature = 0; public int last_countdown_house = 0; public int last_countdown_min = 0; public int last_countdown_sec = 0; @@ -153,7 +153,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple countdown_min = this.itemProtocol.getItem_countdown_min(); countdown_sec = this.itemProtocol.getItem_countdown_sec(); finish = this.itemProtocol.getItem_finish(); - task = this.itemProtocol.getItem_task(); error1 = this.itemProtocol.getItem_error1(); consumption = this.itemProtocol.getItem_consumption(); voltageA = this.itemProtocol.getItem_voltageA(); @@ -272,7 +271,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple public void writing(int command) { String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; + + "." ; //String opcservcerid = this.getDevice().getOpc_server_id(); //Server server = ReadUtil.getServer(opcservcerid); Map itemMap = new HashMap(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java index e210b4e46..3542c0ca3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java @@ -25,7 +25,6 @@ public class ItemProtocol { public static String item_countdown_sec = "countdown_sec"; public static String item_finish = "finish"; - public static String item_task = "task"; public static String item_error1 = "error1"; public static String item_consumption = "consumption"; public static String item_voltageA = "voltageA"; @@ -34,9 +33,6 @@ public class ItemProtocol { public static String item_currentA = "currentA"; public static String item_currentB = "currentB"; public static String item_currentC = "currentC"; - - - public static String item_to_command = "to_command"; public static String item_to_open_door = "to_open_door"; public static String item_to_close_door = "to_close_door"; public static String item_to_temperature = "to_temperature"; @@ -44,7 +40,6 @@ public class ItemProtocol { public static String item_to_time_min = "to_time_min"; public static String item_to_time_sec = "to_time_sec"; - public static String item_to_task = "to_task"; private HongXiangConveyorDeviceDriver driver; @@ -71,8 +66,9 @@ public class ItemProtocol { public int getItem_door(){ return this.getOpcIntegerValue(item_door); } ; - public int getItem_temperature(){ - return this.getOpcIntegerValue(item_temperature); + + public float getItem_temperature(){ + return this.getOpcFloatValue(item_temperature); } ; public int getItem_countdown_house(){ return this.getOpcIntegerValue(item_countdown_house); @@ -86,9 +82,6 @@ public class ItemProtocol { public int getItem_finish(){ return this.getOpcIntegerValue(item_finish); } ; - public int getItem_task(){ - return this.getOpcIntegerValue(item_task); - } ; public int getItem_error1(){ return this.getOpcIntegerValue(item_error1); } ; @@ -150,40 +143,39 @@ public class ItemProtocol { } + + public static List getReadableItemDtos() { ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB118.B251")); - list.add(new ItemDto(item_mode, "工作模式", "DB118.B7990")); - list.add(new ItemDto(item_move, "光电信号", "DB118.B550")); - list.add(new ItemDto(item_door, "门状态", "DB118.B450")); - list.add(new ItemDto(item_temperature, "工位温度", "DB118.B7991")); - list.add(new ItemDto(item_countdown_house, "恒温倒计时(时)", "DB118.B80500")); - list.add(new ItemDto(item_countdown_min, "恒温倒计时(分)", "DB118.B80502")); - list.add(new ItemDto(item_countdown_sec, "恒温倒计时(秒)", "DB118.B80504")); - list.add(new ItemDto(item_finish, "烘干完成", "DB118.B8025")); - list.add(new ItemDto(item_action, "取放信号", "DB118.B450")); - list.add(new ItemDto(item_task, "任务号", "DB118.B220")); - list.add(new ItemDto(item_error, "故障", "DB118.B8055")); - list.add(new ItemDto(item_error1, "故障1", "DB118.B216")); - list.add(new ItemDto(item_consumption, "电能耗", "DB118.B8092")); - list.add(new ItemDto(item_voltageA, "A相电压", "DB118.B8080")); - list.add(new ItemDto(item_voltageB, "B相电压", "DB118.B8082")); - list.add(new ItemDto(item_voltageC, "C相电压", "DB118.B8084")); - list.add(new ItemDto(item_currentA, "A相电流", "DB118.B8086")); - list.add(new ItemDto(item_currentB, "B相电流", "DB118.B8088")); - list.add(new ItemDto(item_currentC, "C相电流", "DB118.B8090")); + list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W0")); + list.add(new ItemDto(item_mode, "工作模式", "DB1.W2")); + list.add(new ItemDto(item_move, "光电信号", "DB1.W4")); + list.add(new ItemDto(item_door, "门状态", "DB1.W18")); + list.add(new ItemDto(item_temperature, "工位温度", "DB1.REAL20")); + list.add(new ItemDto(item_countdown_house, "恒温倒计时(时)", "DB1.W24")); + list.add(new ItemDto(item_countdown_min, "恒温倒计时(分)", "DB1.W26")); + list.add(new ItemDto(item_countdown_sec, "恒温倒计时(秒)", "DB1.W28")); + list.add(new ItemDto(item_finish, "烘干完成", "DB1.W66")); + list.add(new ItemDto(item_action, "取放信号", "DB1.W80")); + list.add(new ItemDto(item_error, "故障", "DB1.W94")); + list.add(new ItemDto(item_error1, "故障1", "DB1.W96")); + list.add(new ItemDto(item_consumption, "电能耗", "DB1.REAL110")); + list.add(new ItemDto(item_voltageA, "A相电压", "DB1.REAL114")); + list.add(new ItemDto(item_voltageB, "B相电压", "DB1.REAL118")); + list.add(new ItemDto(item_voltageC, "C相电压", "DB1.REAL122")); + list.add(new ItemDto(item_currentA, "A相电流", "DB1.REAL126")); + list.add(new ItemDto(item_currentB, "B相电流", "DB1.REAL130")); + list.add(new ItemDto(item_currentC, "C相电流", "DB1.REAL134")); return list; } public static List getWriteableItemDtos() { ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "下发命令", "DB118.B40226")); - list.add(new ItemDto(item_to_open_door, "开门", "DB118.B00111")); - list.add(new ItemDto(item_to_close_door, "关门", "DB118.B00112")); - list.add(new ItemDto(item_to_temperature, "生产温度", "DB118.B48100")); - list.add(new ItemDto(item_to_time_house, "生产时间(时)", "DB118.B48771")); - list.add(new ItemDto(item_to_time_min, "生产时间(分)", "DB118.B48770")); - list.add(new ItemDto(item_to_task, "任务号", "DB118.B40232")); + list.add(new ItemDto(item_to_open_door, "开门", "DB1.W138")); + list.add(new ItemDto(item_to_close_door, "关门", "DB1.W140")); + list.add(new ItemDto(item_to_temperature, "生产温度", "DB1.W142")); + list.add(new ItemDto(item_to_time_house, "生产时间(时)", "DB1.W144")); + list.add(new ItemDto(item_to_time_min, "生产时间(分)", "DB1.W146")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java index 9fade47c3..509391dc3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java @@ -90,6 +90,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i Boolean iserror = false; + Boolean ovenGantryTask = false; + + + //光电信号 int move = 0; int last_move = 0; 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 827aae606..bef097e66 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 @@ -356,18 +356,15 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } - - if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); - if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1 ) { + if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) { notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货或者未开门,无法下发指令!指令号:" + instruction.getInstruction_code(); return false; } } - Device startDevice = deviceAppService.findDeviceByCode(start_device_code); Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { @@ -376,8 +373,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - String start_addr = startDevice.getExtraValue().get("address").toString(); - String next_addr = nextDevice.getExtraValue().get("address").toString(); + String start_addr = startDevice.getAddress(); + String next_addr = nextDevice.getAddress(); String msg = "当前设备:" + device_code + ",下发指令:" + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() + ",指令终点:" + instruction.getNext_device_code(); @@ -435,16 +432,16 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); - if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) { - notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "光电无货,无法生成指令!"; + if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0 || hongXiangConveyorDeviceDriver.getError() != 0 || hongXiangConveyorDeviceDriver.getError1() != 0) { + notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "光电无货,无法生成指令!" + hongXiangConveyorDeviceDriver.getError() + "异常" + + hongXiangConveyorDeviceDriver.getError1() + "异常,无法生成指令!"; return false; } } if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); - if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) { - notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "光电有货,无法生成指令!"; + if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1 || hongXiangConveyorDeviceDriver.getError() != 0 || hongXiangConveyorDeviceDriver.getError1() != 0) { + notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "光电有货,无法生成指令!" + hongXiangConveyorDeviceDriver.getError() + "异常" + + hongXiangConveyorDeviceDriver.getError1() + "异常,无法生成指令!"; return false; } } @@ -519,8 +516,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i luceneExecuteLogService.deviceExecuteLog(logDto); throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - String start_addr = startDevice.getExtraValue().get("address").toString(); - String next_addr = nextDevice.getExtraValue().get("address").toString(); + String start_addr = startDevice.getAddress(); + String next_addr = nextDevice.getAddress(); if (ObjectUtil.isEmpty(start_addr) || ObjectUtil.isEmpty(next_addr)) { throw new BadRequestException("设备:" + startDevice.getDevice_code() + "或设备:" + nextDevice.getDevice_code() + "地址值!"); } @@ -564,12 +561,14 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i private void toOpenDoor(Device nextdevice) { HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); + hongXiangConveyorDeviceDriver.writing("to_close_door", "0"); hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); } private void toCloseDoor(Device nextdevice) { HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); + hongXiangConveyorDeviceDriver.writing("to_open_door", "0"); hongXiangConveyorDeviceDriver.writing("to_close_door", "1"); } @@ -747,7 +746,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); // EXECUTOR.execute(() -> { - toOpenDoor(device); + toOpenDoor(device); // }); int mode = hongXiangConveyorDeviceDriver.getMode(); int door = hongXiangConveyorDeviceDriver.getDoor(); @@ -804,7 +803,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } //取货完成关闭烘箱门 - if (mode == 3 && action == 2 && move == 1 && task > 0) { + if (mode == 3 && action == 2 && move == 1 && task > 0 && walk_y == 1) { Instruction inst2 = checkInst(); if (ObjectUtil.isNotEmpty(inst2)) { String start_device_code = inst2.getStart_device_code(); @@ -813,7 +812,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); // EXECUTOR.execute(() -> { - toCloseDoor(device); + toCloseDoor(device); // }); int mode = hongXiangConveyorDeviceDriver.getMode(); int door = hongXiangConveyorDeviceDriver.getDoor(); @@ -821,7 +820,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int error1 = hongXiangConveyorDeviceDriver.getError1(); int error = hongXiangConveyorDeviceDriver.getError(); int move = hongXiangConveyorDeviceDriver.getMove(); - if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 0) { + if (mode == 1 && door == 2 && error == 0 && error1 == 0 && move == 0) { map.put("code", "to_command"); map.put("value", "3"); list.add(map); @@ -879,7 +878,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver(); // EXECUTOR.submit(() -> { - toOpenDoor(nextDevice); + toOpenDoor(nextDevice); // }); int mode = hongXiangConveyorDeviceDriver.getMode(); int door = hongXiangConveyorDeviceDriver.getDoor(); @@ -935,7 +934,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } //放货完成 - if (mode == 3 && action == 4 && move == 0 && task > 0) { + if (mode == 3 && action == 4 && move == 0 && task > 0 && walk_y == 1) { Instruction inst2 = checkInst(); if (inst2 != null) { if (StrUtil.equals(inst2.getInstruction_status(), "1")) { @@ -949,7 +948,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver(); // EXECUTOR.execute(() -> { - toCloseDoor(nextDevice); + toCloseDoor(nextDevice); // }); if (StrUtil.isNotEmpty(taskDto.getOven_time())) { //下发烘箱时间 @@ -966,7 +965,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int error1 = hongXiangConveyorDeviceDriver.getError1(); int error = hongXiangConveyorDeviceDriver.getError(); int move = hongXiangConveyorDeviceDriver.getMove(); - if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 1) { + if (mode == 1 && door == 2 && error == 0 && error1 == 0 && move == 1) { map.put("code", "to_command"); map.put("value", "5"); list.add(map); @@ -1031,8 +1030,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i // } // } // - } } + } } else { feedMessage = "行架机械手:"; if (mode != 3) { @@ -1048,8 +1047,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; } } - } } + } public synchronized boolean finish_instruction(Instruction inst) throws Exception { instructionService.finish(inst); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/roll_up_roller_manipulator/RollUpRollerManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/roll_up_roller_manipulator/RollUpRollerManipulatorDeviceDriver.java index c86c015dc..95167b554 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/roll_up_roller_manipulator/RollUpRollerManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/roll_up_roller_manipulator/RollUpRollerManipulatorDeviceDriver.java @@ -347,13 +347,14 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver luceneExecuteLogService.deviceExecuteLog(logDto); String response = acsToWmsService.secondaryAllocationPoint(param); JSONObject jo = JSON.parseObject(response); + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("管芯库满入或空出请求lms,参数,接口返回:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); if (jo.getInteger("status") == 200) { - LuceneLogDto logDto2 = LuceneLogDto.builder() - .device_code(device_code) - .content("管芯库满入或空出请求lms,参数,接口返回:" + jo) - .build(); - logDto2.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto2); + List list = new ArrayList(); if (error == 2) { Map map1 = new HashMap<>(); @@ -379,12 +380,12 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver } this.actionRequireSucess = true; } else { - LuceneLogDto logDto2 = LuceneLogDto.builder() + LuceneLogDto logDto3 = LuceneLogDto.builder() .device_code(device_code) .content("管芯库满入或空出请求lms,返回参数:" + jo) .build(); - logDto2.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto2); + logDto3.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto3); List list = new ArrayList(); Map map1 = new HashMap<>(); map1.put("code", "to_command"); @@ -502,7 +503,6 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver } - if (nextDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (ObjectUtil.isEmpty(next_addr)) { notCreateInstMessage = "未设置电气调度号!"; @@ -511,7 +511,7 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver } if (nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) nextDevice.getDeviceDriver(); - if ( manipulatorAgvStationDeviceDriver.getMove() != 0) { + if (manipulatorAgvStationDeviceDriver.getMove() != 0) { notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + manipulatorAgvStationDeviceDriver.getMove() + "有货,无法下发指令!任务号:" + instruction.getInstruction_code(); return false; } @@ -575,7 +575,7 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver notCreateInstMessage = "未设置电气调度号!"; throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - if ( manipulatorAgvStationDeviceDriver.getMove() != 0) { + if (manipulatorAgvStationDeviceDriver.getMove() != 0) { notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + manipulatorAgvStationDeviceDriver.getMove() + "有货,无法下发指令!任务号:" + taskDto.getTask_code(); return false; } @@ -627,7 +627,6 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver } - private void packageData(Instruction instdto, String route_plan_code, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String start_device_code2, String next_device_code2) { instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(route_plan_code); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index dd98d5e66..3edc54797 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -830,7 +830,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { //温度需要除以10 jo.put("temperature", hongXiangConveyorDeviceDriver.getTo_temperature() / 10); jo.put("now_temperature", hongXiangConveyorDeviceDriver.getTemperature() / 10); - jo.put("door", hongXiangConveyorDeviceDriver.getDoor()); jo.put("finish", hongXiangConveyorDeviceDriver.getFinish()); jo.put("task", hongXiangConveyorDeviceDriver.getTask()); diff --git a/acs2/nladmin-ui/public/config.js b/acs2/nladmin-ui/public/config.js index c46539a79..484ae77d0 100644 --- a/acs2/nladmin-ui/public/config.js +++ b/acs2/nladmin-ui/public/config.js @@ -1,6 +1,6 @@ window.g = { dev: { - VUE_APP_BASE_API: 'http://127.0.0.1:8012' + VUE_APP_BASE_API: 'http://127.0.0.1:8019' }, prod: { VUE_APP_BASE_API: 'http://192.168.20.11:8011' diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java index 69f16bce5..24cf99450 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java @@ -64,10 +64,11 @@ public class BakingPdaServiceImpl implements BakingPdaService { String pointCode = param.getString("point_code"); Assert.notBlank(pointCode, "点位不能为空!"); SchBasePoint hotZcPoint = pointService.getById(pointCode); + if (ObjectUtil.isEmpty(hotZcPoint)) { throw new BadRequestException("点位 [" + pointCode + "] 不存在!"); } - PdmBiRawfoilworkorder rawOrder = rawfoilworkorderService.getById(hotZcPoint.getSource_id()); + PdmBiRawfoilworkorder rawOrder = rawfoilworkorderService.getByContainerName(hotZcPoint.getMaterial_code()); if (ObjectUtil.isEmpty(rawOrder)) { throw new BadRequestException("点位 [" + pointCode + "] 对应的生箔工单不存在!"); } diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/IstIvtHotpointivtService.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/IstIvtHotpointivtService.java index 44668cc5e..6db7bade1 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/IstIvtHotpointivtService.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/IstIvtHotpointivtService.java @@ -6,6 +6,7 @@ import org.nl.common.domain.query.PageQuery; import org.nl.wms.pdm.ivt.hot.service.dao.StIvtHotpointivt; import com.baomidou.mybatisplus.extension.service.IService; import org.nl.wms.pdm.ivt.hot.service.dao.dto.StIvtHotpointivtParam; +import org.nl.wms.quartz.dto.HotDeviceAndEreaDto; import java.util.List; import java.util.Map; @@ -74,7 +75,7 @@ public interface IstIvtHotpointivtService extends IService { * @param productArea / * @return / */ - JSONArray getHotDeviceInfoForAcs(String productArea); + List getHotDeviceInfoForAcs(String productArea); /** * 根据点位编码获取烘箱点位 diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.java index be969dd6f..609bd6fd4 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.java @@ -3,6 +3,7 @@ package org.nl.wms.pdm.ivt.hot.service.dao.mapper; import com.alibaba.fastjson.JSONArray; import org.nl.wms.pdm.ivt.hot.service.dao.StIvtHotpointivt; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.quartz.dto.HotDeviceAndEreaDto; import java.util.List; @@ -17,7 +18,7 @@ public interface StIvtHotpointivtMapper extends BaseMapper { List getNotTaskHotOven(String rollType, String used); - JSONArray getHotDeviceInfoForAcs(String productArea); + List getHotDeviceInfoForAcs(String productArea); List getNeedBakingPoint(); diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.xml b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.xml index 3864b94ce..bd8d96830 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.xml +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/dao/mapper/StIvtHotpointivtMapper.xml @@ -26,7 +26,7 @@ AND ht3.point_status = '01' AND t2.task_status '07') - SELECT point_code AS device_code, product_area FROM st_ivt_hotpointivt ivt diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java index 5d30a22bd..5386471a8 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java @@ -14,6 +14,7 @@ import org.nl.wms.pdm.ivt.hot.service.IstIvtHotpointivtService; import org.nl.wms.pdm.ivt.hot.service.dao.StIvtHotpointivt; import org.nl.wms.pdm.ivt.hot.service.dao.dto.StIvtHotpointivtParam; import org.nl.wms.pdm.ivt.hot.service.dao.mapper.StIvtHotpointivtMapper; +import org.nl.wms.quartz.dto.HotDeviceAndEreaDto; import org.nl.wms.storage_manage.ios.enums.IOSEnum; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -130,7 +131,7 @@ public class StIvtHotpointivtServiceImpl extends ServiceImpl getHotDeviceInfoForAcs(String productArea) { return stIvtHotpointivtMapper.getHotDeviceInfoForAcs(productArea); } diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/quartz/AutoQueryDeviceStatus.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/quartz/AutoQueryDeviceStatus.java index f65935d3c..da7cc9534 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/quartz/AutoQueryDeviceStatus.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/quartz/AutoQueryDeviceStatus.java @@ -1,6 +1,7 @@ package org.nl.wms.quartz; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.SneakyThrows; @@ -8,10 +9,14 @@ import lombok.extern.slf4j.Slf4j; import org.nl.common.utils.RedisUtils; import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.pdm.ivt.hot.service.IstIvtHotpointivtService; +import org.nl.wms.quartz.dto.HotDeviceAndEreaDto; import org.nl.wms.util.URLEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.Collections; +import java.util.List; + /** * 自动查询烘箱温度 * @Author: lyd @@ -34,11 +39,12 @@ public class AutoQueryDeviceStatus { String product_area = url.getProduct_area(); //通过ACS接口获取温度 // 查找设备号和区域 - JSONArray device_rows = hotpointivtService.getHotDeviceInfoForAcs(product_area); + List device_rows = hotpointivtService.getHotDeviceInfoForAcs(product_area); if (device_rows.size() == 0) { continue; } - JSONObject jo = wmsToAcsService.getHotPointStatus(device_rows); + JSONArray array= JSONArray.parseArray(JSON.toJSONString(device_rows)); + JSONObject jo = wmsToAcsService.getHotPointStatus(array); JSONArray de_rows = jo.getJSONArray("data"); for (int i = 0; i < de_rows.size(); i++) { JSONObject row = de_rows.getJSONObject(i); diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/quartz/dto/HotDeviceAndEreaDto.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/quartz/dto/HotDeviceAndEreaDto.java new file mode 100644 index 000000000..8b27f4965 --- /dev/null +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/quartz/dto/HotDeviceAndEreaDto.java @@ -0,0 +1,15 @@ +package org.nl.wms.quartz.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class HotDeviceAndEreaDto { + private String device_code; + private String product_area; +}