From 5b483c69369793a4f43718390585185f7144548f Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Mon, 15 Jan 2024 19:14:06 +0800 Subject: [PATCH] rev:task --- .../FeedBackTaskStatusRequest.java | 3 --- .../task/service/impl/TaskServiceImpl.java | 20 +++++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/one/feedBackTaskStatus/FeedBackTaskStatusRequest.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/one/feedBackTaskStatus/FeedBackTaskStatusRequest.java index c1cd625..1d3593b 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/one/feedBackTaskStatus/FeedBackTaskStatusRequest.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/one/feedBackTaskStatus/FeedBackTaskStatusRequest.java @@ -1,9 +1,6 @@ package org.nl.acs.ext.wms.data.one.feedBackTaskStatus; -import lombok.Builder; import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.SuperBuilder; import org.nl.acs.ext.wms.data.one.BaseRequest; @Data diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 3692e5e..af77d4a 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -457,9 +457,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme } @Override - @Transactional(rollbackFor = Exception.class) public void create(TaskDto dto) throws Exception { - CommonFinalParam commonFinalParam = new CommonFinalParam(); dto = foramte(dto); if (!StrUtil.isEmpty(dto.getVehicle_code())) { TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code()); @@ -476,7 +474,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme String task_code = dto.getTask_code(); if (StrUtil.isEmpty(task_code)) { task_code = CodeUtil.getNewCode("TASK_NO"); - task_code = commonFinalParam.getBARRE() + task_code; + task_code = CommonFinalParam.HYPHEN_ + task_code; } String start_point_code = dto.getStart_point_code(); String next_point_code = dto.getNext_point_code(); @@ -510,14 +508,22 @@ public class TaskServiceImpl extends CommonServiceImpl impleme DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); Device nextdevice = appService.findDeviceByCode(next_device_code); + if (nextdevice == null){ + //TODO 国际化处理 + throw new BadRequestException("终点设备未配置"); + } Device startdevice = appService.findDeviceByCode(start_device_code); + if (startdevice == null){ + //TODO 国际化处理 + throw new BadRequestException("起点设备未配置"); + } dto.setMaterial(startdevice.getMaterial_type()); if (StrUtil.equals(DeviceType.storage.toString(), startDeviceType)) { - start_point_code = start_device_code + commonFinalParam.getBARRE() + dto.getFrom_y() + commonFinalParam.getBARRE() + dto.getFrom_z(); + start_point_code = start_device_code + CommonFinalParam.HYPHEN_ + dto.getFrom_y() + CommonFinalParam.HYPHEN_ + dto.getFrom_z(); dto.setStart_point_code(start_point_code); } if (StrUtil.equals(DeviceType.storage.toString(), nextDeviceType)) { - next_point_code = next_device_code + commonFinalParam.getBARRE() + dto.getTo_y() + commonFinalParam.getBARRE() + dto.getTo_z(); + next_point_code = next_device_code + CommonFinalParam.HYPHEN_ + dto.getTo_y() + CommonFinalParam.HYPHEN_ + dto.getTo_z(); dto.setNext_point_code(next_point_code); } if (StrUtil.equals(createTaskCheck, CommonFinalParam.ONE)) { @@ -592,7 +598,6 @@ public class TaskServiceImpl extends CommonServiceImpl impleme if (array.size() == 0) { throw new BadRequestException(LangProcess.msg("starting_point_isNull")); - //throw new RuntimeException("请选择起点"); } for (int i = 0; i < array.size(); i++) { JSONObject arrjo = array.getJSONObject(i); @@ -840,9 +845,8 @@ public class TaskServiceImpl extends CommonServiceImpl impleme } else { next_device_code = this_device_code; } - CommonFinalParam commonFinalParam = new CommonFinalParam(); if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) { - next_point_code = next_device_code + commonFinalParam.getBARRE() + acsTask.getTo_y() + commonFinalParam.getBARRE() + acsTask.getTo_z(); + next_point_code = next_device_code + CommonFinalParam.HYPHEN_ + acsTask.getTo_y() + CommonFinalParam.HYPHEN_ + acsTask.getTo_z(); } else { next_point_code = next_device_code; }