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();