3 Commits ea68a5050b ... c75d2c7474

Author SHA1 Message Date
  luguang c75d2c7474 2024-11-05 修改 2 weeks ago
  luguang 9fa28961eb Merge remote-tracking branch 'origin/master' 2 weeks ago
  luguang f2b0f093a2 2024-11-05 合并大屏数据 2 weeks ago
1 changed files with 36 additions and 12 deletions
  1. 36 12
      src/main/java/com/sy/coinage/workshop/component/ScreenComponent.java

+ 36 - 12
src/main/java/com/sy/coinage/workshop/component/ScreenComponent.java

@@ -128,6 +128,8 @@ public class ScreenComponent {
         // 取实物收发卡付出
         List<WorkshopAccount> accountListOut = this.workshopAccountList(2, date, dept);
         List<Stock> stockList = this.getStockList(2);
+        // 取手动管理的大屏数据
+        List<ScreenWareVO> screenDataList = this.listScreenData();
         List<ScreenWareVO> list = new ArrayList<>();
         if (stockList != null && stockList.size() > 0) {
             for (Stock stock : stockList) {
@@ -165,6 +167,17 @@ public class ScreenComponent {
                 if (vo.getQty() + vo.getDayInQty() + vo.getDayOutQty() > 0) {
                     list.add(vo);
                 }
+                if (screenDataList != null && screenDataList.size() > 0) {
+                    for (ScreenWareVO screenWareVO : list) {
+                        if (vo.getSecurities().equals(screenWareVO.getSecurities()) && vo.getWareCn().equals(screenWareVO.getWareCn())) {
+                            vo.setQty(vo.getQty() + (screenWareVO.getQty() == null ? 0 : screenWareVO.getQty()));
+                            vo.setDayInQty(vo.getDayInQty() + (screenWareVO.getDayInQty() == null ? 0 : screenWareVO.getDayInQty()));
+                            vo.setDayOutQty(vo.getDayOutQty() + (screenWareVO.getDayOutQty() == null ? 0 : screenWareVO.getDayOutQty()));
+                        }
+                    }
+                }
+
+
             }
         }
         this.redisService.set("screen_ware", JSON.toJSONString(list));
@@ -177,6 +190,8 @@ public class ScreenComponent {
         List<WorkshopAccount> accountListOut = this.workshopAccountList(2, date, dept);
         List<Stock> stockList = this.getStockList(1);
         List<ScreenWareVO> list = new ArrayList<>();
+        // 取手动管理的大屏数据
+        List<ScreenWareVO> screenDataList = this.listScreenData();
         if (stockList != null && stockList.size() > 0) {
             for (Stock stock : stockList) {
                 ScreenWareVO vo = new ScreenWareVO();
@@ -196,24 +211,33 @@ public class ScreenComponent {
                 if (vo.getQty() + vo.getDayInQty() + vo.getDayOutQty() > 0) {
                     list.add(vo);
                 }
-            }
-        }
-        // 取手动管理的大屏数据
-        List<ScreenWareVO> screenDataList = this.listScreenData();
-        if (screenDataList != null && screenDataList.size() > 0) {
-            if (list != null && list.size() > 0) {
-                for (ScreenWareVO screenWareVO : list) {
-                    for (int i = screenDataList.size() - 1; i >= 0; i--) {
-                        ScreenWareVO vo = screenDataList.get(i);
+                if (screenDataList != null && screenDataList.size() > 0) {
+                    for (ScreenWareVO screenWareVO : list) {
                         if (vo.getSecurities().equals(screenWareVO.getSecurities())) {
-                            screenDataList.remove(i);
-                            break;
+                            vo.setQty(vo.getQty() + (screenWareVO.getQty() == null ? 0 : screenWareVO.getQty()));
+                            vo.setDayInQty(vo.getDayInQty() + (screenWareVO.getDayInQty() == null ? 0 : screenWareVO.getDayInQty()));
+                            vo.setDayOutQty(vo.getDayOutQty() + (screenWareVO.getDayOutQty() == null ? 0 : screenWareVO.getDayOutQty()));
                         }
                     }
                 }
             }
-            list.addAll(screenDataList);
         }
+        // 取手动管理的大屏数据
+//        List<ScreenWareVO> screenDataList = this.listScreenData();
+//        if (screenDataList != null && screenDataList.size() > 0) {
+//            if (list != null && list.size() > 0) {
+//                for (ScreenWareVO screenWareVO : list) {
+//                    for (int i = screenDataList.size() - 1; i >= 0; i--) {
+//                        ScreenWareVO vo = screenDataList.get(i);
+//                        if (vo.getSecurities().equals(screenWareVO.getSecurities())) {
+//                            screenDataList.remove(i);
+//                            break;
+//                        }
+//                    }
+//                }
+//            }
+//            list.addAll(screenDataList);
+//        }
         this.redisService.set("screen_day", JSON.toJSONString(list));
     }