Ver Fonte

feat(apCheck): 供应商客户列表数据查询数据返回判断,如果本期应收没有值,前端不返回数据

hejq há 7 anos atrás
pai
commit
e0a35d2420

+ 13 - 13
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApCheckServiceImpl.java

@@ -677,20 +677,20 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
                     .map(ApCheckAmount::getAmount).collect(Collectors.toList());
                 detail.setTotalAmount(totalAmount.size() > 0 ? totalAmount.get(0) : null);
                 detail.setCurrency(currency);
+                if (!StringUtils.isEmpty(customer.getThisMonthTodoCount())) {
+                    List<String> thisPeriodTodoAmount = customer.getThisMonthTodoCount().stream()
+                        .filter(count -> currency.equals(count.getCurrency()))
+                        .map(ApCheckAmount::getAmount).collect(Collectors.toList());
+                    detail.setThisPeriodTodoAmount(thisPeriodTodoAmount.size() > 0 ? thisPeriodTodoAmount.get(0) : null);
+                }
+                if (!StringUtils.isEmpty(customer.getThisMonthDoneCount())) {
+                    List<String> thisPeriodDoneAmount = customer.getThisMonthDoneCount().stream()
+                        .filter(count -> currency.equals(count.getCurrency()))
+                        .map(ApCheckAmount::getAmount).collect(Collectors.toList());
+                    detail.setThisPeriodDoneAmount(thisPeriodDoneAmount.size() > 0 ? thisPeriodDoneAmount.get(0) : null);
+                }
+                detailList.add(detail);
             }
-            if (!StringUtils.isEmpty(customer.getThisMonthTodoCount())) {
-                List<String> thisPeriodTodoAmount = customer.getThisMonthTodoCount().stream()
-                    .filter(count -> currency.equals(count.getCurrency()))
-                    .map(ApCheckAmount::getAmount).collect(Collectors.toList());
-                detail.setThisPeriodTodoAmount(thisPeriodTodoAmount.size() > 0 ? thisPeriodTodoAmount.get(0) : null);
-            }
-            if (!StringUtils.isEmpty(customer.getThisMonthDoneCount())) {
-                List<String> thisPeriodDoneAmount = customer.getThisMonthDoneCount().stream()
-                    .filter(count -> currency.equals(count.getCurrency()))
-                    .map(ApCheckAmount::getAmount).collect(Collectors.toList());
-                detail.setThisPeriodDoneAmount(thisPeriodDoneAmount.size() > 0 ? thisPeriodDoneAmount.get(0) : null);
-            }
-            detailList.add(detail);
         });
         customer.setAmountDetailList(detailList);
     }