From 85c3af5ee83772eb9ed929e4789e854653889b68 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期六, 16 八月 2025 13:32:20 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   65 ++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 35e3521..98cad51 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -2139,22 +2139,55 @@
 //                    }catch (Exception e){
 //                        log.error("宸ヤ綔妗f鏄庣粏杈撳叆鐢佃鏈哄け璐�1锛氬紓甯镐俊鎭�==銆�"+e);
 //                    }
-                    wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(
-                            wrkDetl.getMatnr()
-                            , wrkDetl.getMaktx()
-                            , wrkDetl.getAnfme()
-                            , wrkDetl.getWeight()
-                            , wrkDetl.getStockNum()
-                            , wrkDetl.getStockNum2()
-                            , wrkDetl.getSpecs()
-                            , wrkDetl.getSku()
-                            , wrkDetl.getZpallet()
-                            , wrkDetl.getModel()
-                            , wrkDetl.getSupp()
-                            , wrkDetl.getKpCstmrName()
-                            , wrkDetl.getOrderNo()
-                            , wrkDetl.getCstateid$()
-                    )));
+
+                    if (!wrkDetls.isEmpty()) {
+                        WrkDetl wrkDetl = wrkDetls.get(0);
+                        for (WrkDetl detl : wrkDetls) {
+                            double anfme = wrkDetl.getAnfme() + detl.getAnfme();
+                            double weight = wrkDetl.getWeight() + detl.getWeight();
+                            double stockNum = wrkDetl.getStockNum() + detl.getStockNum();
+                            double stockNum2 = wrkDetl.getStockNum2() + detl.getStockNum2();
+                            wrkDetl.setAnfme(anfme);
+                            wrkDetl.setWeight(weight);
+                            wrkDetl.setStockNum(stockNum);
+                            wrkDetl.setStockNum2(stockNum2);
+                        }
+
+                        ledCommand.getMatDtos().add(new MatDto(
+                                wrkDetl.getMatnr()
+                                , wrkDetl.getMaktx()
+                                , wrkDetl.getAnfme()
+                                , wrkDetl.getWeight()
+                                , wrkDetl.getStockNum()
+                                , wrkDetl.getStockNum2()
+                                , wrkDetl.getSpecs()
+                                , wrkDetl.getSku()
+                                , wrkDetl.getZpallet()
+                                , wrkDetl.getModel()
+                                , wrkDetl.getSupp()
+                                , wrkDetl.getKpCstmrName()
+                                , wrkDetl.getOrderNo()
+                                , wrkDetl.getCstateid$()
+                        ));
+
+//                        wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(
+//                                wrkDetl.getMatnr()
+//                                , wrkDetl.getMaktx()
+//                                , wrkDetl.getAnfme()
+//                                , wrkDetl.getWeight()
+//                                , wrkDetl.getStockNum()
+//                                , wrkDetl.getStockNum2()
+//                                , wrkDetl.getSpecs()
+//                                , wrkDetl.getSku()
+//                                , wrkDetl.getZpallet()
+//                                , wrkDetl.getModel()
+//                                , wrkDetl.getSupp()
+//                                , wrkDetl.getKpCstmrName()
+//                                , wrkDetl.getOrderNo()
+//                                , wrkDetl.getCstateid$()
+//                        )));
+                    }
+
                 }
                 commands.add(ledCommand);
             }

--
Gitblit v1.9.1