ソースを参照

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

hejq 7 年 前
コミット
35268ad132

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

@@ -665,16 +665,16 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
         List<ApCheckAmountDetail> detailList = new ArrayList<>();
         currencySet.forEach(currency -> {
             ApCheckAmountDetail detail = new ApCheckAmountDetail();
-            List<String> totalAmount = customer.getTotalCount().stream()
-                .filter(count -> currency.equals(count.getCurrency()))
-                .map(ApCheckAmount::getAmount).collect(Collectors.toList());
-            detail.setTotalAmount(totalAmount.size() > 0 ? totalAmount.get(0) : null);
-            detail.setCurrency(currency);
             if (!StringUtils.isEmpty(customer.getThisMonthCount())) {
                 List<String> thisPeriodAmount = customer.getThisMonthCount().stream()
                     .filter(count -> currency.equals(count.getCurrency()))
                     .map(ApCheckAmount::getAmount).collect(Collectors.toList());
                 detail.setThisPeriodAmount(thisPeriodAmount.size() > 0 ? thisPeriodAmount.get(0) : null);
+                List<String> totalAmount = customer.getTotalCount().stream()
+                    .filter(count -> currency.equals(count.getCurrency()))
+                    .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()