From d871326f5ad1c55367333e1cb1aaf93e87989bea Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 23 五月 2025 09:39:42 +0800
Subject: [PATCH] 库存出库功能优化
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TaskController.java | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TaskController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TaskController.java
index ea8eabb..7e7ae8a 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TaskController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TaskController.java
@@ -14,9 +14,8 @@
import com.vincent.rsf.server.common.domain.KeyValVo;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.manager.service.*;
-import com.vincent.rsf.server.manager.service.impl.BasStationServiceImpl;
import com.vincent.rsf.server.system.controller.BaseController;
-import com.vincent.rsf.server.system.enums.LocStsType;
+import com.vincent.rsf.server.system.service.impl.ConfigServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -37,6 +36,8 @@
private WaitPakinService waitPakinService;
@Autowired
private LocService locService;
+ @Autowired
+ private ConfigServiceImpl configService;
@PreAuthorize("hasAuthority('manager:task:list')")
@@ -130,8 +131,9 @@
if (Objects.isNull(id)) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
- List<Short> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
+ List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs));
+
for (Task task : tasks) {
task.setTaskStatus(task.getTaskType() < (short) 100 ? TaskStsType.COMPLETE_IN.id : TaskStsType.COMPLETE_OUT.id);
}
@@ -153,7 +155,11 @@
if (Objects.isNull(id)) {
throw new CoolException("鑳芥暟涓嶈兘涓虹┖锛侊紒");
}
- return taskService.pickTask(id);
+ try {
+ return R.ok(taskService.pickTask(id));
+ } catch (Exception e) {
+ throw new CoolException(e.getMessage());
+ }
}
// @PreAuthorize("hasAuthority('manager:task:update')")
@@ -173,7 +179,7 @@
if (Objects.isNull(id)) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
- List<Short> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
+ List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs));
if (tasks.isEmpty()) {
throw new CoolException("浠诲姟宸插鎵ц鐘舵�佷笉鍙竴閿疆椤讹紒锛�");
--
Gitblit v1.9.1