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 8d3d47fac..77cbff7f5 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 @@ -54,4 +54,6 @@ public interface AcsConfig { String AutoCleanDays = "AutoCleanDays"; //最大任务下发时间 String MAXSENDTASKTIME = "maxSendTaskTime"; + //指令下发立库 + String INSTSENDLK = "instSendLk"; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java index b12d79e5e..1952fc8c4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -299,6 +299,11 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple } else if (this.getMode() == 3) { mode = "运行中"; } + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("requireSucess", requireSucess); if (this.getMove() == 0) { move = "无货"; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index b28f0f5d5..e79566627 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -222,5 +222,18 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } + public void writing(String param, String value) { + + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + param; + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + + itemMap.put(to_param, value); +// itemMap.put(to_param, Integer.parseInt(value)); + ReadUtil.write(itemMap, server); + } + } 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 602380f06..f95bc2fa5 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 @@ -134,7 +134,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme String message = null; try { device_code = this.getDeviceCode(); - mode = this.itemProtocol.getMode();move = this.itemProtocol.getMove(); + mode = this.itemProtocol.getMode(); + move = this.itemProtocol.getMove(); carrier_direction = this.itemProtocol.getCarrier_direction(); error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); @@ -187,44 +188,60 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); } - if (task > 0) { - Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); - if (ObjectUtil.isNotEmpty(instruction)) { +// if (task > 0) { +// Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); +// if (ObjectUtil.isNotEmpty(instruction)) { +// +// if (StrUtil.equals(this.getDeviceCode(), instruction.getStart_device_code())) { +// +// if (StrUtil.equals(instruction.getInstruction_status(), "0")) { +// instruction.setInstruction_status("1"); +// instructionService.update(instruction); +// } +// +// String next_device_code = instruction.getNext_device_code(); +// Device device = deviceAppservice.findDeviceByCode(next_device_code); +// if (ObjectUtil.isEmpty(device)) { +// logServer.deviceExecuteLog(this.device_code, "", "", "任务号:" + task + "输送线任务未完成,目标站设备为空!"); +// return; +// } +// SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; +// if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { +// if(mode ==2 ){ +// siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); +// int nextTask = siemensConveyorDeviceDriver.getTask(); +// if (nextTask == task) { +// inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code(); +// if (StrUtil.equals(instruction.getInstruction_status(), "1")) { +// inst = instruction; +// finish_instruction(); +// this.clearWrite(); +// } +// } +// } +// +// } +// } +// +// } +// +// } - if (StrUtil.equals(this.getDeviceCode(), instruction.getStart_device_code())) { - - if (StrUtil.equals(instruction.getInstruction_status(), "0")) { - instruction.setInstruction_status("1"); - instructionService.update(instruction); - } - - String next_device_code = instruction.getNext_device_code(); - Device device = deviceAppservice.findDeviceByCode(next_device_code); - if (ObjectUtil.isEmpty(device)) { - logServer.deviceExecuteLog(this.device_code, "", "", "任务号:" + task + "输送线任务未完成,目标站设备为空!"); - return; - } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - if(mode ==2 ){ - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); - int nextTask = siemensConveyorDeviceDriver.getTask(); - if (nextTask == task) { - inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code(); - if (StrUtil.equals(instruction.getInstruction_status(), "1")) { - inst = instruction; - finish_instruction(); - this.clearWrite(); - } - } - } - - } + if (mode == 2 && move != 0 && task > 0) { + //inst_message + inst = instructionService.findByCodeFromCache(String.valueOf(task)); + if (inst != null) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); + if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { + finish_instruction(); + } + if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { + inst.setInstruction_status("1"); + instructionService.update(inst); } - } - } + } catch (Exception var17) { inst_message = var17.getMessage(); logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage()); @@ -646,22 +663,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme applyLabelingAndBindingRequest.setType("1"); applyLabelingAndBindingRequest.setVehicle_code(vehicle_code); ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); - if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){ - Map datas = applyLabelingAndBindingResponse.getData(); - String length = datas.get("box_length").toString(); - String width = datas.get("box_width").toString(); - String box_high = datas.get("box_high").toString(); - String bundle_times = datas.get("bundle_times").toString(); + if(applyLabelingAndBindingResponse.getstatus() == 200){ List list = new ArrayList(); Map map = new HashMap(); map.put("code","to_command"); map.put("value","5"); list.add(map); this.writing(list); - + message ="申请贴标成功"; + requireApplyLabelingSuccess = true; + } else { + message = applyLabelingAndBindingResponse.getMessage(); } - requireApplyLabelingSuccess = true; } } @@ -698,39 +712,46 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme applyLabelingAndBindingRequest.setType("2"); applyLabelingAndBindingRequest.setVehicle_code(vehicle_code); ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); - if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){ - Map datas = applyLabelingAndBindingResponse.getData(); - String length = datas.get("box_length").toString(); - String width = datas.get("box_width").toString(); - String box_high = datas.get("box_high").toString(); - String bundle_times = datas.get("bundle_times").toString(); + if(applyLabelingAndBindingResponse.getstatus() == 200) { + if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){ + Map datas = applyLabelingAndBindingResponse.getData(); + String length = datas.get("box_length").toString(); + String width = datas.get("box_width").toString(); + String box_high = datas.get("box_high").toString(); + String bundle_times = datas.get("bundle_times").toString(); - List list = new ArrayList(); - Map map = new HashMap(); - map.put("code","to_length"); - map.put("value",length); - list.add(map); - Map map2 = new HashMap(); - map2.put("code","to_weight"); - map2.put("value",width); - list.add(map2); - Map map3 = new HashMap(); - map3.put("code","to_height"); - map3.put("value",box_high); - list.add(map3); - Map map4 = new HashMap(); - map4.put("code","to_strap_times"); - map4.put("value",bundle_times); - list.add(map4); - Map map5 = new HashMap(); - map5.put("code","to_command"); - map5.put("value","4"); - list.add(map5); - this.writing(list); + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code","to_length"); + map.put("value",length); + list.add(map); + Map map2 = new HashMap(); + map2.put("code","to_weight"); + map2.put("value",width); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code","to_height"); + map3.put("value",box_high); + list.add(map3); + Map map4 = new HashMap(); + map4.put("code","to_strap_times"); + map4.put("value",bundle_times); + list.add(map4); + Map map5 = new HashMap(); + map5.put("code","to_command"); + map5.put("value","4"); + list.add(map5); + this.writing(list); + message ="申请贴标成功"; + requireApplyLaStrangulationSuccess = true; + } else { + message = "未返回尺寸信息"; + } + } else { + message = applyLabelingAndBindingResponse.getMessage(); } - requireApplyLaStrangulationSuccess = true; } } 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 c4882ae4c..8ff22d693 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 @@ -268,6 +268,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe this.setBarcode(null); this.setRequireSucess(false); this.setApplySucess(false); + applySucess = false; clearBarcode(); this.set_last_container(container); List list = new ArrayList(); @@ -300,7 +301,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe map7.put("value","0"); list.add(map7); this.writing(list); - + message = null; } public void set_last_container(String barcode) { @@ -384,122 +385,40 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe //container_code TaskDto task = taskserver.findByContainer(container_code); if (!ObjectUtil.isEmpty(task)) { - String taskid = task.getTask_id(); - String taskcode = task.getTask_code(); - String vehiclecode = task.getVehicle_code(); - String priority = task.getPriority(); - String start_point_code = task.getStart_point_code(); - String start_device_code = task.getStart_device_code(); - String route_plan_code = task.getRoute_plan_code(); - String next_device_code = ""; + Instruction instdto = instructionService.findByTaskcodeAndStatus(task.getTask_code()); + if(ObjectUtil.isNotEmpty(instdto)){ + List list = new ArrayList(); + Map map = new HashMap(); - /** - * 开始平均分配 - */ - String this_coevice_code = taskserver.queryAssignedByDevice(device_code, task.getNext_device_code()); - if (StrUtil.isEmpty(this_coevice_code)) { - List shortPathsList = routeLineService.getShortPathLines(start_device_code, task.getNext_device_code(), route_plan_code); - RouteLineDto routeLineDto = shortPathsList.get(0); - - String path = routeLineDto.getPath(); - String type = routeLineDto.getType(); - String[] str = path.split("->"); -// if (!StrUtil.equals(type, "0")) { -// return false; -// } - List pathlist = Arrays.asList(str); - int index = 0; - for (int m = 0; m < pathlist.size(); m++) { - if (pathlist.get(m).equals(start_device_code)) { - index = m + 1; - break; + if(StrUtil.isNotEmpty(task.getTo_z())){ + if(StrUtil.equals(task.getTo_z(),"01")){ + map.put("code","to_target"); + map.put("value","102"); + } else if(StrUtil.equals(task.getTo_z(),"02")){ + map.put("code","to_target"); + map.put("value","201"); + } else if(StrUtil.equals(task.getTo_z(),"03")){ + map.put("code","to_target"); + map.put("value","301"); } } - next_device_code = pathlist.get(index); + 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; } else { - next_device_code = this_coevice_code; - } - //校验路由关系 - List shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); - if (ObjectUtils.isEmpty(shortPathsList)) { - throw new RuntimeException("路由不通!"); + message = "任务号:"+ task.getTask_code()+"未找到指令"; } - Device startdevice = deviceAppservice.findDeviceByCode(start_device_code); - Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code); - String next_point_code; - if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) { - next_point_code = task.getTo_x() + "-" + task.getTo_y() + "-" + task.getTo_z(); - } else { - next_point_code = next_device_code; - } - Instruction instdto = new Instruction(); - instdto.setInstruction_id(IdUtil.simpleUUID()); - instdto.setRoute_plan_code(route_plan_code); - instdto.setRemark(task.getRemark()); - instdto.setMaterial(task.getMaterial()); - instdto.setQuantity(task.getQuantity()); - instdto.setTask_id(taskid); - instdto.setTask_code(taskcode); - instdto.setVehicle_code(vehiclecode); - String now = DateUtil.now(); - instdto.setCreate_time(now); - instdto.setCreate_by("auto"); - instdto.setStart_device_code(start_device_code); - instdto.setNext_device_code(next_device_code); - instdto.setStart_point_code(start_point_code); - instdto.setNext_point_code(next_point_code); - instdto.setPriority(priority); - instdto.setInstruction_status("0"); - instdto.setExecute_device_code(start_point_code); - instructionService.create(instdto); - //创建指令后修改任务状态 - WQLObject taskwo = WQLObject.getWQLObject("acs_task"); - task.setTask_status("1"); - //创建指令后修改任务状态 - task.setTask_status("1"); - taskserver.update(task); -// this.writing("to_command","1"); -// if(StrUtil.isNotEmpty(task.getTo_z())){ -// if(StrUtil.equals(task.getTo_z(),"01")){ -// this.writing("to_target","102"); -// } else if(StrUtil.equals(task.getTo_z(),"02")){ -// this.writing("to_target","201"); -// } else if(StrUtil.equals(task.getTo_z(),"03")){ -// this.writing("to_target","301"); -// } -// } -// this.writing("to_command","1"); -// this.writing("to_task",instdto.getInstruction_code()); - - List list = new ArrayList(); - Map map = new HashMap(); - - if(StrUtil.isNotEmpty(task.getTo_z())){ - if(StrUtil.equals(task.getTo_z(),"01")){ - map.put("code","to_target"); - map.put("value","102"); - } else if(StrUtil.equals(task.getTo_z(),"02")){ - map.put("code","to_target"); - map.put("value","201"); - } else if(StrUtil.equals(task.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); - - requireSucess = true; - applySucess = true; } else { log.info("未找到载具号{}对应任务", container_code); } @@ -509,7 +428,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe /** * 请求指令 - * + * 定点任务时请求这里 * @param container_code * @param container_type */ @@ -600,20 +519,6 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe taskserver.update(task); - -// this.writing("to_command","1"); -// if(StrUtil.isNotEmpty(task.getTo_z())){ -// if(StrUtil.equals(task.getTo_z(),"01")){ -// this.writing("to_target","102"); -// } else if(StrUtil.equals(task.getTo_z(),"02")){ -// this.writing("to_target","201"); -// } else if(StrUtil.equals(task.getTo_z(),"03")){ -// this.writing("to_target","301"); -// } -// } -// this.writing("to_command","1"); -// this.writing("to_task",instdto.getInstruction_code()); - List list = new ArrayList(); Map map = new HashMap(); @@ -655,13 +560,16 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe message = "接口不通"; } else { if (jo.getInteger("status") == 200) { + message = "申请任务成功"; requireSucess = true; + applySucess = false; } else { requireSucess = false; message = jo.get("message").toString(); } } - +// requireSucess = true; +// message = "申请任务成功"; } } return true; @@ -753,6 +661,11 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe requireSucess = "1"; } jo.put("requireSucess", requireSucess); + String applySucess = "0"; + if (this.applySucess) { + applySucess = "1"; + } + jo.put("applySucess", applySucess); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java index 4ce629b33..39f2037a9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java @@ -37,7 +37,7 @@ public class AcsUtil { logServer.extLog(LokiLogType.ACS_TO_LK.name(),"下发立库任务请求参数:{}"+JSON.toJSONString(requestParam) ); log.info("下发立库任务请求参数:{}", JSON.toJSONString(requestParam)); String body = HttpRequest - .post(liKu_wcs_url + api) + .post(liKu_wcs_url + api).setConnectionTimeout(3000) .body(JSON.toJSONString(requestParam)) .execute() .body(); @@ -46,7 +46,7 @@ public class AcsUtil { } catch (Exception e) { JSONObject result = new JSONObject(); result.put("result", "false"); - result.put("code", ""); + result.put("code", "1"); result.put("comment", e.getMessage()); log.info("下发立库任务异常返回参数:{}", String.valueOf(result)); return String.valueOf(result); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index 4f0ca0d40..4ae5fec1a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -85,4 +85,12 @@ public class WmsToAcsController { } + @PostMapping("/putPlusPullAction") + @Log("下发插拔轴动作") + @ApiOperation("下发插拔轴动作") + @SaIgnore + public ResponseEntity putPlusPullAction(@RequestBody String whereJson){ + return new ResponseEntity<>(wmstoacsService.putPlusPullAction(whereJson), HttpStatus.OK); + } + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java index 007a68c3e..60c427e7b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java @@ -1,6 +1,8 @@ package org.nl.acs.ext.wms.service; +import com.alibaba.fastjson.JSONObject; import org.nl.acs.ext.wms.liKuData.*; +import org.nl.acs.instruction.service.dto.Instruction; /** * @author: geng by @@ -8,6 +10,9 @@ import org.nl.acs.ext.wms.liKuData.*; */ public interface AcsToLiKuService { + + public Resp sendInst(String type, Instruction inst); + /** * 入库任务下发 * @param requestParam diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java index 1a676db8a..a9125cccf 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java @@ -75,4 +75,13 @@ public interface WmsToAcsService { Map querydevice(String whereJson); + /** + * 下发插拔轴动作 + * + * @param whereJson 条件 + * @return Map + */ + Map putPlusPullAction(String whereJson); + + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java index f0f0ce6cd..1bdb2e8e9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java @@ -1,15 +1,26 @@ package org.nl.acs.ext.wms.service.impl; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.acs.AcsConfig; import org.nl.acs.device.address.service.AddressService; import org.nl.acs.ext.wms.RespUtil; import org.nl.acs.ext.wms.AcsUtil; import org.nl.acs.ext.wms.liKuData.*; import org.nl.acs.ext.wms.service.AcsToLiKuService; +import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.modules.system.service.ParamService; +import org.nl.modules.wql.util.SpringContextHolder; import org.slf4j.MDC; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** * 立库WCS接口 * @@ -26,12 +37,13 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { private String log_file_type="log_file_type"; private String log_type="ACS请求立库"; + @Override public Resp inStore(InStoreRequest requestParam) { try { MDC.put(log_file_type, log_type); String api = addressService.findByCode("inStore").getMethods_url(); - log.info("inStore-----输入参数{}", requestParam); + log.info("inStore-----输入参数{}", JSON.toJSONString(requestParam)); String result = AcsUtil.notifyAcs(api, requestParam); log.info("inStore-----输出参数{}", result); return RespUtil.getResp(result, new InStoreResponse()); @@ -45,7 +57,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp outStore(OutStoreRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("outStore-----输入参数{}", requestParam); + log.info("outStore-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("outStore").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("outStore-----输出参数{}", result); @@ -60,7 +72,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp emptyVehicleOutStore(EmptyVehicleOutStoreRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("emptyVehicleOutStore-----输入参数{}", requestParam); + log.info("emptyVehicleOutStore-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("emptyVehicleOutStore").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("emptyVehicleOutStore-----输出参数{}", result); @@ -75,7 +87,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp moveStore(MoveStoreRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("moveStore-----输入参数{}", requestParam); + log.info("moveStore-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("moveStore").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("moveStore-----输出参数{}", result); @@ -90,7 +102,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp inStoreReset(InStoreResetRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("inStoreReset-----输入参数{}", requestParam); + log.info("inStoreReset-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("inStoreReset").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("inStoreReset-----输出参数{}", result); @@ -105,7 +117,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp moveStoreReset(MoveStoreResetRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("moveStoreReset-----输入参数{}", requestParam); + log.info("moveStoreReset-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("moveStoreReset").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("moveStoreReset-----输出参数{}", result); @@ -121,7 +133,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp roadWayIsLock(RoadWayIsLockRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("roadWayIsLock-----输入参数{}", requestParam); + log.info("roadWayIsLock-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("roadWayIsLock").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("roadWayIsLock-----输出参数{}", result); @@ -138,7 +150,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp cancelTask(CancelTaskRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("cancelTask-----输入参数{}", requestParam); + log.info("cancelTask-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("cancelTask").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("cancelTask-----输出参数{}", result); @@ -154,7 +166,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp queryCarDeviceStatus(DeviceStatusRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("queryCarDeviceStatus-----输入参数{}", requestParam); + log.info("queryCarDeviceStatus-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("queryCarDeviceStatus").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("queryCarDeviceStatus-----输出参数{}", result); @@ -168,7 +180,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp queryTsjDeviceStatus(DeviceStatusRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("queryTsjDeviceStatus-----输入参数{}", requestParam); + log.info("queryTsjDeviceStatus-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("queryTsjDeviceStatus").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("queryTsjDeviceStatus-----输出参数{}", result); @@ -182,7 +194,7 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp querySsxDeviceStatus(DeviceStatusRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("querySsxDeviceStatus-----输入参数{}", requestParam); + log.info("querySsxDeviceStatus-----输入参数{}", JSON.toJSONString(requestParam)); String api = addressService.findByCode("querySsxDeviceStatus").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); log.info("querySsxDeviceStatus-----输出参数{}", result); @@ -192,4 +204,86 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { } } + @Override + public Resp sendInst(String type, Instruction dto){ + AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class); + ParamService paramService = SpringContextHolder.getBean(ParamService.class); + + Resp resp = new Resp(); + String instSendLk = paramService.findByCode(AcsConfig.INSTSENDLK).getValue(); + + try { + if(StrUtil.equals(instSendLk, "1")){ + if(StrUtil.equals(type,"1")){ + InStoreRequest request = new InStoreRequest(); + request.setFloorNo(Integer.parseInt(dto.getTo_z())); + request.setType(1); + request.setPalletCode(dto.getVehicle_code()); + request.setOrderId(dto.getInstruction_code()); + request.setSrcLocation(dto.getStart_point_code()); + request.setDestLocation(dto.getNext_point_code()); + resp = acsToLiKuService.inStore(request); + //空托入库 + } else if (StrUtil.equals(type,"2")){ + InStoreRequest request = new InStoreRequest(); + request.setFloorNo(Integer.parseInt(dto.getTo_z())); + request.setType(2); + request.setPalletCode(dto.getVehicle_code()); + request.setOrderId(dto.getInstruction_code()); + request.setSrcLocation(dto.getStart_point_code()); + request.setDestLocation(dto.getNext_point_code()); + resp = acsToLiKuService.inStore(request); + //出库 + } else if (StrUtil.equals(type,"3")){ + OutStoreRequest outStore = new OutStoreRequest(); + BaseStoreRequest baseReq = new BaseStoreRequest(); + List list = new ArrayList(); + baseReq.setOrderId(dto.getInstruction_code()); + baseReq.setSrcLocation(dto.getStart_point_code()); + baseReq.setDestLocation(dto.getNext_point_code()); + baseReq.setFloorNo(Integer.parseInt(dto.getFrom_z())); + baseReq.setPalletCode(dto.getVehicle_code()); + list.add(baseReq); + outStore.setOrderInfos(list); + outStore.setGroupId(dto.getInstruction_code()); + resp = acsToLiKuService.outStore(outStore); + //空托出库 + } else if (StrUtil.equals(type,"4")) { + EmptyVehicleOutStoreRequest emptyVehicleOutStoreRequest = new EmptyVehicleOutStoreRequest(); + emptyVehicleOutStoreRequest.setOrderId(dto.getInstruction_code()); + emptyVehicleOutStoreRequest.setFloorNo(Integer.parseInt(dto.getFrom_z())); + emptyVehicleOutStoreRequest.setSrcLocation(dto.getStart_point_code()); + emptyVehicleOutStoreRequest.setDestLocation(dto.getNext_point_code()); + emptyVehicleOutStoreRequest.setPalletCode(dto.getVehicle_code()); + resp = acsToLiKuService.emptyVehicleOutStore(emptyVehicleOutStoreRequest); + //转库 + } else if (StrUtil.equals(type,"5")) { + MoveStoreRequest moveStoreRequest = new MoveStoreRequest(); + BaseStoreRequest baseReq = new BaseStoreRequest(); + List list = new ArrayList(); + baseReq.setFloorNo(Integer.parseInt(dto.getFrom_z())); + baseReq.setPalletCode(dto.getVehicle_code()); + baseReq.setOrderId(dto.getInstruction_code()); + baseReq.setSrcLocation(dto.getStart_point_code()); + baseReq.setDestLocation(dto.getNext_point_code()); + list.add(baseReq); + moveStoreRequest.setGroupId(dto.getInstruction_code()); + moveStoreRequest.setOrderInfos(list); + resp = acsToLiKuService.moveStore(moveStoreRequest); + } + } else { + resp.setCode("0"); + resp.setResult("true"); + resp.setComment("ACS模拟下发成功"); + } + + } catch (Exception e) { + resp.setCode("1"); + resp.setResult("false"); + resp.setComment(e.getMessage()); + } + + return resp; + } + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java index 7de777270..66e60cb71 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java @@ -1,6 +1,7 @@ package org.nl.acs.ext.wms.service.impl; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -57,13 +58,15 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService { public Resp inStoreReport(InStoreReportRequest requestParam) throws Exception { try { MDC.put(log_file_type, log_type); - log.info("入库任务状态反馈-----输入参数{}", requestParam.toString()); + log.info("入库任务状态反馈-----输入参数{}", JSON.toJSONString(requestParam)); String inst_code = requestParam.getOrderId(); String status = requestParam.getState(); Instruction inst = instructionService.findByCodeFromCache(inst_code); TaskDto task = taskService.findByCodeFromCache(inst.getTask_code()); // 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞 if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){ + task.setTask_status("1"); + taskService.update(task); inst.setInstruction_status("1"); instructionService.update(inst); } else if(StrUtil.equals(status,"3")){ @@ -132,7 +135,7 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService { public Resp outStoreReport(OutStoreReportRequest requestParam) throws Exception { try { MDC.put(log_file_type, log_type); - log.info("出库任务状态反馈-----输入参数{}", requestParam.toString()); + log.info("出库任务状态反馈-----输入参数{}", JSON.toJSONString(requestParam)); String inst_code = requestParam.getOrderId(); String status = requestParam.getState(); Instruction inst = instructionService.findByCodeFromCache(inst_code); @@ -140,6 +143,8 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService { // 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞 if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){ + task.setTask_status("1"); + taskService.update(task); inst.setInstruction_status("1"); instructionService.update(inst); } else if(StrUtil.equals(status,"3")){ @@ -190,13 +195,15 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService { public Resp moveStoreReport(MoveStoreReportRequest requestParam) throws Exception { try { MDC.put(log_file_type, log_type); - log.info("移库任务上报-----输入参数{}", requestParam.toString()); + log.info("移库任务上报-----输入参数{}", JSON.toJSONString(requestParam)); String inst_code = requestParam.getOrderId(); String status = requestParam.getState(); Instruction inst = instructionService.findByCodeFromCache(inst_code); TaskDto task = taskService.findByCodeFromCache(inst.getTask_code()); // 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞 if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){ + task.setTask_status("1"); + taskService.update(task); inst.setInstruction_status("1"); instructionService.update(inst); @@ -272,7 +279,7 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService { public Resp putEmptyPallet(putEmptyPalletRequest requestParam) throws Exception { try { MDC.put(log_file_type, log_type); - log.info("请求放空盘-----输入参数{}", requestParam.toString()); + log.info("请求放空盘-----输入参数{}", JSON.toJSONString(requestParam)); String device_code = requestParam.getDeviceId(); String type = requestParam.getType(); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); @@ -283,7 +290,7 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService { if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); if(StrUtil.equals(type,"1")){ - if(siemensConveyorDeviceDriver.getMode() ==2 && siemensConveyorDeviceDriver.getMove() ==0){ + if((siemensConveyorDeviceDriver.getMode() ==2 || siemensConveyorDeviceDriver.getMode() ==7 )&& siemensConveyorDeviceDriver.getMove() ==0){ result.put("result", "true"); result.put("comment", ""); } else { 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 7f7f9a737..1032de1c8 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 @@ -2,6 +2,7 @@ package org.nl.acs.ext.wms.service.impl; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; @@ -13,8 +14,11 @@ import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyor import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver; import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver; import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; +import org.nl.acs.device_driver.basedriver.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.ext.wms.data.*; +import org.nl.acs.ext.wms.liKuData.Resp; +import org.nl.acs.ext.wms.service.AcsToLiKuService; import org.nl.acs.ext.wms.service.WmsToAcsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; @@ -34,6 +38,8 @@ import org.springframework.context.ApplicationContext; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -49,6 +55,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { private final DeviceService deviceService; private final DeviceAppService deviceAppService; private final RouteLineService routeLineService; + private final AcsToLiKuService acsToLiKuService; + private String log_file_type="log_file_type"; private String log_type="LMS请求ACS"; @@ -157,10 +165,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { throw new Exception("未找到对应设备:" + device_code); } HongXiangStationDeviceDriver hongXiangStationDeviceDriver; + PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver; if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); hongXiangStationDeviceDriver.writing(code, value); } + + + } response.setStatus(200); response.setMessage("success"); @@ -219,6 +231,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("countdown_house", hongXiangConveyorDeviceDriver.getCountdown_house()); jo.put("countdown_min", hongXiangConveyorDeviceDriver.getCountdown_min()); jo.put("countdown_sec", hongXiangConveyorDeviceDriver.getCountdown_sec()); + //温度需要除以100 待实现 jo.put("temperature", hongXiangConveyorDeviceDriver.getTemperature()); jo.put("door", hongXiangConveyorDeviceDriver.getDoor()); jo.put("finish", hongXiangConveyorDeviceDriver.getFinish()); @@ -291,6 +304,160 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { return null; } + + + @Override + public Map putPlusPullAction(String param) { + try { + MDC.put(log_file_type, log_type); + log.info("putPlusPullAction-----输入参数{}", param); + JSONObject jo = JSON.parseObject(param); + String device_code = jo.getString("device_code"); + String size = jo.getString("size"); + String type = jo.getString("type"); + Device device = deviceAppService.findDeviceByCode(device_code); + if (ObjectUtil.isEmpty(device)) { + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "未找到对应的设备:"+device_code); + return resultJson; + } + PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver; + if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { + plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver(); + // 0 穿轴 1拔轴 + if(StrUtil.equals(type,"1")){ + + if(plugPullDeviceSiteDeviceDriver.getMode() == 1){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求拔轴,当前设备工作模式未自动"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getAction() == 0){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求拔轴,当前设备未全自动"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getStatus() != 0){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求拔轴,当前设备未待机"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getControl() != 0){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求拔轴,当前设备未远程控制"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getMove() != 0){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求拔轴,当前设备有轴"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getMode() == 0 && plugPullDeviceSiteDeviceDriver.getAction() ==1 + && plugPullDeviceSiteDeviceDriver.getStatus() ==0 && plugPullDeviceSiteDeviceDriver.getMove() ==0 + && plugPullDeviceSiteDeviceDriver.getControl() ==0 ){ + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code","to_size"); + map.put("value",size); + list.add(map); + Map map2 = new HashMap(); + map2.put("code","to_type"); + map2.put("value",type); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code","to_command"); + map3.put("value","1"); + list.add(map3); + plugPullDeviceSiteDeviceDriver.writing(list); + + } else { + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "当前设备状态不满足下发条件"); + return resultJson; + } + + } else if (StrUtil.equals(type,"0")){ + + if(plugPullDeviceSiteDeviceDriver.getMode() == 1){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求插轴,当前设备工作模式未自动"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getAction() == 0){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求插轴,当前设备未全自动"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getStatus() != 0){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求插轴,当前设备未待机"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getControl() != 0){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求插轴,当前设备未远程控制"); + return resultJson; + } + if(plugPullDeviceSiteDeviceDriver.getMove() != 1){ + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "请求插轴,当前设备没有轴"); + return resultJson; + } + + if(plugPullDeviceSiteDeviceDriver.getMode() == 0 && plugPullDeviceSiteDeviceDriver.getAction() ==1 + && plugPullDeviceSiteDeviceDriver.getStatus() ==0 && plugPullDeviceSiteDeviceDriver.getMove() ==1 + && plugPullDeviceSiteDeviceDriver.getControl() ==0 ){ + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code","to_size"); + map.put("value",size); + list.add(map); + Map map2 = new HashMap(); + map2.put("code","to_type"); + map2.put("value",type); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code","to_command"); + map3.put("value","1"); + list.add(map3); + plugPullDeviceSiteDeviceDriver.writing(list); + + } else { + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.BAD_REQUEST.value()); + resultJson.put("message", "当前设备状态不满足下发条件"); + return resultJson; + } + } + } + + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.OK.value()); + resultJson.put("message", "操作成功"); + log.info("putPlusPullAction--------------:输出参数" + resultJson.toString()); + return resultJson; + + } finally { + MDC.remove(log_file_type); + } + } + + + @Override public CreateTaskResponse crateTask(String param) { try { @@ -330,13 +497,28 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String next_point_code2 = ""; String put_point_code = ""; if (StrUtil.isEmpty(task_code)) { - throw new WDKException("任务号不能为空"); + JSONObject json = new JSONObject(); + json.put("task_code", task_code); + json.put("ext_task_id", ext_task_id); + json.put("message", "任务号不能为空"); + errArr.add(json); + continue; } if (StrUtil.isEmpty(start_device_code)) { - throw new WDKException("起点不能为空"); + JSONObject json = new JSONObject(); + json.put("task_code", task_code); + json.put("ext_task_id", ext_task_id); + json.put("message", "起点不能为空"); + errArr.add(json); + continue; } if (StrUtil.isEmpty(next_device_code)) { - throw new WDKException("终点不能为空"); + JSONObject json = new JSONObject(); + json.put("task_code", task_code); + json.put("ext_task_id", ext_task_id); + json.put("message", "终点不能为空"); + errArr.add(json); + continue; } @@ -399,14 +581,32 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { route_plan_code = "normal"; } + if( StrUtil.equals(task_type,"5") && taskService.querySameDeviceReadyTask(start_device_code,next_device_code,"0") > 1){ + JSONObject json = new JSONObject(); + json.put("task_code", task_code); + json.put("ext_task_id", ext_task_id); + json.put("message", "已存在相同的起点终点未执行的输送任务"); + errArr.add(json); + continue; + } TaskDto taskDto = taskService.findByCodeFromCache(task_code); if (taskDto != null) { - throw new WDKException("不能存在相同的任务号!"); + JSONObject json = new JSONObject(); + json.put("task_code", task_code); + json.put("ext_task_id", ext_task_id); + json.put("message", "不能存在相同的任务号"); + errArr.add(json); + continue; } if (!StrUtil.isEmpty(vehicle_code)) { TaskDto vehicle_dto = taskService.findByContainer(vehicle_code); if (vehicle_dto != null) { - throw new WDKException("已存在该载具号的任务!"); + JSONObject json = new JSONObject(); + json.put("task_code", task_code); + json.put("ext_task_id", ext_task_id); + json.put("message", "不能存在相同的托盘号"); + errArr.add(json); + continue; } } @@ -460,12 +660,44 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { try { // task_type=7 则是立库任务需要下刻下发 if (StrUtil.equals(task_dto.getTask_type(), "7")) { - taskService.create(task_dto); +// taskService.create(task_dto); +// try{ +// taskService.createInst(task_dto.getTask_id()); +// } catch (Exception e) { +// e.printStackTrace(); +// JSONObject json = new JSONObject(); +// json.put("task_code", task_code); +// json.put("ext_task_id", ext_task_id); +// json.put("message", "创建指令失败:"+e.getMessage()); +// errArr.add(json); +// } + + //创建临时指令 不创建、不生成 + //等立库反馈成功才能创建任务和指令 + Instruction inst = taskService.createTemporaryInst(task_dto); + Resp resp = acsToLiKuService.sendInst(task_dto.getStorage_task_type(),inst); + + if(StrUtil.equals(resp.result,"true")){ + //创建任务和指令 + taskService.create(task_dto); + inst.setSend_status("1"); + taskService.createInst(inst); + + } else { + JSONObject json = new JSONObject(); + json.put("task_code", task_code); + json.put("ext_task_id", ext_task_id); + json.put("message", resp.getComment()); + json.put("code", resp.code); + json.put("data", data); + errArr.add(json); + } + } else { taskService.create(task_dto); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); JSONObject json = new JSONObject(); json.put("task_code", task_code); json.put("ext_task_id", ext_task_id); @@ -480,7 +712,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { } response.setMessage("success"); response.setErrArr(errArr); - log.info("createFromWms--------------:输出参数:" + response); + log.info("createFromWms--------------:输出参数:" + JSON.toJSONString(response)); return response; } finally { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java index 62c9d7559..107f5c395 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -103,6 +103,7 @@ public interface InstructionService { */ void create(Instruction dto) throws Exception; + void create2(Instruction dto) throws Exception; /** * 再次创建 * @@ -270,4 +271,8 @@ public interface InstructionService { boolean removeByCodeFromCache(String code); + + boolean createLkInst(String type,Instruction inst); + + } 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 37b47a7e5..40eeb25ce 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 @@ -254,7 +254,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } @Override - @Transactional(rollbackFor = Exception.class) public void create(Instruction dto) throws Exception { dto = foramte(dto); String task_code = dto.getTask_code(); @@ -345,74 +344,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(),dto); } else { - //入库 - AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class); - Resp resp = null; - if(StrUtil.equals(task.getStorage_task_type(),"1")){ - InStoreRequest request = new InStoreRequest(); - request.setFloorNo(Integer.parseInt(dto.getTo_z())); - request.setType(1); - request.setPalletCode(dto.getVehicle_code()); - request.setOrderId(dto.getInstruction_code()); - request.setSrcLocation(dto.getStart_point_code()); - request.setDestLocation(dto.getNext_point_code()); - resp = acsToLiKuService.inStore(request); - //空托入库 - } else if (StrUtil.equals(task.getStorage_task_type(),"2")){ - InStoreRequest request = new InStoreRequest(); - request.setFloorNo(Integer.parseInt(dto.getTo_z())); - request.setType(2); - request.setPalletCode(dto.getVehicle_code()); - request.setOrderId(dto.getInstruction_code()); - request.setSrcLocation(dto.getStart_point_code()); - request.setDestLocation(dto.getNext_point_code()); - resp = acsToLiKuService.inStore(request); - //出库 - } else if (StrUtil.equals(task.getStorage_task_type(),"3")){ - OutStoreRequest outStore = new OutStoreRequest(); - BaseStoreRequest baseReq = new BaseStoreRequest(); - List list = new ArrayList(); - baseReq.setOrderId(dto.getInstruction_code()); - baseReq.setSrcLocation(dto.getStart_point_code()); - baseReq.setDestLocation(dto.getNext_point_code()); - baseReq.setFloorNo(Integer.parseInt(dto.getFrom_z())); - baseReq.setPalletCode(dto.getVehicle_code()); - list.add(baseReq); - outStore.setOrderInfos(list); - outStore.setGroupId(dto.getInstruction_code()); - resp = acsToLiKuService.outStore(outStore); - //空托出库 - } else if (StrUtil.equals(task.getStorage_task_type(),"4")) { - EmptyVehicleOutStoreRequest emptyVehicleOutStoreRequest = new EmptyVehicleOutStoreRequest(); - emptyVehicleOutStoreRequest.setOrderId(dto.getInstruction_code()); - emptyVehicleOutStoreRequest.setFloorNo(Integer.parseInt(dto.getFrom_z())); - emptyVehicleOutStoreRequest.setSrcLocation(dto.getStart_point_code()); - emptyVehicleOutStoreRequest.setDestLocation(dto.getNext_point_code()); - emptyVehicleOutStoreRequest.setPalletCode(dto.getVehicle_code()); - resp = acsToLiKuService.emptyVehicleOutStore(emptyVehicleOutStoreRequest); - //转库 - } else if (StrUtil.equals(task.getStorage_task_type(),"5")) { - MoveStoreRequest moveStoreRequest = new MoveStoreRequest(); - BaseStoreRequest baseReq = new BaseStoreRequest(); - List list = new ArrayList(); - baseReq.setFloorNo(Integer.parseInt(dto.getFrom_z())); - baseReq.setPalletCode(dto.getVehicle_code()); - baseReq.setOrderId(dto.getInstruction_code()); - baseReq.setSrcLocation(dto.getStart_point_code()); - baseReq.setDestLocation(dto.getNext_point_code()); - list.add(baseReq); - moveStoreRequest.setGroupId(dto.getInstruction_code()); - moveStoreRequest.setOrderInfos(list); - resp = acsToLiKuService.moveStore(moveStoreRequest); - } - - if(ObjectUtil.isNotEmpty(resp)){ - if(StrUtil.equals(resp.getResult(),"true")){ - dto.setSend_status("1"); - } else { - dto.setSend_status("2"); - dto.setRemark(resp.getData().toString()); - } + // Boolean result = createLkInst(task.getStorage_task_type(),dto); + Resp resp = acsToLiKuService.sendInst(task.getStorage_task_type(),dto); + if(StrUtil.equals(resp.result,"true")){ + dto.setSend_status("1"); + } else { + dto.setSend_status("2"); } } } @@ -429,6 +366,114 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } + @Override + public void create2(Instruction dto) throws Exception { + dto = foramte(dto); + String task_code = dto.getTask_code(); + TaskDto task = taskService.findByCodeFromCache(task_code); + + WQLObject instwo = WQLObject.getWQLObject("acs_instruction"); + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + if (StrUtil.isEmpty(dto.getRoute_plan_code())) { + dto.setRoute_plan_code(task.getRoute_plan_code()); + } + if (StrUtil.isEmpty(dto.getPriority())) { + dto.setPriority(task.getPriority()); + } + if (StrUtil.isEmpty(dto.getInstruction_code())) { + dto.setInstruction_code(CodeUtil.getNewCode("INSTRUCT_NO")); + } + if (StrUtil.isEmpty(dto.getInstruction_id())) { + dto.setInstruction_id(IdUtil.simpleUUID()); + } + if (StrUtil.isEmpty(dto.getIs_send())) { + dto.setIs_send(task.getIs_send()); + } + if (StrUtil.isEmpty(dto.getLink_num())) { + dto.setIs_send(task.getLink_num()); + } + if (task.getTask_type().equals("1") || task.getTask_type().equals("2")) { + dto.setInstruction_type(task.getTask_type()); + } else if (false) { + + } else { + dto.setInstruction_type("3"); + } + + + //起点设备与终点设备相同则为初始指令 + if (StrUtil.equals(task.getStart_device_code(), dto.getStart_device_code())) { + if (!StrUtil.equals(dto.getCompound_inst(), "0") && StrUtil.equals(task.getCompound_task(), "1")) { + dto.setCompound_inst("1"); + dto.setCompound_inst_data(task.getCompound_task_data()); + } + } + + dto.setCreate_by(currentUsername); + dto.setUpdate_by(currentUsername); + dto.setUpdate_time(now); + dto.setCreate_time(now); + dto.setStart_parent_code(task.getStart_parent_code()); + dto.setNext_parent_code(task.getNext_parent_code()); + + if (ObjectUtil.isNotEmpty(task.getTask_type())) { + dto.setInstruction_type(task.getTask_type()); + } + + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + Device startdevice = appService.findDeviceByCode(dto.getStart_device_code()); + Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code()); + + HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; + StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; + + if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); + hongXiangConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code())); + } + + try { + String start_device_code = dto.getStart_device_code(); + String next_device_code = dto.getNext_device_code(); + String route_plan_code = task.getRoute_plan_code(); + List shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); + RouteLineDto route = null; + for (int i = 0; i < shortPathsList.size(); i++) { + RouteLineDto routeLineDto = shortPathsList.get(i); + String route_device = routeLineDto.getDevice_code(); + String route_next_device = routeLineDto.getNext_device_code(); + if (route_device.equals(dto.getStart_device_code()) && route_next_device.equals(dto.getNext_device_code())) { + route = routeLineDto; + break; + } + } + if (ObjectUtil.isEmpty(route)) { + throw new BadRequestException("未查询到相关路由!"); + } + if (StrUtil.equals(shortPathsList.get(0).getType(), "1")){ + // 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统 + if (!StrUtil.equals(task.getAgv_system_type(), "0") && ObjectUtil.isNotEmpty(task.getAgv_system_type())) { + NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); + ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(),dto); + } else { +// Boolean result = createLkInst(task.getStorage_task_type(),dto); + } + } + } catch (Exception e) { + dto.setSend_status("2"); + e.printStackTrace(); + } + + WQLObject wo = WQLObject.getWQLObject("acs_instruction"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.insert(json); + instructions.add(dto); + } + + + @Override @Transactional(rollbackFor = Exception.class) public void createAgain(Instruction dto) throws Exception { @@ -1201,6 +1246,89 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu return false; } + + @Override + public boolean createLkInst(String type, Instruction dto) { + //入库 + AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class); + Resp resp = null; + if(StrUtil.equals(type,"1")){ + InStoreRequest request = new InStoreRequest(); + request.setFloorNo(Integer.parseInt(dto.getTo_z())); + request.setType(1); + request.setPalletCode(dto.getVehicle_code()); + request.setOrderId(dto.getInstruction_code()); + request.setSrcLocation(dto.getStart_point_code()); + request.setDestLocation(dto.getNext_point_code()); + resp = acsToLiKuService.inStore(request); + //空托入库 + } else if (StrUtil.equals(type,"2")){ + InStoreRequest request = new InStoreRequest(); + request.setFloorNo(Integer.parseInt(dto.getTo_z())); + request.setType(2); + request.setPalletCode(dto.getVehicle_code()); + request.setOrderId(dto.getInstruction_code()); + request.setSrcLocation(dto.getStart_point_code()); + request.setDestLocation(dto.getNext_point_code()); + resp = acsToLiKuService.inStore(request); + //出库 + } else if (StrUtil.equals(type,"3")){ + OutStoreRequest outStore = new OutStoreRequest(); + BaseStoreRequest baseReq = new BaseStoreRequest(); + List list = new ArrayList(); + baseReq.setOrderId(dto.getInstruction_code()); + baseReq.setSrcLocation(dto.getStart_point_code()); + baseReq.setDestLocation(dto.getNext_point_code()); + baseReq.setFloorNo(Integer.parseInt(dto.getFrom_z())); + baseReq.setPalletCode(dto.getVehicle_code()); + list.add(baseReq); + outStore.setOrderInfos(list); + outStore.setGroupId(dto.getInstruction_code()); + resp = acsToLiKuService.outStore(outStore); + //空托出库 + } else if (StrUtil.equals(type,"4")) { + EmptyVehicleOutStoreRequest emptyVehicleOutStoreRequest = new EmptyVehicleOutStoreRequest(); + emptyVehicleOutStoreRequest.setOrderId(dto.getInstruction_code()); + emptyVehicleOutStoreRequest.setFloorNo(Integer.parseInt(dto.getFrom_z())); + emptyVehicleOutStoreRequest.setSrcLocation(dto.getStart_point_code()); + emptyVehicleOutStoreRequest.setDestLocation(dto.getNext_point_code()); + emptyVehicleOutStoreRequest.setPalletCode(dto.getVehicle_code()); + resp = acsToLiKuService.emptyVehicleOutStore(emptyVehicleOutStoreRequest); + //转库 + } else if (StrUtil.equals(type,"5")) { + MoveStoreRequest moveStoreRequest = new MoveStoreRequest(); + BaseStoreRequest baseReq = new BaseStoreRequest(); + List list = new ArrayList(); + baseReq.setFloorNo(Integer.parseInt(dto.getFrom_z())); + baseReq.setPalletCode(dto.getVehicle_code()); + baseReq.setOrderId(dto.getInstruction_code()); + baseReq.setSrcLocation(dto.getStart_point_code()); + baseReq.setDestLocation(dto.getNext_point_code()); + list.add(baseReq); + moveStoreRequest.setGroupId(dto.getInstruction_code()); + moveStoreRequest.setOrderInfos(list); + resp = acsToLiKuService.moveStore(moveStoreRequest); + } + + if(ObjectUtil.isNotEmpty(resp)){ + if(StrUtil.equals(resp.getResult(),"true")){ + dto.setSend_status("1"); + } else { + dto.setSend_status("2"); + dto.setRemark(resp.getData().toString()); + return false; + } + } else { + dto.setSend_status("2"); + dto.setRemark("ERROR"); + return false; + } + + + return true; + } + + public Instruction findByContainer(String container_code) { Iterator var3 = instructions.iterator(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java index f5f5f07f2..91145516c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java @@ -3,6 +3,7 @@ package org.nl.acs.task.service; import com.alibaba.fastjson.JSONObject; +import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.task.service.dto.TaskDto; import org.springframework.data.domain.Pageable; @@ -191,7 +192,12 @@ public interface TaskService { * * @param ids */ - void createInst(String ids) throws Exception; + Instruction createInst(String ids) throws Exception; + + Instruction createInst(Instruction inst) throws Exception; + + + Instruction createTemporaryInst(TaskDto dto); /** * 导出数据 @@ -219,6 +225,7 @@ public interface TaskService { TaskDto findByCodeFromCache(String task_code); + /** * 根据目的地设备编号查询当前是否有设备 * @@ -298,4 +305,12 @@ public interface TaskService { */ Integer querySameDestinationTask(String code); + + /** + * 查询相同起终任务的数量 + * + * @param + * @return + */ + Integer querySameDeviceReadyTask(String start_device,String next_device,String status); } 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 a613c0b3f..7e5c0883c 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 @@ -94,7 +94,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } public synchronized void reload() { - this.tasks = this.queryAll("task_status <2 and is_delete =0"); + this.tasks = this.queryAll("task_status <2 and is_delete =0 order by create_time"); } @Override @@ -890,8 +890,138 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } @Override - @Transactional(rollbackFor = Exception.class) - public void createInst(String ids) throws Exception { + public Instruction createTemporaryInst(TaskDto acsTask){ + if (acsTask == null) { + throw new BadRequestException("被删除或无权限,操作失败!"); + } + acsTask = foramte(acsTask); + ParamService paramService = SpringContextHolder.getBean(ParamService.class); + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl"); +// InstructionDto inst = instructionservice.findByTaskid(acsTask, "instruction_status < 2 "); +// if (inst != null) { +// throw new BadRequestException("有指令未完成!"); +// } + + String taskid = acsTask.getTask_id(); + String taskcode = acsTask.getTask_code(); + String vehiclecode = acsTask.getVehicle_code(); + String priority = acsTask.getPriority(); + String start_point_code = acsTask.getStart_point_code(); + String start_device_code = acsTask.getStart_device_code(); + String route_plan_code = acsTask.getRoute_plan_code(); + String vehicleType = acsTask.getVehicle_type(); + //是否复合任务 =0非复合任务 + String compound_task = acsTask.getCompound_task(); + String next_point_code = acsTask.getNext_point_code(); + String next_device_code = acsTask.getNext_device_code(); + String start_point_code2 = acsTask.getStart_point_code2(); + String next_point_code2 = acsTask.getNext_point_code2(); + String agv_system_type = acsTask.getAgv_system_type(); + String task_type = acsTask.getTask_type(); + String from_x = acsTask.getFrom_x(); + String from_y = acsTask.getFrom_y(); + String from_z = acsTask.getFrom_z(); + String to_x = acsTask.getTo_x(); + String to_y = acsTask.getTo_y(); + String to_z = acsTask.getTo_z(); + + + /** + * 开始平均分解校验 + */ + String this_device_code = this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code()); + if (StrUtil.isEmpty(this_device_code)) { + List shortPathsList = routeLineService.getShortPathLines(start_device_code, acsTask.getNext_device_code(), route_plan_code); + RouteLineDto routeLineDto = shortPathsList.get(0); + String path = routeLineDto.getPath(); + String type = routeLineDto.getType(); + String[] str = path.split("->"); + List pathlist = Arrays.asList(str); + int index = 0; + for (int m = 0; m < pathlist.size(); m++) { + if (pathlist.get(m).equals(start_device_code)) { + index = m + 1; + break; + } + } + next_device_code = pathlist.get(index); + } else { + next_device_code = this_device_code; + } + + if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) { + next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z(); + } else { + next_point_code = next_device_code; + } + + Instruction instdto = new Instruction(); + if (StrUtil.isEmpty(instdto.getInstruction_code())) { + instdto.setInstruction_code(CodeUtil.getNewCode("INSTRUCT_NO")); + } + instdto.setInstruction_type(task_type); + instdto.setInstruction_id(IdUtil.simpleUUID()); + instdto.setRoute_plan_code(route_plan_code); + instdto.setRemark(acsTask.getRemark()); + instdto.setMaterial(acsTask.getMaterial()); + instdto.setQuantity(acsTask.getQuantity()); + instdto.setTask_id(taskid); + instdto.setTask_code(taskcode); + instdto.setVehicle_code(vehiclecode); + String now = DateUtil.now(); + instdto.setCreate_time(now); + instdto.setCreate_by("auto"); + instdto.setStart_device_code(start_device_code); + instdto.setNext_device_code(next_device_code); + instdto.setStart_point_code(start_point_code); + instdto.setNext_point_code(next_point_code); + instdto.setPriority(priority); + instdto.setInstruction_status("0"); + instdto.setExecute_device_code(start_point_code); + instdto.setVehicle_type(vehicleType); + instdto.setStart_point_code2(start_point_code2); + instdto.setStart_device_code2(start_point_code2); + instdto.setNext_device_code2(next_point_code2); + instdto.setNext_point_code2(next_point_code2); + instdto.setAgv_system_type(agv_system_type); + instdto.setFrom_x(from_x); + instdto.setFrom_y(from_y); + instdto.setFrom_z(from_z); + instdto.setTo_x(to_x); + instdto.setTo_y(to_y); + instdto.setTo_z(to_z); + + //判断agv系统 + //1、1楼叉车系统 + //2、2楼1区域AGV系统 + //3、2楼2区域AGV系统 + if (!StrUtil.equals(agv_system_type, "1")) { + // task_type + //1、生箔; Itype=1:取空,取满,放空,放满; + //2、分切 Itype=3取满、取空、放满、放空; + //3、普通任务 Itype=2:取货、放货; + //4、叉车任务 + //5、输送任务 + //6、行架 + //7、立库 + if (StrUtil.equals(task_type, "1")) { + instdto.setAgv_inst_type("1"); + } else if (StrUtil.equals(task_type, "3")) { + instdto.setAgv_inst_type("2"); + } else if (StrUtil.equals(task_type, "2")) { + instdto.setAgv_inst_type("3"); + } + } else { + instdto.setAgv_inst_type("4"); + } + return instdto; + } + + + + @Override + public Instruction createInst(String ids) throws Exception { TaskDto acsTask = this.findById(ids); if (acsTask == null) { throw new BadRequestException("被删除或无权限,操作失败!"); @@ -998,12 +1128,24 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } else { instdto.setAgv_inst_type("4"); } - instructionservice.create(instdto); + instructionservice.create2(instdto); - acsTask.setTask_status("1"); - this.update(acsTask); +// acsTask.setTask_status("1"); +// this.update(acsTask); + return instdto; } + @Override + public Instruction createInst(Instruction inst) throws Exception { + + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl"); + + instructionservice.create2(inst); + return inst; + } + + @Override public void download(List all, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); @@ -1183,6 +1325,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (Integer.parseInt(start_point[2]) < 10 && start_point[2].length() == 1) { from_z = "0" + start_point[2]; task.setFrom_z(from_z); + } else if (start_point[2].length() == 2 ){ + from_z = start_point[2]; + task.setFrom_z(start_point[2]); } else { from_z = start_point[2]; } @@ -1208,6 +1353,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (Integer.parseInt(task.getFrom_z()) < 10 && task.getFrom_z().length() == 1) { from_z = "0" + task.getFrom_z(); task.setFrom_z(from_z); + } else if (task.getFrom_z().length() == 2 ) { + from_z = task.getFrom_z(); + task.setFrom_z(from_z); } else { from_z = task.getFrom_z(); } @@ -1234,6 +1382,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (Integer.parseInt(next_point[2]) < 10 && next_point[2].length() == 1) { to_z = "0" + next_point[2]; task.setTo_z(to_z); + } else if ( next_point[2].length() == 2){ + to_z = next_point[2]; + task.setTo_z(to_z); } else { to_z = next_point[2]; task.setTo_z(to_z); @@ -1259,6 +1410,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (Integer.parseInt(task.getTo_z()) < 10 && task.getTo_z().length() == 1) { to_z = "0" + task.getTo_z(); task.setTo_z(to_z); + } else if (task.getTo_z().length() == 2){ + to_z = task.getTo_z(); + task.setTo_z(to_z); } else { to_z = task.getTo_z(); } @@ -1328,6 +1482,23 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { return null; } + + @Override + public Integer querySameDeviceReadyTask(String start_device,String next_device,String status ) { + int num = 0; + Iterator iterator = tasks.iterator(); + while (iterator.hasNext()) { + TaskDto task = iterator.next(); + if (StrUtil.equals(task.getStart_device_code(),start_device) && StrUtil.equals(task.getNext_device_code(),next_device) + && StrUtil.equals(task.getTask_status(),status)) { + num++; + } + } + + return num; + } + + @Override public Integer querySameTaskByType(String taskType) { int num = 0; @@ -1352,4 +1523,5 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { return null; } + } diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index 6af6f7273..f68170c29 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -39,6 +39,9 @@ public class AutoCreateInst { List list = taskserver.queryAll("task_status = '0'"); for (int i = 0; i < list.size(); i++) { TaskDto acsTask = list.get(i); + if(StrUtil.equals(acsTask.getTask_type(),"7") && !StrUtil.startWith(acsTask.getTask_code(), "-") ){ + continue; + } String taskid = acsTask.getTask_id(); String taskcode = acsTask.getTask_code(); String task_type = acsTask.getTask_type(); @@ -71,9 +74,7 @@ public class AutoCreateInst { if (StrUtil.equals(is_send, "0")) { continue; } - if(StrUtil.equals(storage_task_type,"1") || StrUtil.equals(storage_task_type,"2") ){ - continue; - } + //校验路由关系 List shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); if (ObjectUtils.isEmpty(shortPathsList)) { 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 4b0734aeb..063b473e2 100644 --- a/acs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/src/main/resources/config/application-dev.yml @@ -6,9 +6,9 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource 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: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 + 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 username: ${DB_USER:root} # password: ${DB_PWD:P@ssw0rd} # password: ${DB_PWD:Root.123456} @@ -131,7 +131,7 @@ file: avatarMaxSize: 5 logging: file: - path: C:\log\acs + path: D:\acs_log config: classpath:logback-spring.xml # Sa-Token配置 @@ -155,5 +155,5 @@ sa-token: token-prefix: Bearer loki: - url: http://localhost:3100/loki/api/v1 + url: http://127.0.0.1:3100/loki/api/v1 systemName: acs diff --git a/acs/nladmin-system/src/main/resources/config/application-prod.yml b/acs/nladmin-system/src/main/resources/config/application-prod.yml index 4a18ca476..e95a76390 100644 --- a/acs/nladmin-system/src/main/resources/config/application-prod.yml +++ b/acs/nladmin-system/src/main/resources/config/application-prod.yml @@ -135,7 +135,7 @@ file: avatarMaxSize: 5 logging: file: - path: /app/jar/logs + path: D:\acs_log config: classpath:logback-spring.xml # Sa-Token配置 diff --git a/acs/nladmin-system/src/main/resources/config/application-test.yml b/acs/nladmin-system/src/main/resources/config/application-test.yml index 250e563b1..4a18ca476 100644 --- a/acs/nladmin-system/src/main/resources/config/application-test.yml +++ b/acs/nladmin-system/src/main/resources/config/application-test.yml @@ -1,42 +1,22 @@ server: - port: 8010 -#ERP系统相关 -erp: - oracle: - enabled: false - jdbcurl: jdbc:oracle:thin:@192.168.81.251:1522:ORCL2 - username: system - password: 123456 - sqlserver: - enabled: false - jdbcurl: jdbc:sqlserver://47.97.157.227:1433;DatabaseName=testdb-lx - username: sa - password: Nl@123 - + port: 8011 #配置数据源 spring: datasource: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - # url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:whxr}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:whxr_mes1}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + 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 username: ${DB_USER:root} - password: ${DB_PWD:Root.123456} - # username: ${DB_USER:root} - # password: ${DB_PWD:root} + password: ${DB_PWD:123456} # 初始连接数 initial-size: 5 # 最小连接数 min-idle: 15 # 最大连接数 - max-active: 30 - # 是否自动回收超时连接 - remove-abandoned: true - # 超时时间(以秒数为单位) - remove-abandoned-timeout: 180 + max-active: 60 # 获取连接超时时间 - max-wait: 3000 + max-wait: 5000 # 连接有效性检测时间 time-between-eviction-runs-millis: 60000 # 连接在池中最小生存的时间 @@ -56,8 +36,11 @@ spring: enabled: true stat-view-servlet: enabled: true + # 控制台管理用户名和密码 url-pattern: /druid/* reset-enable: false + login-username: admin + login-password: 123456 filter: stat: enabled: true @@ -70,16 +53,16 @@ spring: multi-statement-allow: true redis: #数据库索引 - database: ${REDIS_DB:1} - host: ${REDIS_HOST:47.111.78.178} + database: ${REDIS_DB:9} + host: ${REDIS_HOST:127.0.0.1} port: ${REDIS_PORT:6379} password: ${REDIS_PWD:} #连接超时时间 - timeout: 10000 + timeout: 5000 # 登录相关配置 login: # 登录缓存 - cache-enable: false + cache-enable: true # 是否限制单用户登录 single-login: false # 验证码 @@ -94,7 +77,7 @@ login: heigth: 36 # 内容长度 length: 2 - # 字体名称,为空则使用默认字体 + # 字体名称,为空则使用默认字体,如遇到线上乱码,设置其他字体即可 font-name: # 字体大小 font-size: 25 @@ -106,29 +89,36 @@ jwt: token-start-with: Bearer # 必须使用最少88位的Base64对该令牌进行编码 base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI= - # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html - token-validity-in-seconds: 14400000 + # 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html + token-validity-in-seconds: 7200000 # 在线用户key online-key: online-token- # 验证码 code-key: code-key- - # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 + # token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 detect: 1800000 - # 续期时间范围,默认1小时,单位毫秒 + # 续期时间范围,默认 1小时,这里单位毫秒 renew: 3600000 -#是否允许生成代码,生产环境设置为false -generator: - enabled: true - -#是否开启 swagger-ui -swagger: - enabled: true - # IP 本地解析 ip: local-parsing: true +#是否允许生成代码,生产环境设置为false +generator: + enabled: false + +#如果生产环境要开启swagger,需要配置请求地址 +#springfox: +# documentation: +# swagger: +# v2: +# host: # 接口域名或外网ip + +#是否开启 swagger-ui +swagger: + enabled: false + # 文件存储路径 file: mac: @@ -145,5 +135,29 @@ file: avatarMaxSize: 5 logging: file: - path: C:\log\wms + path: /app/jar/logs config: classpath:logback-spring.xml + +# Sa-Token配置 +sa-token: + # token 名称 (同时也是cookie名称) + token-name: Authorization + # token 有效期,单位s 默认30天, -1代表永不过期 + timeout: 2592000 + # token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 + activity-timeout: -1 + # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) + is-share: false + # token风格 + token-style: random-128 + # 是否输出操作日志 + is-log: false + jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq + # token 前缀 + token-prefix: Bearer + +loki: + url: http://localhost:3100/loki/api/v1 + systemName: acs diff --git a/acs/nladmin-system/src/main/resources/config/application.yml b/acs/nladmin-system/src/main/resources/config/application.yml index 2c2cb8d53..f943602c7 100644 --- a/acs/nladmin-system/src/main/resources/config/application.yml +++ b/acs/nladmin-system/src/main/resources/config/application.yml @@ -2,7 +2,7 @@ spring: freemarker: check-template-location: false profiles: - active: prod + active: dev jackson: time-zone: GMT+8 data: @@ -44,7 +44,7 @@ rsa: private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A== logging: file: - path: C:\log\acs + path: D:\acs_log config: classpath:logback-spring.xml # sa-token白名单配置 security: diff --git a/acs/nladmin-system/src/main/resources/log/AcsToLk.xml b/acs/nladmin-system/src/main/resources/log/AcsToLk.xml index 55a7a6329..c8c2d049c 100644 --- a/acs/nladmin-system/src/main/resources/log/AcsToLk.xml +++ b/acs/nladmin-system/src/main/resources/log/AcsToLk.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} diff --git a/acs/nladmin-system/src/main/resources/log/AcsToWms.xml b/acs/nladmin-system/src/main/resources/log/AcsToWms.xml index 2262d7c4f..1fd47dab8 100644 --- a/acs/nladmin-system/src/main/resources/log/AcsToWms.xml +++ b/acs/nladmin-system/src/main/resources/log/AcsToWms.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} diff --git a/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml b/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml index 7a7c5ff10..cb94a38ea 100644 --- a/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml +++ b/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} diff --git a/acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml b/acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml index f79a8116c..cf6996bac 100644 --- a/acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml +++ b/acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} diff --git a/acs/nladmin-system/src/main/resources/log/LkToAcs.xml b/acs/nladmin-system/src/main/resources/log/LkToAcs.xml index 508edd726..2df63ce06 100644 --- a/acs/nladmin-system/src/main/resources/log/LkToAcs.xml +++ b/acs/nladmin-system/src/main/resources/log/LkToAcs.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} @@ -26,7 +27,7 @@ --> - + diff --git a/acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml b/acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml index 5c558e6bc..7387ef7ad 100644 --- a/acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml +++ b/acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} diff --git a/acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml b/acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml index 07dc0b623..26d4cebf5 100644 --- a/acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml +++ b/acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} diff --git a/acs/nladmin-system/src/main/resources/log/WmsToAcs.xml b/acs/nladmin-system/src/main/resources/log/WmsToAcs.xml index 7adef980c..9c26bdaee 100644 --- a/acs/nladmin-system/src/main/resources/log/WmsToAcs.xml +++ b/acs/nladmin-system/src/main/resources/log/WmsToAcs.xml @@ -17,6 +17,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} diff --git a/acs/nladmin-system/src/main/resources/logback-spring.xml b/acs/nladmin-system/src/main/resources/logback-spring.xml index c24e8e7d2..488d2a99a 100644 --- a/acs/nladmin-system/src/main/resources/logback-spring.xml +++ b/acs/nladmin-system/src/main/resources/logback-spring.xml @@ -48,6 +48,7 @@ https://juejin.cn/post/6844903775631572999 + @@ -151,42 +152,38 @@ https://juejin.cn/post/6844903775631572999 + - - + - + + + - - + - - + - - + - - + - - + - - + 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 7cfd2c261..68d9a28e6 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -299,6 +299,8 @@ export default { this.dialogFormVisible4 = true } else if (clickObj.data.driver_type === 'siemens_conveyor') { this.dialogFormVisible5 = true + } else if (clickObj.data.driver_type === 'standard_conveyor_control_with_scanner') { + this.dialogFormVisible5 = true } else { this.dialogFormVisible = true }