From 3799e9f3fc8abaafa95094c8c987a8d9da3eb2a9 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 06 五月 2025 13:11:19 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TaskController.java | 43 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 39 insertions(+), 4 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 5ed649b..1b53b5f 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
@@ -12,11 +12,17 @@
import com.vincent.rsf.server.common.domain.BaseParam;
import com.vincent.rsf.server.common.domain.KeyValVo;
import com.vincent.rsf.server.common.domain.PageParam;
+import com.vincent.rsf.server.manager.entity.Loc;
import com.vincent.rsf.server.manager.entity.Task;
import com.vincent.rsf.server.manager.entity.TaskItem;
+import com.vincent.rsf.server.manager.entity.WaitPakin;
+import com.vincent.rsf.server.manager.enums.PakinIOStatus;
+import com.vincent.rsf.server.manager.service.LocService;
import com.vincent.rsf.server.manager.service.TaskItemService;
import com.vincent.rsf.server.manager.service.TaskService;
+import com.vincent.rsf.server.manager.service.WaitPakinService;
import com.vincent.rsf.server.system.controller.BaseController;
+import com.vincent.rsf.server.system.enums.LocStsType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -34,6 +40,12 @@
@Autowired
private TaskItemService taskItemService;
+
+ @Autowired
+ private WaitPakinService waitPakinService;
+
+ @Autowired
+ private LocService locService;
@PreAuthorize("hasAuthority('manager:task:list')")
@PostMapping("/task/page")
@@ -95,10 +107,34 @@
if (Objects.isNull(ids) || ids.length < 1) {
return R.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
- List<Long> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
+ List<Short> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().in(Task::getId, ids).in(Task::getTaskStatus, longs));
if (tasks.isEmpty()) {
throw new CoolException("浠诲姟宸插鎵ц鐘舵�佷笉鍙彇娑堬紒锛�");
+ }
+ for (Task task : tasks) {
+ //鎭㈠缁勬墭鐘舵��
+ WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>()
+ .eq(WaitPakin::getBarcode, task.getBarcode())
+ );
+ if (null != waitPakin) {
+ waitPakin.setIoStatus(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val));
+ if (!waitPakinService.updateById(waitPakin)) {
+ return R.error("鏇存柊缁勬墭鐘舵�佸け璐�");
+ }
+ }
+ Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>()
+ .eq(Loc::getCode, task.getTaskType() < 100 ? task.getTargLoc() : task.getOrgLoc())
+ );
+ if (null != loc
+ && (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type)
+ || loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type))) {
+
+ loc.setUseStatus(LocStsType.LOC_STS_TYPE_O.type);
+ if (!locService.updateById(loc)) {
+ return R.error("鏇存柊搴撲綅鐘舵�佸け璐�");
+ }
+ }
}
if (!taskService.removeByIds(Arrays.asList(ids))) {
return R.error("Delete Fail");
@@ -136,7 +172,7 @@
if (Objects.isNull(id)) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
- List<Long> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
+ List<Short> 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("浠诲姟宸插鎵ц鐘舵�佷笉鍙竴閿畬鎴愶紒锛�");
@@ -155,7 +191,6 @@
return R.ok();
}
-
@PreAuthorize("hasAuthority('manager:task:update')")
@ApiOperation("浠诲姟鍑哄簱缃《")
@PostMapping("/task/top/{id}")
@@ -163,7 +198,7 @@
if (Objects.isNull(id)) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
- List<Long> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
+ List<Short> 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