From e83dacb5066a86db29dbdc232218d8aba6adc95f Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 02 八月 2024 13:34:04 +0800
Subject: [PATCH] #

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java
index be7a0c9..e9a0f64 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java
@@ -96,6 +96,7 @@
                                 locDetlField.setDetlId(locDetl.getId());
                                 locDetlField.setFieldId(detlField.getFieldId());
                                 locDetlField.setName(detlField.getName());
+                                locDetlField.setValue(detlField.getValue());
                                 locDetlField.setHostId(hostId);
                                 if (!locDetlFieldService.save(locDetlField)) {
                                     throw new CoolException("鎻掑叆鏄庣粏鎵╁睍瀛楁澶辫触");
@@ -104,18 +105,20 @@
                         }
 
                         //缁勬墭閫氱煡妗h浆鍘嗗彶妗�
-                        WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, task.getBarcode()).eq(WaitPakin::getHostId, hostId));
-                        if (waitPakin == null) {
+                        List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, task.getBarcode()).eq(WaitPakin::getHostId, hostId));
+                        if(waitPakins.isEmpty()) {
                             throw new CoolException("缁勬墭閫氱煡妗d笉瀛樺湪");
                         }
-                        WaitPakinLog waitPakinLog = new WaitPakinLog();
-                        waitPakinLog.sync(waitPakin);
-                        if (!waitPakinLogService.save(waitPakinLog)) {
-                            throw new CoolException("缁勬墭閫氱煡妗h浆鍘嗗彶妗eけ璐�");
-                        }
+                        for (WaitPakin waitPakin : waitPakins) {
+                            WaitPakinLog waitPakinLog = new WaitPakinLog();
+                            waitPakinLog.sync(waitPakin);
+                            if (!waitPakinLogService.save(waitPakinLog)) {
+                                throw new CoolException("缁勬墭閫氱煡妗h浆鍘嗗彶妗eけ璐�");
+                            }
 
-                        //鍒犻櫎缁勬墭閫氱煡妗�
-                        waitPakinService.remove(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, task.getBarcode()).eq(WaitPakin::getHostId, hostId));
+                            //鍒犻櫎缁勬墭閫氱煡妗�
+                            waitPakinService.removeById(waitPakin.getId());
+                        }
 
                         break;
                 }

--
Gitblit v1.9.1