From 148a7afdeb8f40157f9823636bad4674945bce4d Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 28 五月 2025 11:00:46 +0800
Subject: [PATCH] 组托任务下发,执行数量修改有误问题修复 删除未用表结构

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
index 2e3cd67..fa3234f 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -82,7 +82,6 @@
             throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
         }
         /**鑾峰彇缁勬嫋*/
-//        List<Long> ids = pakins.stream().map(WaitPakin::getId).collect(Collectors.toList());
         List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>()
                 .in(WaitPakin::getId, pakins.getId())
                 .eq(WaitPakin::getIoStatus, Short.parseShort(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)));
@@ -105,7 +104,7 @@
             task.setTaskCode(ruleCode)
                     .setTaskStatus(TaskStsType.GENERATE_IN.id)
                     .setTaskType(TaskType.TASK_TYPE_IN.type)
-                    .setWarehType(WarehType.WAREHOUSE_TYPE_AGV.id)
+                    .setWarehType(WarehType.WAREHOUSE_TYPE_AGV.val)
                     .setTargLoc(targetLoc)
                     .setOrgSite(orgSta)
                     .setBarcode(pakin.getBarcode())
@@ -190,7 +189,7 @@
             task.setTaskCode(ruleCode)
                     .setTaskStatus(TaskStsType.COMPLETE_IN.id)
                     .setTaskType(TaskType.TASK_TYPE_IN.type)
-                    .setWarehType(WarehType.WAREHOUSE_TYPE_PLAT.id)
+                    .setWarehType(WarehType.WAREHOUSE_TYPE_PLAT.val)
                     .setTargLoc(targetLoc)
                     .setBarcode(pakin.getBarcode())
                     .setCreateBy(loginUserId)
@@ -583,17 +582,15 @@
                     throw new CoolException("鏇存柊缁勬墭鐘舵�佸け璐ワ紒锛�");
                 }
             }
-            Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTaskType() < TaskStsType.UPDATED_IN.id ? 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 loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTaskType() < TaskStsType.UPDATED_IN.id ? 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)) {
                     throw new CoolException("鏇存柊搴撲綅鐘舵�佸け璐ワ紒锛�");
                 }
             }
-            if (!Objects.isNull(task.getWarehType()) && task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.id)) {
+            if (!Objects.isNull(task.getWarehType()) && task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.val)) {
                 BasStation basStation = null;
                 if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) {
                     basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
@@ -608,8 +605,7 @@
                 ) {
                     basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                             .eq(BasStation::getStationName, task.getTargLoc())
-                            .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type)
-                    );
+                            .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type));
                 }
                 if (null == basStation) {
                     throw new CoolException("绔欑偣鐘舵�侀敊璇紒锛�");
@@ -619,6 +615,10 @@
                     throw new CoolException("鏇存柊绔欑偣鐘舵�佸け璐ワ紒锛�");
                 }
             }
+
+            if (!taskItemService.remove(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()))) {
+                throw new CoolException("浠诲姟鏄庣粏鍒犻櫎澶辫触锛侊紒");
+            }
         }
         if (!this.removeByIds(Arrays.asList(ids))) {
             throw new CoolException("Delete Fail");

--
Gitblit v1.9.1