Преглед изворни кода

【企业端】【首页】企业服务商支付数据判断null值写法调整

ZhangWenQiang пре 3 година
родитељ
комит
ff2f9a5a9a

+ 8 - 8
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/impl/HlwCompanyAccountDetailServiceImpl.java

@@ -349,13 +349,13 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
             List<HlwPayment> paymentList = hlwPaymentService.list(paymentQueryWrapper);
             if (paymentList != null && paymentList.size() > 0) {
                 //待支付付款单
-                noPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(1)).collect(Collectors.toList());
+                noPaymentList = paymentList.stream().filter(item -> item.getStatus() != null && item.getStatus().equals(1)).collect(Collectors.toList());
                 //支付中付款单
-                onPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(2)).collect(Collectors.toList());
+                onPaymentList = paymentList.stream().filter(item -> item.getStatus() != null && item.getStatus().equals(2)).collect(Collectors.toList());
                 //已支付付款单
-                alPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(3)).collect(Collectors.toList());
+                alPaymentList = paymentList.stream().filter(item -> item.getStatus() != null && item.getStatus().equals(3)).collect(Collectors.toList());
                 // 未发起付款单
-                nonePaymentList = paymentList.stream().filter(item -> item.getStatus().equals(null)).collect(Collectors.toList());
+                nonePaymentList = paymentList.stream().filter(item -> item.getStatus() == null).collect(Collectors.toList());
             }
         } else {
             queryWrapper.eq("cp_id", hlwCompanyAccount.getSubcontractorId());
@@ -376,13 +376,13 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
             List<HlwPayment> paymentList = hlwPaymentService.list(paymentQueryWrapper);
             if (paymentList != null && paymentList.size() > 0) {
                 //待支付付款单
-                noPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(1)).collect(Collectors.toList());
+                noPaymentList = paymentList.stream().filter(item -> item.getStatus() != null && item.getStatus().equals(1)).collect(Collectors.toList());
                 //支付中付款单
-                onPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(2)).collect(Collectors.toList());
+                onPaymentList = paymentList.stream().filter(item -> item.getStatus() != null && item.getStatus().equals(2)).collect(Collectors.toList());
                 //已支付付款单
-                alPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(3)).collect(Collectors.toList());
+                alPaymentList = paymentList.stream().filter(item -> item.getStatus() != null && item.getStatus().equals(3)).collect(Collectors.toList());
                 // 未发起付款单
-                nonePaymentList = paymentList.stream().filter(item -> item.getStatus().equals(null)).collect(Collectors.toList());
+                nonePaymentList = paymentList.stream().filter(item -> item.getStatus() == null).collect(Collectors.toList());
             }
         }
         //待支付付款单遍历