From a783eee4d7fa4f8b1ee9d7496b9d0f20a39b0548 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Fri, 15 Dec 2023 14:18:29 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=B9=B3=E6=9D=BF=E6=96=B0=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E6=96=B0=E5=A2=9E=E7=AB=99=E7=82=B9=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=81=E4=BB=BB=E5=8A=A1=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardCoveyorControlDeviceDriver.java | 4 +- .../StandardOrdinarySiteDeviceDriver.java | 3 + .../service/InstructionService.java | 1 + .../service/dto/InstructionDto.java | 2 +- .../service/impl/InstructionServiceImpl.java | 44 ++++--- .../org/nl/acs/task/service/TaskService.java | 5 + .../task/service/impl/TaskServiceImpl.java | 19 ++- .../nl/hand/alx/rest/LXHandController.java | 9 ++ .../nl/hand/alx/service/LXHandService.java | 5 + .../alx/service/impl/LXHandServicelmpl.java | 123 ++++++++++++++---- .../quartz/task/QueryXZAgvTaskStatus.java | 31 +++-- .../main/resources/config/application-dev.yml | 6 +- .../src/main/resources/config/application.yml | 4 +- .../device/driver/standard_ordinary_site.vue | 8 ++ 14 files changed, 190 insertions(+), 74 deletions(-) diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java index ed92297..46c8758 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java @@ -167,12 +167,12 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver this.execute_log.log("设备:" + device_code + ",last_error -> error:" + last_error + "->" + error); } - if ( move != 0 && task > 0) { + if (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(mode == 2){ + if (mode == 2) { if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { finish_instruction(); } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 2280ed0..db74747 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -100,6 +100,9 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple int move; + //站点物料来源 + String source_device = ""; + @Override public void execute() { hasGoods = this.getDevice().getHas_goods(); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java index 8a991bc..b1552a7 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -195,6 +195,7 @@ public interface InstructionService { * @return Instruction */ Instruction findByInstCodeFromCache(String inst_code); + /** * 根据设备id查询 * diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java b/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java index c20a7e9..186aa11 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java @@ -67,7 +67,7 @@ public class InstructionDto implements Serializable { /** * 完成类型 */ - private String finish_type ="0"; + private String finish_type = "0"; /** * 优先级 diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index d82fbcd..ac092c6 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -461,7 +461,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } catch (Exception e) { dto.setSend_status("2"); log.info("指令号:" + dto.getInstruction_code() + "下发agv失败!"); - logServer.log(dto.getTask_code(),"create","","","指令号:" + dto.getInstruction_code() + "下发agv失败!","","",dto.getVehicle_code()); e.printStackTrace(); } @@ -671,18 +670,20 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu JSONObject jo1 = new JSONObject(); jo1.put("device_code", instnextdevice); - if (StrUtil.equals(entity.getMaterial(), "1")) { - jo1.put("hasGoodStatus", "1"); - } else { - jo1.put("hasGoodStatus", "2"); - } - jo1.put("put_goods_time",DateUtil.now()); +// if (StrUtil.equals(entity.getMaterial(), "1")) { + jo1.put("hasGoodStatus", "1"); +// } else { +// jo1.put("hasGoodStatus", "2"); +// } + jo1.put("put_goods_time", DateUtil.now()); jo1.put("material_type", startdevice.getMaterial_type()); jo1.put("quantity", startdevice.getQuantity()); jo1.put("remark", startdevice.getRemark()); jo1.put("batch", startdevice.getBatch()); jo1.put("vehicle_code", entity.getVehicle_code()); jo1.put("islock", "false"); + jo1.put("source_device", entity.getStart_device_code()); + deviceService.changeDeviceStatus(jo1); // 如果是无光电的设备 指令完成变更起点、终点状态 JSONObject jo = new JSONObject(); @@ -695,6 +696,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu jo.put("islock", "false"); deviceService.changeDeviceStatus(jo); + JSONObject json = JSONObject.fromObject(entity); wo.update(json); JSONObject taskjson = taskwo.query("task_id ='" + insttaskid + "'").uniqueResult(0); @@ -878,7 +880,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu // != 0 为agv任务 1=magic 2=NDC 3=XZ if (!StrUtil.equals(type, "0")) { if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "1") - && !StrUtil.equals(entity.getSend_status(),"2")) { + && !StrUtil.equals(entity.getSend_status(), "2")) { agvService.deleteAgvInst(entity.getInstruction_code()); flag = true; @@ -890,7 +892,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu flag = true; } } else if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "3") - && !StrUtil.equals(entity.getSend_status(),"2")) { + && !StrUtil.equals(entity.getSend_status(), "2")) { agvService.deleteXZAgvInst(entity.getInstruction_code()); flag = true; } else { @@ -1037,7 +1039,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } - @Override public Instruction findByInstCodeFromCache(String inst_code) { for (int i = 0; i < this.instructions.size(); i++) { @@ -1057,7 +1058,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu return inst; } } - return null; } + return null; + } @Override public Instruction findByIdFromCache(String id) { @@ -1232,14 +1234,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } @Override - public void getFinish(String id){ + public void getFinish(String id) { Instruction inst = this.findById(id); JSONObject feedjo = new JSONObject(); - feedjo.put("status","1"); - feedjo.put("device_code",inst.getStart_device_code()); - feedjo.put("vehicle_code",inst.getVehicle_code()); - feedjo.put("task_code",inst.getTask_code()); + feedjo.put("status", "1"); + feedjo.put("device_code", inst.getStart_device_code()); + feedjo.put("vehicle_code", inst.getVehicle_code()); + feedjo.put("task_code", inst.getTask_code()); JSONArray feedja = JSONArray.fromObject(feedjo); acsToWmsService.feedbackActionStatusToWms(feedja); inst.setFinish_type("1"); @@ -1247,14 +1249,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } @Override - public void putFinish(String id){ + public void putFinish(String id) { Instruction inst = this.findById(id); JSONObject feedjo = new JSONObject(); - feedjo.put("status","2"); - feedjo.put("device_code",inst.getNext_device_code()); - feedjo.put("vehicle_code",inst.getVehicle_code()); - feedjo.put("task_code",inst.getTask_code()); + feedjo.put("status", "2"); + feedjo.put("device_code", inst.getNext_device_code()); + feedjo.put("vehicle_code", inst.getVehicle_code()); + feedjo.put("task_code", inst.getTask_code()); JSONArray feedja = JSONArray.fromObject(feedjo); acsToWmsService.feedbackActionStatusToWms(feedja); inst.setFinish_type("2"); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java b/hd/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java index 696e42c..16cf91a 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java @@ -30,6 +30,7 @@ public interface TaskService { * 数据同步 */ void reload(); + /** * 在缓存中查询所有任务列表 * @@ -99,8 +100,12 @@ public interface TaskService { */ TaskDto findByCode(String code); + + List findByDeviceCode(String device_code); + /** * 检测任务号是否重复 + * * @param code * @return */ diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 905a836..5a18651 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -302,12 +302,23 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { return obj; } + @Override + public List findByDeviceCode(String device_code) { + return Optional + .ofNullable(this.tasks) + .orElse(new ArrayList<>()) + .stream() + .filter(taskDto -> taskDto.getStart_device_code().equals(device_code) || taskDto.getNext_device_code().equals(device_code)) + .filter(taskDto -> taskDto.getTask_code().startsWith("-")) + .collect(Collectors.toList()); + } + @Override public Boolean checkSameTaskByCode(String code) { WQLObject wo = WQLObject.getWQLObject("acs_task"); JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0); final TaskDto obj = (TaskDto) JSONObject.toBean(json, TaskDto.class); - if(ObjectUtil.isEmpty(obj)){ + if (ObjectUtil.isEmpty(obj)) { return false; } return true; @@ -620,7 +631,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } if (ObjectUtil.isNotEmpty(this.findByStartCode(start_device_code)) - || ObjectUtil.isNotEmpty(this.findByNextCode(next_device_code))) { + || ObjectUtil.isNotEmpty(this.findByNextCode(next_device_code))) { throw new WDKException("已存在该起点或终点的任务!"); } if (StrUtil.equals(material_type, "") || StrUtil.equals(quantity, "")) { @@ -1022,7 +1033,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl"); InstructionDto instdto = instructionservice.findByTaskid(entity.getTask_id(), "instruction_status <2 "); - if(!ObjectUtil.isEmpty(instdto)){ + if (!ObjectUtil.isEmpty(instdto)) { instructionService.cancel(instdto.getInstruction_id()); } @@ -1150,7 +1161,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl"); InstructionDto instdto = instructionservice.findByTaskid(entity.getTask_id(), "instruction_status <2 "); - if(!ObjectUtil.isEmpty(instdto)){ + if (!ObjectUtil.isEmpty(instdto)) { instructionService.cancel(instdto.getInstruction_id()); } diff --git a/hd/nladmin-system/src/main/java/org/nl/hand/alx/rest/LXHandController.java b/hd/nladmin-system/src/main/java/org/nl/hand/alx/rest/LXHandController.java index 513723f..d749e05 100644 --- a/hd/nladmin-system/src/main/java/org/nl/hand/alx/rest/LXHandController.java +++ b/hd/nladmin-system/src/main/java/org/nl/hand/alx/rest/LXHandController.java @@ -6,6 +6,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import net.sf.json.JSONObject; import org.nl.annotation.Log; import org.nl.annotation.rest.AnonymousPostMapping; import org.nl.hand.ajp.service.JPHandService; @@ -61,6 +62,14 @@ public class LXHandController { return new ResponseEntity<>(HandService.queryPointByArea(areaCode), HttpStatus.OK); } + @PostMapping("/bindpoint") + @Log("点位绑定") + @ApiOperation("点位绑定") + //@PreAuthorize("@el.check('sect:list')") + public ResponseEntity bindPoint(@RequestBody JSONObject reqParam) { + return new ResponseEntity<>(HandService.bindPoint(reqParam), HttpStatus.OK); + } + @PostMapping("/insts") @Log("查询指令") @ApiOperation("查询指令") diff --git a/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/LXHandService.java b/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/LXHandService.java index 99db817..b084fcf 100644 --- a/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/LXHandService.java +++ b/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/LXHandService.java @@ -1,5 +1,8 @@ package org.nl.hand.alx.service; + +import net.sf.json.JSONObject; + import java.util.Map; /** @@ -23,6 +26,8 @@ public interface LXHandService { */ Map queryPointByArea(String dict_id); + Map bindPoint(JSONObject reqParam); + /** * 查询设备扩展性 * diff --git a/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/impl/LXHandServicelmpl.java b/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/impl/LXHandServicelmpl.java index e46538e..1f75b14 100644 --- a/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/impl/LXHandServicelmpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/hand/alx/service/impl/LXHandServicelmpl.java @@ -1,6 +1,7 @@ package org.nl.hand.alx.service.impl; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; @@ -42,8 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; -import java.util.HashMap; -import java.util.Map; +import java.util.*; /** * @author qxuan @@ -53,12 +53,11 @@ import java.util.Map; @Service @RequiredArgsConstructor @Slf4j -public class LXHandServicelmpl implements LXHandService{ +public class LXHandServicelmpl implements LXHandService { private final UserService userService; private final PasswordEncoder passwordEncoder; private final DeviceService deviceService; private final DeviceAppService deviceAppService; - InstructionService instructionService = null; @Override @@ -71,31 +70,52 @@ public class LXHandServicelmpl implements LXHandService{ return jo; } + @Override public Map queryPointByArea(String dict_id) { JSONArray resultArr = new JSONArray(); JSONObject resultJson = new JSONObject(); - JSONObject jo = new JSONObject(); + //根据value值去查所有的设备 JSONArray acs_deviceja = WQLObject.getWQLObject("ACS_DEVICE").query("region='" + dict_id + "' and device_type='conveyor' and is_config='true' ", "seq_num,device_name").getResultJSONArray(0); + + TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class); + WQLObject wo_runPoint = WQLObject.getWQLObject("acs_device_runpoint"); + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + + for (int i = 0; i < acs_deviceja.size(); i++) { JSONObject devicejo = acs_deviceja.getJSONObject(i); String device_code = devicejo.optString("device_code"); - DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); Device device = appService.findDeviceByCode(device_code); + //点位状态status对应status_name 0空 1有货 2有任务 + String status = "0"; + String status_name = "无货"; + String input_material = "0"; + String allow_update = "0"; + JSONObject jo = new JSONObject(); //无光电普通站点 - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - + JSONObject deviceRunPoint = wo_runPoint.query("device_code = '" + devicejo.optString("device_code") + "'").uniqueResult(0); + Integer hasgoods = deviceRunPoint.optInt("hasgoods"); + if (hasgoods == 1) { + status = "1"; + status_name = "有货"; + } + allow_update = "1"; + input_material = "1"; jo.put("device_id", devicejo.optString("device_id")); jo.put("device_code", devicejo.optString("device_code")); jo.put("device_name", devicejo.optString("device_name")); - jo.put("allow_update", "1"); + jo.put("allow_update", allow_update); + jo.put("status", status); + jo.put("status_name", status_name); + jo.put("input_material", input_material); + jo.put("source_device", standardOrdinarySiteDeviceDriver.getSource_device()); } - - resultArr.add(jo); } resultJson.put("code", "1"); @@ -104,6 +124,33 @@ public class LXHandServicelmpl implements LXHandService{ return resultJson; } + @Override + public Map bindPoint(JSONObject reqParam) { + WQLObject wo_runPoint = WQLObject.getWQLObject("acs_device_runpoint"); + String device_code = reqParam.getString("device_code"); + String status = reqParam.getString("status"); + if (StrUtil.isEmpty(device_code)) { + throw new BadRequestException("设备号不能为空!"); + } + if (StrUtil.isEmpty(status)) { + throw new BadRequestException("点位状态不能为空!"); + } + Device device = deviceAppService.findDeviceByCode(device_code); + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + JSONObject jo = new JSONObject(); + JSONObject map = new JSONObject(); + map.put("hasgoods", status); + wo_runPoint.update(map, "device_code = '" + device_code + "'"); + if (device != null && device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + standardOrdinarySiteDeviceDriver.setHasGoods(Integer.valueOf(status)); + device.setHas_goods(Integer.valueOf(status)); + } + jo.put("code", "1"); + jo.put("desc", "成功"); + return jo; + } + @Override public Map queryDevice(Map whereMap) { String deviceCode = whereMap.get("device_code").toString(); @@ -133,6 +180,7 @@ public class LXHandServicelmpl implements LXHandService{ resultJson.put("result", jo); return resultJson; } + @Override public Map queryTaskType() { JSONObject resultJson = new JSONObject(); @@ -207,18 +255,42 @@ public class LXHandServicelmpl implements LXHandService{ } //判断起点有货,终点为空 -// if (ObjectUtil.isEmpty(startDevice.getMaterial_type()) || Integer.parseInt(startDevice.getMaterial_type()) == 0) { -// resultJson.put("code", "0"); -// resultJson.put("desc", "起点必须有货"); -// resultJson.put("result", ""); -// return resultJson; -// } -// if (!ObjectUtil.isEmpty(nextDevice.getMaterial_type()) && !StrUtil.equals(nextDevice.getMaterial_type(), "0")) { -// resultJson.put("code", "0"); -// resultJson.put("desc", "终点必须为空"); -// resultJson.put("result", ""); -// return resultJson; -// } + if (ObjectUtil.isEmpty(startDevice.getHas_goods()) || startDevice.getHas_goods() == 0) { + resultJson.put("code", "0"); + resultJson.put("desc", "起点必须有货"); + resultJson.put("result", ""); + return resultJson; + } + + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + if (StrUtil.equals(String.valueOf(startDevice.getExtraValue().get("source_device")), "true")) { + if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) startDevice.getDeviceDriver(); + if (StrUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getSource_device()) && + !StrUtil.equals(standardOrdinarySiteDeviceDriver.getSource_device(), next_devicecode)) { + throw new BadRequestException("起点物料来源与终点不一致,不能生成任务!"); + } + } + } + + if (!ObjectUtil.isEmpty(nextDevice.getHas_goods()) && nextDevice.getHas_goods() == 1) { + resultJson.put("code", "0"); + resultJson.put("desc", "终点必须为空"); + resultJson.put("result", ""); + return resultJson; + } + + TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class); + //判断是否有起点的任务 + List start_taskDtos = taskService.findByDeviceCode(start_devicecode); + //判断是否有终点的任务 + List next_taskDtos = taskService.findByDeviceCode(next_devicecode); + + if (ObjectUtil.isNotEmpty(start_taskDtos) || ObjectUtil.isNotEmpty(next_taskDtos)) { + throw new BadRequestException("已存在该点位的任务,不能生成任务!"); + } + + // if(Boolean.parseBoolean(startDevice.getIslock()) || Boolean.parseBoolean(nextDevice.getIslock())){ // resultJson.put("code", "0"); // resultJson.put("desc", "起点或终点设备已被锁定"); @@ -236,7 +308,6 @@ public class LXHandServicelmpl implements LXHandService{ return resultJson; } - TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class); TaskDto dto = new TaskDto(); dto.setIs_active("1"); dto.setIs_delete("0"); @@ -295,7 +366,6 @@ public class LXHandServicelmpl implements LXHandService{ } - @SneakyThrows @Override public Map handleLogin(Map jsonObject) { @@ -493,7 +563,7 @@ public class LXHandServicelmpl implements LXHandService{ TaskDto acsTask = (TaskDto) JSONObject.toBean(taskjo, TaskDto.class); InstructionService instructionservice = SpringContextHolder.getBean(InstructionServiceImpl.class); InstructionDto instdto = instructionservice.findByTaskid(acsTask.getTask_id(), "instruction_status <2 "); - if (instdto != null){ + if (instdto != null) { jo.put("code", "0"); jo.put("desc", "有指令未完成!"); jo.put("result", new JSONObject()); @@ -514,5 +584,4 @@ public class LXHandServicelmpl implements LXHandService{ } - } diff --git a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java index 3e26706..b08788c 100644 --- a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java +++ b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java @@ -50,30 +50,30 @@ public class QueryXZAgvTaskStatus { continue; //子任务状态 待以后处理 JSONArray blocks = JSONArray.fromObject(one.get("blocks")); - for(int j=0;j + + + + + + + @@ -165,6 +172,7 @@ export default { manual_create_task: true, auto_create_task: true, is_pickup: true, + source_device: true, is_release: true, station_manager: true, auto_clean_task: true,