Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

xuqiang 2 ay önce
ebeveyn
işleme
5c30a71def
26 değiştirilmiş dosya ile 517 ekleme ve 110 silme
  1. 9 0
      authentication/src/main/java/com/jzg/config/JzgAuthenticationProvider.java
  2. 17 4
      commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostBatchAdjustParam.java
  3. 4 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/QueryFollowIncomeVo.java
  4. 4 0
      commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfo.java
  5. 29 0
      commons/src/main/java/com/jzg/commons/entity/report/dto/ReportOperatingProfitDataDto.java
  6. 1 1
      commons/src/main/java/com/jzg/commons/entity/report/vo/PayableStatisticsDetailParam.java
  7. 13 0
      consoleStatistics/src/main/java/com/jzg/console/client/FeeAuditClient.java
  8. 26 3
      consoleStatistics/src/main/java/com/jzg/console/controller/ReportFinanceDataManageController.java
  9. 2 2
      consoleStatistics/src/main/java/com/jzg/console/service/impl/ReportMeetDataServiceImpl.java
  10. 139 14
      consoleStatistics/src/main/java/com/jzg/console/service/impl/ReportOperatingProfitDataServiceImpl.java
  11. 2 2
      consoleStatistics/src/main/resources/mapper/ReportMeetDataMapper.xml
  12. 18 12
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/build/DaDiCrawlerQuoteResultVoBuild.java
  13. 83 2
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/response/DaDiQuoteResponse.java
  14. 1 1
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/service/impl/DaDiCrawlerRequestImpl.java
  15. 24 11
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/build/HbCrawlerQuoteResultVoBuild.java
  16. 3 3
      tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/build/HuaTaiCrawlerQuoteResultsVoBuild.java
  17. 21 10
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/FactorMatch.java
  18. 7 5
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java
  19. 17 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeOrderController.java
  20. 5 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsOrdersController.java
  21. 10 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/InsFeeOrdersService.java
  22. 17 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeOrdersServiceImpl.java
  23. 4 3
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java
  24. 20 20
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/constant/enums/ZmCrawlerFloatFlag.java
  25. 34 11
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostServiceImpl.java
  26. 7 6
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

+ 9 - 0
authentication/src/main/java/com/jzg/config/JzgAuthenticationProvider.java

@@ -9,6 +9,7 @@ import com.alipay.api.DefaultAlipayClient;
 import com.alipay.api.request.AlipaySystemOauthTokenRequest;
 import com.alipay.api.response.AlipaySystemOauthTokenResponse;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.jzg.client.OrganizationClient;
 import com.jzg.client.PlatformClient;
 import com.jzg.commons.constants.RedisKeyConstants;
