소스 검색

2024-11-05 修改02

luguang 2 주 전
부모
커밋
23688bba3e
1개의 변경된 파일56개의 추가작업 그리고 10개의 파일을 삭제
  1. 56 10
      src/main/java/com/sy/coinage/workshop/component/ScreenComponent.java

+ 56 - 10
src/main/java/com/sy/coinage/workshop/component/ScreenComponent.java

@@ -164,20 +164,51 @@ public class ScreenComponent {
                     Integer totalQty = accountListOut.stream().filter(item -> item.getWareId().intValue() == stock.getWareId().intValue() && item.getSecuritiesId().intValue() == stock.getSecuritiesId().intValue()).collect(Collectors.toList()).stream().mapToInt(item -> item.getPayQty()).sum();
                     vo.setDayOutQty(totalQty / p.getAmountPerBox());
                 }
-                if (vo.getQty() + vo.getDayInQty() + vo.getDayOutQty() > 0) {
-                    list.add(vo);
-                }
                 if (screenDataList != null && screenDataList.size() > 0) {
-                    for (ScreenWareVO screenWareVO : list) {
+                    for (int i = screenDataList.size() - 1; i >= 0; i--) {
+                        ScreenWareVO screenWareVO = screenDataList.get(i);
                         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()));
+                            screenDataList.remove(i);
+                        }
+                    }
+                }
+                if (vo.getQty() + vo.getDayInQty() + vo.getDayOutQty() > 0) {
+                    list.add(vo);
+                }
+                if (screenDataList != null && screenDataList.size() > 0) {
+                    for (int i = screenDataList.size() - 1; i >= 0; i--) {
+                        ScreenWareVO screenWareVO = screenDataList.get(i);
+                        if (vo.getWareCn().equals(screenWareVO.getWareCn())) {
+                            ScreenWareVO vo1 = new ScreenWareVO();
+                            vo1.setWareCn(screenWareVO.getWareCn());
+                            vo1.setSecurities(screenWareVO.getSecurities());
+                            vo1.setQty((screenWareVO.getQty() == null ? 0 : screenWareVO.getQty()));
+                            vo1.setDayInQty((screenWareVO.getDayInQty() == null ? 0 : screenWareVO.getDayInQty()));
+                            vo1.setDayOutQty((screenWareVO.getDayOutQty() == null ? 0 : screenWareVO.getDayOutQty()));
+                            screenDataList.remove(i);
+                            if (vo1.getQty() + vo1.getDayInQty() + vo1.getDayOutQty() > 0) {
+                                list.add(vo1);
+                            }
                         }
                     }
                 }
-
-
+            }
+            if (screenDataList != null && screenDataList.size() > 0) {
+                for (int i = screenDataList.size() - 1; i >= 0; i--) {
+                    ScreenWareVO screenWareVO = screenDataList.get(i);
+                    ScreenWareVO vo1 = new ScreenWareVO();
+                    vo1.setWareCn(screenWareVO.getWareCn());
+                    vo1.setSecurities(screenWareVO.getSecurities());
+                    vo1.setQty((screenWareVO.getQty() == null ? 0 : screenWareVO.getQty()));
+                    vo1.setDayInQty((screenWareVO.getDayInQty() == null ? 0 : screenWareVO.getDayInQty()));
+                    vo1.setDayOutQty((screenWareVO.getDayOutQty() == null ? 0 : screenWareVO.getDayOutQty()));
+                    if (vo1.getQty() + vo1.getDayInQty() + vo1.getDayOutQty() > 0) {
+                        list.add(vo1);
+                    }
+                }
             }
         }
         this.redisService.set("screen_ware", JSON.toJSONString(list));
@@ -208,18 +239,33 @@ public class ScreenComponent {
                     Integer totalQty = accountListOut.stream().filter(item -> item.getSecuritiesId().intValue() == stock.getSecuritiesId().intValue()).collect(Collectors.toList()).stream().mapToInt(item -> item.getPayQty()).sum();
                     vo.setDayOutQty(totalQty / p.getAmountPerBox());
                 }
-                if (vo.getQty() + vo.getDayInQty() + vo.getDayOutQty() > 0) {
-                    list.add(vo);
-                }
                 if (screenDataList != null && screenDataList.size() > 0) {
-                    for (ScreenWareVO screenWareVO : list) {
+                    for (int i = screenDataList.size() - 1; i >= 0; i--) {
+                        ScreenWareVO screenWareVO = screenDataList.get(i);
                         if (vo.getSecurities().equals(screenWareVO.getSecurities())) {
                             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()));
+                            screenDataList.remove(i);
                         }
                     }
                 }
+                if (vo.getQty() + vo.getDayInQty() + vo.getDayOutQty() > 0) {
+                    list.add(vo);
+                }
+            }
+            if (screenDataList != null && screenDataList.size() > 0) {
+                for (int i = screenDataList.size() - 1; i >= 0; i--) {
+                    ScreenWareVO screenWareVO = screenDataList.get(i);
+                    ScreenWareVO vo = new ScreenWareVO();
+                    vo.setSecurities(screenWareVO.getSecurities());
+                    vo.setQty((screenWareVO.getQty() == null ? 0 : screenWareVO.getQty()));
+                    vo.setDayInQty((screenWareVO.getDayInQty() == null ? 0 : screenWareVO.getDayInQty()));
+                    vo.setDayOutQty((screenWareVO.getDayOutQty() == null ? 0 : screenWareVO.getDayOutQty()));
+                    if (vo.getQty() + vo.getDayInQty() + vo.getDayOutQty() > 0) {
+                        list.add(vo);
+                    }
+                }
             }
         }
         // 取手动管理的大屏数据