diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java b/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java index 77cbff7f5..c86cdd28e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java @@ -56,4 +56,7 @@ public interface AcsConfig { String MAXSENDTASKTIME = "maxSendTaskTime"; //指令下发立库 String INSTSENDLK = "instSendLk"; + //是否允许下发 + String ISALLOWTASK= "is_allow_task"; + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index dd51383a9..26f3d5dbb 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -79,6 +79,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int task = 0; int last_task = 0; + int heartbeat = 0; + int last_heartbeat = 0; + Boolean isonline = true; int hasGoods = 0; @@ -126,6 +129,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i walk_y = this.itemProtocol.getWalk_y(); error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); + heartbeat = this.itemProtocol.getHeartbeat(); + if(heartbeat != last_heartbeat){ + logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat); + } if (mode != last_mode) { if (mode == 2) { logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess:" + requireSucess); @@ -171,17 +178,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i inst1.setInstruction_status("1"); inst1.setExecute_device_code(this.device_code); instructionService.update(inst1); -// TaskDto tas未反馈电气信号原因kDto = taskserver.findByCodeFromCache(inst1.getTask_code()); -// if (ObjectUtil.isNotEmpty(taskDto)) { -// if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) { -// JSONArray array = new JSONArray(); -// JSONObject map = new JSONObject(); -// map.put("task_id", taskDto.getExt_task_id()); -// map.put("task_status", "1"); -// array.add(map); -// acsToWmsService.feedbackTaskStatusToWms(array); -// } -// } } } } @@ -428,7 +424,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } catch (Exception var17) { var17.printStackTrace(); feedMessage = var17.getMessage(); - logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage()); + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage()+ ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol) ); + } // if (!this.itemProtocol.getIsonline()) { @@ -488,6 +485,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i last_walk_y = walk_y; last_error = error; last_task = task; + last_heartbeat = heartbeat; } @@ -592,6 +590,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i this.writing("to_target", next_addr); this.writing("to_task", instruction.getInstruction_code()); this.writing("to_command", "1"); + if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); + hongXiangConveyorDeviceDriver.writing("to_open_door","1"); + } if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); hongXiangConveyorDeviceDriver.writing("to_open_door","1"); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index 5e6707160..de987c5cc 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -122,7 +122,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme int branchProtocol = 0; String inst_message; String last_inst_message; - + int heartbeat = 0; + int last_heartbeat = 0; //当前指令 //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 @@ -149,6 +150,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); to_command = this.itemProtocol.getTo_command(); + heartbeat = this.itemProtocol.getHeartbeat(); + if(heartbeat != last_heartbeat){ + logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat); + } if (mode != last_mode) { if (mode == 2) { requireSucess = false; @@ -227,8 +232,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } catch (Exception var17) { var17.printStackTrace(); - inst_message = var17.getMessage(); - logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage()); + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage()+ ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol) ); } if("true".equals(this.device.getExtraValue().get("ship_device_update"))){ @@ -313,6 +317,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme last_carrier_direction = carrier_direction; last_error = error; last_task = task; + last_heartbeat = heartbeat; } private void shipDeviceUpdate() { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java index 508456c35..33c9e544e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java @@ -88,7 +88,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl int last_task = 0; int agvphase = 0; String task_code = null; - + int heartbeat = 0; + int last_heartbeat = 0; int phase = 0; int index = 0; Boolean isonline = true; @@ -142,6 +143,10 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl carrier_direction = this.itemProtocol.getCarrier_direction(); error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); + heartbeat = this.itemProtocol.getHeartbeat(); + if(heartbeat != last_heartbeat){ + logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat); + } if (mode != last_mode) { if (mode == 2) { requireSucess = false; @@ -262,6 +267,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl last_carrier_direction = carrier_direction; last_error = error; last_task = task; + last_heartbeat = heartbeat; } private void shipDeviceUpdate() { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java index 82c1f5c56..f44486b82 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java @@ -69,7 +69,8 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver @Autowired NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); // 当前指令 Instruction inst = null; - + int heartbeat = 0; + int last_heartbeat = 0; // 工作模式 int mode = 0; int last_mode = 0; @@ -139,6 +140,10 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); weight = this.itemProtocol.getWeight(); + heartbeat = this.itemProtocol.getHeartbeat(); + if(heartbeat != last_heartbeat){ + logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat); + } if (mode != last_mode) { if (mode == 2) { requireSucess = false; @@ -281,6 +286,8 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver last_carrier_direction = carrier_direction; last_error = error; last_task = task; + last_heartbeat = heartbeat; + } public boolean exe_error() { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java index d1d521baf..91b62d7d6 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java @@ -70,7 +70,8 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); //当前指令 Instruction inst = null; - + int heartbeat = 0; + int last_heartbeat = 0; //工作模式 int mode = 0; int last_mode = 0; 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 41f65f969..06ab59266 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 @@ -104,6 +104,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl int branchProtocol = 0; + int heartbeat = 0; + int last_heartbeat = 0; + //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 int flag; @@ -158,7 +161,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl task2 = this.itemProtocol.getTask2(); to_command1 = this.itemProtocol.getTo_command1(); to_command2 = this.itemProtocol.getTo_command2(); - + heartbeat = this.itemProtocol.getHeartbeat(); + if(heartbeat != last_heartbeat){ + logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat); + } if (mode != last_mode) { if (mode == 2) { logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为:" + requireSucess); @@ -626,12 +632,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } } - - - } catch (Exception var17) { - var17.printStackTrace(); - feedMessage = var17.getMessage(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + feedMessage = e.getMessage(); + System.out.println("11111111:"+e.getMessage()); + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + e.getMessage()+ ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol) ); } if (mode == 0) { @@ -724,6 +729,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl last_type = type; last_task1 = task1; last_task2 = task2; + last_heartbeat = heartbeat; } //关联设备异常申请任务 diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/ItemProtocol.java index 99ec030a5..f8b5abf12 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/ItemProtocol.java @@ -87,6 +87,9 @@ public class ItemProtocol { return this.getOpcStringValue(item_barcode); } + public int getTotTask() { + return this.getOpcIntegerValue(item_to_task); + } Boolean isonline; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java index feb06818a..0ecc3fc51 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java @@ -84,6 +84,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe int action = 0; int error = 0; int task = 0; + int to_task = 0; String plcbarcode = null; String last_plcbarcode = null; int plcbarcode_length = 0; @@ -193,7 +194,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe task = this.itemProtocol.getTask(); plcbarcode = this.itemProtocol.getplcBarCode(); plcbarcode_length = this.itemProtocol.getBarCode_length(); - + to_task = this.itemProtocol.getTotTask(); if (mode != last_mode) { logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode +"复位请求标记"); if(mode == 2){ @@ -549,10 +550,44 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe //需要判断指令中的指令 再次请求不能生成 if (!ObjectUtils.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code(),"1"))) { { - logServer.deviceExecuteLog(this.device_code, "", "", "申请任务时该载具号" + container_code - + "已存在对应任务"); - requireSucess = true; - applySucess = true; + Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code(),"1"); + if(to_task != Integer.parseInt(instdto.getInstruction_code())){ + List list = new ArrayList(); + Map map = new HashMap(); + if (StrUtil.isNotEmpty(taskdto.getTo_z())) { + if (StrUtil.equals(taskdto.getTo_z(), "01")) { + map.put("code", "to_target"); + map.put("value", "102"); + } else if (StrUtil.equals(taskdto.getTo_z(), "02")) { + map.put("code", "to_target"); + map.put("value", "201"); + } else if (StrUtil.equals(taskdto.getTo_z(), "03")) { + map.put("code", "to_target"); + map.put("value", "301"); + } + } + list.add(map); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", instdto.getInstruction_code()); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "1"); + list.add(map3); + this.writing(list); + message = "下发电气任务号成功"; + requireSucess = true; + applySucess = true; + return true; + } else { + logServer.deviceExecuteLog(this.device_code, "", "", "申请任务时该载具号" + container_code + + "已存在对应任务"); + requireSucess = true; + applySucess = true; + return true; + } + } } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 355fc01f4..3b055e6e7 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -472,7 +472,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { log.info("crateTask-----输入参数{}", param); JSONArray datas = JSONArray.parseArray(param); CreateTaskResponse response = new CreateTaskResponse(); + ParamService paramService = SpringContextHolder.getBean(ParamService.class); + String cancelTaskCheck = paramService.findByCode(AcsConfig.ISALLOWTASK).getValue(); JSONArray errArr = new JSONArray(); + if(StrUtil.equals(cancelTaskCheck,"0")){ + response.setStatus(400); + response.setMessage("ACS系统需要更新,请稍等"); + response.setErrArr(datas); + return response; + } for (int i = 0; i < datas.size(); i++) { String data = datas.get(i).toString(); CreateTaskRequest request = JsonUtl.format(data, CreateTaskRequest.class); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index c93ae2124..b569116fd 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -189,9 +189,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu JSONObject ins = new JSONObject(); ins.put("task_id", jo.get("instruction_id")); ins.put("task_code", jo.get("instruction_code")); + ins.put("task_type", jo.get("instruction_type")); ins.put("task_status", jo.get("instruction_status")); ins.put("start_point_code", jo.get("start_point_code")); + ins.put("start_point_code2", jo.get("start_point_code2")); ins.put("next_point_code", jo.get("next_point_code")); + ins.put("next_point_code2", jo.get("next_point_code2")); ins.put("matarial", jo.get("matarial")); ins.put("remark", jo.get("remark")); ins.put("create_by", jo.get("create_by")); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/wql/QINST_QUERY.wql b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/wql/QINST_QUERY.wql index 4b39fdfa5..9b7b0bae7 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/wql/QINST_QUERY.wql +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/wql/QINST_QUERY.wql @@ -81,6 +81,10 @@ inst.start_point_code LIKE CONCAT ( '%', 输入.point_code, '%' ) OR inst.next_point_code LIKE CONCAT ( '%', 输入.point_code, '%' ) + OR + inst.start_point_code2 LIKE CONCAT ( '%', 输入.point_code, '%' ) + OR + inst.next_point_code2 LIKE CONCAT ( '%', 输入.point_code, '%' ) ) ENDOPTION OPTION 输入.instruction_type <> "" diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index 8a01bb1ef..531f767cf 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -121,6 +121,7 @@ public class DeviceOpcProtocolRunable implements Runnable { itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0])); } catch (Exception e){ System.out.println("数据同步异常:"+ this.getOpcServer().getOpc_code()); + log.trace("数据同步异常:{}", this.getOpcServer().getOpc_code()); //e.printStackTrace(); } long end = System.currentTimeMillis(); @@ -130,7 +131,7 @@ public class DeviceOpcProtocolRunable implements Runnable { System.out.println("线程:"+tag + " 读取耗时:"+ duration); if (duration > 1000L) { if (!time_out) { - log.warn("{} 读取超时 : {}", tag, duration); + log.warn(" {} 读取超时 : {}", tag, duration); } time_out = true; @@ -138,7 +139,11 @@ public class DeviceOpcProtocolRunable implements Runnable { time_out = false; } -// if(ObjectUtil.isEmpty(itemStatus)) continue label97; + if(ObjectUtil.isEmpty(itemStatus)) { + System.out.println( tag + " :itemStatus is null"); + log.warn(" {} 读取异常 : {} itemStatus is null", tag); + } + Set items = itemStatus.keySet(); Iterator var18 = items.iterator(); @@ -167,12 +172,13 @@ public class DeviceOpcProtocolRunable implements Runnable { value = OpcUtl.getValue(item, itemState); his = accessor_value.getValue(item.getId()); if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) { - log.warn("opc 值不健康 item: {}, 状态: {}", item.getId(), itemState.getQuality()); + log.warn("opc 值不健康 item: {}, 状态: {},当前读取值:{}, 系统内存值{} ", item.getId(), itemState.getQuality(), value, his); } } while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码 OpcItemDto itemDto = this.getItem(item.getId()); - if (itemDto.getNeed_log() != null && itemDto.getNeed_log()) { + //默认记录日志 + if (true) { StringBuilder sb = new StringBuilder(); //设备的ITEM项 List relate_items = itemDto.getRelate_items(); @@ -184,7 +190,7 @@ public class DeviceOpcProtocolRunable implements Runnable { sb.append("key:" + relate + "value:" + obj + ";"); } - log.info("信号{}变更从{}->{};信号快照:{}", new Object[]{item.getId(), his, value, sb}); + log.warn("信号{}变更从{}->{};信号快照:{}", new Object[]{item.getId(), his, value, sb}); } // accessor_value.setValueWithPersistence(item.getId(),accessor_value.getValue(item.getId())); @@ -199,6 +205,7 @@ public class DeviceOpcProtocolRunable implements Runnable { try { this.server.disconnect(); } catch (Exception var25) { + log.warn("{} : server disconnect", var25); } } @@ -213,6 +220,7 @@ public class DeviceOpcProtocolRunable implements Runnable { Thread.sleep((long) (OpcConfig.synchronized_exception_wait_second * 1000)); } catch (InterruptedException e) { e.printStackTrace(); + log.warn("OPC 读取线程读取异常{} :", e); // Thread.currentThread().interrupt();不会真正停止线程 } ++this.error_num; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcConfig.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcConfig.java index 850716847..068a8aae5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcConfig.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcConfig.java @@ -4,7 +4,7 @@ public class OpcConfig { public static Boolean auto_start_opc = Boolean.valueOf(true); public static String udw_opc_value_key = "opc_value"; public static Integer synchronized_millisecond = Integer.valueOf(100); - public static Integer synchronized_exception_wait_second = Integer.valueOf(10); + public static Integer synchronized_exception_wait_second = Integer.valueOf(3); public static Integer retry_times = Integer.valueOf(3); public static String sync_issue_type_code = "device_opc_sync"; public static String opc_server_default_group = "group"; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index b011cd6d0..5ab39530e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -1179,6 +1179,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { instdto.setAgv_inst_type("2"); } else if (StrUtil.equals(task_type, "2")) { instdto.setAgv_inst_type("3"); + } else if (StrUtil.equals(task_type, "8")) { + instdto.setAgv_inst_type("2"); } } else { instdto.setAgv_inst_type("4"); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/wql/QTASK_QUERY.wql b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/wql/QTASK_QUERY.wql index fac35ef90..583e75e99 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/wql/QTASK_QUERY.wql +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/wql/QTASK_QUERY.wql @@ -105,6 +105,10 @@ IF 输入.flag = "2" task.start_point_code LIKE CONCAT ( '%', 输入.point_code, '%' ) OR task.next_point_code LIKE CONCAT ( '%', 输入.point_code, '%') + OR + task.start_point_code2 LIKE CONCAT ( '%', 输入.point_code, '%' ) + OR + task.next_point_code2 LIKE CONCAT ( '%', 输入.point_code, '%') ) ENDOPTION OPTION 输入.create_time <> "" diff --git a/acs/nladmin-system/src/main/resources/config/application-dev.yml b/acs/nladmin-system/src/main/resources/config/application-dev.yml index a1f56261a..f57637425 100644 --- a/acs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/src/main/resources/config/application-dev.yml @@ -13,11 +13,11 @@ spring: driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy # url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_wcs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true username: ${DB_USER:root} # password: ${DB_PWD:P@ssw0rd} # password: ${DB_PWD:Root.123456} - password: ${DB_PWD:123456} + password: ${DB_PWD:password} # 初始连接数 initial-size: 5 diff --git a/acs/nladmin-system/src/main/resources/logback-spring.xml b/acs/nladmin-system/src/main/resources/logback-spring.xml index f78125731..99c06c8d5 100644 --- a/acs/nladmin-system/src/main/resources/logback-spring.xml +++ b/acs/nladmin-system/src/main/resources/logback-spring.xml @@ -40,7 +40,7 @@ https://juejin.cn/post/6844903775631572999 - + @@ -174,7 +174,7 @@ https://juejin.cn/post/6844903775631572999 - + diff --git a/acs/nladmin-ui/src/views/acs/history/instRecord/index.vue b/acs/nladmin-ui/src/views/acs/history/instRecord/index.vue index 6dc37822b..935da3147 100644 --- a/acs/nladmin-ui/src/views/acs/history/instRecord/index.vue +++ b/acs/nladmin-ui/src/views/acs/history/instRecord/index.vue @@ -99,16 +99,20 @@ + + + + + @@ -167,7 +171,7 @@ const defaultForm = { update_time: null } export default { - dicts: ['task_status'], + dicts: ['task_status', 'task_type'], name: 'Instruction', components: { pagination, crudOperation, Search }, mixins: [presenter(), header(), form(defaultForm), crud()], diff --git a/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue b/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue index 9fade6d65..44449b4cb 100644 --- a/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue +++ b/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue @@ -232,17 +232,21 @@ + + + + + @@ -288,7 +292,7 @@ const defaultForm = { export default { name: 'Task', components: { pagination, crudOperation, Search }, - dicts: ['task_status'], + dicts: ['task_status', 'task_type'], mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ diff --git a/acs/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue b/acs/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue index ac8fd5113..e49dd0b84 100644 --- a/acs/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue +++ b/acs/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue @@ -89,11 +89,14 @@ + + + @@ -138,7 +141,7 @@ const defaultForm = { export default { name: 'Task', components: { pagination, crudOperation, Search }, - dicts: ['task_status'], + dicts: ['task_status', 'task_type'], mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ title: '任务', url: 'api/task/getAll', idField: 'task_id', sort: 'task_id,desc', crudMethod: { ...crudTask }, optShow: { 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 f97cc4704..3f0233add 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -153,7 +153,7 @@ 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 2e22ec9b2..905f6866f 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 @@ -4099,9 +4099,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { //更新改切子卷为该子卷的分切计划 JSONObject source_dtl = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinv_id = '" + iostorinv_id + "' AND IFNULL(source_billdtl_id,'') <> ''").uniqueResult(0); - HashMap map = new HashMap<>(); - map.put("is_parent_ok", "1"); - WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map, "restruct_container_name = '" + source_dtl.getString("pcsn") + "'"); + JSONObject jsonPlan = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("package_box_sn = '" + source_dtl.getString("box_no") + "'").uniqueResult(0); + + if (ObjectUtil.isEmpty(jsonPlan)) throw new BadRequestException("未找到对应改制计划"); + + JSONObject map = new JSONObject(); + map.put("is_parent_ok","1"); + + WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map,"package_box_sn = '"+source_dtl.getString("box_no")+"'"); + }