Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

liub 3 bulan lalu
induk
melakukan
2a107ce7fc
28 mengubah file dengan 307 tambahan dan 154 penghapusan
  1. 3 0
      commons/src/main/java/com/jzg/commons/entity/account/po/SysUserAccountIncomeLog.java
  2. 7 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchRulesAttrLink.java
  3. 0 2
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/PtlAgreementDispatchVo.java
  4. 2 1
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncome.java
  5. 2 5
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeInvoice.java
  6. 4 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/ReceivableQueryVo.java
  7. 3 3
      commons/src/main/java/com/jzg/commons/entity/orders/po/InsFeeAudit.java
  8. 5 0
      commons/src/main/java/com/jzg/commons/entity/po/InsFeeOrders.java
  9. 9 0
      commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementUndwrtRulesDictLabal.java
  10. 20 0
      commons/src/main/java/com/jzg/commons/entity/po/SysUserAccount.java
  11. 2 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/QuoteEchoVo.java
  12. 3 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/orders/InsOrdersVo.java
  13. 25 0
      commons/src/main/java/com/jzg/commons/entity/vo/InsFeeOrdersVo.java
  14. 10 4
      platform/src/main/java/com/jzg/service/impl/SysDeptServiceImpl.java
  15. 2 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeAuditController.java
  16. 14 8
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java
  17. 106 73
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeOrdersServiceImpl.java
  18. 2 2
      tenant/insurance/quotation-summary/src/main/resources/mapper/InsFeeAuditMapper.xml
  19. 8 1
      tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrdersMapper.xml
  20. 6 5
      tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementDispatchController.java
  21. 7 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchMapper.java
  22. 8 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java
  23. 15 17
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesServiceImpl.java
  24. 24 15
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  25. 1 1
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysDeptServiceImpl.java
  26. 1 0
      tenant/organization/src/main/resources/application.yml
  27. 8 0
      tenant/organization/src/main/resources/mapper/PtlAgreementDispatchMapper.xml
  28. 10 16
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/account/po/SysUserAccountIncomeLog.java

