From 45e00c028934dbfbbbf11897ea7b40fb23010e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Fri, 18 Aug 2023 15:18:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=AE=8C=E6=88=90=E5=92=8C=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E4=BB=BB=E5=8A=A1=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/wms/sch/manage/AbstractAcsTask.java | 4 ++-- .../org/nl/wms/sch/task/CallEmptyVehicleTask.java | 12 ++---------- .../java/org/nl/wms/sch/task/CallMaterialTask.java | 12 ++---------- .../org/nl/wms/sch/task/SendEmptyVehicleTask.java | 12 ++---------- .../org/nl/wms/sch/task/SendFullVehicleTask.java | 12 ++---------- .../nl/wms/sch/task/SendResiduesMaterialTask.java | 12 ++---------- 6 files changed, 12 insertions(+), 52 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java index c2ffa3b..32ea2e1 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java @@ -120,8 +120,8 @@ public abstract class AbstractAcsTask { if (ObjectUtil.isNotEmpty(tasks)) { String taskStatus = ((JSONObject) tasks.get(0)).getString("task_status"); - if (!StrUtil.equals(taskStatus, TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("只能下发已确认起点和终点的任务"); + if (Integer.parseInt(taskStatus) < Integer.parseInt(TaskStatus.START_AND_END.getCode())) { + throw new BadRequestException("只能下发已确认起点和终点之后的任务"); } JSONObject result = AcsUtils.notifyAcs("api/wms/task", tasks); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallEmptyVehicleTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallEmptyVehicleTask.java index 0ab373e..60ddedc 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallEmptyVehicleTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallEmptyVehicleTask.java @@ -194,11 +194,8 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { } if (taskOperationType == TaskOperationType.MANUAL) { - if (Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发的任务需要从ACS完成"); - } - if (!StrUtil.equals(taskStatus, TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("只有已确认起点和终点的任务可以手动完成"); + if (Integer.parseInt(taskStatus) < Integer.parseInt(TaskStatus.START_AND_END.getCode())) { + throw new BadRequestException("只有已确认起点和终点之后的任务可以手动完成"); } } @@ -247,11 +244,6 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { throw new BadRequestException("该任务已完成"); } - if (taskOperationType == TaskOperationType.MANUAL - && Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发任务需要从ACS取消"); - } - WQLObject.getWQLObject("sch_base_task").delete(task); WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallMaterialTask.java index 4bf4aaa..58c3d2b 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallMaterialTask.java @@ -171,11 +171,8 @@ public class CallMaterialTask extends AbstractAcsTask { } if (taskOperationType == TaskOperationType.MANUAL) { - if (Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发的任务需要从ACS完成"); - } - if (!StrUtil.equals(taskStatus, TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("只有已确认起点和终点的任务可以手动完成"); + if (Integer.parseInt(taskStatus) < Integer.parseInt(TaskStatus.START_AND_END.getCode())) { + throw new BadRequestException("只有已确认起点和终点之后的任务可以手动完成"); } } @@ -229,11 +226,6 @@ public class CallMaterialTask extends AbstractAcsTask { throw new BadRequestException("该任务已完成"); } - if (taskOperationType == TaskOperationType.MANUAL - && Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发任务需要从ACS取消"); - } - WQLObject.getWQLObject("sch_base_task").delete(task); WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendEmptyVehicleTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendEmptyVehicleTask.java index 60e83ae..44d6a45 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendEmptyVehicleTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendEmptyVehicleTask.java @@ -202,11 +202,8 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { } if (taskOperationType == TaskOperationType.MANUAL) { - if (Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发的任务需要从ACS完成"); - } - if (!StrUtil.equals(taskStatus, TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("只有已确认起点和终点的任务可以手动完成"); + if (Integer.parseInt(taskStatus) < Integer.parseInt(TaskStatus.START_AND_END.getCode())) { + throw new BadRequestException("只有已确认起点和终点之后的任务可以手动完成"); } } @@ -255,11 +252,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { throw new BadRequestException("该任务已完成"); } - if (taskOperationType == TaskOperationType.MANUAL - && Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发任务需要从ACS取消"); - } - WQLObject.getWQLObject("sch_base_task").delete(task); WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendFullVehicleTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendFullVehicleTask.java index 9d2db17..7be0fbe 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendFullVehicleTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendFullVehicleTask.java @@ -198,11 +198,8 @@ public class SendFullVehicleTask extends AbstractAcsTask { } if (taskOperationType == TaskOperationType.MANUAL) { - if (Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发的任务需要从ACS完成"); - } - if (!StrUtil.equals(taskStatus, TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("只有已确认起点和终点的任务可以手动完成"); + if (Integer.parseInt(taskStatus) < Integer.parseInt(TaskStatus.START_AND_END.getCode())) { + throw new BadRequestException("只有已确认起点和终点之后的任务可以手动完成"); } } @@ -273,11 +270,6 @@ public class SendFullVehicleTask extends AbstractAcsTask { throw new BadRequestException("该任务已完成"); } - if (taskOperationType == TaskOperationType.MANUAL - && Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发任务需要从ACS取消"); - } - WQLObject.getWQLObject("sch_base_task").delete(task); WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendResiduesMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendResiduesMaterialTask.java index c1dea4f..89eb1a0 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendResiduesMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendResiduesMaterialTask.java @@ -204,11 +204,8 @@ public class SendResiduesMaterialTask extends AbstractAcsTask { } if (taskOperationType == TaskOperationType.MANUAL) { - if (Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发的任务需要从ACS完成"); - } - if (!StrUtil.equals(taskStatus, TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("只有已确认起点和终点的任务可以手动完成"); + if (Integer.parseInt(taskStatus) < Integer.parseInt(TaskStatus.START_AND_END.getCode())) { + throw new BadRequestException("只有已确认起点和终点之后的任务可以手动完成"); } } @@ -279,11 +276,6 @@ public class SendResiduesMaterialTask extends AbstractAcsTask { throw new BadRequestException("该任务已完成"); } - if (taskOperationType == TaskOperationType.MANUAL - && Integer.parseInt(taskStatus) > Integer.parseInt(TaskStatus.START_AND_END.getCode())) { - throw new BadRequestException("已下发任务需要从ACS取消"); - } - WQLObject.getWQLObject("sch_base_task").delete(task); WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");