Browse Source

fix 完成和取消任务的逻辑

master
张江玮 1 year ago
parent
commit
45e00c0289
  1. 4
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java
  2. 12
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallEmptyVehicleTask.java
  3. 12
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/CallMaterialTask.java
  4. 12
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendEmptyVehicleTask.java
  5. 12
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendFullVehicleTask.java
  6. 12
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/SendResiduesMaterialTask.java

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

12
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");

12
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");

12
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");

12
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");

12
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");

Loading…
Cancel
Save