From 80177213191f969dc5d89f4528e4f8bedacd6107 Mon Sep 17 00:00:00 2001 From: loujf Date: Wed, 20 Jul 2022 20:14:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E9=80=81=E6=8C=87=E4=BB=A4=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InstructionServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 7b5fbf1..5a82d7d 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpResponse; +import io.swagger.models.auth.In; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import net.sf.json.JSONArray; @@ -345,6 +346,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu if (ObjectUtils.isEmpty(shortPathsList)) { throw new Exception(dto.getStart_device_code() + "->" + dto.getNext_device_code() + "路由不通"); } + + for (int i = 0; i < shortPathsList.size(); i++) { + RouteLineDto routeLineDto = shortPathsList.get(i); + if (routeLineDto.getType().equals("0")) { + Instruction byContainer = this.findByContainer(dto.getVehicle_code()); + if (ObjectUtil.isNotEmpty(byContainer)) { + throw new RuntimeException("已有当前载具号的输送指令"); + } + } + } + String carno = ""; //判断是agv指令才能指定车号 List deviceByType = deviceAppService.findDevice(DeviceType.agv); @@ -432,7 +444,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu for (int i = 0; i < shortPathsList.size(); i++) { RouteLineDto routeLineDto = shortPathsList.get(i); if (routeLineDto.getType().equals("1") && carno.equals("")) { - throw new RuntimeException("agv车号为空!"); + throw new RuntimeException("创建agv指令未找到可分配agv!"); } } String type = shortPathsList.get(0).getType();