Переглянути джерело

Merge branch 'master' into wrq_dev

wangrq 2 місяців тому
батько
коміт
bb5e7740c5

+ 4 - 1
commons/src/main/java/com/jzg/commons/entity/finance/dto/CompanySuperviseSettlementReportDto.java

@@ -40,9 +40,12 @@ public class CompanySuperviseSettlementReportDto implements Serializable {
     @Schema(description = "累计应收金额(跟单费页面展示)")
     private String totalFollowFee;
 
-    @Schema(description = "应收手续费")
+    @Schema(description = "应收手续费(车险)")
     private String superviseFee;
 
+    @Schema(description = "应收手续费(非车险)")
+    private String superviseFee4Other;
+
 
     @Schema(description = "应收跟单费")
     private String followFee;

+ 1 - 7
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/service/impl/ChengTaiApiRequestImpl.java

@@ -156,7 +156,7 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
         PremiumCalculationResponse premiumCalculationResponse = new PremiumCalculationResponse();
         String ciQuestion = null,biQuestion = null;
         while(true) {
-            if(index >=5){
+            if(index >=6){
                 break;
             }
             premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest,apiUrl);
@@ -288,15 +288,9 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
                         String ocrStr = HttpUtil.sendPost("http://39.98.41.104:8088/getres", sendBody);
                         CheckCodeResp resp = JSONUtil.toBean(ocrStr, CheckCodeResp.class);
                         if(StringUtils.isNotEmpty(resp.getJqImageCode())){
-                            if(quoteVo.getCiTransferCode() != null && !quoteVo.getCiTransferCode().equals("")){
-                                resp.setJqImageCode(quoteVo.getCiTransferCode());
-                            }
                             quoteVo.setCiTransferCode(resp.getJqImageCode().replace("0", "O"));
                         }
                         if(StringUtils.isNotEmpty(resp.getSyImageCode())){
-                            if(quoteVo.getBiTransferCode() != null && !quoteVo.getBiTransferCode().equals("")){
-                                resp.setSyImageCode(quoteVo.getBiTransferCode());
-                            }
                             quoteVo.setBiTransferCode(resp.getSyImageCode().replace("0", "O"));
                         }
                         premiumCalculationRequest = new PremiumCalculationRequest(quoteVo, carActualValue, parameters, vehicle, orderNumber);

+ 48 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/OrderOperationLogAspect.java

@@ -14,6 +14,7 @@ import com.jzg.commons.entity.quote.vo.aggregated.*;
 import com.jzg.commons.entity.vo.AdjustAllRefundVo;
 import com.jzg.quotation.commons.constant.SpElMapping;
 import com.jzg.quotation.commons.utils.SpElFieldExtractor;
+import com.jzg.quotation.summary.aop.aspect.OrderOperationLog;
 import com.jzg.quotation.summary.constants.QuoteNumberConstant;
 import com.jzg.quotation.summary.service.InsOrderAdjustService;
 import com.jzg.quotation.summary.service.InsOrdersCarInfoService;
@@ -64,6 +65,7 @@ public class OrderOperationLogAspect {
         // 获取方法信息和参数
         MethodSignature signature = (MethodSignature) joinPoint.getSignature();
         Object[] args = joinPoint.getArgs();
+        logger.info("订单相关的参数:args=[{}]", JSONUtil.toJsonStr(args));
         String[] paramNames = signature.getParameterNames();
         // 设置 SpEL 上下文
         EvaluationContext context = new StandardEvaluationContext();
@@ -152,10 +154,56 @@ public class OrderOperationLogAspect {
                 HttpResult<String> res = (HttpResult)result;
                 this.dealApproveOrders(res.getData(),res,log);
                 break;
+            // 费用调整
+            case 15:
+                logger.info("费用调整log.orderSpEl()=[{}]",log.orderSpEl());
+                result = joinPoint.proceed();
+                String orderNo01 = "001";
+                this.saveCostInfo(orderNo01,result,log);
+                break;
+            // 批量修改比例
+            case 16:
+                logger.info("批量修改比例.log.orderSpEl()=[{}]",log.orderSpEl());
+                result = joinPoint.proceed();
+                String orderNo02 = "002";
+                this.batchModify(orderNo02,result,log);
+                break;
         }
         return result;
     }
 
+    /**
+     * 批量修改比例
+     *
+     * @author lipf
+     * @date 2026/7/8 15:29
+     */
+    private void batchModify(String orderNo, Object result, OrderOperationLog log) {
+        InsOrdersTrack track = new InsOrdersTrack();
+        track.setModule("应收订单");
+        track.setSubModule("");
+        track.setOptType(16);
+        track.setOrderNo(orderNo);
+        track.setResult(JSONUtil.toJsonStr(result));
+        traceService.save(track);
+    }
+
+    /**
+     * 保存费用信息
+     * @author lipf
+     * @date 2026/7/8 15:28
+     */
+    private void saveCostInfo(String orderNo, Object result, OrderOperationLog log) {
+        InsOrdersTrack track = new InsOrdersTrack();
+        track.setModule("订单审核");
+        track.setSubModule("我的审核");
+        track.setOptType(15);
+        track.setOrderNo(orderNo);
+        track.setResult(JSONUtil.toJsonStr(result));
+        traceService.save(track);
+    }
+
+
     /**
      * 订单审核(通过/驳回)
      *

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/mapper/ReceivableMapper.java

@@ -250,7 +250,7 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
      */
     //@MapKey("companyId")
     List<CalRes> queryInvoicedAmount(@Param("systemCode") String systemCode,
-                                     @Param("invoiceType") List<Integer> invoiceType,
+                                     @Param("invoiceType") List<String> invoiceType,
                                      @Param("invoiceStartDate") String invoiceStartDate,
                                      @Param("invoiceEndDate") String invoiceEndDate,
                                      @Param("agreementType") String agreementType);

+ 35 - 28
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -5273,8 +5273,26 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         String systemCode = baseController.getSystemCode();
         log.info("保险公司结算报表查询-区分租户并且按照日期进行过滤:systemCode=[{}],queryVo=[{}]", systemCode, JSONUtil.toJsonStr(queryVo));
         // 1. 先将有数据的保险公司进行汇总
-        // 累计应收金额, 应收手续费(手续费), 应收手续费(手续费)
+        // 累计应收金额, 应收手续费(手续费)
         List<CompanySuperviseSettlementReportDto> allCompaniesIncomeDatas = baseMapper.queryCumulativeAccountsReceivable(systemCode, queryVo);
+        
+        // 车险
+        if("10".equals(queryVo.getAccountsReceivable())){
+            // 默认情况下,superviseFee 得到的就是车险的手续费
+            allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().toList();
+        }else if("20".equals(queryVo.getAccountsReceivable())){
+            allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().peek(action->{
+                // 统计非车的手续费
+              action.setSuperviseFee(action.getSuperviseFee4Other());
+            }).toList();
+        }else if(StrUtil.isEmpty(queryVo.getAccountsReceivable())){
+                // 统计总的手续费
+            allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().peek(action->{
+                // 统计非车的手续费
+                action.setSuperviseFee(action.getTotalReceivable());
+            }).toList();
+        }
+
         // for test, 查看一家公司的数据,将不可变对象变成 可变对象
 //        allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().filter(action-> "1738811735599338932".equals(action.getCompanyId())).toList();
 //        allCompaniesIncomeDatas = new ArrayList<>(allCompaniesIncomeDatas);
@@ -5310,20 +5328,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             BigDecimal totalReceivable = groupList.stream()
                     .map(x -> new BigDecimal(x.getTotalReceivable()))
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
-            BigDecimal totalFollowFee = groupList.stream()
-                    .map(x -> new BigDecimal(x.getTotalFollowFee()))
-                    .reduce(BigDecimal.ZERO, BigDecimal::add);
+
             BigDecimal superviseFee = groupList.stream()
                     .map(x -> new BigDecimal(x.getSuperviseFee()))
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
-            BigDecimal followFee = groupList.stream()
-                    .map(x -> new BigDecimal(x.getFollowFee()))
-                    .reduce(BigDecimal.ZERO, BigDecimal::add);
-
             sumDto.setTotalReceivable(totalReceivable.toString());
-            sumDto.setTotalFollowFee(totalFollowFee.toString());
             sumDto.setSuperviseFee(superviseFee.toString());
-            sumDto.setFollowFee(followFee.toString());
             sumDto.setParentId(first.getParentId());
             resultList.add(sumDto);
         }
@@ -5422,22 +5432,25 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         // 已开票(手续费)
         // 已开票(跟单费)
 
+        List<String> invoiceTypes = List.of("1","3");
+
+
+        if("10".equals(queryVo.getAccountsReceivable())){
+            invoiceTypes = List.of("1");
+        }else if("20".equals(queryVo.getAccountsReceivable())){
+            invoiceTypes = List.of("3");
+        }
+
         List<CalRes> calRes;
-        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(1, 3), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
+        calRes = baseMapper.queryInvoicedAmount(systemCode, invoiceTypes, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> sxfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
         Map<String, BigDecimal> sxfOverinflatedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getOverinflatedAmount, (o1,o2)->o1));
