From 694f541f9f4bc51818395be84e5ddf322c8048d8 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 10 六月 2025 14:35:57 +0800
Subject: [PATCH] 调整出入库报表

---
 igds-inout/src/main/java/com/ld/igds/inout/service/JInoutReportService.java |   54 ++++++++++++++++++++++++------------------------------
 1 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/igds-inout/src/main/java/com/ld/igds/inout/service/JInoutReportService.java b/igds-inout/src/main/java/com/ld/igds/inout/service/JInoutReportService.java
index 9546182..71102a3 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/service/JInoutReportService.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/service/JInoutReportService.java
@@ -252,9 +252,9 @@
             // 璁剧疆搴忓彿
             d.setRemarks(String.valueOf(index));
             // 褰撳墠鏁版嵁娣诲姞鍒濇湡搴撳瓨
-            d = this.updateDepotReportCqkc(d, list1);
-//			d = this.updateDepotReportQmkc(d, list2);
-
+//            d = this.updateDepotReportCqkc(d, list1);
+//			d = this.updateDepotReportQmkc(d, list1, list2);
+            d.setQmkc(d.getInNum() - d.getOutNum());
             // 鍚堣淇℃伅
             sum.setCqkc(sum.getCqkc() + d.getCqkc());
             sum.setInNum(sum.getInNum() + d.getInNum());
@@ -271,40 +271,34 @@
     }
 
     // 娉ㄦ剰锛氬鏋滄湡鏈簱瀛樻病鏈変复杩戞暟鎹紝鍒欒〃绀鸿幏鍙栨渶鏂扮殑搴撳瓨
-    public ReportInoutDepotData updateDepotReportQmkc(ReportInoutDepotData d,
+    public ReportInoutDepotData updateDepotReportQmkc(ReportInoutDepotData d,List<ReportInoutStorageData> list1,
                                                        List<ReportInoutStorageData> list2) {
-        ReportInoutStorageData inoutStorageData = null;
-        for (ReportInoutStorageData storageData : list2) {
-            if (storageData.getDepotId().equals(d.getDepotId())) {
-                inoutStorageData = storageData;
-                break;
+        ReportInoutStorageData inoutStorageData1 = null;
+        ReportInoutStorageData inoutStorageData2 = null;
+        if(null!= list1 && list1.size() > 0){
+            for (ReportInoutStorageData storageData : list1) {
+                if (storageData.getDepotId().equals(d.getDepotId())) {
+                    inoutStorageData1 = storageData;
+                    break;
+                }
             }
         }
-        if (null == inoutStorageData) {
-            Depot depot = depotService.getDepotById(ContextUtil.getCompanyId(),
-                    d.getDepotId());
-            d.setQmkc(null == depot.getStorageReal() ? 0.0 : depot
-                    .getStorageReal());
-            return d;
+        if(null!= list2 && list2.size() > 0){
+            for (ReportInoutStorageData storageData : list2) {
+                if (storageData.getDepotId().equals(d.getDepotId())) {
+                    inoutStorageData2 = storageData;
+                    break;
+                }
+            }
         }
 
-        double cmkc = inoutStorageData.getCurStorage();
-        if (InoutConstant.TYPE_IN.equals(inoutStorageData.getType())) {
-            cmkc = inoutStorageData.getCurStorage()
-                    + inoutStorageData.getSettleWeight();
+        if (null == inoutStorageData1) {
+            inoutStorageData1 = new ReportInoutStorageData();
         }
-        if (InoutConstant.TYPE_OUT.equals(inoutStorageData.getType())) {
-            cmkc = inoutStorageData.getCurStorage()
-                    - inoutStorageData.getSettleWeight();
+        if (null == inoutStorageData2) {
+            inoutStorageData2 = new ReportInoutStorageData();
         }
-        if (Constant.LOSS_OVER_OVER.equals(inoutStorageData.getType())) {
-            cmkc = inoutStorageData.getCurStorage()
-                    + inoutStorageData.getSettleWeight();
-        }
-        if (Constant.LOSS_OVER_LOSS.equals(inoutStorageData.getType())) {
-            cmkc = inoutStorageData.getCurStorage()
-                    - inoutStorageData.getSettleWeight();
-        }
+        double cmkc = inoutStorageData1.getSettleWeight() - inoutStorageData2.getSettleWeight();
         d.setQmkc(cmkc);
 
         return d;

--
Gitblit v1.9.3