Просмотр исходного кода

Merge remote-tracking branch 'origin/dev_jzg_lipf_v20260622' into dev_jzg_lipf_v20260622

lipf 2 месяцев назад
Родитель
Сommit
af78472173

+ 1 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/InsFeeFollowOrderReconciliationController.java

@@ -43,6 +43,7 @@ public class InsFeeFollowOrderReconciliationController {
                 .eq("month", saveDTO.getMonth())
                 .eq("partner_company_id", saveDTO.getPartnerCompanyId())
                 .eq("system_code", baseController.getSystemCode())
+                .eq("invoice_type", saveDTO.getInvoiceType())
                 .last("LIMIT 1"); // 取一条即可,或者根据业务取最新的
         InsFeeFollowOrderReconciliation insFeeFollowOrderReconciliation = reconciliationService.getOne(insFeeFollowOrderReconciliationQueryWrapper);
 

+ 15 - 4
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -327,8 +327,17 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         Page<InsPlyIncome> page = baseMapper.getReceivablePage(page1, receivableQueryVo);
         List<InsPlyIncomeOrder> res = page.getRecords().stream()
                 .map(action -> new InsPlyIncomeOrder(action.getId(), action.getOrderNo())).toList();
-        BigDecimal totalAmount = page.getRecords().stream()
-                .map(action -> new BigDecimal(Objects.toString(action.getReceivableAmount(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+        BigDecimal totalAmount = BigDecimal.ZERO;
+        if ("3".equals(receivableQueryVo.getInvoiceType())){
+            totalAmount = page.getRecords().stream()
+                    .map(action -> new BigDecimal(Objects.toString(action.getJySuperviseCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+        } else if ("4".equals(receivableQueryVo.getInvoiceType())){
+            totalAmount = page.getRecords().stream()
+                    .map(action -> new BigDecimal(Objects.toString(action.getJyOtherCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+        }else{
+            totalAmount = page.getRecords().stream()
+                    .map(action -> new BigDecimal(Objects.toString(action.getReceivableAmount(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+        }
 
         InsPlyIncomeVO vo = new InsPlyIncomeVO(null, res,Objects.toString(totalAmount,"0"));
         log.info("获取私有/平台协议手续费应收列表的id集合。receivableQueryVo=[{}]. ids.size=[{}]", JSONUtil.toJsonStr(receivableQueryVo), CollUtil.size(res));
@@ -4065,7 +4074,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 for (int month = 1; month <= 12; month++) {
                     InsFeeFollowOrderVo vo = buildFollowOrderVo(
                             year, month, firstItem, partnerCompanyId,
-                            monthReceivableMap, invoicedMap
+                            monthReceivableMap, invoicedMap, followInvoicePageListVo
                     );
                     result.add(vo);
                 }
@@ -4195,7 +4204,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     private InsFeeFollowOrderVo buildFollowOrderVo(Integer year, int month, InsPlyIncomeDto firstItem,
                                                    String partnerCompanyId,
                                                    Map<Integer, BigDecimal> monthReceivableMap,
-                                                   Map<String, BigDecimal> invoicedMap) {
+                                                   Map<String, BigDecimal> invoicedMap, FollowInvoicePageListVo followInvoicePageListVo) {
 
         String systemCode = baseController.getSystemCode();
         // 获取当月应收保费,默认为0
@@ -4221,6 +4230,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 .eq("month", month)
                 .eq("partner_company_id", partnerCompanyId)
                 .eq("system_code", systemCode)
+                .eq("invoice_type", followInvoicePageListVo.getInvoiceType())
                 .last("LIMIT 1"); // 取一条即可,或者根据业务取最新的
         InsFeeFollowOrder dbOrder = insFeeFollowOrderMapper.selectOne(queryWrapper);
         if (dbOrder != null) {
@@ -4237,6 +4247,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                     .eq("month", month)
                     .eq("partner_company_id", partnerCompanyId)
                     .eq("system_code", systemCode)
+                    .eq("invoice_type", followInvoicePageListVo.getInvoiceType())
                     .last("LIMIT 1"); // 取一条即可,或者根据业务取最新的
             InsFeeFollowOrderReconciliation insFeeFollowOrderReconciliation = insFeeFollowOrderReconciliationMapper.selectOne(insFeeFollowOrderReconciliationQueryWrapper);
             if (null != insFeeFollowOrderReconciliation){

+ 1 - 1
tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

@@ -335,7 +335,7 @@
                 #{id}
             </foreach>
         </if>
-        <if test="receivableQueryVo.queryType!= null and (receivableQueryVo.queryType == 3 or receivableQueryVo.queryType == 4)">
+        <if test="receivableQueryVo.invoiceType!= null and (receivableQueryVo.invoiceType == 3 or receivableQueryVo.invoiceType == 4)">
             AND ipi.jy_premium != 0
         </if>
         <if test="receivableQueryVo.licenseNo != null and receivableQueryVo.licenseNo != ''">