@@ -4,6 +4,7 @@ import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.Data;
 
 
+import java.io.Serial;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
 
 
@@ -13,6 +14,8 @@ import java.math.BigDecimal;
 @Data
 @Data
 public class SysUserAccountIncomeLog extends BaseModel {
 public class SysUserAccountIncomeLog extends BaseModel {
 
 
+    @Serial
+    private static final long serialVersionUID = 3689832570825862201L;
     private String id;
     private String id;
 
 
     @Schema(description = "用户id")
     @Schema(description = "用户id")

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchRulesAttrLink.java

@@ -31,11 +31,18 @@ public class PtlAgreementDispatchRulesAttrLink implements Serializable {
     @Schema(description = "左操作符")
     @Schema(description = "左操作符")
     private String min;
     private String min;
 
 
+    @Schema(description = "左操作符号转义后的值")
+    @TableField(exist = false)
+    private String minName;
+
     @Schema(description = "操作符")
     @Schema(description = "操作符")
     private String operator;
     private String operator;
 
 
     @Schema(description = "右操作符")
     @Schema(description = "右操作符")
     private String max;
     private String max;
+    @Schema(description = "右操作符号转义后的值")
+    @TableField(exist = false)
+    private String maxName;
 
 
     @TableField(exist = false)
     @TableField(exist = false)
     private List<String> minArray = new ArrayList<>();
     private List<String> minArray = new ArrayList<>();

+ 0 - 2
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/PtlAgreementDispatchVo.java

@@ -1,6 +1,5 @@
 package com.jzg.commons.entity.agreement.dispatch.vo;
 package com.jzg.commons.entity.agreement.dispatch.vo;
 
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
@@ -9,7 +8,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 
 
 @Data
 @Data

+ 2 - 1
commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncome.java

@@ -226,9 +226,10 @@ public class InsPlyIncome extends BaseModel {
     @ExcelProperty("业务来源")
     @ExcelProperty("业务来源")
     private String businessSource;
     private String businessSource;
 
 
+    // 设置初始值为0, 未结算
     @Schema(description = "结算状态(编码)")
     @Schema(description = "结算状态(编码)")
     @ExcelProperty("结算状态(编码)")
     @ExcelProperty("结算状态(编码)")
-    private String settlementStatus;
+    private String settlementStatus="0";
 
 
     @Schema(description = "结算状态(转义后)")
     @Schema(description = "结算状态(转义后)")
     @ExcelProperty("结算状态(转义后)")
     @ExcelProperty("结算状态(转义后)")

+ 2 - 5
commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeInvoice.java

@@ -28,7 +28,7 @@ public class InsPlyIncomeInvoice extends BaseModel {
     private BigDecimal overinflatedAmount;
     private BigDecimal overinflatedAmount;
 
 
     @Schema(description = "应收项")
     @Schema(description = "应收项")
-    private String invoickRiskType;
+    private String invoiceRiskType;
 
 
     public BigDecimal getOverinflatedAmount(){
     public BigDecimal getOverinflatedAmount(){
         return Objects.requireNonNullElse(this.overinflatedAmount, BigDecimal.ZERO);
         return Objects.requireNonNullElse(this.overinflatedAmount, BigDecimal.ZERO);
@@ -38,10 +38,7 @@ public class InsPlyIncomeInvoice extends BaseModel {
     private BigDecimal receivableSupervisePremium;
     private BigDecimal receivableSupervisePremium;
 
 
     public BigDecimal getReceivableSupervisePremium(){
     public BigDecimal getReceivableSupervisePremium(){
-        if(this.receivableSupervisePremium == null){
-            return BigDecimal.ZERO;
-        }
-        return this.receivableSupervisePremium;
+        return Objects.requireNonNullElse(this.receivableSupervisePremium, BigDecimal.ZERO);
     }
     }
 
 
     @Schema(description = "税点")
     @Schema(description = "税点")

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

@@ -16,6 +16,10 @@ import java.util.List;
 @Data
 @Data
 public class ReceivableQueryVo extends PageRequest {
 public class ReceivableQueryVo extends PageRequest {
 
 
+
+    @Schema(description = "发票号")
+    private String invoiceId;
+
     @Schema(description = "选中类型")
     @Schema(description = "选中类型")
     // 1 全部数据选中  2 选中部分数据
     // 1 全部数据选中  2 选中部分数据
     private String selectedType;
     private String selectedType;

+ 3 - 3
commons/src/main/java/com/jzg/commons/entity/orders/po/InsFeeAudit.java

@@ -1,11 +1,9 @@
 
 
 package com.jzg.commons.entity.orders.po;
 package com.jzg.commons.entity.orders.po;
 
 
-import java.io.Serializable;
+import java.io.Serial;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
-import java.util.Date;
 
 
-import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jzg.commons.core.base.BaseModel;
 import com.jzg.commons.core.base.BaseModel;
@@ -20,6 +18,8 @@ import lombok.Data;
 @Schema(description = "订单审核表")
 @Schema(description = "订单审核表")
 public class InsFeeAudit extends BaseModel {
 public class InsFeeAudit extends BaseModel {
 
 
+    @Serial
+    private static final long serialVersionUID = 7798063508653356456L;
     @TableId(value = "order_no")
     @TableId(value = "order_no")
     @Schema(description = "订单号")
     @Schema(description = "订单号")
     private String orderNo;
     private String orderNo;

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/po/InsFeeOrders.java

@@ -9,6 +9,7 @@ import lombok.Data;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.Objects;
 
 
 /**
 /**
  * @author quchen
  * @author quchen
@@ -60,6 +61,10 @@ public class InsFeeOrders {
     @Schema(description = "总应收保费")
     @Schema(description = "总应收保费")
     private BigDecimal totalReceivablePremium;
     private BigDecimal totalReceivablePremium;
 
 
+    public BigDecimal getTotalReceivablePremium(){
+        return Objects.requireNonNullElse(this.totalReceivablePremium, BigDecimal.ZERO);
+    }
+
     @Schema(description = "交强险应付保费")
     @Schema(description = "交强险应付保费")
     private BigDecimal jqPayablePremium;
     private BigDecimal jqPayablePremium;
 
 

+ 9 - 0
commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementUndwrtRulesDictLabal.java

@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.jzg.commons.util.StringUtils;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Objects;
 
 
 @TableName(value = "ptl_agreement_undwrt_rules_dict_labal", autoResultMap = true)
 @TableName(value = "ptl_agreement_undwrt_rules_dict_labal", autoResultMap = true)
 @Data
 @Data
@@ -19,6 +21,13 @@ public class PtlAgreementUndwrtRulesDictLabal {
     @TableId(value = "id", type = IdType.AUTO)
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
     private Integer id;
 
 
+    public String getIdStr(){
+        if(id == null){
+            return StringUtils.EMPTY;
+        }
+        return Objects.toString(this.id);
+    }
+
     @TableField(value = "parent_id")
     @TableField(value = "parent_id")
     private Integer parentId;
     private Integer parentId;
 
 

+ 20 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysUserAccount.java

@@ -1,6 +1,8 @@
 package com.jzg.commons.entity.po;
 package com.jzg.commons.entity.po;
 
 
+import java.io.Serial;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.Objects;
 
 
 import com.jzg.commons.core.base.BaseModel;
 import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -18,6 +20,8 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @AllArgsConstructor
 public class SysUserAccount extends BaseModel {
 public class SysUserAccount extends BaseModel {
 
 
+    @Serial
+    private static final long serialVersionUID = -6570094253249282304L;
     @Schema(description = "主键")
     @Schema(description = "主键")
     private String id;
     private String id;
 
 
@@ -35,4 +39,20 @@ public class SysUserAccount extends BaseModel {
 
 
     @Schema(description = "积分")
     @Schema(description = "积分")
     private BigDecimal integral;
     private BigDecimal integral;
+
+    public BigDecimal getSumAmount() {
+        return Objects.requireNonNullElse(this.sumAmount, BigDecimal.ZERO);
+    }
+
+    public BigDecimal getSumAmountPaid() {
+        return Objects.requireNonNullElse(this.sumAmountPaid, BigDecimal.ZERO);
+    }
+
+    public BigDecimal getSumAmountUnpaid() {
+        return Objects.requireNonNullElse(this.sumAmountUnpaid, BigDecimal.ZERO);
+    }
+
+    public BigDecimal getIntegral() {
+        return Objects.requireNonNullElse(this.integral, BigDecimal.ZERO);
+    }
 }
 }

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/QuoteEchoVo.java

@@ -75,6 +75,7 @@ public class QuoteEchoVo extends QuoteVo {
         private LocalDateTime quoteTime;
         private LocalDateTime quoteTime;
         private String signingTime;
         private String signingTime;
         private String payTime;
         private String payTime;
+        private String orderType;
     }
     }
 
 
     private OrderBaseVo order;
     private OrderBaseVo order;
@@ -309,6 +310,7 @@ public class QuoteEchoVo extends QuoteVo {
         this.getOrder().setCreateTime(insOrdersVo.getCreateTime());
         this.getOrder().setCreateTime(insOrdersVo.getCreateTime());
         this.getOrder().setQuoteTime(insOrdersVo.getCreateTime());
         this.getOrder().setQuoteTime(insOrdersVo.getCreateTime());
         this.getOrder().setSigningTime(insOrdersVo.getPayTime());
         this.getOrder().setSigningTime(insOrdersVo.getPayTime());
+        this.getOrder().setOrderType(insOrdersVo.getOrderType());
         this.setCiSpecialInfoVo(insOrdersVo.getSpecialInfoVo().stream().filter(companyClauseVo -> companyClauseVo.getRiskCode().equals("0507")).collect(Collectors.toList()));
         this.setCiSpecialInfoVo(insOrdersVo.getSpecialInfoVo().stream().filter(companyClauseVo -> companyClauseVo.getRiskCode().equals("0507")).collect(Collectors.toList()));
         this.setBiSpecialInfoVo(insOrdersVo.getSpecialInfoVo().stream().filter(companyClauseVo -> companyClauseVo.getRiskCode().equals("0510")).collect(Collectors.toList()));
         this.setBiSpecialInfoVo(insOrdersVo.getSpecialInfoVo().stream().filter(companyClauseVo -> companyClauseVo.getRiskCode().equals("0510")).collect(Collectors.toList()));
         Salesman salesman = new Salesman();
         Salesman salesman = new Salesman();

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/quote/vo/orders/InsOrdersVo.java

@@ -72,6 +72,9 @@ public class InsOrdersVo extends QuoteVo {
     @Schema(description = "错误信息")
     @Schema(description = "错误信息")
     private String errorMessage;
     private String errorMessage;
 
 
+    @Schema(description = "订单类型")
+    private String orderType;
+
     @Schema(description = "录单时间")
     @Schema(description = "录单时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime createTime;
     private LocalDateTime createTime;

+ 25 - 0
commons/src/main/java/com/jzg/commons/entity/vo/InsFeeOrdersVo.java

@@ -117,6 +117,24 @@ public class InsFeeOrdersVo {
     @Schema(description = "驾意入口比例")
     @Schema(description = "驾意入口比例")
     private BigDecimal jyInletRatio;
     private BigDecimal jyInletRatio;
 
 
+    @Schema(description = "交强险留点费用")
+    private String jqKeepPointPremium;
+
+    @Schema(description = "商业险留点费用")
+    private String syKeepPointPremium;
+
+    @Schema(description = "驾意险留点费用")
+    private String jyKeepPointPremium;
+
+    @Schema(description = "交强出口费用")
+    private String jqExportPremium;
+
+    @Schema(description = "商业出口费用")
+    private String syExportPremium;
+
+    @Schema(description = "驾意出口费用")
+    private String jyExportPremium;
+
     @Schema(description = "交强险出口留点费用")
     @Schema(description = "交强险出口留点费用")
     private String jqExportKeepPointPremium;
     private String jqExportKeepPointPremium;
 
 
@@ -170,6 +188,13 @@ public class InsFeeOrdersVo {
         this.syAdditionalPremium = insFeeOrders.getSyAdditionalPremium() != null ? insFeeOrders.getSyAdditionalPremium().toString() : "0.00";
         this.syAdditionalPremium = insFeeOrders.getSyAdditionalPremium() != null ? insFeeOrders.getSyAdditionalPremium().toString() : "0.00";
         this.jyAdditionalPremium = insFeeOrders.getJyAdditionalPremium() != null ? insFeeOrders.getJyAdditionalPremium().toString() : "0.00";
         this.jyAdditionalPremium = insFeeOrders.getJyAdditionalPremium() != null ? insFeeOrders.getJyAdditionalPremium().toString() : "0.00";
 
 
+        this.jqExportPremium = insFeeOrders.getJqExportPremium() != null ? insFeeOrders.getJqExportPremium().toString() : "0.00";
+        this.syExportPremium = insFeeOrders.getSyExportPremium() != null ? insFeeOrders.getSyExportPremium().toString() : "0.00";
+        this.jyExportPremium = insFeeOrders.getJyExportPremium() != null ? insFeeOrders.getJyExportPremium().toString() : "0.00";
+
+        this.jqKeepPointPremium = insFeeOrders.getJqKeepPointPremium() != null ? insFeeOrders.getJqKeepPointPremium().toString() : "0.00";
+        this.syKeepPointPremium = insFeeOrders.getSyKeepPointPremium() != null ? insFeeOrders.getSyKeepPointPremium().toString() : "0.00";
+        this.jyKeepPointPremium = insFeeOrders.getJyKeepPointPremium() != null ? insFeeOrders.getJyKeepPointPremium().toString() : "0.00";
 
 
         this.jqExportKeepPointPremium = insFeeOrders.getJqExportKeepPointPremium() != null ? insFeeOrders.getJqExportKeepPointPremium().toString() : "0.00";
         this.jqExportKeepPointPremium = insFeeOrders.getJqExportKeepPointPremium() != null ? insFeeOrders.getJqExportKeepPointPremium().toString() : "0.00";
         this.syExportKeepPointPremium = insFeeOrders.getSyExportKeepPointPremium() != null ? insFeeOrders.getSyExportKeepPointPremium().toString() : "0.00";
         this.syExportKeepPointPremium = insFeeOrders.getSyExportKeepPointPremium() != null ? insFeeOrders.getSyExportKeepPointPremium().toString() : "0.00";

+ 10 - 4
platform/src/main/java/com/jzg/service/impl/SysDeptServiceImpl.java

@@ -1,5 +1,6 @@
 package com.jzg.service.impl;
 package com.jzg.service.impl;
 
 
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.base.BaseController;
@@ -17,6 +18,8 @@ import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.mapper.SysDeptMapper;
 import com.jzg.mapper.SysDeptMapper;
 import com.jzg.service.*;
 import com.jzg.service.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -31,6 +34,8 @@ import java.util.stream.Collectors;
 @Service
 @Service
 public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService, HistoryDataService {
 public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService, HistoryDataService {
 
 
+    private static final Logger log = LoggerFactory.getLogger(SysDeptServiceImpl.class);
+
     @Autowired
     @Autowired
     private SysDeptMapper sysDeptMapper;
     private SysDeptMapper sysDeptMapper;
 
 
@@ -156,6 +161,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
 
 
     @Override
     @Override
     public List<SysDeptVo> getDeptTree(String deptId, SysDeptParam param) {
     public List<SysDeptVo> getDeptTree(String deptId, SysDeptParam param) {
+        log.info("查询机构树: deptId=[{}], param=[{}]", deptId, JSONUtil.toJsonStr(param));
         if(Objects.isNull(deptId)){
         if(Objects.isNull(deptId)){
             deptId = "";
             deptId = "";
         }
         }
@@ -166,15 +172,15 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
         }else{
         }else{
             userSystemCode = sysCode;
             userSystemCode = sysCode;
         }
         }
-        SysSystem bySysCode = sysSystemService.getBySystemCode(userSystemCode);
+        SysSystem sysSystem = sysSystemService.getBySystemCode(userSystemCode);
         List<SysDeptVo> sysDepts = new ArrayList<>();
         List<SysDeptVo> sysDepts = new ArrayList<>();
         SysDept sysDept = getById(deptId);
         SysDept sysDept = getById(deptId);
         SysDeptVo sysDeptVo = new SysDeptVo(sysDept);
         SysDeptVo sysDeptVo = new SysDeptVo(sysDept);
         LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
-        if(!deptId.equals("")) {
+        if(!deptId.isEmpty()) {
             lqw.likeRight(SysDept::getRoute, deptId);
             lqw.likeRight(SysDept::getRoute, deptId);
         }
         }
-        lqw.eq(StringUtils.isNotEmpty(sysCode),SysDept::getSystemCode, bySysCode.getSysCode());
+        lqw.eq(StringUtils.isNotEmpty(sysCode),SysDept::getSystemCode, sysSystem.getSysCode());
         List<SysDept> sysDeptList = list(lqw);
         List<SysDept> sysDeptList = list(lqw);
 
 
         List<SysDeptVo> voDept = new ArrayList<>();
         List<SysDeptVo> voDept = new ArrayList<>();
@@ -197,7 +203,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
                 item.setDivision(areaString.substring(0, areaString.length() - 1));
                 item.setDivision(areaString.substring(0, areaString.length() - 1));
             }
             }
             if(!Objects.isNull(item.getLeaderId())){
             if(!Objects.isNull(item.getLeaderId())){
-                SysUserJzgInfo userByUserId = sysUserJzgInfoService.getUserByUserId(item.getLeaderId(),bySysCode.getSysCode());
+                SysUserJzgInfo userByUserId = sysUserJzgInfoService.getUserByUserId(item.getLeaderId(),sysSystem.getSysCode());
                 if(!Objects.isNull(userByUserId)){
                 if(!Objects.isNull(userByUserId)){
                     item.setLeaderName(userByUserId.getName());
                     item.setLeaderName(userByUserId.getName());
                 }
                 }

+ 2 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeAuditController.java

@@ -113,7 +113,8 @@ public class InsFeeAuditController {
 
 
     /**
     /**
      * 审核订单
      * 审核订单
-     * @return
+     *
+     * @return HttpResult<String>
      */
      */
     @PostMapping("/verifyOrder")
     @PostMapping("/verifyOrder")
     @Operation(summary = "审核订单")
     @Operation(summary = "审核订单")

+ 14 - 8
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java

@@ -366,6 +366,10 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
             throw new ServiceException("疑问订单无法直接审核通过,请先取消疑问");
             throw new ServiceException("疑问订单无法直接审核通过,请先取消疑问");
         }
         }
         InsOrders orders = insOrdersService.getById(audit.getOrderNo());
         InsOrders orders = insOrdersService.getById(audit.getOrderNo());
+        if(orders == null){
+            log.info("订单[{}]对应的审核费用数据不存在",audit.getOrderNo());
+            throw new SystemException("订单对应的审核费用数据不存在");
+        }
         if(audit.getAuditStatus() > 0){
         if(audit.getAuditStatus() > 0){
             AssertionUtils.isFail(true, "订单已审核刷新订单详情页!");
             AssertionUtils.isFail(true, "订单已审核刷新订单详情页!");
         }
         }
@@ -545,27 +549,29 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
                 distributor3 = jzgAccountResult.getData();
                 distributor3 = jzgAccountResult.getData();
                 verifySysAccount(distributor3,jzgInfo,feeOrders);
                 verifySysAccount(distributor3,jzgInfo,feeOrders);
             }
             }
+            // 增加账户的金额记录
+            // modify by lipf, 2026年5月20日11:31:59 审核通过后,才需要 生成收入明细日志
+            List<SysUserAccountIncomeLog>builderIncomeLog = this.builderIncomeLog(param.getOrderNo(),feeOrders,userAccount,distributor1,distributor2,distributor3);
+            HttpResult result2 = orgClient.addUserAccountIncomeLog(builderIncomeLog);
+            AssertionUtils.isFail(result2.getCode() != 200,"账户记录添加失败,审核失败");
         }else{
         }else{
             StateResult stateFailResult = auditStateListener.statusChange(AuditState.AuditStateEnum.FAIL_AUDIT,audit.getAuditStatus()+"");
             StateResult stateFailResult = auditStateListener.statusChange(AuditState.AuditStateEnum.FAIL_AUDIT,audit.getAuditStatus()+"");
             audit.setAuditStatus(stateFailResult.getCurrentState());
             audit.setAuditStatus(stateFailResult.getCurrentState());
         }
         }
         audit.setRefuse(param.getRefuse());
         audit.setRefuse(param.getRefuse());
         audit.setIsProblem(0);
         audit.setIsProblem(0);
+        // modify by lipf, 2026年5月20日10:33:03 解决缺少审核时间和审核用户的问题
+        audit.setAuditUser(userName);
+        audit.setAuditTime(LocalDateTime.now());
         this.updateById(audit);
         this.updateById(audit);
 
 
         //合伙人佣金比例
         //合伙人佣金比例
         try {
         try {
             partnerClient.extractFeeSave(orders.getQuoteNo(),orders.getId());
             partnerClient.extractFeeSave(orders.getQuoteNo(),orders.getId());
         }catch (Exception e){
         }catch (Exception e){
-            log.error("保存合伙人佣金计算异常:{}" + e.getMessage());
-            e.printStackTrace();
+            log.error("保存合伙人佣金计算异常:{}",e.getMessage(), e);
         }
         }
 
 
-        // 增加账户的金额记录
-        List<SysUserAccountIncomeLog>builderIncomeLog = this.builderIncomeLog(param.getOrderNo(),feeOrders,userAccount,distributor1,distributor2,distributor3);
-        HttpResult result = orgClient.addUserAccountIncomeLog(builderIncomeLog);
-        AssertionUtils.isFail(result.getCode() != 200,"账户记录添加失败,审核失败");
-
     }
     }
 
 
     /**
     /**
@@ -702,7 +708,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         }
         }
         // 保存比例调整记录
         // 保存比例调整记录
         InsFeeOrderRecord record = new InsFeeOrderRecord(param);
         InsFeeOrderRecord record = new InsFeeOrderRecord(param);
-        recordService.save(record);
+        recordService.updateById(record);
     }
     }
 
 
     /**
     /**

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

@@ -66,7 +66,8 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         // 常量定义 保留小数5位
         // 常量定义 保留小数5位
         final int SCALE = 5;
         final int SCALE = 5;
         final RoundingMode ROUNDING_MODE = RoundingMode.HALF_EVEN;
         final RoundingMode ROUNDING_MODE = RoundingMode.HALF_EVEN;
-        final BigDecimal TAX_FACTOR = new BigDecimal("1").divide(new BigDecimal("1.06"), 10, ROUNDING_MODE);
+        final BigDecimal ONE_HUNDRED = new BigDecimal("100");
+        final BigDecimal TAX_RATE = new BigDecimal("1.06");
 
 
         // 获取订单信息
         // 获取订单信息
         InsOrders insOrders = insOrdersService.getById(ptlAgreementCostRatioVo.getOrderNo());
         InsOrders insOrders = insOrdersService.getById(ptlAgreementCostRatioVo.getOrderNo());
@@ -78,83 +79,115 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         PtlAgreement ptlAgreement = orgClient.getByAgreementId(insOrders.getAgreementId());
         PtlAgreement ptlAgreement = orgClient.getByAgreementId(insOrders.getAgreementId());
         // 获取费用信息
         // 获取费用信息
         InsFeeOrders insFeeOrders = insFeeOrdersMapper.selectById(insOrders.getId());
         InsFeeOrders insFeeOrders = insFeeOrdersMapper.selectById(insOrders.getId());
-        // 保费
-        BigDecimal jqPremium = insOrdersCosts.getJqPremium();
-        BigDecimal syPremium = insOrdersCosts.getSyPremium();
-        BigDecimal jyPremium = insOrdersCosts.getJyPremium();
-        // 手续费比例
-        BigDecimal jqCommissionRatio = covertPercent(ptlAgreementCostRatioVo.getJqCommissionRatio());
-        BigDecimal syCommissionRatio = covertPercent(ptlAgreementCostRatioVo.getSyCommissionRatio());
-        BigDecimal jyCommissionRatio = covertPercent(ptlAgreementCostRatioVo.getJyCommissionRatio());
-        // 跟单费比例
-        BigDecimal jqFollowRatio = covertPercent(ptlAgreementCostRatioVo.getJqFollowRatio());
-        BigDecimal syFollowRatio = covertPercent(ptlAgreementCostRatioVo.getSyFollowRatio());
-        BigDecimal jyFollowRatio = covertPercent(ptlAgreementCostRatioVo.getJyFollowRatio());
-        // 加投费比例
-        BigDecimal jqAddThrowRatio = covertPercent(ptlAgreementCostRatioVo.getJqAdditionalRatio());
-        BigDecimal syAddThrowRatio = covertPercent(ptlAgreementCostRatioVo.getSyAdditionalRatio());
-        BigDecimal jyAddThrowRatio = covertPercent(ptlAgreementCostRatioVo.getJyAdditionalRatio());
-        // 留点比例
-        BigDecimal jqKeepPointRatio = covertPercent(ptlAgreementCostRatioVo.getJqKeepPointRatio());
-        BigDecimal syKeepPointRatio = covertPercent(ptlAgreementCostRatioVo.getSyKeepPointRatio());
-        BigDecimal jyKeepPointRatio = covertPercent(ptlAgreementCostRatioVo.getJyKeepPointRatio());
-        // 入口比例
-        BigDecimal jqInletRatio = covertPercent(ptlAgreementCostRatioVo.getJqInletRatio());
-        BigDecimal syInletRatio = covertPercent(ptlAgreementCostRatioVo.getSyInletRatio());
-        BigDecimal jyInletRatio = covertPercent(ptlAgreementCostRatioVo.getJyInletRatio());
-        // 出口比例
-        BigDecimal jqExportRatio = covertPercent(ptlAgreementCostRatioVo.getJqExportRatio());
-        BigDecimal syExportRatio = covertPercent(ptlAgreementCostRatioVo.getSyExportRatio());
-        BigDecimal jyExportRatio = covertPercent(ptlAgreementCostRatioVo.getJyExportRatio());
 
 
-        // 出口留点比例
-        BigDecimal jqExportKeepPointRatio = covertPercent(ptlAgreementCostRatioVo.getJqExportKeepPointRatio());
-        BigDecimal syExportKeepPointRatio = covertPercent(ptlAgreementCostRatioVo.getSyExportKeepPointRatio());
-        BigDecimal jyExportKeepPointRatio = covertPercent(ptlAgreementCostRatioVo.getJyExportKeepPointRatio());
-
-        List<CostTypeParam> typeParams = Arrays.asList(
-                new CostTypeParam("jq", jqPremium, jqCommissionRatio, jqFollowRatio, jqAddThrowRatio,
-                        jqKeepPointRatio, jqInletRatio, jqExportRatio, jqExportKeepPointRatio),
-                new CostTypeParam("sy", syPremium, syCommissionRatio, syFollowRatio, syAddThrowRatio,
-                        syKeepPointRatio, syInletRatio, syExportRatio, syExportKeepPointRatio),
-                new CostTypeParam("jy", jyPremium, jyCommissionRatio, jyFollowRatio, jyAddThrowRatio,
-                        jyKeepPointRatio, jyInletRatio, jyExportRatio, jyExportKeepPointRatio)
-        );
-        // 5. 根据协议类型计算费用
-        boolean isPlatformAgreement = ptlAgreement.getAgreementType() == 1;
-        BigDecimal totalReceivable = BigDecimal.ZERO;
-        BigDecimal totalPayable = BigDecimal.ZERO;
-
-        for (CostTypeParam param : typeParams) {
-            // 5.1 计算基础保费(平台协议直接用原始保费,私有协议扣税)
-            BigDecimal basePremium = isPlatformAgreement ?
-                    param.premium : divideTaxFactor(param.premium, TAX_FACTOR, SCALE);
-
-            // 5.2 计算各类费用
-            BigDecimal commission = calculateFee(basePremium, param.commissionRatio, SCALE);
-            BigDecimal follow = calculateFee(basePremium, param.followRatio, SCALE);
-            BigDecimal addThrow = calculateFee(basePremium, param.addThrowRatio, SCALE);
-            BigDecimal keepPoint = calculateFee(basePremium, param.keepPointRatio, SCALE);
-            BigDecimal inlet = calculateFee(basePremium, param.inletRatio, SCALE);
-            BigDecimal export = calculateFee(basePremium, param.exportRatio, SCALE);
-            BigDecimal exportKeepPoint = calculateFee(basePremium, param.exportKeepPointRatio, SCALE);
-
-            // 5.3 设置费用到对象(通过反射或方法引用简化setter调用)
-            setFeeToOrder(insFeeOrders, param.typePrefix, commission, follow, addThrow, keepPoint, inlet, export, exportKeepPoint);
-
-            // 5.4 累加总应收/应付款
-            totalReceivable = totalReceivable.add(inlet);
-            totalPayable = totalPayable.add(export);
-        }
+        // 关键:获取是否含税标识
+        Integer withTax = ptlAgreement.getWithTax(); // 0-否 1-是
+
+        // 保费
+        BigDecimal jqPremium = insOrdersCosts.getJqPremium() == null ? BigDecimal.ZERO : insOrdersCosts.getJqPremium();
+        BigDecimal syPremium = insOrdersCosts.getSyPremium() == null ? BigDecimal.ZERO : insOrdersCosts.getSyPremium();
+        BigDecimal jyPremium = insOrdersCosts.getJyPremium() == null ? BigDecimal.ZERO : insOrdersCosts.getJyPremium();
+
+        // 更新对象中的比例字段
+        saveRatio(ptlAgreementCostRatioVo, insFeeOrders);
+
+        // 核心:规则重新计算所有费用
+        // 1. 交强险
+        calculatePremiumByRule(insFeeOrders, "jq", jqPremium,
+                insFeeOrders.getJqCommissionRatio(), insFeeOrders.getJqInletRatio(), insFeeOrders.getJqFollowRatio(),
+                insFeeOrders.getJqAdditionalRatio(), insFeeOrders.getJqKeepPointRatio(), insFeeOrders.getJqExportRatio(), insFeeOrders.getJqExportKeepPointRatio(),
+                withTax, TAX_RATE, SCALE);
+
+        // 2. 商业险
+        calculatePremiumByRule(insFeeOrders, "sy", syPremium,
+                insFeeOrders.getSyCommissionRatio(), insFeeOrders.getSyInletRatio(), insFeeOrders.getSyFollowRatio(),
+                insFeeOrders.getSyAdditionalRatio(), insFeeOrders.getSyKeepPointRatio(), insFeeOrders.getSyExportRatio(), insFeeOrders.getSyExportKeepPointRatio(),
+                withTax, TAX_RATE, SCALE);
+
+        // 3. 驾乘险
+        calculatePremiumByRule(insFeeOrders, "jy", jyPremium,
+                insFeeOrders.getJyCommissionRatio(), insFeeOrders.getJyInletRatio(), insFeeOrders.getJyFollowRatio(),
+                insFeeOrders.getJyAdditionalRatio(), insFeeOrders.getJyKeepPointRatio(), insFeeOrders.getJyExportRatio(), insFeeOrders.getJyExportKeepPointRatio(),
+                withTax, TAX_RATE, SCALE);
+
+        // 重新统计总应收、总应付
+        BigDecimal totalPayable = insFeeOrders.getJqPayablePremium().add(insFeeOrders.getSyPayablePremium()).add(insFeeOrders.getJyPayablePremium());
+        BigDecimal totalReceivable = insFeeOrders.getJqReceivablePremium().add(insFeeOrders.getSyReceivablePremium()).add(insFeeOrders.getJyReceivablePremium());
 
 
-        // 6. 设置总费用、 比例并更新
-        saveRatio(ptlAgreementCostRatioVo,insFeeOrders);
-        insFeeOrders.setTotalReceivablePremium(scale(totalReceivable, SCALE));
         insFeeOrders.setTotalPayablePremium(scale(totalPayable, SCALE));
         insFeeOrders.setTotalPayablePremium(scale(totalPayable, SCALE));
+        insFeeOrders.setTotalReceivablePremium(scale(totalReceivable, SCALE));
+
+        // 保存比例
         this.updateById(insFeeOrders);
         this.updateById(insFeeOrders);
         return insFeeOrders;
         return insFeeOrders;
     }
     }
 
 
+    /**
+     * 【按你的规则统一计算费用】
+     * withTax=0 → 保费 /1.06
+     * withTax=1 → 直接用保费
+     */
+    private void calculatePremiumByRule(
+            InsFeeOrders insFeeOrders, String type,
+            BigDecimal premium,
+            BigDecimal commissionRatio, BigDecimal inletRatio, BigDecimal followRatio,
+            BigDecimal addThrowRatio, BigDecimal keepPointRatio, BigDecimal exportRatio, BigDecimal exportKeepPointRatio,
+            Integer withTax, BigDecimal taxRate, int scale) {
+
+        // 计算基数
+        BigDecimal base = BigDecimal.ZERO;
+        if (withTax == 0) {
+            // 不含税:保费 / 1.06
+            base = premium.divide(taxRate, scale, RoundingMode.HALF_EVEN);
+        } else {
+            // 含税:直接用保费
+            base = premium;
+        }
+
+        // ===================== 按比例计算各项费用 =====================
+        BigDecimal commission = base.multiply(commissionRatio).setScale(scale, RoundingMode.HALF_EVEN);
+        BigDecimal inlet = base.multiply(inletRatio).setScale(scale, RoundingMode.HALF_EVEN);
+        BigDecimal follow = base.multiply(followRatio).setScale(scale, RoundingMode.HALF_EVEN);
+
+        // 加投直接乘
+        BigDecimal addThrow = premium.multiply(addThrowRatio).setScale(scale, RoundingMode.HALF_EVEN);
+        // 出口直接乘
+        BigDecimal export = premium.multiply(exportRatio).setScale(scale, RoundingMode.HALF_EVEN);
+        BigDecimal exportKeepPoint = premium.multiply(exportKeepPointRatio).setScale(scale, RoundingMode.HALF_EVEN);
+        // 留点比例直接乘
+        BigDecimal keepPoint = premium.multiply(keepPointRatio).setScale(scale, RoundingMode.HALF_EVEN);
+
+        // 赋值到实体(自动匹配 jq / sy / jy)
+        if ("jq".equals(type)) {
+            insFeeOrders.setJqCommissionPremium(commission);
+            insFeeOrders.setJqReceivablePremium(inlet);
+            insFeeOrders.setJqFollowPremium(follow);
+            insFeeOrders.setJqAdditionalPremium(addThrow);
+            insFeeOrders.setJqKeepPointPremium(keepPoint);
+            insFeeOrders.setJqExportPremium(export);
+            insFeeOrders.setJqExportKeepPointPremium(exportKeepPoint);
+            insFeeOrders.setJqPayablePremium(commission);
+        } else if ("sy".equals(type)) {
+            insFeeOrders.setSyCommissionPremium(commission);
+            insFeeOrders.setSyReceivablePremium(inlet);
+            insFeeOrders.setSyFollowPremium(follow);
+            insFeeOrders.setSyAdditionalPremium(addThrow);
+            insFeeOrders.setSyKeepPointPremium(keepPoint);
+            insFeeOrders.setSyExportPremium(export);
+            insFeeOrders.setSyExportKeepPointPremium(exportKeepPoint);
+            insFeeOrders.setSyPayablePremium(commission);
+        } else if ("jy".equals(type)) {
+            insFeeOrders.setJyCommissionPremium(commission);
+            insFeeOrders.setJyReceivablePremium(inlet);
+            insFeeOrders.setJyFollowPremium(follow);
+            insFeeOrders.setJyAdditionalPremium(addThrow);
+            insFeeOrders.setJyKeepPointPremium(keepPoint);
+            insFeeOrders.setJyExportPremium(export);
+            insFeeOrders.setJyExportKeepPointPremium(exportKeepPoint);
+            insFeeOrders.setJyPayablePremium(commission);
+        }
+    }
+
     // 转换百分比
     // 转换百分比
     public BigDecimal covertPercent(BigDecimal ratio) {
     public BigDecimal covertPercent(BigDecimal ratio) {
         if (ratio == null) {
         if (ratio == null) {
@@ -249,8 +282,8 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         insFeeOrders.setJyFollowRatio(insFeeOrders.getJyInletRatio().subtract(insFeeOrders.getJyCommissionRatio()));
         insFeeOrders.setJyFollowRatio(insFeeOrders.getJyInletRatio().subtract(insFeeOrders.getJyCommissionRatio()));
         // 加投比例
         // 加投比例
         insFeeOrders.setJqAdditionalRatio(covertPercent(ptlAgreementCostRatioVo.getJqAdditionalRatio()));
         insFeeOrders.setJqAdditionalRatio(covertPercent(ptlAgreementCostRatioVo.getJqAdditionalRatio()));
-        insFeeOrders.setSyAdditionalRatio(covertPercent(ptlAgreementCostRatioVo.getJqAdditionalRatio()));
-        insFeeOrders.setJyAdditionalRatio(covertPercent(ptlAgreementCostRatioVo.getJqAdditionalRatio()));
+        insFeeOrders.setSyAdditionalRatio(covertPercent(ptlAgreementCostRatioVo.getSyAdditionalRatio()));
+        insFeeOrders.setJyAdditionalRatio(covertPercent(ptlAgreementCostRatioVo.getJyAdditionalRatio()));
         // 留点比例
         // 留点比例
         insFeeOrders.setJqKeepPointRatio(covertPercent(ptlAgreementCostRatioVo.getJqKeepPointRatio()));
         insFeeOrders.setJqKeepPointRatio(covertPercent(ptlAgreementCostRatioVo.getJqKeepPointRatio()));
         insFeeOrders.setSyKeepPointRatio(covertPercent(ptlAgreementCostRatioVo.getSyKeepPointRatio()));
         insFeeOrders.setSyKeepPointRatio(covertPercent(ptlAgreementCostRatioVo.getSyKeepPointRatio()));

+ 2 - 2
tenant/insurance/quotation-summary/src/main/resources/mapper/InsFeeAuditMapper.xml

@@ -36,7 +36,7 @@
             WHEN 1 THEN '车险出单'
             WHEN 1 THEN '车险出单'
             WHEN 2 THEN '代客录单'
             WHEN 2 THEN '代客录单'
             WHEN 3 THEN '补录订单'
             WHEN 3 THEN '补录订单'
-            ELSE '未知状态'
+            ELSE ''
             END AS order_type,
             END AS order_type,
             suji.name as name,
             suji.name as name,
             su.mobile as mobile,
             su.mobile as mobile,
@@ -161,7 +161,7 @@
                 WHEN 1 THEN '车险出单'
                 WHEN 1 THEN '车险出单'
                 WHEN 2 THEN '代客录单'
                 WHEN 2 THEN '代客录单'
                 WHEN 3 THEN '补录订单'
                 WHEN 3 THEN '补录订单'
-                ELSE '未知状态'
+                ELSE ''
                 END AS order_type,
                 END AS order_type,
                 suji.name as name,
                 suji.name as name,
                 su.mobile as mobile,
                 su.mobile as mobile,

+ 8 - 1
tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrdersMapper.xml

@@ -204,6 +204,7 @@
         <result property="auditId" column="audit_id" jdbcType="VARCHAR"/>
         <result property="auditId" column="audit_id" jdbcType="VARCHAR"/>
         <result property="auditName" column="audit_name" jdbcType="VARCHAR"/>
         <result property="auditName" column="audit_name" jdbcType="VARCHAR"/>
         <result property="errorMessage" column="error_message" jdbcType="VARCHAR"/>
         <result property="errorMessage" column="error_message" jdbcType="VARCHAR"/>
+        <result property="orderType" column="order_type" jdbcType="VARCHAR"/>
         <association property="insOrders" column="{id=id}" select="selectOrdersById"/>
         <association property="insOrders" column="{id=id}" select="selectOrdersById"/>
         <association property="carInfoVo" column="{orderNo=id}" select="selectOrdersCarInfoByOrderNo"/>
         <association property="carInfoVo" column="{orderNo=id}" select="selectOrdersCarInfoByOrderNo"/>
         <association property="insOrdersOtherInfo" column="{orderNo=id}" select="selectOrdersOtherByOrderNo"/>
         <association property="insOrdersOtherInfo" column="{orderNo=id}" select="selectOrdersOtherByOrderNo"/>
@@ -719,7 +720,13 @@
                create_time,
                create_time,
                create_by,
                create_by,
                update_time,
                update_time,
-               update_by
+               update_by,
+                CASE entry_status
+                WHEN 1 THEN '车险出单'
+                WHEN 2 THEN '代客录单'
+                WHEN 3 THEN '补录订单'
+                ELSE ''
+                END AS order_type
         from ins_orders
         from ins_orders
         where id = #{id}
         where id = #{id}
     </select>
     </select>

+ 6 - 5
tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementDispatchController.java

@@ -2,14 +2,10 @@ package com.jzg.organization.controller;
 
 
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.action.enums.ActionEnum;
 import com.jzg.commons.entity.action.enums.ActionEnum;
-import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
 import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchQuery;
 import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchQuery;
 import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
 import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
-import com.jzg.commons.entity.dto.CostExternalParam;
-import com.jzg.commons.entity.orders.po.InsOrders;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
-import com.jzg.commons.entity.vo.CostExternalListVo;
 import com.jzg.commons.request.RequestSingleParam;
 import com.jzg.commons.request.RequestSingleParam;
 import com.jzg.organization.action.ActionExecutor;
 import com.jzg.organization.action.ActionExecutor;
 import com.jzg.organization.service.PtlAgreementDispatchService;
 import com.jzg.organization.service.PtlAgreementDispatchService;
@@ -44,9 +40,14 @@ public class PtlAgreementDispatchController {
         return HttpResult.ok(ptlAgreementDispatchService.getAgreementDispatch(ptlAgreementDispatchQuery));
         return HttpResult.ok(ptlAgreementDispatchService.getAgreementDispatch(ptlAgreementDispatchQuery));
     }
     }
 
 
+    /**
+     * 添加协议调度
+     * @author lipf modify by lipf
+     * @date 2026/5/20 15:46
+     */
     @PostMapping("addAgreementDispatch")
     @PostMapping("addAgreementDispatch")
     @Operation(summary = "添加协议调度")
     @Operation(summary = "添加协议调度")
-    public HttpResult addAgreementDispatch(@RequestBody PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo){
+    public HttpResult<String> addAgreementDispatch(@RequestBody PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo){
         String dispatchId = ptlAgreementDispatchService.addAgreementDispatch(ptlAgreementDispatchVo);
         String dispatchId = ptlAgreementDispatchService.addAgreementDispatch(ptlAgreementDispatchVo);
         return HttpResult.ok("添加协议调度成功",dispatchId);
         return HttpResult.ok("添加协议调度成功",dispatchId);
     }
     }

+ 7 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchMapper.java

@@ -3,9 +3,16 @@ package com.jzg.organization.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
+import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
 
 
 @Mapper
 @Mapper
 public interface PtlAgreementDispatchMapper extends BaseMapper<PtlAgreementDispatch> {
 public interface PtlAgreementDispatchMapper extends BaseMapper<PtlAgreementDispatch> {
 
 
+
+    @Select("select * from ptl_agreement_undwrt_rules_dict_labal paurdl where paurdl.is_delete =0")
+    List<PtlAgreementUndwrtRulesDictLabal> queryAllDictLabal();
 }
 }

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java

@@ -141,6 +141,10 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
             // 获取保司的报价失败之后的动作
             // 获取保司的报价失败之后的动作
             List<PtlAgreementDispatchAfterAction> ptlAgreementDispatchAfterActions = afterActionMapper.getAfterActions(ptlAgreementDispatchQuery.getCompanyId());
             List<PtlAgreementDispatchAfterAction> ptlAgreementDispatchAfterActions = afterActionMapper.getAfterActions(ptlAgreementDispatchQuery.getCompanyId());
             int index = 1;
             int index = 1;
+            // add by lipf, 对协议配置中的字典序号进行转义 2026年5月20日16:43:34
+            List<PtlAgreementUndwrtRulesDictLabal> ptlAgreementUndwrtRulesDictLabals = baseMapper.queryAllDictLabal();
+            Map<String, String> dictLabalId2Name = ptlAgreementUndwrtRulesDictLabals.stream()
+                    .collect(Collectors.toMap(PtlAgreementUndwrtRulesDictLabal::getIdStr, PtlAgreementUndwrtRulesDictLabal::getName));
             for(PtlAgreementDispatch dispatch : ptlAgreementDispatches){
             for(PtlAgreementDispatch dispatch : ptlAgreementDispatches){
                 if(dispatch.getDispatchName().isEmpty()){
                 if(dispatch.getDispatchName().isEmpty()){
                     dispatch.setDispatchName("规则" + index);
                     dispatch.setDispatchName("规则" + index);
@@ -168,6 +172,10 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
                     }else{
                     }else{
                         attrlink.setOperatorDesc("未知");
                         attrlink.setOperatorDesc("未知");
                     }
                     }
+                    String minName = dictLabalId2Name.getOrDefault(attrlink.getMin(),attrlink.getMin());
+                    String maxName = dictLabalId2Name.getOrDefault(attrlink.getMax(),attrlink.getMax());
+                    attrlink.setMinName(minName);
+                    attrlink.setMaxName(maxName);
                     PtlAgreementUndwrtRulesAttr undwrtRuleAttrByAttrCode = ptlAgreementUndwrtRulesAttrService.getUndwrtRuleAttrByAttrCode(attrlink.getAttrCode());
                     PtlAgreementUndwrtRulesAttr undwrtRuleAttrByAttrCode = ptlAgreementUndwrtRulesAttrService.getUndwrtRuleAttrByAttrCode(attrlink.getAttrCode());
                     if(undwrtRuleAttrByAttrCode != null && undwrtRuleAttrByAttrCode.getDictId() != null){
                     if(undwrtRuleAttrByAttrCode != null && undwrtRuleAttrByAttrCode.getDictId() != null){
                         attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());
                         attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());

+ 15 - 17
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesServiceImpl.java

@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
 public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreementUndwrtRulesMapper, PtlAgreementUndwrtRules>
 public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreementUndwrtRulesMapper, PtlAgreementUndwrtRules>
     implements PtlAgreementUndwrtRulesService {
     implements PtlAgreementUndwrtRulesService {
 
 
-    private static final Logger log = LoggerFactory.getLogger(PtlAgreementUndwrtRulesServiceImpl.class);;
+    private static final Logger log = LoggerFactory.getLogger(PtlAgreementUndwrtRulesServiceImpl.class);
 
 
     @Autowired
     @Autowired
     private PtlAgreementUndwrtRulesAttrLinkMapper agreementUndwrtRulesAttrLinkMapper;
     private PtlAgreementUndwrtRulesAttrLinkMapper agreementUndwrtRulesAttrLinkMapper;
@@ -61,7 +61,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
 
 
     @Override
     @Override
     public List<AgreementRulesVo> queryList(String agreementId) {
     public List<AgreementRulesVo> queryList(String agreementId) {
-        log.info("查询协议承保规则列表。 agreementId=[]", JSONUtil.toJsonStr(agreementId));
+        log.info("查询协议承保规则列表。 agreementId=[{}]", JSONUtil.toJsonStr(agreementId));
         List<AgreementRulesVo> rulesVos = baseMapper.queryList(agreementId);
         List<AgreementRulesVo> rulesVos = baseMapper.queryList(agreementId);
         LocalDateTime now = LocalDateTime.now();
         LocalDateTime now = LocalDateTime.now();
         if(CollUtil.isNotEmpty(rulesVos)){
         if(CollUtil.isNotEmpty(rulesVos)){
@@ -71,22 +71,20 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
                 param.setCoverRuleId(rulesVo.getId());
                 param.setCoverRuleId(rulesVo.getId());
                 List<CostListVo> costVos = ptlAgreementCostService.queryByAgreementIdAndCoverRuleId(param);
                 List<CostListVo> costVos = ptlAgreementCostService.queryByAgreementIdAndCoverRuleId(param);
                 if(CollUtil.isNotEmpty(costVos)){
                 if(CollUtil.isNotEmpty(costVos)){
-                    costVos.forEach(cost->{
-                        cost.getPtlAgreementCostVoList().forEach(vo->{
-                            LocalDateTime effectiveTime = vo.getEffectiveTime().toInstant()
-                                    .atZone(ZoneId.systemDefault())
-                                    .toLocalDateTime();
-                            LocalDateTime failureTime = vo.getFailureTime().toInstant()
-                                   .atZone(ZoneId.systemDefault())
-                                   .toLocalDateTime();
-                            if(now.isAfter(effectiveTime) && now.isBefore(failureTime)){
-                                vo.setIsValid(0);
-                            }else{
-                                vo.setIsValid(1);
-                            }
+                    costVos.forEach(cost-> cost.getPtlAgreementCostVoList().forEach(vo->{
+                        LocalDateTime effectiveTime = vo.getEffectiveTime().toInstant()
+                                .atZone(ZoneId.systemDefault())
+                                .toLocalDateTime();
+                        LocalDateTime failureTime = vo.getFailureTime().toInstant()
+                               .atZone(ZoneId.systemDefault())
+                               .toLocalDateTime();
+                        if(now.isAfter(effectiveTime) && now.isBefore(failureTime)){
+                            vo.setIsValid(0);
+                        }else{
+                            vo.setIsValid(1);
+                        }
 
 
-                        });
-                    });
+                    }));
                     rulesVo.setCostVoList(costVos);
                     rulesVo.setCostVoList(costVos);
                 }
                 }
             }
             }

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

@@ -144,7 +144,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     public InsPlyIncome getUnauditedOrder(ReceivableQueryVo receivableQueryVo) {
     public InsPlyIncome getUnauditedOrder(ReceivableQueryVo receivableQueryVo) {
         InsPlyIncome auditedOrder = baseMapper.getAuditedOrder(receivableQueryVo.getOrderNo(), receivableQueryVo.getQueryType(), InsOrderStatusEnum.UNDERWRITED.getCode(), receivableQueryVo.getAgreementType());
         InsPlyIncome auditedOrder = baseMapper.getAuditedOrder(receivableQueryVo.getOrderNo(), receivableQueryVo.getQueryType(), InsOrderStatusEnum.UNDERWRITED.getCode(), receivableQueryVo.getAgreementType());
         if (receivableQueryVo.getQueryType().equals("3") || receivableQueryVo.getQueryType().equals("4")) {
         if (receivableQueryVo.getQueryType().equals("3") || receivableQueryVo.getQueryType().equals("4")) {
-            if (Objects.isNull(auditedOrder.getJyPolicyNo()) && auditedOrder.getJyPolicyNo().equals("")) {
+            if (Objects.isNull(auditedOrder.getJyPolicyNo()) && auditedOrder.getJyPolicyNo().isEmpty()) {
                 return null;
                 return null;
             }
             }
         }
         }
@@ -505,15 +505,15 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             invoice.setInvoiceType(invoicingVo.getInvoiceType());
             invoice.setInvoiceType(invoicingVo.getInvoiceType());
             // 开票类型  1 手续费  2 跟单费  3 驾意险手续费 4 驾意险跟单费
             // 开票类型  1 手续费  2 跟单费  3 驾意险手续费 4 驾意险跟单费
             if("1".equals(invoicingVo.getInvoiceType()) || "2".equals(invoicingVo.getInvoiceType())){
             if("1".equals(invoicingVo.getInvoiceType()) || "2".equals(invoicingVo.getInvoiceType())){
-                invoice.setInvoickRiskType("10");
+                invoice.setInvoiceRiskType("10");
             }else{
             }else{
-                invoice.setInvoickRiskType("20");
+                invoice.setInvoiceRiskType("20");
             }
             }
             invoice.setInvoiceParty(invoicingVo.getInvoiceParty());
             invoice.setInvoiceParty(invoicingVo.getInvoiceParty());
             invoice.setOverinflatedAmount(invoicingVo.getOverinflatedAmount());
             invoice.setOverinflatedAmount(invoicingVo.getOverinflatedAmount());
             invoice.setReceivableSupervisePremium(invoicingVo.getReceivablePremium());
             invoice.setReceivableSupervisePremium(invoicingVo.getReceivablePremium());
             invoice.setTaxPoint(invoicingVo.getTaxPoint());
             invoice.setTaxPoint(invoicingVo.getTaxPoint());
-            int insert = insPlyIncomeInvoiceMapper.insert(invoice);
+            insPlyIncomeInvoiceMapper.insert(invoice);
 
 
             List<InsPlyIncomeInvoiceLink> invoicingLinkList = new ArrayList();
             List<InsPlyIncomeInvoiceLink> invoicingLinkList = new ArrayList();
 
 
@@ -529,6 +529,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             result.setSumPrice(invoicingVo.getReceivablePremium().toString());
             result.setSumPrice(invoicingVo.getReceivablePremium().toString());
             return result;
             return result;
         } catch (Exception e) {
         } catch (Exception e) {
+            log.info("开票异常.invoicingVo=[{}]",JSONUtil.toJsonStr(invoicingVo), e);
             // 回滚事务
             // 回滚事务
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return null;
             return null;
@@ -1222,6 +1223,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 // 设置待结算金额
                 // 设置待结算金额
                 action.setRemainSettlementAmount(remainSettlementAmount);
                 action.setRemainSettlementAmount(remainSettlementAmount);
                 action.setCompanyALlName(allCompanyHierarchyPaths.get(Objects.toString(action.getCompanyId(),"")));
                 action.setCompanyALlName(allCompanyHierarchyPaths.get(Objects.toString(action.getCompanyId(),"")));
+                action.setSettlementStatus(settlementStatusName);
             }).toList();
             }).toList();
             invoiceRecordList.setRecords(records);
             invoiceRecordList.setRecords(records);
         }
         }
@@ -1319,19 +1321,14 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         if("30".equals(settlementQueryVo.getStatus())){
         if("30".equals(settlementQueryVo.getStatus())){
             settlementQueryVo.setStatus(null);
             settlementQueryVo.setStatus(null);
         }
         }
-//        if("30".equals(settlementQueryVo.getAccountsReceivable())){
-//            settlementQueryVo.setAccountsReceivable(null);
-//        }
-//        if("accountsReceivable"){
-//
-//        }
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page, settlementQueryVo);
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page, settlementQueryVo);
         exportSuperviseSettlementExcelDtos.getRecords().forEach(dto -> {
         exportSuperviseSettlementExcelDtos.getRecords().forEach(dto -> {
-            if (dto.getInvoiceParty().equals("1")) {
+            if ("1".equals(dto.getInvoiceParty())) {
                 dto.setInvoiceParty("我方开票");
                 dto.setInvoiceParty("我方开票");
-            } else if (dto.getInvoiceParty().equals("2")) {
+            } else if ("2".equals(dto.getInvoiceParty())) {
                 dto.setInvoiceParty("保司开票");
                 dto.setInvoiceParty("保司开票");
             }
             }
+            dto.setInvoiceType(Objects.toString(dto.getInvoiceType(),""));
             switch (dto.getInvoiceType()) {
             switch (dto.getInvoiceType()) {
                 case "1" -> dto.setInvoiceType("手续费");
                 case "1" -> dto.setInvoiceType("手续费");
                 case "2" -> dto.setInvoiceType("跟单费");
                 case "2" -> dto.setInvoiceType("跟单费");
@@ -1339,9 +1336,21 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 case "4" -> dto.setInvoiceType("驾意险跟单费");
                 case "4" -> dto.setInvoiceType("驾意险跟单费");
             }
             }
             dto.setInvoiceTypeName(Constant.invoiceRiskTypeMap.get(Objects.toString(dto.getInvoiceType())));
             dto.setInvoiceTypeName(Constant.invoiceRiskTypeMap.get(Objects.toString(dto.getInvoiceType())));
-            SysUploadFiles file = sysUploadFilesMapper.selectById(dto.getFileId());
-            if (file != null) {
-                dto.setFileUrl(MinioUtils.getPresignedObjectUrl("jzg", file.getFileName()));
+            LambdaQueryWrapper<InsPlyIncomeInvoiceSettlementFile> wrapper = new LambdaQueryWrapper<InsPlyIncomeInvoiceSettlementFile>();
+            List<InsPlyIncomeInvoiceSettlementFile> insPlyIncomeInvoiceSettlementFiles = insPlyIncomeInvoiceSettlementFileMapper.selectList(wrapper.eq(InsPlyIncomeInvoiceSettlementFile::getSettlementId, dto.getSettlementId()));
+            if(CollUtil.isNotEmpty(insPlyIncomeInvoiceSettlementFiles)){
+                String fileIds = insPlyIncomeInvoiceSettlementFiles.stream().map(InsPlyIncomeInvoiceSettlementFile::getFileId).collect(Collectors.joining(","));
+                dto.setFileId(fileIds);
+                String fileUrls = insPlyIncomeInvoiceSettlementFiles.stream().map(InsPlyIncomeInvoiceSettlementFile::getFileId).map(fileId -> {
+                    SysUploadFiles file = sysUploadFilesMapper.selectById(fileId);
+                    if (file != null) {
+                        return MinioUtils.getPresignedObjectUrl("jzg", file.getFileName());
+                    }
+                    return null;
+                }).filter(Objects::nonNull).collect(Collectors.joining(","));
+                if(StrUtil.isNotEmpty(fileUrls)){
+                    dto.setFileUrl(fileUrls);
+                }
             }
             }
         });
         });
         return exportSuperviseSettlementExcelDtos;
         return exportSuperviseSettlementExcelDtos;

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysDeptServiceImpl.java

@@ -180,7 +180,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
 
 
     @Override
     @Override
     public List<SysDeptVo> getDeptTree(String deptId, SysDeptParam param) {
     public List<SysDeptVo> getDeptTree(String deptId, SysDeptParam param) {
-        log.info("查询部门信息:deptTid=[{}],param=[{}]",deptId, JSONUtil.toJsonStr(param));
+        log.info("查询部门信息:deptId=[{}],param=[{}]",deptId, JSONUtil.toJsonStr(param));
         deptId = Objects.toString(deptId, "");
         deptId = Objects.toString(deptId, "");
         // 用户所属的部门序号
         // 用户所属的部门序号
         final String userDeptId = deptId;
         final String userDeptId = deptId;

+ 1 - 0
tenant/organization/src/main/resources/application.yml

@@ -57,6 +57,7 @@ tenant:
     - ptl_scheme_insurance_driving_intention
     - ptl_scheme_insurance_driving_intention
     - ins_business_insurance_option
     - ins_business_insurance_option
     - ins_business_insurance
     - ins_business_insurance
+    - ptl_agreement
     - ptl_agreement_attribution
     - ptl_agreement_attribution
     - ptl_agreement_dept
     - ptl_agreement_dept
     - ptl_agreement_undwrt_rules_attr
     - ptl_agreement_undwrt_rules_attr

+ 8 - 0
tenant/organization/src/main/resources/mapper/PtlAgreementDispatchMapper.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jzg.organization.mapper.PtlAgreementDispatchMapper">
+
+
+</mapper>

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

@@ -127,10 +127,6 @@
         io.id = #{orderNo}
         io.id = #{orderNo}
         AND
         AND
         io.order_status = #{orderStatus}
         io.order_status = #{orderStatus}
-        <if test="auditStatus != null and auditStatus != ''">
-            AND
-            ifa.audit_status = #{auditStatus}
-        </if>
     </select>
     </select>
 
 
 
 
@@ -217,7 +213,7 @@
         WHEN 1 THEN '车险出单'
         WHEN 1 THEN '车险出单'
         WHEN 2 THEN '代客录单'
         WHEN 2 THEN '代客录单'
         WHEN 3 THEN '补录订单'
         WHEN 3 THEN '补录订单'
-        ELSE '未知状态'
+        ELSE ''
         END AS order_type,
         END AS order_type,
         ipi.license_no,
         ipi.license_no,
         (ipi.jq_receivable_premium + ipi.sy_receivable_premium + ipi.jy_receivable_premium) as receivableAmount,  -- 总应收金额
         (ipi.jq_receivable_premium + ipi.sy_receivable_premium + ipi.jy_receivable_premium) as receivableAmount,  -- 总应收金额
@@ -271,9 +267,13 @@
             </foreach>
             </foreach>
         </if>
         </if>
     </select>
     </select>
-    
     <select id="getReceivablePage" resultType="com.jzg.commons.entity.finance.po.InsPlyIncome">
     <select id="getReceivablePage" resultType="com.jzg.commons.entity.finance.po.InsPlyIncome">
         <include refid="query"/>
         <include refid="query"/>
+        <if test="receivableQueryVo.invoiceId != null and receivableQueryVo.invoiceId != ''" >
+            and ipi.id  in (
+                select ipiil.income_id  from ins_ply_income_invoice_link ipiil where ipiil.invoice_id  = #{receivableQueryVo.invoiceId}
+            )
+        </if>
         <if test="receivableQueryVo.typeAttr != null and receivableQueryVo.typeAttr != ''">
         <if test="receivableQueryVo.typeAttr != null and receivableQueryVo.typeAttr != ''">
             and io.real_quote_user_id  in (select su.username  from sys_user_jzg_info_salesman sujis left join sys_user_jzg_info suji on sujis.sys_user_jzg_info_id = suji.id
             and io.real_quote_user_id  in (select su.username  from sys_user_jzg_info_salesman sujis left join sys_user_jzg_info suji on sujis.sys_user_jzg_info_id = suji.id
             left join sys_user su on su.id = suji.user_id
             left join sys_user su on su.id = suji.user_id
@@ -509,11 +509,9 @@
         ipiis.actual_received_amount as actualReceivedAmount,
         ipiis.actual_received_amount as actualReceivedAmount,
         ipiis.receive_payment_date as receivePaymentDate,
         ipiis.receive_payment_date as receivePaymentDate,
         ipiis.create_by as createBy,
         ipiis.create_by as createBy,
-        ipiis.create_time as createTime,
-        ipiisf.file_id as fileId
+        ipiis.create_time as createTime
         FROM
         FROM
         ins_ply_income_invoice_settlement ipiis
         ins_ply_income_invoice_settlement ipiis
-        LEFT JOIN ins_ply_income_invoice_settlement_file ipiisf ON ipiisf.settlement_id = ipiis.id
         LEFT JOIN ins_ply_income_invoice ipii ON ipii.id = ipiis.invoice_id
         LEFT JOIN ins_ply_income_invoice ipii ON ipii.id = ipiis.invoice_id
         LEFT JOIN ins_ply_income_invoice_link ipil ON ipil.invoice_id = ipiis.invoice_id
         LEFT JOIN ins_ply_income_invoice_link ipil ON ipil.invoice_id = ipiis.invoice_id
         LEFT JOIN ins_ply_income ipi ON ipi.id = ipil.income_id
         LEFT JOIN ins_ply_income ipi ON ipi.id = ipil.income_id
@@ -1066,17 +1064,13 @@
             ipii.update_by,
             ipii.update_by,
             eic.name as company_name,
             eic.name as company_name,
             sum( ipiis.actual_received_amount ) AS actual_received_amount,
             sum( ipiis.actual_received_amount ) AS actual_received_amount,
-            ipii.status,
-            CASE
-                WHEN ifnull(ipii.receivable_supervise_premium,0)  + ifnull(ipii.overinflated_amount,0) = SUM( ipiis.actual_received_amount ) THEN
-                    '已结清' ELSE '已开票未结算'
-                END AS settlement_status
+            ipii.status
         FROM
         FROM
             ins_ply_income_invoice ipii
             ins_ply_income_invoice ipii
                 LEFT JOIN ins_ply_income_invoice_settlement ipiis ON ipii.id = ipiis.invoice_id
                 LEFT JOIN ins_ply_income_invoice_settlement ipiis ON ipii.id = ipiis.invoice_id
                 LEFT JOIN esm_ins_company eic on eic.id = ipii.company_id
                 LEFT JOIN esm_ins_company eic on eic.id = ipii.company_id
         WHERE
         WHERE
-            1=1 AND ipii.is_delete = 0 AND ipiis.is_delete = 0 AND eic.is_delete = 0
+            1=1
         <if test="invoiceRecordQueryVo.invoiceType != null and invoiceRecordQueryVo.invoiceType != ''">
         <if test="invoiceRecordQueryVo.invoiceType != null and invoiceRecordQueryVo.invoiceType != ''">
             AND ipii.invoice_type = #{invoiceRecordQueryVo.invoiceType}
             AND ipii.invoice_type = #{invoiceRecordQueryVo.invoiceType}
         </if>
         </if>
@@ -1103,7 +1097,7 @@
             ipii.receivable_supervise_premium,
             ipii.receivable_supervise_premium,
             ipii.invoice_type,
             ipii.invoice_type,
             ipii.company_id,
             ipii.company_id,
-            ipii.invoice_party;
+            ipii.invoice_party
     </select>
     </select>
 
 
     <!-- 基础结果集映射 -->
     <!-- 基础结果集映射 -->