-//        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(2, 4), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
-//        Map<String, BigDecimal> gdfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
 
         // 结算费用 
-        List<CalRes> sxfList = baseMapper.querySettledAmount(systemCode, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType(), CollUtil.newArrayList("1", "3"));
-        // List<CalRes> gdfList = baseMapper.querySettledAmount(systemCode, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType(), CollUtil.newArrayList("2", "4"));
+        List<CalRes> sxfList = baseMapper.querySettledAmount(systemCode, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType(), invoiceTypes);
         Map<String, BigDecimal> sxfSettledAmountMap = CollUtil.isNotEmpty(sxfList) ? sxfList.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getSettlement, (o1,o2)->o1)) : new HashMap<>();
         // 手续费的回款差额汇总
         Map<String, BigDecimal> sxfSettledDiffAmountMap = CollUtil.isNotEmpty(sxfList) ? sxfList.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getOverinflatedAmount, (o1,o2)->o1)) : new HashMap<>();
-        //Map<String, BigDecimal> gdfSettledAmountMap = CollUtil.isNotEmpty(gdfList) ? gdfList.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getSettlement, (o1,o2)->o1)) : new HashMap<>();
-        // 跟单费的回款差额汇总
-        //Map<String, BigDecimal> gdfSettledDiffAmountMap = CollUtil.isNotEmpty(gdfList) ? gdfList.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getOverinflatedAmount, (o1,o2)->o1)) : new HashMap<>();
 
         // 计算已开票和未开票
         for (String companyId : companyMap.keySet()) {
@@ -5447,37 +5460,27 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             companySuperviseSettlementReportDto.setSxfInvoicedAmount(Objects.toString(sxf,BigDecimal.ZERO+""));
             BigDecimal sxfOverinflatedAmount = sxfOverinflatedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setTotalOverinflatedAmount(Objects.toString(sxfOverinflatedAmount,BigDecimal.ZERO+""));
-//            BigDecimal gdf = gdfInvoicedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
-            //companySuperviseSettlementReportDto.setGdfInvoicedAmount(Objects.toString(gdf,BigDecimal.ZERO+""));
             // 平台就没有未结算的,只要结算就是已结算的
             companySuperviseSettlementReportDto.setPtInvoicedAmount(companySuperviseSettlementReportDto.getTotalReceivable());
 
             CompanySuperviseSettlementReportDto dto;
             dto = companyMap.get(companyId);
             companySuperviseSettlementReportDto.setSxfUnInvoicedAmount(BigDecimalUtil.subtract(new BigDecimal(dto.getSuperviseFee()),BigDecimalUtil.subtract(sxf, new BigDecimal(dto.getTotalOverinflatedAmount()))).toString());
-            //companySuperviseSettlementReportDto.setGdfUnInvoicedAmount(BigDecimalUtil.subtract(new BigDecimal(dto.getFollowFee()),BigDecimalUtil.subtract(gdf,new BigDecimal(dto.getTotalOverinflatedAmount()))).toString());
             companySuperviseSettlementReportDto.setPtUnInvoicedAmount(BigDecimal.ZERO.toString());
 
             BigDecimal sxfS = sxfSettledAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
-            //BigDecimal gdfS = gdfSettledAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             BigDecimal overinflatedAmount = sxfOverinflatedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setSxfSettledAmount(Objects.toString(sxfS, BigDecimal.ZERO+""));
             companySuperviseSettlementReportDto.setSxfUnSettledAmount(BigDecimalUtil.subtract(sxf,BigDecimalUtil.add(sxfS,sxfSettledDiffAmountMap.getOrDefault(companyId, BigDecimal.ZERO))).toString());
             companySuperviseSettlementReportDto.setTotalOverinflatedAmount(Objects.toString(overinflatedAmount, BigDecimal.ZERO+""));
             companySuperviseSettlementReportDto.setSettlementPaymentDifference(Objects.toString(sxfSettledDiffAmountMap.getOrDefault(companyId, BigDecimal.ZERO)) );
-
-            //companySuperviseSettlementReportDto.setGdfSettledAmount(Objects.toString(gdfS, BigDecimal.ZERO+""));
-            //companySuperviseSettlementReportDto.setGdfUnSettledAmount(BigDecimalUtil.subtract(gdf,gdfS).toString());
-
             // 当起始日期有值的时候,计算的没有意义
             if(StrUtil.isNotEmpty(queryVo.getInvoiceStartTime())){
                 companySuperviseSettlementReportDto.setSxfUnInvoicedAmount("-");
-                //companySuperviseSettlementReportDto.setGdfUnInvoicedAmount("-");
                 companySuperviseSettlementReportDto.setPtUnInvoicedAmount("-");
             }
             if(StrUtil.isNotEmpty(queryVo.getSettlementStartTime())){
                 companySuperviseSettlementReportDto.setSxfUnSettledAmount("-");
-                // companySuperviseSettlementReportDto.setGdfUnSettledAmount("-");
             }
         }
         return new ArrayList<>(companyMap.values().stream().toList());
