From d7355ce983c2bddcc5b95e4d84283f6631fb176a Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 27 十一月 2025 13:38:46 +0800
Subject: [PATCH] 修改入出库历史的拣料类型,不上传ERP

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java |   13 +++++++------
 1 files changed, 7 insertions(+), 6 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 484ccf4..e6ecd8a 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
@@ -737,10 +737,10 @@
             LocItemWorking locWorking = locItemWorkingService.getOne(new LambdaQueryWrapper<LocItemWorking>()
                     .eq(LocItemWorking::getTaskId, taskItem.getTaskId())
                     .eq(LocItemWorking::getFieldsIndex, taskItem.getFieldsIndex())
-                    .eq(StringUtils.isNotBlank(taskItem.getBatch()), LocItemWorking::getBatch, taskItem.getBatch())
+                    .eq(StringUtils.isNotEmpty(taskItem.getBatch()), LocItemWorking::getBatch, taskItem.getBatch())
                     .eq(LocItemWorking::getMatnrId, taskItem.getMatnrId()));
             if (Objects.isNull(locWorking)) {
-                throw new CoolException("鏁版嵁閿欒锛屼綔涓氫腑搴撳瓨鏁版嵁涓㈠け锛侊紒");
+               continue;
             }
             if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
                 locWorking.setAnfme(taskItem.getAnfme());
@@ -756,7 +756,7 @@
 
         TaskItem taskItem = taskItems.stream().findFirst().get();
         //淇濆瓨鍏ュ嚭搴撴祦姘�
-        saveStockItems(taskItems, task, null, null, taskItem.getWkType(), taskItem.getOrderType(), loginUserId);
+        saveStockItems(taskItems, task, null, null, taskItem.getWkType(), OrderType.ORDER_IN.type, loginUserId);
 
         locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()));
 
@@ -1048,12 +1048,12 @@
 
         tempLocs.forEach(working -> {
             taskItems.forEach(taskItem -> {
-                if (taskItem.getId().equals(working.getMatnrId()) && taskItem.getFieldsIndex().equals(working.getFieldsIndex())) {
+                if (taskItem.getFieldsIndex().equals(working.getFieldsIndex())) {
                     Double minQty = taskItem.getAnfme();
                     if (!task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
-                        minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 100) / 100.0;
+                        minQty = Math.round((working.getAnfme() - taskItem.getQty()) * 100) / 100.0;
                     }
-                    if (minQty.compareTo(0.0) > 0) {
+                    if (minQty.compareTo(0.0) >= 0) {
                         taskItem.setAnfme(minQty);
                         if (!taskItemService.updateById(taskItem)) {
                             throw new CoolException("浠诲姟鏄庣粏淇敼澶辫触锛侊紒");
@@ -1104,6 +1104,7 @@
                 LocItemWorking itemWorking = new LocItemWorking();
                 BeanUtils.copyProperties(taskItem, itemWorking);
                 itemWorking.setTaskId(task.getId())
+                        .setQty(0.0)
                         .setLocId(loc1.getId())
                         .setLocCode(loc1.getCode());
                 workings.add(itemWorking);

--
Gitblit v1.9.1