diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 117e034..c7b19c6 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -26,6 +26,7 @@ import org.nl.acs.device.service.mapper.DeviceExtraMapper; import org.nl.acs.device.domain.DeviceRunpoint; import org.nl.acs.device.service.mapper.DeviceRunpointMapper; import org.nl.acs.device_driver.manipulator.standard_manipulator.OvenGantryManipulatorDeviceDriver; +import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.route.domain.RouteLine; import org.nl.acs.route.service.mapper.RouteLineMapper; //import org.nl.acs.stage.domain.Stage; @@ -1188,6 +1189,9 @@ public class DeviceServiceImpl extends CommonServiceImpl i StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver(); standardCoveyorControlWithScannerDeviceDriver.setDeviceStatus(form); + } else if (device.getDeviceDriver() instanceof DeviceStageMonitor) { + DeviceStageMonitor deviceStageMonitor = (DeviceStageMonitor) device.getDeviceDriver(); + deviceStageMonitor.setDeviceStatus(form); } } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/double_station_stacker/DoubleStationStackerDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/double_station_stacker/DoubleStationStackerDeviceDriver.java index 5c0b4c2..efbcb06 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/double_station_stacker/DoubleStationStackerDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/double_station_stacker/DoubleStationStackerDeviceDriver.java @@ -68,7 +68,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im public static final Integer MAX_Y = 6; public static final Integer MIN_Y = 1; - /** + /** * 心跳 */ Integer heartbeat = 0; @@ -78,18 +78,18 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im */ Integer itemDeviceCode = 0; Integer lastItemDeviceCode = 0; - /** + /** * 工作模式 */ Integer mode = 0; Integer lastMode = 0; - /** + /** * 行走开关信号 */ Float move = 0F; Float lastMove = 0F; - /** + /** * 行走动作信号 */ Float action = 0F; @@ -105,24 +105,24 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im Integer frontTask = 0; Integer lastFrontTask = 0; - /** + /** * 行走激光数值 */ Integer distanceX = 0; Integer lastDistanceX = 0; - /** + /** * 特殊开关量1 */ Float special1 = 0F; Float lastSpecial1 = 0F; - /** + /** * 特殊开关量2 */ Float special2 = 0F; Float lastSpecial2 = 0F; - /** + /** * 水箱和消防缓存位有无货 */ Float storageCache = 0F; @@ -151,7 +151,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im Integer backZerror = 0; Integer lastBackZerror = 0; - /** + /** * 前叉行走排号 */ Integer frontZ = 0; @@ -236,6 +236,19 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im */ Boolean requireSucess = false; + /** + * 禁止入库 + */ + private boolean prohibitInWarehouse = false; + /** + * 禁止出库 + */ + private boolean prohibitOutWarehouse = false; + /** + * 停止接收任务 + */ + private boolean stopReceiveTask = false; + @Override public Device getDevice() { @@ -264,38 +277,38 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im message = "有报警"; } else { Map map = new LinkedHashMap<>(); - if (CommandEnum.STANDY.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.STANDY.getStatus())){ + if (CommandEnum.STANDY.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.STANDY.getStatus())) { applyTask(); requireSucess = true; } - if (CommandEnum.PICKUP.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.PICKUP.getStatus())){ + if (CommandEnum.PICKUP.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.PICKUP.getStatus())) { message = "取货中"; } - if (CommandEnum.PICKUP_COMPLETE.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.PICKUP_COMPLETE.getStatus())){ + if (CommandEnum.PICKUP_COMPLETE.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.PICKUP_COMPLETE.getStatus())) { message = "取货完成"; LinkedList inst = new LinkedList<>(); getIns(inst); - if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isNotEmpty(inst.get(0))) { + if (CollectionUtil.isNotEmpty(inst) && ObjectUtil.isNotEmpty(inst.get(0))) { String startDeviceCode = inst.get(0).getStart_device_code(); Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode); - writeStorageOrConveyor(inst,startDeviceCode,startDevice,map); + writeStorageOrConveyor(inst, startDeviceCode, startDevice, map); } - if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isEmpty(inst.get(0))) { + if (CollectionUtil.isNotEmpty(inst) && ObjectUtil.isEmpty(inst.get(0))) { String startDeviceCode = inst.get(1).getStart_device_code(); Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode); - writeStorageOrConveyor(inst,startDeviceCode,startDevice,map); + writeStorageOrConveyor(inst, startDeviceCode, startDevice, map); } map.put("to_command", CommandEnum.PICKUP_COMPLETE.getStatus()); requireSucess = true; } - if (CommandEnum.RELEASE.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.RELEASE.getStatus())){ + if (CommandEnum.RELEASE.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.RELEASE.getStatus())) { message = "放货中"; } - if (CommandEnum.UNLOAD.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.UNLOAD.getStatus())){ + if (CommandEnum.UNLOAD.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.UNLOAD.getStatus())) { message = "请求卸货(申请卸货)"; LinkedList inst = new LinkedList<>(); getIns(inst); - if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isNotEmpty(inst.get(0))) { + if (CollectionUtil.isNotEmpty(inst) && ObjectUtil.isNotEmpty(inst.get(0))) { String nextDeviceCode = inst.get(0).getNext_device_code(); Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode); //指令为执行 @@ -305,7 +318,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im map.put("to_command", 3); requireSucess = true; } - if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isEmpty(inst.get(0))) { + if (CollectionUtil.isNotEmpty(inst) && ObjectUtil.isEmpty(inst.get(0))) { String nextDeviceCode = inst.get(1).getNext_device_code(); Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode); if (unloadCheck(nextDevice)) { @@ -315,13 +328,13 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im requireSucess = true; } } - if (CommandEnum.UNLOAD_COMPLETE.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.UNLOAD_COMPLETE.getStatus())){ + if (CommandEnum.UNLOAD_COMPLETE.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.UNLOAD_COMPLETE.getStatus())) { message = "放货完成"; map.put("to_command", 5); LinkedList inst = new LinkedList<>(); getIns(inst); try { - if (CollectionUtil.isNotEmpty(inst)){ + if (CollectionUtil.isNotEmpty(inst)) { for (Instruction instruction : inst) { finishInstruction(instruction); } @@ -333,17 +346,17 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im } - if (CommandEnum.PICKUP_PREPARATION.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.PICKUP_PREPARATION.getStatus())){ + if (CommandEnum.PICKUP_PREPARATION.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.PICKUP_PREPARATION.getStatus())) { message = "取货准备(会库位台)"; map.put("to_command", 6); requireSucess = true; } - if (CommandEnum.RECALL.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.RECALL.getStatus())){ + if (CommandEnum.RECALL.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.RECALL.getStatus())) { message = "召回"; map.put("to_command", 7); requireSucess = true; } - if (CommandEnum.STOP.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.STOP.getStatus())){ + if (CommandEnum.STOP.getStatus().equals(frontCommand) || backCommand.equals(CommandEnum.STOP.getStatus())) { message = "急停"; map.put("to_command", 8); requireSucess = true; @@ -398,15 +411,16 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im private void getIns(LinkedList inst) { if (ObjectUtil.isNotEmpty(this.frontTask)) { Instruction instructionFront = instructionService.findByCodeFromCache(String.valueOf(frontTask)); - if (ObjectUtil.isNotEmpty(instructionFront)){ + if (ObjectUtil.isNotEmpty(instructionFront)) { inst.add(instructionFront); } } if (ObjectUtil.isNotEmpty(this.backTask)) { Instruction instructionBack = instructionService.findByCodeFromCache(String.valueOf(backTask)); - if (CollectionUtil.isNotEmpty(inst) && ObjectUtil.isNotEmpty(instructionBack)){ + if (CollectionUtil.isNotEmpty(inst) && ObjectUtil.isNotEmpty(instructionBack)) { inst.add(instructionBack); - }if (CollectionUtil.isEmpty(inst) && ObjectUtil.isNotEmpty(instructionBack)){ + } + if (CollectionUtil.isEmpty(inst) && ObjectUtil.isNotEmpty(instructionBack)) { inst.add(null); inst.add(instructionBack); } @@ -465,7 +479,6 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im /** * 申请任务 - * */ public synchronized boolean applyTask() { Date date = new Date(); @@ -503,7 +516,6 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im } - } return false; } @@ -556,17 +568,16 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im } //前叉信号写入 HashMap map = new HashMap<>(); - if (inst.size()==1&& ObjectUtil.isNotEmpty(inst.get(0))) { + if (inst.size() == 1 && ObjectUtil.isNotEmpty(inst.get(0))) { map.put("to_device_code", this.getDevice().getAddress()); map.put("to_command", CommandEnum.PICKUP.getStatus().toString()); map.put("to_front_task", inst.get(0).getInstruction_code()); - } - else if (inst.size()>1 && ObjectUtil.isEmpty(inst.get(1))) { + } else if (inst.size() > 1 && ObjectUtil.isEmpty(inst.get(1))) { map.put("to_device_code", this.getDevice().getAddress()); map.put("to_command", CommandEnum.PICKUP.getStatus().toString()); map.put("to_back_task", inst.get(1).getInstruction_code()); - }else{ + } else { map.put("to_device_code", this.getDevice().getAddress()); map.put("to_command", CommandEnum.PICKUP.getStatus().toString()); map.put("to_front_task", inst.get(0).getInstruction_code()); @@ -604,16 +615,16 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im map.put("to_z", inst.get(0).getFrom_x()); } map.put("to_x", inst.get(0).getFrom_y()); - }else { + } else { //只存在后叉的情况 - map.put("to_y", Integer.parseInt(inst.get(0).getFrom_z())+1); + map.put("to_y", Integer.parseInt(inst.get(0).getFrom_z()) + 1); if (inst.get(0).getFrom_x().length() > 1) { String substring = inst.get(0).getFrom_x().substring(1); - map.put("to_z", Integer.parseInt(substring)+1); + map.put("to_z", Integer.parseInt(substring) + 1); } else { - map.put("to_z", Integer.parseInt(inst.get(0).getFrom_x())+1); + map.put("to_z", Integer.parseInt(inst.get(0).getFrom_x()) + 1); } - map.put("to_x", Integer.parseInt(inst.get(0).getFrom_y())+1); + map.put("to_x", Integer.parseInt(inst.get(0).getFrom_y()) + 1); } } } @@ -621,14 +632,14 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im private boolean findInstruction(List instructionList, Instruction inst, LinkedList instructionsAll) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); CommonFinalParam commonFinalParam = new CommonFinalParam(); - wrapper.in(DeviceExtra::getExtra_name,"no_front_y","no_front_x","no_back_y","no_back_x","sort"); + wrapper.in(DeviceExtra::getExtra_name, "no_front_y", "no_front_x", "no_back_y", "no_back_x", "sort"); List deviceExtras = deviceExtraMapper.selectList(wrapper); //默认第一条指令为前叉判断是否符合 - if (StringUtils.isEmpty(inst.getNext_point_code())&&!StringUtils.contains(inst.getNext_point_code(),commonFinalParam.getBARRE())){ + if (StringUtils.isEmpty(inst.getNext_point_code()) && !StringUtils.contains(inst.getNext_point_code(), commonFinalParam.getBARRE())) { return true; - }else { + } else { String[] splitFront = inst.getNext_point_code().split(commonFinalParam.getBARRE()); List frontY = deviceExtras.stream().filter(item -> "no_front_y".equals(item.getExtra_name())).collect(Collectors.toList()); List frontX = deviceExtras.stream().filter(item -> "no_front_x".equals(item.getExtra_name())).collect(Collectors.toList()); @@ -643,30 +654,30 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im return true; } - if (Integer.valueOf(splitFront[1]).equals(MIN_Y)){ + if (Integer.valueOf(splitFront[1]).equals(MIN_Y)) { return true; } - String x1 ; - String x2 ; - if (Integer.parseInt(splitFront[1])<10){ - x1 = "0"+(Integer.parseInt(splitFront[1]) - 1); - x2 = "0"+(Integer.parseInt(splitFront[1]) + 1); - }else { - x1 = ""+(Integer.parseInt(splitFront[1]) - 1); - x2 = ""+(Integer.parseInt(splitFront[1]) + 1); + String x1; + String x2; + if (Integer.parseInt(splitFront[1]) < 10) { + x1 = "0" + (Integer.parseInt(splitFront[1]) - 1); + x2 = "0" + (Integer.parseInt(splitFront[1]) + 1); + } else { + x1 = "" + (Integer.parseInt(splitFront[1]) - 1); + x2 = "" + (Integer.parseInt(splitFront[1]) + 1); } //根据排序进行加减 String nextPointCodeDown = splitFront[0] + commonFinalParam.getBARRE() + x1 + commonFinalParam.getBARRE() + splitFront[2]; String nextPointCodeUp = splitFront[0] + commonFinalParam.getBARRE() + x2 + commonFinalParam.getBARRE() + splitFront[2]; - if (CollectionUtil.isNotEmpty(sort)&& SortEnum.BACK.getCode().equals(sort.get(0).getExtra_value())){ + if (CollectionUtil.isNotEmpty(sort) && SortEnum.BACK.getCode().equals(sort.get(0).getExtra_value())) { nextPointCodeDown = splitFront[0] + commonFinalParam.getBARRE() + x2 + commonFinalParam.getBARRE() + splitFront[2]; nextPointCodeUp = splitFront[0] + commonFinalParam.getBARRE() + x1 + commonFinalParam.getBARRE() + splitFront[2]; } - if (Integer.valueOf(splitFront[1]).equals(MAX_Y)){ + if (Integer.valueOf(splitFront[1]).equals(MAX_Y)) { String finalNextPointCodeDown = nextPointCodeDown; List instructionNextPointList = instructionList.stream().filter(item -> item.getNext_point_code().equals(finalNextPointCodeDown)).collect(Collectors.toList()); - if (instructionNextPointList.size()>0){ + if (instructionNextPointList.size() > 0) { String[] splitBack = instructionNextPointList.get(0).getNext_point_code().split(commonFinalParam.getBARRE()); if (checkY(splitBack, backY)) { return true; @@ -676,13 +687,13 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im } instructionsAll.add(instructionNextPointList.get(0)); } - }else { + } else { String finalNextPointCodeDown1 = nextPointCodeDown; List instructionNextPointList1 = instructionList.stream().filter(item -> item.getNext_point_code().equals(finalNextPointCodeDown1)).collect(Collectors.toList()); String finalNextPointCodeUp = nextPointCodeUp; List instructionNextPointList2 = instructionList.stream().filter(item -> item.getNext_point_code().equals(finalNextPointCodeUp)).collect(Collectors.toList()); - if (instructionNextPointList1.size()>0){ + if (instructionNextPointList1.size() > 0) { String[] splitBack = instructionNextPointList1.get(0).getNext_point_code().split(commonFinalParam.getBARRE()); if (checkY(splitBack, backY)) { return true; @@ -693,7 +704,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im instructionsAll.add(instructionNextPointList1.get(0)); return false; } - if (instructionNextPointList2.size()>0){ + if (instructionNextPointList2.size() > 0) { //前叉的上一列有指令,此时前叉变成后叉,重新校验 String[] splitBack = instructionNextPointList2.get(0).getNext_point_code().split(commonFinalParam.getBARRE()); if (checkY(splitBack, frontY)) { @@ -720,7 +731,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im } private boolean checkX(String[] split, List x) { - if (x.size()!=0&& StringUtils.isNotEmpty(x.get(0).getExtra_value())){ + if (x.size() != 0 && StringUtils.isNotEmpty(x.get(0).getExtra_value())) { String[] splitValue = x.get(0).getExtra_value().split(","); Set set = new HashSet<>(Arrays.asList(splitValue)); return set.contains(split[0]); @@ -729,7 +740,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im } private boolean checkY(String[] split, List y) { - if (y.size()!=0&& StringUtils.isNotEmpty(y.get(0).getExtra_value())){ + if (y.size() != 0 && StringUtils.isNotEmpty(y.get(0).getExtra_value())) { String[] splitValue = y.get(0).getExtra_value().split(","); Set set = new HashSet<>(Arrays.asList(splitValue)); return set.contains(split[1]); @@ -759,14 +770,37 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im @Override public JSONObject getDeviceStatusName() { - return null; + JSONObject jo = new JSONObject(); + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("prohibitInWarehouse", this.prohibitInWarehouse); + jo.put("prohibitOutWarehouse", this.prohibitOutWarehouse); + jo.put("stopReceiveTask", this.stopReceiveTask); + jo.put("is_click", true); + jo.put("driver_type", "double_station_stacker"); + return jo; } @Override public void setDeviceStatus(JSONObject data) { - + if (ObjectUtil.isNotEmpty(data)) { + //监控大屏下发作业命令清警-5、召回-7、急停-8 + Integer toCommand = data.getInteger("toCommand"); + if (toCommand != null) { + Map map = new HashMap<>(); + map.put("to_command", toCommand); + this.writing(map); + } + //ACS监控大屏设置禁止入库、禁止出库、停止接收任务 + Boolean prohibitInWarehouse = data.getBoolean("prohibitInWarehouse"); + this.prohibitInWarehouse = prohibitInWarehouse; + Boolean prohibitOutWarehouse = data.getBoolean("prohibitOutWarehouse"); + this.prohibitOutWarehouse = prohibitOutWarehouse; + Boolean stopReceiveTask = data.getBoolean("stopReceiveTask"); + this.stopReceiveTask = stopReceiveTask; + } } + /** * 完成指令 * @@ -824,6 +858,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im /** * 将扩展表中的字符串数据转换成集合 + * * @param extraName * @return */ @@ -846,7 +881,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im private void setData() { device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getItem_heartbeat(); - itemDeviceCode= this.itemProtocol.getItem_device_Code(); + itemDeviceCode = this.itemProtocol.getItem_device_Code(); mode = this.itemProtocol.getItem_mode(); move = this.itemProtocol.getItem_move(); frontCommand = this.itemProtocol.getItem_front_command(); diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/domain/RouteLine.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/domain/RouteLine.java index c38306f..de70c86 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/domain/RouteLine.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/domain/RouteLine.java @@ -41,10 +41,18 @@ public class RouteLine extends CommonModel implements Serializable { @NotBlank private String device_code; + @ApiModelProperty(value = "设备类型") + @NotBlank + private String start_device_type; + @ApiModelProperty(value = "下一设备") @NotBlank private String next_device_code; + @ApiModelProperty(value = "下一设备类型") + @NotBlank + private String next_device_type; + @ApiModelProperty(value = "路线类型") private String type; diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/dto/RouteLineDto.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/dto/RouteLineDto.java index 755a383..0effe1e 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/dto/RouteLineDto.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/dto/RouteLineDto.java @@ -30,9 +30,15 @@ public class RouteLineDto implements Serializable { @ApiModelProperty(value = "设备编码") private String device_code; + @ApiModelProperty(value = "起点设备类型") + private String start_device_type; + @ApiModelProperty(value = "下一设备") private String next_device_code; + @ApiModelProperty(value = "终点设备类型") + private String next_device_type; + @ApiModelProperty(value = "路线类型") private String type; /** diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java index 6f30b22..bd24aec 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java @@ -17,6 +17,8 @@ import org.nl.acs.auto.initial.ApplicationAutoInitial; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; import org.nl.acs.device.enums.DeviceType; +import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device.service.dto.DeviceDto; import org.nl.acs.device.service.mapper.DeviceMapper; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.opc.DeviceAppService; @@ -85,6 +87,8 @@ public class RouteLineServiceImpl extends CommonServiceImpl queryAll(RouteLineQueryParam query, Pageable pageable) { @@ -298,13 +302,17 @@ public class RouteLineServiceImpl extends CommonServiceImpl next_arr = (ArrayList) whereJson.get("next_device_code"); for (int i = 0; i < start_arr.size(); i++) { String device_code = start_arr.get(i); + DeviceDto start_device = deviceService.findByCode(device_code); for (int j = 0; j < next_arr.size(); j++) { String next_device_code = next_arr.get(j); + DeviceDto next_device = deviceService.findByCode(next_device_code); RouteLineDto dto = new RouteLineDto(); dto.setWeights(String.valueOf(whereJson.get("weights"))); dto.setRoute_plan_id(String.valueOf(whereJson.get("route_plan_id"))); dto.setDevice_code(device_code); + dto.setStart_device_type(start_device.getDevice_type()); dto.setNext_device_code(next_device_code); + dto.setNext_device_type(next_device.getDevice_type()); dto.setType(String.valueOf(whereJson.get("type"))); String currentUsername = SecurityUtils.getCurrentUsername(); String now = DateUtil.now(); @@ -467,6 +475,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl @@ -167,7 +170,12 @@ > - + +