From 7a92ebbfb8227ff30ebe3300cc9db263a75b7e22 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期四, 05 三月 2026 13:06:15 +0800
Subject: [PATCH] lsh#

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
index 97d64bc..5ea60ab 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
@@ -134,7 +134,7 @@
                 taskInstanceNode.setStatus(flowInstance.getStatus());
                 TaskInstance taskInstance = taskInstanceService.getById(flowInstance.getTaskId());
                 if (Cools.isEmpty(taskInstance)) { continue;}
-                Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskCode, taskInstance.getTaskNo()));
+                Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskCode, taskInstance.getTaskNo()).last("limit 1"),false);
                 if (Cools.isEmpty(task)) { continue;}
                 if (!task.getTaskStatus().equals(flowStepInstance.getWmsNowTaskStatus())) {
                     log.error("浠诲姟鍙凤細"+task.getTaskCode()+"鐨勪换鍔$姸鎬佷笌鎵ц妗f浠诲姟鐘舵�侊細"+flowStepInstance.getWmsNowTaskStatus()+"涓嶄竴鑷达紒锛侊紒");
@@ -156,7 +156,7 @@
                                     .eq(FlowStepInstance::getStatus, (short)0)
                                     .eq(FlowStepInstance::getTaskNo, flowStepInstance.getTaskNo())
                                     .eq(FlowStepInstance::getStepOrder, flowStepInstance.getStepOrder() + 1)
-                                    .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus()));
+                                    .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus()).last("limit 1"));
                             if (Cools.isEmpty(nextFlowStepInstance)) {
                                 throw new CoolException("浠诲姟鍙�"+task.getTaskCode()+"浠诲姟姝ラ涓㈠け锛侊紒锛�");
                             }
@@ -183,7 +183,7 @@
                     if (souSign){
                         WarehouseAreas warehouseAreas = warehouseAreasService.getById(Long.parseLong(taskInstance.getSourceCode()));
                         if (Cools.isEmpty(warehouseAreas)){
-                            BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode()));
+                            BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode()).last("limit 1"));
                             if (Cools.isEmpty(basStation)){
                                 basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                                         .apply("station_alias != '[]'")  // 涓嶆槸绌烘暟缁�
@@ -209,7 +209,7 @@
                             missionTaskIssueParam.setSourceCode(taskInstance.getSourceCode());
                         }
                     } else {
-                        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode()));
+                        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode()).last("limit 1"));
                         if (Cools.isEmpty(basStation)){
                             basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                                     .apply("station_alias != '[]'")  // 涓嶆槸绌烘暟缁�
@@ -235,7 +235,7 @@
                     if (endSign){
                         WarehouseAreas warehouseAreas = warehouseAreasService.getById(Long.parseLong(taskInstance.getTargetCode()));
                         if (Cools.isEmpty(warehouseAreas)){
-                            BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode()));
+                            BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode()).last("limit 1"));
                             if (Cools.isEmpty(basStation)){
                                 basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                                         .apply("station_alias != '[]'")  // 涓嶆槸绌烘暟缁�
@@ -261,7 +261,7 @@
                             missionTaskIssueParam.setTargetCode(taskInstance.getTargetCode());
                         }
                     } else {
-                        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode()));
+                        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode()).last("limit 1"));
                         if (Cools.isEmpty(basStation)){
                             basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                                     .apply("station_alias != '[]'")  // 涓嶆槸绌烘暟缁�
@@ -345,7 +345,7 @@
                                             .eq(FlowStepInstance::getStatus, (short)0)
                                             .eq(FlowStepInstance::getTaskNo, flowStepInstance.getTaskNo())
                                             .eq(FlowStepInstance::getStepOrder, flowStepInstance.getStepOrder() + 1)
-                                            .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus()));
+                                            .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus()).last("limit 1"));
                                     if (Cools.isEmpty(nextFlowStepInstance)) {
                                         throw new CoolException("浠诲姟鍙�"+task.getTaskCode()+"浠诲姟姝ラ涓㈠け锛侊紒锛�");
                                     }
@@ -456,9 +456,10 @@
                 } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type)
                         || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type)
                         || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type)
-                        || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)
-                        || task.getTaskType().equals(TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type)
-                        || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)) {
+                        || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)) {
+                    task.setTaskStatus(TaskStsType.AWAIT.id);
+                } else if ( task.getTaskType().equals(TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type)
+                        || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)) {//澶囪揣
                     task.setTaskStatus(TaskStsType.COMPLETE_OUT.id);
                 }
                 taskService.updateById(task);
@@ -760,7 +761,7 @@
 
         BasStation station = null;
         if (!task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) {
-            station = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getTargSite()));
+            station = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getTargSite()).last("limit 1"));
             if (Objects.isNull(station)) {
                 throw new CoolException("绔欑偣涓嶅瓨鍦紒锛�");
             }
@@ -771,7 +772,7 @@
         Loc locStart = null;
         if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) ||
                 task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)) {
-            locStart = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc()));
+            locStart = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc()).last("limit 1"));
             if (Objects.isNull(locStart)) {
                 throw new CoolException("婧愬簱浣嶄笉瀛樺湪锛侊紒");
             }
@@ -790,7 +791,7 @@
                     task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) ||
                     task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)
             ) {
-                BasStation stationS = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite()));
+                BasStation stationS = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite()).last("limit 1"));
                 if (Objects.isNull(stationS)) {
                     throw new CoolException("婧愬簱浣嶄笉瀛樺湪锛侊紒");
                 }
@@ -798,7 +799,7 @@
                 if (stationS.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) {
                     taskParams.setSign(LocStsWcsOrOtherType.LOC_STS_TYPE_WCS.type);
                 } else {
-                    Loc locEnd = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()));
+                    Loc locEnd = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()).last("limit 1"));
                     if (Objects.isNull(locEnd)) {
                         throw new CoolException("婧愬簱浣嶄笉瀛樺湪锛侊紒");
                     }
@@ -858,7 +859,7 @@
             /**绔欑偣闂寸Щ搴撳弬鏁�*/
             itemParam.setOriSta(task.getOrgSite()).setDestSta(task.getTargSite());
 
-            BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite()));
+            BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite()).last("limit 1"));
             if (Objects.isNull(curSta)) {
                 throw new CoolException("绔欑偣涓嶅瓨鍦紒锛�");
             }

--
Gitblit v1.9.1