@@ -5608,6 +5611,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             tree.setParentId(dto.getParentId());
             // 将原对象的其他属性放入扩展字段
             tree.putExtra("companyName",dto.getCompanyName());
+            tree.putExtra("companyId",dto.getCompanyId());
             tree.putExtra("totalReceivable",dto.getTotalReceivable());
             tree.putExtra("totalFollowFee",dto.getTotalFollowFee());
             tree.putExtra("superviseFee",dto.getSuperviseFee());
@@ -5624,6 +5628,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             tree.putExtra("gdfUnSettledAmount",dto.getGdfUnSettledAmount());
             tree.putExtra("totalOverinflatedAmount",dto.getTotalOverinflatedAmount());
             tree.putExtra("settlementPaymentDifference",dto.getSettlementPaymentDifference());
+
+
+
         });
         log.info("树形结构构建:一级数据[{}]个", CollUtil.size(build));
         return build;

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

@@ -1921,9 +1921,8 @@
         ipi.company_id,
         ipi.system_code,
         sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_premiums,0 )+COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as totalReceivable ,
-        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_premiums,0 )+COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as totalFollowFee,
-        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_premiums,0 )) as superviseFee,
-        sum(COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as followFee
+        sum(COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as superviseFee4Other ,
+        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_premiums,0 )) as superviseFee
         from
         ins_ply_income ipi
         left join esm_ins_company eic on eic.id = ipi.company_id AND eic.is_delete = 0