Browse Source

【企业端】【首页】企业服务商支付数据调整

ZhangWenQiang 3 years atrás
parent
commit
5f07c27844

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

@@ -322,9 +322,13 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
         Double payment = 0.00;
         Double serviceFee = 0.00;
         Double totalPayment = 0.00;
+        Double nonePayment = 0.00;
+        Double noneServiceFee = 0.00;
+        Double noneTotalPayment = 0.00;
         List<HlwPayment> noPaymentList = new ArrayList<>();
         List<HlwPayment> onPaymentList = new ArrayList<>();
         List<HlwPayment> alPaymentList = new ArrayList<>();
+        List<HlwPayment> nonePaymentList = new ArrayList<>();
         if (hlwCompanyAccount.getCpType() == 1) {
             queryWrapper.eq("subcontractor_id", hlwCompanyAccount.getSubcontractorId());
             //服务商数据统计
@@ -350,6 +354,8 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
                 onPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(2)).collect(Collectors.toList());
                 //已支付付款单
                 alPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(3)).collect(Collectors.toList());
+                // 未发起付款单
+                nonePaymentList = paymentList.stream().filter(item -> item.getStatus().equals(null)).collect(Collectors.toList());
             }
         } else {
             queryWrapper.eq("cp_id", hlwCompanyAccount.getSubcontractorId());
@@ -375,6 +381,8 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
                 onPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(2)).collect(Collectors.toList());
                 //已支付付款单
                 alPaymentList = paymentList.stream().filter(item -> item.getStatus().equals(3)).collect(Collectors.toList());
+                // 未发起付款单
+                nonePaymentList = paymentList.stream().filter(item -> item.getStatus().equals(null)).collect(Collectors.toList());
             }
         }
         //待支付付款单遍历
@@ -383,6 +391,12 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
             serviceFee = businessAccountUtils.add(serviceFee, hlwPayment.getServiceFee());
             totalPayment = businessAccountUtils.add(totalPayment, hlwPayment.getTotalPayment());
         }
+        // 未发起付款单遍历
+        for (HlwPayment hlwPayment : nonePaymentList) {
+            nonePayment = businessAccountUtils.add(nonePayment, hlwPayment.getPayment());
+            noneServiceFee = businessAccountUtils.add(noneServiceFee, hlwPayment.getServiceFee());
+            noneTotalPayment = businessAccountUtils.add(noneTotalPayment, hlwPayment.getTotalPayment());
+        }
         //待支付金额
         map.put("noPayment", payment);
         //待支付服务费
@@ -395,6 +409,16 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
         map.put("onPaymentCount", onPaymentList.size());
         //已支付付款单数量
         map.put("alPaymentCount", alPaymentList.size());
+        //未发起付款单数量
+        map.put("nonePaymentCount", nonePaymentList.size());
+        //未发起金额
+        map.put("nonePayment", nonePayment);
+        //未发起服务费
+        map.put("noneServiceFee", noneServiceFee);
+        //未发起总金额
+        map.put("noneTotalPayment", noneTotalPayment);
+        // 处理中付款单数量
+        map.put("ingPaymentCount", (noPaymentList.size() + onPaymentList.size()));
         List<HlwCpSubcontractorBankAccount> list = hlwCpSubcontractorBankAccountService.list(queryWrapper);
         map.put("bankList", list);
         return Result.ok(map);