diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java index 13067629f..62e441851 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java @@ -1,5 +1,6 @@ package org.nl.acs.agv.server.impl; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -81,8 +82,8 @@ public class NDCAgvServiceImpl implements NDCAgvService { @LokiLog(type = LokiLogType.AGV) @Override public void sendAgvInstToNDC(String agv_system_type, Instruction inst) { - log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() + - ",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() + + log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() + + ",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() + ",nextAddress:" + inst.getNext_point_code()); if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { if (!StrUtil.equals(agv_system_type, "1")) { @@ -109,8 +110,16 @@ public class NDCAgvServiceImpl implements NDCAgvService { byte fhdlow2 = (byte) IntToHexLow(nextAddress2); byte prioritylow = (byte) IntToHexLow(priority); + String str = "十进制下发:"; String str1 = "十六进制下发:"; + if (ObjectUtil.isNotEmpty(inst.getCarno())) { + int carNo = Integer.parseInt(inst.getCarno()); + byte agvnohigh = (byte) IntToHexHigh(carNo); + byte agvnolow = (byte) IntToHexLow(carNo); + str += "agv车号 /carNo:" + (carNo); + str1 += "agv车号 /carNo:" + hexToString(agvnolow & 0xFF); + } str += "任务号 ikey:" + (Integer.parseInt(instcode)); str1 += "任务号 ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF); @@ -132,22 +141,45 @@ public class NDCAgvServiceImpl implements NDCAgvService { byte[] b = new byte[]{}; if (type == 1) { - b = new byte[]{(byte) 0X87, (byte) 0XCD, - (byte) 0X00, (byte) 0X08, - (byte) 0X00, (byte) 0X16, - (byte) 0X00, (byte) 0X01, - (byte) 0X00, (byte) 0X71, - (byte) 0X00, (byte) 0X12, - (byte) 0X01, prioritylow, - (byte) 0X00, (byte) 0X01, - (byte) ikeyhigh, (byte) ikeylow, - (byte) ikeyhigh, (byte) ikeylow, - (byte) typehigh, (byte) typelow, - (byte) qhdhigh, (byte) qhdlow, - (byte) qhdhigh2, (byte) qhdlow2, - (byte) fhdhigh, (byte) fhdlow, - (byte) fhdhigh2, (byte) fhdlow2 - }; + if (ObjectUtil.isNotEmpty(inst.getCarno())) { + int carNo = Integer.parseInt(inst.getCarno()); + byte agvnohigh = (byte) IntToHexHigh(carNo); + byte agvnolow = (byte) IntToHexLow(carNo); + b = new byte[]{(byte) 0X87, (byte) 0XCD, + (byte) 0X00, (byte) 0X08, + (byte) 0X00, (byte) 0X18, + (byte) 0X00, (byte) 0X01, + (byte) 0X00, (byte) 0X71, + (byte) 0X00, (byte) 0X14, + (byte) 0X01, prioritylow, + (byte) 0X00, (byte) 0X01, + (byte) ikeyhigh, (byte) ikeylow, + (byte) ikeyhigh, (byte) ikeylow, + (byte) typehigh, (byte) typelow, + (byte) qhdhigh, (byte) qhdlow, + (byte) qhdhigh2, (byte) qhdlow2, + (byte) fhdhigh, (byte) fhdlow, + (byte) fhdhigh2, (byte) fhdlow2, + (byte) agvnohigh, (byte) agvnolow + }; + } else { + b = new byte[]{(byte) 0X87, (byte) 0XCD, + (byte) 0X00, (byte) 0X08, + (byte) 0X00, (byte) 0X16, + (byte) 0X00, (byte) 0X01, + (byte) 0X00, (byte) 0X71, + (byte) 0X00, (byte) 0X12, + (byte) 0X01, prioritylow, + (byte) 0X00, (byte) 0X01, + (byte) ikeyhigh, (byte) ikeylow, + (byte) ikeyhigh, (byte) ikeylow, + (byte) typehigh, (byte) typelow, + (byte) qhdhigh, (byte) qhdlow, + (byte) qhdhigh2, (byte) qhdlow2, + (byte) fhdhigh, (byte) fhdlow, + (byte) fhdhigh2, (byte) fhdlow2 + }; + } } else if (type == 2) { b = new byte[]{(byte) 0X87, (byte) 0XCD, (byte) 0X00, (byte) 0X08, diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 1b3be020d..d16ea07c0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -465,7 +465,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logServer.deviceExecuteLog(this.device_code, "", "", "上报满卷重量,weight:" + weight); message = "上报满卷重量,weight:" + weight + ",指令号:" + ikey; task.setWeight(String.valueOf(weight)); - task.setCarno(this.device_code); + task.setCar_no(this.device_code); taskService.update(task); } data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java index 9d559cfb8..036de651d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java @@ -146,4 +146,6 @@ public class CreateTaskRequest extends BaseRequest { private String paper_array; + private String car_no; + } 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 cc5187dfe..eb747c840 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 @@ -774,6 +774,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String route_plan_code = request.getRoute_plan_code(); String task_type = request.getTask_type(); String truss_type = request.getTruss_type(); + String car_no = request.getCar_no(); String is_bushing = request.getIs_bushing(); String version = request.getVersion(); String bushing_num = request.getBushing_num(); @@ -968,6 +969,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("vehicle_type", vehicle_type); jo.put("storage_task_type", storage_task_type); jo.put("agv_system_type", agv_system_type); + jo.put("car_no", car_no); jo.put("start_height", start_height); jo.put("next_height", next_height); jo.put("oven_time", (int) Math.ceil(oven_time)); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java index 2f5f4f03b..3eef4176c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java @@ -303,7 +303,7 @@ public class TaskDto implements Serializable { /** * 车号 */ - private String carno; + private String car_no; /** * agv取货高度 @@ -353,6 +353,7 @@ public class TaskDto implements Serializable { + @Override public String toString(){ return "task_code:" + this.getTask_code() 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 1502152b2..25ebe4706 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 @@ -774,8 +774,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (ObjectUtil.isNotEmpty(dto.getWeight())) { feed_jo.put("weight", dto.getWeight()); } - if (ObjectUtil.isNotEmpty(dto.getCarno())) { - feed_jo.put("car_no", dto.getCarno()); + if (ObjectUtil.isNotEmpty(dto.getCar_no())) { + feed_jo.put("car_no", dto.getCar_no()); } JSONArray ja = new JSONArray(); ja.add(feed_jo); @@ -1188,7 +1188,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { map.put("立库任务类型", acsTask.getStorage_task_type()); map.put("烘箱温度", acsTask.getTemperature()); map.put("烘箱时间", acsTask.getOven_time()); - map.put("agv车号", acsTask.getCarno()); + map.put("agv车号", acsTask.getCar_no()); map.put("路由方案名称", acsTask.getRoute_plan_name()); map.put("路由方案编码", acsTask.getRoute_plan_code()); map.put("是否需要反馈上位系统", acsTask.getIs_needfeedback()); 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 e4de5af55..8808b4a1b 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 @@ -68,6 +68,7 @@ public class AutoCreateInst { String route_plan_code = acsTask.getRoute_plan_code(); String vehicleType = acsTask.getVehicle_type(); String agv_system_type = acsTask.getAgv_system_type(); + String carno = acsTask.getCar_no(); String start_height = acsTask.getStart_height(); String next_height = acsTask.getNext_height(); @@ -141,6 +142,7 @@ public class AutoCreateInst { instdto.setExecute_device_code(start_point_code); instdto.setVehicle_type(vehicleType); instdto.setAgv_system_type(agv_system_type); + instdto.setCarno(carno); instdto.setStart_height(start_height); instdto.setNext_height(next_height); //判断agv系统 diff --git a/acs/nladmin-system/src/main/resources/config/application.yml b/acs/nladmin-system/src/main/resources/config/application.yml index 9d5b4935c..5a5b8e2f7 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: dev + active: prod jackson: time-zone: GMT+8 data: diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java index be1d60f43..fcd194c23 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java @@ -124,4 +124,6 @@ public interface XianGongAgvService { * @return */ HttpResponse sendOrderSequencesToForklift(Instruction dto, InteractionJsonDTO interactionJsonDTO); + + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java index 218c4d6ce..56c06afb7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java @@ -1,5 +1,6 @@ package org.nl.acs.agv.server.impl; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -74,17 +75,15 @@ public class NDCAgvServiceImpl implements NDCAgvService { } - @Override public void sendAgvInstToNDC(String agv_system_type, Instruction inst) { - log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() + - ",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() + + log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() + + ",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() + ",nextAddress:" + inst.getNext_point_code()); if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { if (!StrUtil.equals(agv_system_type, "1")) { String instcode = inst.getInstruction_code(); int type = Integer.parseInt(inst.getAgv_inst_type()); - int carNo = Integer.parseInt(inst.getCarno()); int priority = Integer.parseInt(inst.getPriority()) + 128; DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); @@ -96,8 +95,6 @@ public class NDCAgvServiceImpl implements NDCAgvService { byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode)); byte typehigh = (byte) IntToHexHigh(type); byte typelow = (byte) IntToHexLow(type); - byte agvnohigh = (byte) IntToHexHigh(carNo); - byte agvnolow = (byte) IntToHexLow(carNo); byte qhdhigh = (byte) IntToHexHigh(startAddress); byte qhdlow = (byte) IntToHexLow(startAddress); byte qhdhigh2 = (byte) IntToHexHigh(startAddress2); @@ -107,7 +104,6 @@ public class NDCAgvServiceImpl implements NDCAgvService { byte fhdhigh2 = (byte) IntToHexHigh(nextAddress2); byte fhdlow2 = (byte) IntToHexLow(nextAddress2); byte prioritylow = (byte) IntToHexLow(priority); - String str = "十进制下发:"; String str1 = "十六进制下发:"; str += "任务号 ikey:" + (Integer.parseInt(instcode)); @@ -128,8 +124,6 @@ public class NDCAgvServiceImpl implements NDCAgvService { str += "优先级 /priority:" + (priority); str1 += "优先级 /priority:" + hexToString(prioritylow & 0xFF); - str += "agv车号 /carNo:" + (carNo); - str1 += "agv车号 /carNo:" + hexToString(agvnolow & 0xFF); byte[] b = new byte[]{}; if (type == 1) { @@ -341,7 +335,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { } @Override - public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity) { + public byte[] sendAgvTwoModeInst(int phase, int index, int result, int offset, int quantity) { if (phase < 0 || index < 0) return null; byte indexhigh = (byte) IntToHexHigh(index); @@ -368,7 +362,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { log.info("反馈agv动作数据--index:" + hexToString(indexhigh & 0xFF) + hexToString(indexlow & 0xFF) + ",phase:" - + hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF)+",是否侧移: "+(offset == 1?"侧移":"不测移") + ",偏离量: " + quantity); + + hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF) + ",是否侧移: " + (offset == 1 ? "侧移" : "不测移") + ",偏离量: " + quantity); System.out.println("反馈agv动作数据:" + Bytes2HexString(b)); return b; @@ -520,7 +514,6 @@ public class NDCAgvServiceImpl implements NDCAgvService { } - @Override public Map findAllAgvFromCache() { return AGVDeviceStatus; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index a1d6165b4..ecfe8732e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -1082,6 +1082,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } + /** * 追加动作块 * diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 5170b35c6..c5745b7cd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -338,16 +338,26 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i List taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); if (ObjectUtil.isNotEmpty(taskDtoStream)) { TaskDto taskDto = taskDtos.get(0); - if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDto.getTask_type())) { - Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code()); - String start_device_code = instruction.getStart_device_code(); - String next_device_code = instruction.getNext_device_code(); - Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); - Device startdevice = deviceAppService.findDeviceByCode(start_device_code); - HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; - StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; - ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; - OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; + + //存在行架->暂存的AGV任务 需要过滤 + // 6 行架任务 8烘箱任务 + if (!StrUtil.equals(taskDto.getTask_type(), "6") && !StrUtil.equals(taskDto.getTask_type(), "8")) { + taskDto = null; + continue; + } + + Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code()); + if (ObjectUtil.isEmpty(instruction)) { + break; + } + String start_device_code = instruction.getStart_device_code(); + String next_device_code = instruction.getNext_device_code(); + Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); + Device startdevice = deviceAppService.findDeviceByCode(start_device_code); + HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; + StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; + ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; + OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; /*if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof RangingStationsDeviceDriver) { ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (RangingStationsDeviceDriver) nextdevice.getDeviceDriver(); @@ -378,111 +388,104 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i return false; } }*/ - if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); - if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { - if (standardInspectSiteDeviceDriver.getMove() != 1) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; - } - } - } - if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { - hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); - if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; - } - } - - if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); - if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { - if (standardInspectSiteDeviceDriver.getMove() != 0) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; - } - } - } - if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { - hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); - if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; - } - } - //判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true - boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code); - //未关门结束 - if (isCloseDoor) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); + if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); +// if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { + if (standardInspectSiteDeviceDriver.getMove() != 1) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); return false; } +// } + } + if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); + if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } + } + + if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); +// if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { + if (standardInspectSiteDeviceDriver.getMove() != 0) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } +// } + } + if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); + if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } + } + //判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true + boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code); + //未关门结束 + if (isCloseDoor) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); + return false; + } /*instruction.setInstruction_status("1"); instruction.setUpdate_time(DateUtil.now()); instructionService.update(instruction);*/ - Device startDevice = deviceAppService.findDeviceByCode(start_device_code); - Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); - if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { - throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); - } - if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { - throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); - } - String start_addr = startDevice.getExtraValue().get("address").toString(); - String next_addr = nextDevice.getExtraValue().get("address").toString(); - String msg = "当前设备:" + device_code + ",下发指令:" - + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() - + ",指令终点:" + instruction.getNext_device_code(); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(msg) - .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); - List list = new ArrayList<>(); - Map map = new HashMap(); - map.put("code", "to_onset"); - map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0"); - Map map1 = new HashMap(); - map1.put("code", "to_target"); - map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0"); - Map map2 = new HashMap(); - map2.put("code", "to_task"); - map2.put("value", instruction.getInstruction_code()); - Map map3 = new HashMap(); - map3.put("code", "to_command"); - map3.put("value", "1"); - list.add(map); - list.add(map1); - list.add(map2); - list.add(map3); - this.writing(list); - this.setRequireSucess(true); - return true; + Device startDevice = deviceAppService.findDeviceByCode(start_device_code); + Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); + if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); } + if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); + } + String start_addr = startDevice.getExtraValue().get("address").toString(); + String next_addr = nextDevice.getExtraValue().get("address").toString(); + String msg = "当前设备:" + device_code + ",下发指令:" + + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() + + ",指令终点:" + instruction.getNext_device_code(); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(msg) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + List list = new ArrayList<>(); + Map map = new HashMap(); + map.put("code", "to_onset"); + map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0"); + Map map1 = new HashMap(); + map1.put("code", "to_target"); + map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0"); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", instruction.getInstruction_code()); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "1"); + list.add(map); + list.add(map1); + list.add(map2); + list.add(map3); + this.writing(list); + this.setRequireSucess(true); + return true; } else { - List taskDtoList = taskserver.findByTrappedManipulatorReady(); + List taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); if (ObjectUtil.isNotEmpty(taskDtoList)) { - List taskDtosReady = new ArrayList<>(); - for (TaskDto taskDto1 : taskDtoList) { - if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { - taskDtosReady.add(taskDto1); + for (int j = 0; j < taskDtoList.size(); j++) { + //按照优先级排序 优先级相等按照创建时间排序 + taskDtoList = this.sortTask(taskDtoList); + task = taskDtoList.get(j); + // 6 行架任务 8烘箱任务 + if (!StrUtil.equals(task.getTask_type(), "6") && !StrUtil.equals(task.getTask_type(), "8")) { + task = null; + continue; + } + if (ObjectUtil.isNotEmpty(task)) { + break; } } -// task = taskDtosReady.get(0); - List readyTaskDtos = new ArrayList<>(); - for (int j = 0; j < taskDtosReady.size(); j++) { - task = taskDtosReady.get(j); - - readyTaskDtos.add(task); - } - //按照优先级排序 优先级相等按照创建时间排序 - readyTaskDtos = this.sortTask(readyTaskDtos); - task = readyTaskDtos.get(0); - } - if (ObjectUtil.isNotEmpty(task)) { - break; } } } @@ -524,12 +527,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i }*/ if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); - if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { - if (standardInspectSiteDeviceDriver.getMove() != 1) { - notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!"; - return false; - } +// if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { + if (standardInspectSiteDeviceDriver.getMove() != 1) { + notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!"; + return false; } +// } } if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); @@ -548,12 +551,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); - if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { - if (standardInspectSiteDeviceDriver.getMove() != 0) { - notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!"; - return false; - } +// if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { + if (standardInspectSiteDeviceDriver.getMove() != 0) { + notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!"; + return false; } +// } } String taskid = task.getTask_id(); @@ -664,11 +667,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i list.add(map3); this.writing(list); this.setRequireSucess(true); - return true; } else { notCreateInstMessage = "未找到关联设备的任务,指令无法创建"; } - return true; } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java index 577f0688d..c1f04f9cb 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java @@ -226,9 +226,4 @@ public class CreateTaskRequest extends BaseRequest { * 17 木箱堆叠行架任务 */ private String class_type; - - /** - * agv编号 - */ - private String agv_no; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 9a4c80ae6..fc67a293e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -133,7 +133,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String route_plan_code = request.getRoute_plan_code(); String task_type = request.getTask_type(); String class_type = request.getClass_type(); - String agv_no = request.getAgv_no(); String truss_type = request.getTruss_type(); Integer agv_action_type = request.getAgv_action_type(); String empty_site = request.getEmpty_site(); @@ -355,7 +354,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("next_device_code2", next_device_code2); jo.put("put_device_code", put_device_code); jo.put("agv_action_type", agv_action_type); - jo.put("agv_no", agv_no); jo.put("priority", priority); jo.put("vehicle_code", vehicle_code); jo.put("vehicle_code2", vehicle_code2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java index e93bb3b29..c1e76c964 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java @@ -247,11 +247,6 @@ public class Task extends CommonModel implements Serializable { private Integer agv_action_type; - - /** - * agv编号 - */ - private String agv_no; /** * 任务类型 * 9 子卷下线行架任务 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java index da00d9385..8a77885cc 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java @@ -370,9 +370,4 @@ public class TaskDto implements Serializable { * 15 RGV输送任务 */ private String class_type; - - /** - * agv编号 - */ - private String agv_no; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java index aa9b66175..7ad71a891 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java @@ -88,7 +88,6 @@ public class AutoCreateInst { String route_plan_code = acsTask.getRoute_plan_code(); String vehicleType = acsTask.getVehicle_type(); String agv_system_type = acsTask.getAgv_system_type(); - String agv_no = acsTask.getAgv_no(); String start_height = acsTask.getStart_height(); String next_height = acsTask.getNext_height(); @@ -167,7 +166,6 @@ public class AutoCreateInst { instdto.setStart_height(start_height); instdto.setNext_height(next_height); instdto.setAgv_action_type(agvActionType); - instdto.setCarno(agv_no); //判断agv系统 //1、1楼叉车系统 //2、2楼1区域AGV系统 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/user/impl/ISysUserServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/user/impl/ISysUserServiceImpl.java index c17023930..ae247757d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/user/impl/ISysUserServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/user/impl/ISysUserServiceImpl.java @@ -130,6 +130,9 @@ public class ISysUserServiceImpl extends ServiceImpl imp }catch (Exception ex){ throw new RuntimeException(); } + if ("123456".equals(sysUser.getPassword())) { + sysUser.setPassword(SaSecureUtil.md5BySalt("123456", "salt")); + } sysUser.setUpdate_time(new Date()); sysUser.setUpdate_id(SecurityUtils.getCurrentUserId()); this.updateById(sysUser); diff --git a/acs2/nladmin-ui/src/components/Permission/permission.js b/acs2/nladmin-ui/src/components/Permission/permission.js index 01244eb80..ce66d1150 100644 --- a/acs2/nladmin-ui/src/components/Permission/permission.js +++ b/acs2/nladmin-ui/src/components/Permission/permission.js @@ -1,7 +1,7 @@ import store from '@/store' export default { - inserted(el, binding) { + inserted(el, binding, vnode) { const { value } = binding const roles = store.getters && store.getters.roles if (value && value instanceof Array && value.length > 0) { diff --git a/lms/nladmin-system/src/main/resources/config/application-dev.yml b/lms/nladmin-system/src/main/resources/config/application-dev.yml index 8e72c8c4b..b48f93e95 100644 --- a/lms/nladmin-system/src/main/resources/config/application-dev.yml +++ b/lms/nladmin-system/src/main/resources/config/application-dev.yml @@ -10,7 +10,7 @@ spring: url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # username: ${DB_USER:root} username: ${DB_USER:root} - password: ${DB_PWD:root} + password: ${DB_PWD:123456} # 初始连接数 initial-size: 5 # 最小连接数