@@ -363,6 +364,14 @@ public class JzgAuthenticationProvider implements AuthenticationProvider {
         details = detailMap;
 
         Object finalDetails = details;
+
+        // 新增维护上次登录时间
+        sysUserJzgInfoMapper.update(null,new LambdaUpdateWrapper<SysUserJzgInfo>()
+                .eq(SysUserJzgInfo::getUserId,weblogUser.getId())
+                .eq(SysUserJzgInfo::getSystemCode,system)
+                .set(SysUserJzgInfo::getLastLoginTime,LocalDateTime.now())
+        );
+
         return new UsernamePasswordAuthenticationToken(username, rawPassword, authorities) {
             @Serial
             private static final long serialVersionUID = 6103193211327672348L;

+ 17 - 4
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostBatchAdjustParam.java

@@ -30,9 +30,22 @@ public class PtlAgreementCostBatchAdjustParam {
     @Schema(description = "操作类型:ADD-加,SUBTRACT-减", requiredMode = Schema.RequiredMode.REQUIRED, example = "ADD")
     private String operationType;
 
-    @Schema(description = "入口比例调整值(百分比)")
-    private BigDecimal inletRatio;
+    @Schema(description = "交强险入口比例调整值(百分比)")
+    private BigDecimal jqInletRatio;
+
+    @Schema(description = "交强险出口比例调整值(百分比)")
+    private BigDecimal jqExportRatio;
+
+    @Schema(description = "商业险入口比例调整值(百分比)")
+    private BigDecimal syInletRatio;
+
+    @Schema(description = "商业险出口比例调整值(百分比)")
+    private BigDecimal syExportRatio;
+
+    @Schema(description = "驾意险入口比例调整值(百分比)")
+    private BigDecimal jyInletRatio;
+
+    @Schema(description = "驾意险出口比例调整值(百分比)")
+    private BigDecimal jyExportRatio;
 
-    @Schema(description = "入口留点比例调整值(百分比)")
-    private BigDecimal inletKeepPointRatio;
 }

+ 4 - 0
commons/src/main/java/com/jzg/commons/entity/finance/vo/QueryFollowIncomeVo.java

@@ -3,13 +3,17 @@ package com.jzg.commons.entity.finance.vo;
 import com.jzg.commons.core.base.PageRequest;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
 import java.util.List;
 
 @Data
 @AllArgsConstructor
+@NoArgsConstructor
+@Builder
 public class QueryFollowIncomeVo  extends PageRequest implements Serializable {
 
     @Schema(description = "开始年份")

+ 4 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfo.java

@@ -344,6 +344,10 @@ public class SysUserJzgInfo extends BaseModel implements Serializable {
     @Schema(description = "合伙人类型")
     private String partnerTypeAttr;
 
+    @TableField(value = "last_login_time")
+    @Schema(description = "上次登录时间")
+    private LocalDateTime lastLoginTime;
+
     /**
      * 判断用户是否能登录
      *      启用状态才能登录

+ 29 - 0
commons/src/main/java/com/jzg/commons/entity/report/dto/ReportOperatingProfitDataDto.java

@@ -88,4 +88,33 @@ public class ReportOperatingProfitDataDto {
     @ColumnWidth(20)
     @Schema(description = "实付")
     private BigDecimal paidMoney;
+
+    /**
+     * 将另一个 DTO 的数值字段累加到当前对象中。
+     * 注意:此方法会修改当前对象(this)。
+     *
+     * @param other 要合并的另一个 DTO 对象
+     */
+    public void merge(ReportOperatingProfitDataDto other) {
+        if (other == null) {
+            return;
+        }
+        this.sumPremium = addSafe(this.sumPremium, other.sumPremium);
+        this.receivableMoney = addSafe(this.receivableMoney, other.receivableMoney);
+        this.meetMoney = addSafe(this.meetMoney, other.meetMoney);
+        this.profitMoney = addSafe(this.profitMoney, other.profitMoney);
+        this.receivedMoney = addSafe(this.receivedMoney, other.receivedMoney);
+        this.paidMoney = addSafe(this.paidMoney, other.paidMoney);
+        // 如果还有其他数值类型字段,请在此处继续添加
+    }
+
+    /**
+     * 安全的 BigDecimal 累加,防止空指针异常。
+     * 规则:null + value = value; value + null = value; null + null = null
+     */
+    private BigDecimal addSafe(BigDecimal a, BigDecimal b) {
+        if (a == null) return b;
+        if (b == null) return a;
+        return a.add(b);
+    }
 }

+ 1 - 1
commons/src/main/java/com/jzg/commons/entity/report/vo/PayableStatisticsDetailParam.java

@@ -17,6 +17,6 @@ public class PayableStatisticsDetailParam extends PageRequest {
     private static final long serialVersionUID = 1L;
 
     @Schema(description = "年月时间,格式:yyyy-MM")
-    private String yearAndMonthTime;
+    private String yearMonth;
 
 }

+ 13 - 0
consoleStatistics/src/main/java/com/jzg/console/client/FeeAuditClient.java

@@ -6,9 +6,12 @@ import com.jzg.commons.entity.dto.FeeAuditParam;
 import com.jzg.commons.entity.orders.vo.FeeAuditSummaryParam;
 import com.jzg.commons.entity.orders.vo.FeeAuditSummaryVO;
 import com.jzg.commons.entity.orders.vo.FeeAuditVo;
+import com.jzg.commons.entity.report.dto.ReportOperatingProfitDataDto;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -34,4 +37,14 @@ public interface FeeAuditClient {
     @PostMapping("/feeAudit/queryAuditSummary")
     HttpResult<List<FeeAuditSummaryVO>> queryAuditSummary(@RequestBody FeeAuditSummaryParam param);
 
+    /**
+     * 查询指定年份的经营利润
+     *
+     * @param year 年份,例如 2026
+     * @author lipf
+     * @date 2026/7/25 11:22
+     */
+    @GetMapping("/feeAudit/queryOperatingProfits")
+    HttpResult<List<ReportOperatingProfitDataDto>> queryOperatingProfits(@RequestParam("year") String year);
+
 }

+ 26 - 3
consoleStatistics/src/main/java/com/jzg/console/controller/ReportFinanceDataManageController.java

@@ -5,20 +5,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.orders.vo.FeeAuditVo;
 import com.jzg.commons.entity.report.dto.FeeAuditSummaryVo;
 import com.jzg.commons.entity.report.vo.FeeAuditDetailParam;
 import com.jzg.commons.entity.report.vo.FeeAuditSummaryParam;
 import com.jzg.commons.entity.report.vo.PayableStatisticsDetailParam;
 import com.jzg.commons.entity.report.vo.ReportSearchCommonVo;
-import com.jzg.commons.entity.orders.vo.FeeAuditVo;
 import com.jzg.console.service.*;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import java.io.IOException;
 import java.util.List;
 
 /**
@@ -502,5 +504,26 @@ public class ReportFinanceDataManageController extends BaseController {
             return HttpResult.error(e.getMessage());
         }
     }
+    /**
+     * 财务数据-应付统计:按月份汇总查询应付数据导出
+     * @author: jk
+     */
+    @Operation(summary = "财务数据-应付统计导出Excel", description = "财务数据-应付统计导出Excel")
+    @PostMapping(value = "/exportPayableStatistics")
+    public void exportPayableStatistics(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
+        String systemCode = getSystemCode();
+        reportMeetDataService.exportPayableStatistics(reportSearchCommonVo, systemCode);
+    }
+
+    /**
+     * 财务数据-应付统计明细:查询指定年月的提现明细列表导出
+     * @author: jk
+     */
+    @Operation(summary = "财务数据-应付统计明细导出Excel", description = "财务数据-应付统计明细导出Excel")
+    @PostMapping(value = "/exportPayableStatisticsDetail")
+    public void exportPayableStatisticsDetail(@RequestBody PayableStatisticsDetailParam param) {
+        String systemCode = getSystemCode();
+        reportMeetDataService.exportPayableStatisticsDetail(param, systemCode);
+    }
 
 }

+ 2 - 2
consoleStatistics/src/main/java/com/jzg/console/service/impl/ReportMeetDataServiceImpl.java

@@ -95,7 +95,7 @@ public class ReportMeetDataServiceImpl extends ReportBaseServiceImpl implements
     @Override
     public IPage<?> getPayableStatisticsDetail(PayableStatisticsDetailParam param, String systemCode) {
         log.info("财务数据-应付统计明细. param=[{}], systemCode=[{}]", JSONUtil.toJsonStr(param), systemCode);
-        if (param == null || StrUtil.isBlank(param.getYearAndMonthTime())) {
+        if (param == null || StrUtil.isBlank(param.getYearMonth())) {
             log.warn("查询年月为空,返回空列表");
             return new Page<>(param.getPages(), param.getSize());
         }
@@ -138,7 +138,7 @@ public class ReportMeetDataServiceImpl extends ReportBaseServiceImpl implements
     @Override
     public void exportPayableStatisticsDetail(PayableStatisticsDetailParam param, String systemCode) {
         log.info("财务数据-应付统计明细导出Excel. param=[{}], systemCode=[{}]", JSONUtil.toJsonStr(param), systemCode);
-        if (param == null || StrUtil.isBlank(param.getYearAndMonthTime())) {
+        if (param == null || StrUtil.isBlank(param.getYearMonth())) {
             log.warn("查询年月为空,不导出");
             return;
         }

+ 139 - 14
consoleStatistics/src/main/java/com/jzg/console/service/impl/ReportOperatingProfitDataServiceImpl.java

@@ -1,24 +1,22 @@
 package com.jzg.console.service.impl;
 
 
-import com.alibaba.excel.annotation.ExcelProperty;
-import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.entity.report.dto.ReportOperatingProfitDataDto;
-import com.jzg.commons.entity.report.dto.ReportRiskDataManageDetailDto;
-import com.jzg.commons.entity.report.dto.ReportRiskDataManageDto;
-import com.jzg.commons.entity.report.dto.ReportSalesmanDataManageDto;
 import com.jzg.commons.entity.report.vo.ReportSearchCommonVo;
+import com.jzg.console.client.FeeAuditClient;
 import com.jzg.console.service.ReportOperatingProfitDataService;
-import com.jzg.console.service.ReportReceivableDataService;
-import io.swagger.v3.oas.annotations.media.Schema;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  *  @version
@@ -28,6 +26,12 @@ import java.util.List;
  */
 @Service
 public class ReportOperatingProfitDataServiceImpl extends ReportBaseServiceImpl implements ReportOperatingProfitDataService {
+
+    private static final Logger log = LoggerFactory.getLogger(ReportOperatingProfitDataServiceImpl.class);
+
+    @Autowired
+    private FeeAuditClient feeAuditClient;
+
     /**
      *  @version
      *  @author: hxl
@@ -36,16 +40,137 @@ public class ReportOperatingProfitDataServiceImpl extends ReportBaseServiceImpl
      */
     @Override
     public IPage<?> getPageListByParams(ReportSearchCommonVo reportSearchCommonVo) {
-        Page<ReportOperatingProfitDataDto> page = new Page<>(reportSearchCommonVo.getPageNo(), reportSearchCommonVo.getPageSize());
+        log.info("财务数据-经营利润-列表查询: reportSearchCommonVo=[{}]", JSONUtil.toJsonStr(reportSearchCommonVo));
+        String sql1 = """
+                
+                select
+                	a.ym ,
+                	sum(a.total_premium),
+                	sum(a.total_receivable_premium)
+                	-- ,sum(a.total_payable_premium)
+                from
+                	(
+                	select
+                		io.id as order_no,
+                		io.signing_time ,
+                		DATE_FORMAT(io.signing_time, '%Y-%m') as ym,
+                		ifo.total_premium ,
+                		ifo.total_payable_premium ,
+                		ifo.total_receivable_premium,
+                		io.system_code
+                	from
+                		ins_fee_orders ifo
+                	left join ins_orders io on
+                		ifo.order_no = io.id
+                	where
+                		io.system_code = 'G111'
+                		and io.signing_time >= '2016-01-01 00:00:00'
+                ) as a
+                group by a.ym
+                order by a.ym asc
+             
+                """;
+
+        String sql11 = """
+                
+                select
+                	a.ym ,
+                	sum(a.total_payable_premium)
+                from
+                	(
+                	select
+                		io.id as order_no,
+                		io.signing_time ,
+                		DATE_FORMAT(io.signing_time, '%Y-%m') as ym,
+                		ifo.total_premium ,
+                		ifo.total_payable_premium ,
+                		ifo.total_receivable_premium,
+                		io.system_code
+                	from
+                		ins_fee_orders ifo
+                	left join ins_orders io on
+                		ifo.order_no = io.id
+                	where
+                		io.system_code = 'G111'
+                		and io.signing_time >= '2016-01-01 00:00:00'
+                		and io.id in (
+                		select
+                			ifa.order_no
+                		from
+                			ins_fee_audit ifa
+                		where
+                			ifa.audit_status = 1
+                )
+                ) as a
+                group by	a.ym
+                order by	a.ym asc
+                
+                """;
+
+        String sql2 = """
+                    select
+                    	sum(ipiis.actual_received_amount),
+                    	DATE_FORMAT(ipiis.receive_payment_date, '%Y-%m') as ym
+                    from
+                    	ins_ply_income_invoice_settlement ipiis
+                    where
+                    	receive_payment_date >= '2026-07-01 00:00:00'
+                    	and ipiis.system_code = 'G111'
+                    group by ym
+                
+                """;
+
+        String sql3 = """
+                select
+                	DATE_FORMAT(suacl.create_time, '%Y-%m') as ym,
+                	sum(suacl.amount)
+                from
+                	sys_user_account_change_log suacl
+                where
+                	suacl.system_code = 'G111'
+                	and suacl.amount < 0
+                	and suacl.create_time >= '2026-01-01 00:00:00'
+                group by
+                	ym
+                """;
+
+        Map<String, ReportOperatingProfitDataDto> map1 = new HashMap<>();
+        Map<String, ReportOperatingProfitDataDto> map2 = new HashMap<>();
+        Map<String, ReportOperatingProfitDataDto> map3 = new HashMap<>();
+        Map<String, ReportOperatingProfitDataDto> map4 = new HashMap<>();
+        List<Map<String, ReportOperatingProfitDataDto>>  allMaps = new ArrayList<>();
+        Map<String, ReportOperatingProfitDataDto> compMaps = this.mergeMaps(allMaps);
+        List<ReportOperatingProfitDataDto> values = new ArrayList<>(compMaps.values());
+
+
+        // Page<ReportOperatingProfitDataDto> page = new Page<>(reportSearchCommonVo.getPageNo(), reportSearchCommonVo.getPageSize());
         IPage<ReportOperatingProfitDataDto> pageList = new Page<ReportOperatingProfitDataDto>();
-        List<ReportOperatingProfitDataDto> list = getList();
-        pageList.setRecords(list);
-        pageList.setTotal(1l);
+        pageList.setRecords(values);
+        pageList.setTotal(CollUtil.size(values));
         pageList.setCurrent(reportSearchCommonVo.getPageNo());
         pageList.setPages(reportSearchCommonVo.getPageNo());
         pageList.setPages(reportSearchCommonVo.getPageSize());
         return pageList;
     }
+
+
+    public Map<String, ReportOperatingProfitDataDto> mergeMaps(List<Map<String, ReportOperatingProfitDataDto>> mapList) {
+        return mapList.stream()
+                // 1. 将 List<Map> 展平为 Stream<Map.Entry>
+                .flatMap(map -> map.entrySet().stream())
+                // 2. 收集为新的 LinkedHashMap (保持插入顺序)
+                .collect(Collectors.toMap(
+                        Map.Entry::getKey,
+                        Map.Entry::getValue,
+                        (dto1, dto2) -> {
+                            // 3. 遇到相同 Key,调用 merge 方法累加字段
+                            dto1.merge(dto2);
+                            return dto1;
+                        },
+                        HashMap::new // 保证结果 Map 是 LinkedHashMap
+                ));
+    }
+
     /**
      *  @version
      *  @author: hxl

+ 2 - 2
consoleStatistics/src/main/resources/mapper/ReportMeetDataMapper.xml

@@ -153,8 +153,8 @@
         <where>
             saa.is_delete = 0
             AND saa.system_code = #{systemCode}
-            <if test="param.yearAndMonthTime != null and param.yearAndMonthTime != ''">
-                AND DATE_FORMAT(saa.create_time, '%Y-%m') = #{param.yearAndMonthTime}
+            <if test="param.yearMonth != null and param.yearMonth != ''">
+                AND DATE_FORMAT(saa.create_time, '%Y-%m') = #{param.yearMonth}
             </if>
         </where>
         ORDER BY saa.create_time DESC

+ 18 - 12
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/build/DaDiCrawlerQuoteResultVoBuild.java

@@ -6,6 +6,7 @@ import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.quotation.commons.utils.DateTimeUtil;
 import com.jzg.quotation.dadi.crawler.entity.response.DaDiQuoteResponse;
+import com.jzg.quotation.dadi.crawler.entity.response.DaDiVehiclePricResponse;
 import com.jzg.quotation.dadi.utils.DaDiVehicleUtils;
 import org.apache.http.util.TextUtils;
 
@@ -20,7 +21,7 @@ import java.util.List;
  */
 public class DaDiCrawlerQuoteResultVoBuild {
 
-    public static QuoteResultsVo build(QuoteVo quoteVo, DaDiQuoteResponse daDiQuoteResponse) {
+    public static QuoteResultsVo build(QuoteVo quoteVo, DaDiQuoteResponse daDiQuoteResponse, DaDiVehiclePricResponse vehiclePricResponse) {
         QuoteResultsVo quoteResultsVo = new QuoteResultsVo();
         quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.WAIT_AUDIT);
         DaDiQuoteResponse.UwResultDTO uwResult = daDiQuoteResponse.getUwResult();
@@ -32,7 +33,6 @@ public class DaDiCrawlerQuoteResultVoBuild {
 
         for (DaDiQuoteResponse.UwResultDTO.UnderwriteRuleInfosDTO underwriteRuleInfo : underwriteRuleInfos) {
             if (!"3".equals(underwriteRuleInfo.getUwType())) {
-                quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.PAY_PENDING);
                 eMsg += underwriteRuleInfo.getRuleDescription() + ";";
             }
         }
@@ -58,8 +58,8 @@ public class DaDiCrawlerQuoteResultVoBuild {
             quoteResultsVo.setBiRiskInfoVo(biRiskInfoVo);
         }
 
-        //设置保费,车船税,投保单号
-        buildParams(daDiQuoteResponse, quoteResultsVo);
+        //设置保费,车船税,投保单号,折旧价
+        buildParams(daDiQuoteResponse, quoteResultsVo, vehiclePricResponse);
         return quoteResultsVo;
     }
 
@@ -94,7 +94,7 @@ public class DaDiCrawlerQuoteResultVoBuild {
         return riskInfoVo;
     }
 
-    public static void buildParams(DaDiQuoteResponse daDiQuoteResponse, QuoteResultsVo quoteResultsVo) {
+    public static void buildParams(DaDiQuoteResponse daDiQuoteResponse, QuoteResultsVo quoteResultsVo, DaDiVehiclePricResponse vehiclePricResponse) {
         //交强险保费
         int trafficDuePremium = daDiQuoteResponse.getInsurancePlan().getTrafficDuePremium();
         quoteResultsVo.getCosts().setCiPremium(String.valueOf(trafficDuePremium));
@@ -104,20 +104,26 @@ public class DaDiCrawlerQuoteResultVoBuild {
         //车船税
         int sumPayment = daDiQuoteResponse.getInsurancePlan().getTax().getSumPayment();
         quoteResultsVo.getCosts().setVvTax(String.valueOf(sumPayment));
+        int niPremium = 0;
         //设置非车保费
-        if (!daDiQuoteResponse.getInsurancePlan().getAccidentInsure().isEmpty()) {
-            int niPremium = daDiQuoteResponse.getInsurancePlan().getAccidentInsure().get(0).getWealthAccPremium();
+        if (daDiQuoteResponse.getInsurancePlan().getAccidentInsure() != null && daDiQuoteResponse.getInsurancePlan().getAccidentInsure().size() > 0) {
+            niPremium = daDiQuoteResponse.getInsurancePlan().getAccidentInsure().get(0).getWealthAccPremium();
             quoteResultsVo.getCosts().setNiPremium(String.valueOf(niPremium));
-        }else if (!daDiQuoteResponse.getInsurancePlan().getHealthInsurance().isEmpty()) {
-            int niPremium = daDiQuoteResponse.getInsurancePlan().getHealthInsurance().get(0).getWealthAccPremium();
+        } else if (daDiQuoteResponse.getInsurancePlan().getHealthInsurance() != null && daDiQuoteResponse.getInsurancePlan().getHealthInsurance().size() > 0) {
+            niPremium = daDiQuoteResponse.getInsurancePlan().getHealthInsurance().get(0).getWealthAccPremium();
             quoteResultsVo.getCosts().setNiPremium(String.valueOf(niPremium));
-        }else  if (!daDiQuoteResponse.getInsurancePlan().getPropertyInsurance().isEmpty()) {
-            int niPremium = daDiQuoteResponse.getInsurancePlan().getHealthInsurance().get(0).getWealthAccPremium();
+        } else if (daDiQuoteResponse.getInsurancePlan().getPropertyInsurance() != null && daDiQuoteResponse.getInsurancePlan().getPropertyInsurance().size() > 0) {
+            niPremium = daDiQuoteResponse.getInsurancePlan().getPropertyInsurance().get(0).getWealthAccPremium();
             quoteResultsVo.getCosts().setNiPremium(String.valueOf(niPremium));
         }
 
         //总保费
-        int sumPremium = trafficDuePremium + businessDuePremium + sumPayment;
+        int sumPremium = trafficDuePremium + businessDuePremium + sumPayment + niPremium;
+        //车辆折旧价(从车价查询接口获取实际价值)
+        String actualValue = vehiclePricResponse.getActualValue();
+        if (!TextUtils.isEmpty(actualValue)) {
+            quoteResultsVo.setCarActualValue(new java.math.BigDecimal(actualValue));
+        }
         quoteResultsVo.getCosts().setSumPremium(String.valueOf(sumPremium));
     }
 

+ 83 - 2
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/response/DaDiQuoteResponse.java

@@ -96,6 +96,8 @@ public class DaDiQuoteResponse extends DaDiBaseResponse {
         private String businessEffectiveStartDate;
         @SerializedName("businessEffectiveEndDate")
         private String businessEffectiveEndDate;
+        @SerializedName("businessQuotationNo")
+        private String businessQuotationNo;
         @SerializedName("trafficIsEffective")
         private String trafficIsEffective;
         @SerializedName("trafficSumInsured")
@@ -104,6 +106,10 @@ public class DaDiQuoteResponse extends DaDiBaseResponse {
         private String businessIsEffective;
         @SerializedName("wealthAccChecked")
         private String wealthAccChecked;
+        @SerializedName("minSharedPremium")
+        private double minSharedPremium;
+        @SerializedName("maxSharedPremium")
+        private double maxSharedPremium;
         @SerializedName("quoteFlag")
         private String quoteFlag;
         @SerializedName("cDiscountRate")
@@ -118,20 +124,40 @@ public class DaDiQuoteResponse extends DaDiBaseResponse {
         private int trafficDuePremium;
         @SerializedName("businessDuePremium")
         private int businessDuePremium;
+        @SerializedName("trafficStdPremium")
+        private int trafficStdPremium;
+        @SerializedName("businessStdPremium")
+        private int businessStdPremium;
+        @SerializedName("businessBeforeVatPremium")
+        private double businessBeforeVatPremium;
+        @SerializedName("businessSumInsured")
+        private int businessSumInsured;
+        @SerializedName("trafficTotalFloat")
+        private double trafficTotalFloat;
+        @SerializedName("businessTotalFloat")
+        private double businessTotalFloat;
         @SerializedName("trafficNcdRate")
         private double trafficNcdRate;
+        @SerializedName("businessNcdRate")
+        private double businessNcdRate;
         @SerializedName("trafficQueryPastDate")
         private String trafficQueryPastDate;
         @SerializedName("trafficQuerySequenceNo")
         private String trafficQuerySequenceNo;
+        @SerializedName("businessQuerySequenceNo")
+        private String businessQuerySequenceNo;
         @SerializedName("trafficQuotationNo")
         private String trafficQuotationNo;
         @SerializedName("trafficRenewalFlag")
         private String trafficRenewalFlag;
         @SerializedName("trafficRenewalType")
         private String trafficRenewalType;
-        @SerializedName("trafficStdPremium")
-        private int trafficStdPremium;
+        @SerializedName("businessQueryPastDate")
+        private String businessQueryPastDate;
+        @SerializedName("businessRenewalFlag")
+        private String businessRenewalFlag;
+        @SerializedName("businessRenewalType")
+        private String businessRenewalType;
         @SerializedName("violationLevel")
         private String violationLevel;
         @SerializedName("businessProductCode")
@@ -146,6 +172,12 @@ public class DaDiQuoteResponse extends DaDiBaseResponse {
         private List<AccidentInsureDTO> healthInsurance;
         @SerializedName("propertyInsurance")
         private List<AccidentInsureDTO> propertyInsurance;
+        @SerializedName("lastPolicy")
+        private LastPolicyDTO lastPolicy;
+        @SerializedName("queryCoverageResVO")
+        private QueryCoverageResVODTO queryCoverageResVO;
+        @SerializedName("businessRisks")
+        private List<BusinessRiskDTO> businessRisks;
 
 
         @NoArgsConstructor
@@ -245,6 +277,55 @@ public class DaDiQuoteResponse extends DaDiBaseResponse {
                 private String subsidyDay;
             }
         }
+
+        @NoArgsConstructor
+        @Data
+        public static class BusinessRiskDTO {
+            @SerializedName("kindCode")
+            private String kindCode;
+            @SerializedName("kindName")
+            private String kindName;
+            @SerializedName("kindFlag")
+            private String kindFlag;
+            @SerializedName("brokenCode")
+            private String brokenCode;
+            @SerializedName("premium")
+            private double premium;
+            @SerializedName("amount")
+            private int amount;
+            @SerializedName("rate")
+            private double rate;
+            @SerializedName("discount")
+            private int discount;
+            @SerializedName("standardPremium")
+            private double standardPremium;
+            @SerializedName("quantity")
+            private int quantity;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class LastPolicyDTO {
+            @SerializedName("lastEffectiveDate")
+            private String lastEffectiveDate;
+            @SerializedName("lastExpireDate")
+            private String lastExpireDate;
+            @SerializedName("lastProducerCode")
+            private String lastProducerCode;
+            @SerializedName("lastModelCode")
+            private String lastModelCode;
+            @SerializedName("lastModel")
+            private String lastModel;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class QueryCoverageResVODTO {
+            @SerializedName("lastStartDate")
+            private String lastStartDate;
+            @SerializedName("lastEndDate")
+            private String lastEndDate;
+        }
     }
 
     @NoArgsConstructor

+ 1 - 1
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/service/impl/DaDiCrawlerRequestImpl.java

@@ -105,7 +105,7 @@ public class DaDiCrawlerRequestImpl implements DaDiCrawlerRequest {
             daDiCrawlerOrderService.save(daDiCrawlerOrder);
         }
 
-        return DaDiCrawlerQuoteResultVoBuild.build(quoteVo, daDiQuoteResponse);
+        return DaDiCrawlerQuoteResultVoBuild.build(quoteVo, daDiQuoteResponse, vehiclePricVo);
     }
 
     /**

+ 24 - 11
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/build/HbCrawlerQuoteResultVoBuild.java

@@ -11,10 +11,12 @@ import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.quotation.commons.utils.DateTimeUtil;
 import com.jzg.quotation.hengbang.crawler.entity.response.HbCrawlerProposalResponse;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.http.util.TextUtils;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -25,6 +27,7 @@ import java.util.stream.Collectors;
  * @author: shenwd
  * @date: 2025/4/10 11:48
  **/
+@Slf4j
 public final class HbCrawlerQuoteResultVoBuild {
     private HbCrawlerQuoteResultVoBuild() {
         throw new IllegalStateException("Utility class");
@@ -124,18 +127,28 @@ public final class HbCrawlerQuoteResultVoBuild {
 
     public static List<KindInfoVo> buildKindInfoList(HbCrawlerProposalResponse proposalResponse, QuoteVo quoteVo) {
         List<KindInfoVo> kindInfoVoList = quoteVo.getKindInfoVo();
-        if (CollUtil.isNotEmpty(kindInfoVoList)) {
-            List<HbCrawlerProposalResponse.CarInsureLiabilityDTO> carInsureLiabilityList = proposalResponse.getCarInsureLiabilityList();
-            Map<String, HbCrawlerProposalResponse.CarInsureLiabilityDTO> carInsureLiabilityDTOMap = carInsureLiabilityList.stream().collect(Collectors.toMap(HbCrawlerProposalResponse.CarInsureLiabilityDTO::getKindcode, carInsureLiabilityDTO -> carInsureLiabilityDTO));
-            kindInfoVoList.forEach(kindInfoVo -> {
-                HbCrawlerProposalResponse.CarInsureLiabilityDTO carInsureLiabilityDTO = carInsureLiabilityDTOMap.get(kindInfoVo.getKindCode());
-                kindInfoVo.setAmount(String.valueOf(carInsureLiabilityDTO.getLiabamt()));
-                kindInfoVo.setPremium(String.valueOf(carInsureLiabilityDTO.getLiabprm()));
-                kindInfoVo.setUnitAmount(carInsureLiabilityDTO.getUnitAmount());
-                kindInfoVo.setQuantity(String.valueOf(carInsureLiabilityDTO.getQuantity()));
-                kindInfoVo.setDeductibleRate(carInsureLiabilityDTO.getLiabrate());
-            });
+        if (CollUtil.isEmpty(kindInfoVoList)) {
+            return new ArrayList<>();
         }
+        List<HbCrawlerProposalResponse.CarInsureLiabilityDTO> carInsureLiabilityList = proposalResponse.getCarInsureLiabilityList();
+        if (CollUtil.isEmpty(carInsureLiabilityList)) {
+            return kindInfoVoList;
+        }
+        Map<String, HbCrawlerProposalResponse.CarInsureLiabilityDTO> carInsureLiabilityDTOMap = carInsureLiabilityList.stream()
+                .collect(Collectors.toMap(HbCrawlerProposalResponse.CarInsureLiabilityDTO::getKindcode, carInsureLiabilityDTO -> carInsureLiabilityDTO));
+        kindInfoVoList.forEach(kindInfoVo -> {
+            HbCrawlerProposalResponse.CarInsureLiabilityDTO carInsureLiabilityDTO = carInsureLiabilityDTOMap.get(kindInfoVo.getKindCode());
+            if (carInsureLiabilityDTO == null) {
+                log.warn("恒邦报价险种匹配失败: kindCode={} 在保司返回列表中未找到", kindInfoVo.getKindCode());
+                return;
+            }
+            kindInfoVo.setAmount(String.valueOf(carInsureLiabilityDTO.getLiabamt()));
+            kindInfoVo.setPremium(String.valueOf(carInsureLiabilityDTO.getLiabprm()));
+            kindInfoVo.setUnitAmount(carInsureLiabilityDTO.getUnitAmount());
+            kindInfoVo.setQuantity(String.valueOf(carInsureLiabilityDTO.getQuantity()));
+            kindInfoVo.setDeductibleRate(carInsureLiabilityDTO.getLiabrate());
+            kindInfoVo.setPlatformKindCode(kindInfoVo.getKindCode());
+        });
         return kindInfoVoList;
     }
 

+ 3 - 3
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/build/HuaTaiCrawlerQuoteResultsVoBuild.java

@@ -152,11 +152,11 @@ public class HuaTaiCrawlerQuoteResultsVoBuild {
         quoteResultsVo.getCosts().setCiPremium(ciDTO.getStandardpremium());
         // 设置车船税
         HtCrawlerQuoteResponse.DataDTO.VehicleTaxationDTO.TaxAmountDTO taxamountdto = quoteResponseData.getVehicletaxationdto().getTaxamountdto();
-        quoteResultsVo.getCosts().setVvTax(StringUtils.isBlank(taxamountdto.getSumtax()) ? "" : taxamountdto.getSumtax());
+        quoteResultsVo.getCosts().setVvTax(StringUtils.isBlank(taxamountdto.getSumtax()) ? "0" : taxamountdto.getSumtax());
         // 设置商业险保费
-        quoteResultsVo.getCosts().setBiPremium(StringUtils.isBlank(getBiPremium(quoteResponseData)) ? "" : getBiPremium(quoteResponseData));
+        quoteResultsVo.getCosts().setBiPremium(StringUtils.isBlank(getBiPremium(quoteResponseData)) ? "0" : getBiPremium(quoteResponseData));
         // 设置非车险(驾意险)保费,报价返回数据中不存在
-        quoteResultsVo.getCosts().setNiPremium(StringUtils.isBlank(niPremium) ? "" : niPremium);
+        quoteResultsVo.getCosts().setNiPremium(StringUtils.isBlank(niPremium) ? "0" : niPremium);
         // 计算总保费 = 交强险 + 商业险 + 驾意险 + 车船税
         QuoteResultsVo.CostsVo costs = quoteResultsVo.getCosts();
         double sumPremium = 0.0;

+ 21 - 10
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/FactorMatch.java

@@ -359,19 +359,30 @@ public class FactorMatch {
         if (ptlAgreementCostRule.getMin() == null || value == null) {
             return false;
         }
-        // 修复:select 支持多选逗号分隔,所以正确做法是 split 后逐个 equals
-        String[] options = ptlAgreementCostRule.getMin().split(",");
-        for (String opt : options) {
-            if (opt.trim().equals(value.trim())) {
-                return true;
+        if (ptlAgreementCostRule.getOperator().equals("2")) {
+            String [] options = ptlAgreementCostRule.getMin().split(",");
+            for (String opt : options) {
+                if (opt.trim().equals(value.trim())) {
+                    return false;
+                }
             }
-            // 顺带支持是/否归一化
-            String n1 = normalizeYesNo(opt.trim());
-            String n2 = normalizeYesNo(value.trim());
-            if (!n1.equals(opt.trim()) && !n2.equals(value.trim()) && n1.equals(n2)) {
-                return true;
+            return true;
+        } else {
+            // 修复:select 支持多选逗号分隔,所以正确做法是 split 后逐个 equals
+            String[] options = ptlAgreementCostRule.getMin().split(",");
+            for (String opt : options) {
+                if (opt.trim().equals(value.trim())) {
+                    return true;
+                }
+                // 顺带支持是/否归一化
+                String n1 = normalizeYesNo(opt.trim());
+                String n2 = normalizeYesNo(value.trim());
+                if (!n1.equals(opt.trim()) && !n2.equals(value.trim()) && n1.equals(n2)) {
+                    return true;
+                }
             }
         }
+
         return false;
     }
 

+ 7 - 5
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java

@@ -188,8 +188,9 @@ public class QuoteVerificationAspect {
                     String[] split = ptlAgreementCostRule.getMin().split(",");
                     boolean isPipei = false;
                     for(int i = 0;i < split.length; i++){
-                        if(split[i].equals(insOrdersCarInfo.getCarNatureCode())) {
+                        if (split[i].equals(insOrdersCarInfo.getCarNatureCode())) {
                             isPipei = true;
+                            break;
                         }
                     }
                     if(!isPipei){
@@ -201,8 +202,9 @@ public class QuoteVerificationAspect {
                     String[] split = ptlAgreementCostRule.getMin().split(",");
                     boolean isPipei = false;
                     for(int i = 0;i < split.length; i++){
-                        if(split[i].equals(insOrdersCarInfo.getCarKindCode())) {
+                        if (split[i].equals(insOrdersCarInfo.getCarKindCode())) {
                             isPipei = true;
+                            break;
                         }
                     }
                     if(!isPipei){
@@ -771,8 +773,9 @@ public class QuoteVerificationAspect {
                             Map<String,Object> level2 = calculateLevel2Distribution(insFeeOrders, totalPremium, level1.get("id").toString(), sysDistributionSetting);
                             if (level2 != null) {
                                 diffAmount = calculateLevel3Distribution(insFeeOrders, totalPremium, level2.get("id").toString(), sysDistributionSetting);
+                                diffAmount = diffAmount.add(new BigDecimal(level2.get("diffAmount").toString()));
                             }
-                            diffAmount = diffAmount.add(new BigDecimal(level2.get("diffAmount").toString())).add(new BigDecimal(level1.get("diffAmount").toString()));
+                            diffAmount = diffAmount.add(new BigDecimal(level1.get("diffAmount").toString()));
                         }
                         break;
                 }
@@ -869,9 +872,8 @@ public class QuoteVerificationAspect {
     public void doBefore(JoinPoint point) {
         Object[] args = point.getArgs();
         for (Object arg : args) {
-            if (arg instanceof QuoteVo) {
+            if (arg instanceof QuoteVo quoteVo) {
                 // 1.根据参数判断是否存在调度信息
-                QuoteVo quoteVo = (QuoteVo)arg;
                 // 过滤险种 前端如果选择不投保的时候 直接过滤掉别让他进报价的逻辑里。
                 if (!quoteVo.getKindInfoVo().isEmpty()) {
                     quoteVo.setKindInfoVo(quoteVo.getKindInfoVo().stream().filter(kindInfoVo ->

+ 17 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeOrderController.java

@@ -1,9 +1,11 @@
 package com.jzg.quotation.summary.controller;
 
 import cn.hutool.json.JSONUtil;
+import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.InsFeeOrdersParam;
 import com.jzg.commons.entity.po.InsFeeOrders;
+import com.jzg.commons.entity.report.dto.ReportOperatingProfitDataDto;
 import com.jzg.quotation.summary.entity.dto.RightsAmountUpdateDto;
 import com.jzg.quotation.summary.service.InsFeeOrdersService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -26,6 +28,8 @@ import java.util.List;
 public class InsFeeOrderController {
     @Autowired
     private InsFeeOrdersService insFeeOrdersService;
+    @Autowired
+    private BaseController baseController;
 
     private static final Logger log = LoggerFactory.getLogger(InsFeeOrderController.class);
 
@@ -88,4 +92,17 @@ public class InsFeeOrderController {
         return insFeeOrdersService.updateAvailableAmount(rightsAmountUpdateDto.getOrderNo(),rightsAmountUpdateDto.getAvailableAmount());
     }
 
+
+    /**
+     * 查询指定年份的经营利润
+     *
+     * @param year 年份,例如 2026
+     * @author lipf
+     * @date 2026/7/25 11:22
+     */
+    @GetMapping("/feeAudit/queryOperatingProfits")
+    HttpResult<List<ReportOperatingProfitDataDto>> queryOperatingProfits(@RequestParam("year") String year){
+        String systemCode = baseController.getSystemCode();
+        return HttpResult.ok(insFeeOrdersService.queryOperatingProfits(year,systemCode));
+    }
 }

+ 5 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsOrdersController.java

@@ -1,6 +1,7 @@
 package com.jzg.quotation.summary.controller;
 
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONArray;
@@ -275,6 +276,10 @@ public class InsOrdersController extends BaseController {
             JSONObject jsonObject = new JSONObject();
             jsonObject.put("companyName",item.getCompanyName());
             for (String kingCode : kindList) {
+                if (CollUtil.isEmpty(item.getKindInfoVo())) {
+                    jsonObject.put(kingCode, "-");
+                    continue;
+                }
                 List<KindInfoVo> collect = item.getKindInfoVo().stream().filter(x -> x.getKindCode().equals(kingCode)).toList();
                 if(collect.isEmpty()){
                     jsonObject.put(kingCode,"-");

+ 10 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/InsFeeOrdersService.java

@@ -5,6 +5,7 @@ import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.CostCalculateRespVO;
 import com.jzg.commons.entity.dto.InsFeeOrdersParam;
 import com.jzg.commons.entity.po.InsFeeOrders;
+import com.jzg.commons.entity.report.dto.ReportOperatingProfitDataDto;
 import com.jzg.commons.entity.vo.PtlAgreementCostRatioVo;
 
 import java.math.BigDecimal;
@@ -57,4 +58,13 @@ public interface InsFeeOrdersService extends IService<InsFeeOrders> {
      */
     InsFeeOrders updateFeeRatio(String orderNo, BigDecimal jqInletRatio, BigDecimal syInletRatio, BigDecimal jyInletRatio,
                                 BigDecimal jqExportRatio, BigDecimal syExportRatio, BigDecimal jyExportRatio);
+
+    /**
+     * 查询指定年份的经营利润
+     *
+     * @param year 年份,例如 2026
+     * @author lipf
+     * @date 2026/7/25 11:22
+     */
+    List<ReportOperatingProfitDataDto> queryOperatingProfits(String year, String systemCode);
 }

+ 17 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeOrdersServiceImpl.java

@@ -14,6 +14,7 @@ import com.jzg.commons.entity.orders.po.InsOrders;
 import com.jzg.commons.entity.orders.po.InsOrdersCosts;
 import com.jzg.commons.entity.po.InsFeeOrders;
 import com.jzg.commons.entity.po.PtlAgreement;
+import com.jzg.commons.entity.report.dto.ReportOperatingProfitDataDto;
 import com.jzg.commons.entity.vo.PtlAgreementCostRatioVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.AssertionUtils;
@@ -710,4 +711,20 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         }
         return initAmout;
     }
+
+    /**
+     * 查询指定年份的经营利润
+     *
+     * @param year       年份,例如 2026
+     * @param systemCode
+     * @author lipf
+     * @date 2026/7/25 11:22
+     */
+    @Override
+    public List<ReportOperatingProfitDataDto> queryOperatingProfits(String year, String systemCode) {
+        log.info("查询租户[{}]在指定年份[{}]的经营利润之保费等信息",systemCode,year);
+
+
+        return List.of();
+    }
 }

+ 4 - 3
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -941,9 +941,10 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             List<InsOrdersAccidentalDriving> accidentalDrivingList = insOrdersAccidentalDrivingService
                     .list(new LambdaQueryWrapper<InsOrdersAccidentalDriving>().eq(InsOrdersAccidentalDriving::getOrderNo, ordersNo));
             if (CollectionUtil.isNotEmpty(accidentalDrivingList) && jyPremium != null) {
-                // 如果只有一个驾意险产品,直接设置其保费为 niPremium
-                if (accidentalDrivingList.size() == 1) {
-                    accidentalDrivingList.get(0).setAmount(jyPremium.toString());
+                // 按保费乘以数量计算每个驾意险的总保费
+                for (InsOrdersAccidentalDriving driving : accidentalDrivingList){
+                    BigDecimal perPremium = jyPremium.multiply(new BigDecimal(driving.getQuantity())).setScale(2, java.math.RoundingMode.HALF_UP);
+                    driving.setAmount(perPremium.toString());
                 }
                 insOrdersAccidentalDrivingService.updateBatchById(accidentalDrivingList);
             }

+ 20 - 20
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/constant/enums/ZmCrawlerFloatFlag.java

@@ -16,30 +16,30 @@ public class ZmCrawlerFloatFlag {
 
     static {
         JQ_RATE_FLOAT_FLAG_MAP.put("0", "费率浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("01", "新车,不浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("02", "首次投保,不浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("03", "车辆所有权转移,不浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("04", "临时上道或临时入境,不浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("05", "为摩托车、拖拉机、变拖类、低速载货汽车、三轮汽车,不浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("06", "未如实告知平台车辆信息,无法确定浮动比率,不浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("07", "非重复投保退保的保单续保,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("01", "新车不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("02", "首次投保不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("03", "车辆所有权转移不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("04", "临时上道或临时入境不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("05", "为摩托车、拖拉机、变拖类、低速载货汽车、三轮汽车不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("06", "未如实告知平台车辆信息无法确定浮动比率不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("07", "非重复投保退保的保单续保不浮动");
         JQ_RATE_FLOAT_FLAG_MAP.put("08", "短期保单续保不下浮");
         JQ_RATE_FLOAT_FLAG_MAP.put("09", "短期单投保不浮动");
-        JQ_RATE_FLOAT_FLAG_MAP.put("10", "脱保,不下浮");
-        JQ_RATE_FLOAT_FLAG_MAP.put("99", "不在浮动时间范围内,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("10", "脱保不下浮");
+        JQ_RATE_FLOAT_FLAG_MAP.put("99", "不在浮动时间范围内不浮动");
 
-        NO_ADJUST_REASON_CODE_MAP.put("01", "过户车,不浮动");
-        NO_ADJUST_REASON_CODE_MAP.put("02", "脱保6个月以上,不浮动");
-        NO_ADJUST_REASON_CODE_MAP.put("03", "本次投保为短期单,不下浮");
-        NO_ADJUST_REASON_CODE_MAP.put("04", "没有上年度保单,不浮动");
-        NO_ADJUST_REASON_CODE_MAP.put("05", "上张保单为短期单,不下浮");
-        NO_ADJUST_REASON_CODE_MAP.put("06", "上张保单做过批改过户,不浮动");
-        NO_ADJUST_REASON_CODE_MAP.put("07", "上年和本年不在同一公司投保,不浮动");
-        NO_ADJUST_REASON_CODE_MAP.put("08", "脱保3个月至6个月(含),不下浮");
+        NO_ADJUST_REASON_CODE_MAP.put("01", "过户车不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("02", "脱保6个月以上不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("03", "本次投保为短期单不下浮");
+        NO_ADJUST_REASON_CODE_MAP.put("04", "没有上年度保单不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("05", "上张保单为短期单不下浮");
+        NO_ADJUST_REASON_CODE_MAP.put("06", "上张保单做过批改过户不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("07", "上年和本年不在同一公司投保不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("08", "脱保3个月至6个月(含)不下浮");
         NO_ADJUST_REASON_CODE_MAP.put("09", "车贷投保多年,不下浮");
-        NO_ADJUST_REASON_CODE_MAP.put("10", "对历史保单(上平台前的保单)的批改,不重新计算系数风险");
-        NO_ADJUST_REASON_CODE_MAP.put("11", "新车,不浮动");
-        NO_ADJUST_REASON_CODE_MAP.put("12", "上年没有出险,赔款金额系数不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("10", "对历史保单(上平台前的保单)的批改不重新计算系数风险");
+        NO_ADJUST_REASON_CODE_MAP.put("11", "新车不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("12", "上年没有出险赔款金额系数不浮动");
     }
 
     /**

+ 34 - 11
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostServiceImpl.java

@@ -494,6 +494,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         updateWrapper.in(PtlAgreementCost::getId, finalCostIds);
         updateWrapper.set(PtlAgreementCost::getEffectiveTime, param.getEffectiveTime());
         updateWrapper.set(PtlAgreementCost::getFailureTime, param.getFailureTime());
+        updateWrapper.set(PtlAgreementCost::getApproved, 0); // 0: 未审批
         boolean success = this.update(updateWrapper);
 
         return success
@@ -520,37 +521,59 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
 
         boolean isAdd = "ADD".equalsIgnoreCase(param.getOperationType());
 
+        // 校验:至少传递一种险种的比例
+        boolean hasJqRatio = param.getJqInletRatio() != null || param.getJqExportRatio() != null;
+        boolean hasSyRatio = param.getSyInletRatio() != null || param.getSyExportRatio() != null;
+        boolean hasJyRatio = param.getJyInletRatio() != null || param.getJyExportRatio() != null;
+
+        if (!hasJqRatio && !hasSyRatio && !hasJyRatio) {
+            return HttpResult.error("至少需要传递一种险种的比例(交强险/商业险/驾意险)");
+        }
+
+        int adjustedCount = 0;
         for (PtlAgreementCostType costType : costTypeList) {
             String costTypeStr = costType.getCostType();
+            boolean wasAdjusted = false;
 
             // 根据费用类型进行调整
-            if ("交强险".equals(costTypeStr)) {
-                adjustCostType(costType, param.getInletRatio(), param.getInletKeepPointRatio(), isAdd);
-            } else if ("商业险".equals(costTypeStr)) {
-                adjustCostType(costType, param.getInletRatio(), param.getInletKeepPointRatio(), isAdd);
-            } else if ("驾意险".equals(costTypeStr)) {
-                adjustCostType(costType, param.getInletRatio(), param.getInletKeepPointRatio(), isAdd);
+            if ("交强险".equals(costTypeStr) && hasJqRatio) {
+                adjustCostType(costType, param.getJqInletRatio(), param.getJqExportRatio(), isAdd);
+                wasAdjusted = true;
+            } else if ("商业险".equals(costTypeStr) && hasSyRatio) {
+                adjustCostType(costType, param.getSyInletRatio(), param.getSyExportRatio(), isAdd);
+                wasAdjusted = true;
+            } else if ("驾意险".equals(costTypeStr) && hasJyRatio) {
+                adjustCostType(costType, param.getJyInletRatio(), param.getJyExportRatio(), isAdd);
+                wasAdjusted = true;
             }
+
+            if (wasAdjusted) {
+                adjustedCount++;
+            }
+        }
+
+        if (adjustedCount == 0) {
+            return HttpResult.error("未找到匹配的费用类型记录进行调整");
         }
 
         // 批量更新
         ptlAgreementCostTypeService.updateBatchById(costTypeList);
 
-        return HttpResult.ok("批量调整成功");
+        return HttpResult.ok("批量调整成功,共调整 " + adjustedCount + " 条记录");
     }
 
     /**
      * 调整费用类型的各项比例
      */
     private void adjustCostType(PtlAgreementCostType costType, BigDecimal inlet,
-                                BigDecimal keepPointRatio, boolean isAdd) {
+                                BigDecimal export, boolean isAdd) {
         // 入口比例
         if (inlet != null) {
             costType.setInlet(calculateNewValue(costType.getInlet(), inlet, isAdd));
         }
-        // 入口留点比例
-        if (keepPointRatio != null) {
-            costType.setKeepPointRatio(calculateNewValue(costType.getKeepPointRatio(), keepPointRatio, isAdd));
+        // 出口比例
+        if (export != null) {
+            costType.setExport(calculateNewValue(costType.getExport(), export, isAdd));
         }
     }
 

+ 7 - 6
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -961,11 +961,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * 查询收入基础数据
      */
     private List<InsPlyIncomeDto> queryFollowIncomeData(SettlementReportQueryVo queryVo) {
-        QueryFollowIncomeVo incomeVo = new QueryFollowIncomeVo(
-                null, null, baseController.getSystemCode(), null,
-                queryVo.getCompanyId(), queryVo.getStartTime(), queryVo.getEndTime(),
-                queryVo.getSigningStartTime(), queryVo.getSigningEndTime()
-        );
+        QueryFollowIncomeVo incomeVo = QueryFollowIncomeVo.builder()
+                .systemCode(baseController.getSystemCode())
+                .companyId(queryVo.getCompanyId())
+                .startTime(queryVo.getStartTime()).endTime(queryVo.getEndTime())
+                .signingStartTime(queryVo.getSigningStartTime()).signingEndTime(queryVo.getSigningEndTime())
+                .build();
         return baseMapper.queryFollowIncome(incomeVo);
     }
 
@@ -4243,7 +4244,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         String systemCode = baseController.getUserSystemCode();
 
         // 查询该年份下的所有跟进收入数据,并按合作方公司ID进行分组
-        QueryFollowIncomeVo queryFollowIncomeVo = new QueryFollowIncomeVo(startYear, endYear, systemCode, null, null, null, null, null, null);
+        QueryFollowIncomeVo queryFollowIncomeVo = QueryFollowIncomeVo.builder().startYear(startYear).endYear(endYear).systemCode(systemCode).build();
         List<InsPlyIncomeDto> incomes = baseMapper.queryFollowIncome(queryFollowIncomeVo);
 
         // ====================== 增加动态条件过滤 ======================