Explorar el Código

Merge remote-tracking branch 'origin/master'

lixiaolong hace 3 semanas
padre
commit
58f3295fc0
Se han modificado 15 ficheros con 284 adiciones y 92 borrados
  1. 3 0
      commons/src/main/java/com/jzg/commons/entity/dto/FeeAuditParam.java
  2. 1 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/IncomeDataVO.java
  3. 5 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/SettlementReportQueryVo.java
  4. 10 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/importimcome/ImportContentExt.java
  5. 3 0
      commons/src/main/java/com/jzg/commons/entity/orders/po/InsFeeAudit.java
  6. 1 1
      consoleStatistics/src/main/resources/mapper/RiskBusinessReportMapper.xml
  7. 3 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java
  8. 2 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/userinfo/UserInfoServiceImpl.java
  9. 12 2
      tenant/insurance/quotation-summary/src/main/resources/mapper/InsFeeAuditMapper.xml
  10. 27 15
      tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java
  11. 178 51
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  12. 3 3
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoServiceImpl.java
  13. 15 15
      tenant/organization/src/main/java/com/jzg/organization/utils/IncomeInvoiceLinkUtil.java
  14. 7 1
      tenant/organization/src/main/resources/mapper/InsPlyIncomeInvoiceSettlementMapper.xml
  15. 14 3
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/dto/FeeAuditParam.java

@@ -111,6 +111,9 @@ public class FeeAuditParam extends PageRequest {
     @Schema(description = "审核人")
     @Schema(description = "审核人")
     private String auditUser;
     private String auditUser;
 
 
+    @Schema(description = "审核人名称")
+    private String auditUserName;
+
     @Schema(description = "领取人")
     @Schema(description = "领取人")
     private String receiveUser;
     private String receiveUser;
 
 

+ 1 - 0
commons/src/main/java/com/jzg/commons/entity/finance/vo/IncomeDataVO.java

@@ -64,6 +64,7 @@ public class IncomeDataVO implements Serializable {
         public static final String ptlAgreement = "ptlAgreement";
         public static final String ptlAgreement = "ptlAgreement";
         public static final String orderType = "orderType";
         public static final String orderType = "orderType";
         public static final String signYear = "signYear";
         public static final String signYear = "signYear";
+        public static final String signMonth = "signMonth";
         public static final String licenseNo = "licenseNo";
         public static final String licenseNo = "licenseNo";
         public static final String jqPolicyNo = "jqPolicyNo";
         public static final String jqPolicyNo = "jqPolicyNo";
         public static final String syPolicyNo = "syPolicyNo";
         public static final String syPolicyNo = "syPolicyNo";

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/finance/vo/SettlementReportQueryVo.java

@@ -48,6 +48,11 @@ public class SettlementReportQueryVo extends PageRequest {
     @Schema(description = "结算开始时间")
     @Schema(description = "结算开始时间")
     private String settlementStartTime;
     private String settlementStartTime;
 
 
+    @Schema(description = "回款开始时间")
+    private String receivePaymentDateBegin;
+    @Schema(description = "回款结束时间")
+    private String receivePaymentDateEnd;
+
     @Schema(description = "开票结束时间")
     @Schema(description = "开票结束时间")
     private String settlementEndTime;
     private String settlementEndTime;
 
 

+ 10 - 0
commons/src/main/java/com/jzg/commons/entity/finance/vo/importimcome/ImportContentExt.java

@@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serial;
 import java.io.Serial;
+import java.math.BigDecimal;
 
 
 /**
 /**
  * Excel 表格字段填充后的完整数据信息
  * Excel 表格字段填充后的完整数据信息
@@ -41,6 +42,15 @@ public class ImportContentExt extends ExcelContent4Platform {
     @Schema(description = "类型")
     @Schema(description = "类型")
     private String type;
     private String type;
 
 
+    @Schema(description = "交强险手续费比例")
+    private BigDecimal jqSuperviseCostsProportion;
+
+    @Schema(description = "商业险手续费比例")
+    private BigDecimal sySuperviseCostsProportion;
+
+    @Schema(description = "驾意险手续费比例")
+    private BigDecimal jySuperviseCostsProportion;
+
     public ImportResultVo checkEmpty(){
     public ImportResultVo checkEmpty(){
         ImportResultVo vo = new ImportResultVo();
         ImportResultVo vo = new ImportResultVo();
         if(StrUtil.isEmpty(this.orderNo)){
         if(StrUtil.isEmpty(this.orderNo)){

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

@@ -36,6 +36,9 @@ public class InsFeeAudit extends BaseModel {
     @Schema(description = "审核人")
     @Schema(description = "审核人")
     private String auditUser;
     private String auditUser;
 
 
+    @Schema(description = "审核人名称")
+    private String auditUserName;
+
     @Schema(description = "租户代码")
     @Schema(description = "租户代码")
     private String systemCode;
     private String systemCode;
 
 

+ 1 - 1
consoleStatistics/src/main/resources/mapper/RiskBusinessReportMapper.xml

@@ -7,7 +7,7 @@
         SELECT o.id,o.quote_no,o.agreement_id,o.company_id,o.company_name,o.product_id,o.product_name,
         SELECT o.id,o.quote_no,o.agreement_id,o.company_id,o.company_name,o.product_id,o.product_name,
         o.order_status,o.entry_status,o.audit_status,o.real_quote_user_id,o.order_source,
         o.order_status,o.entry_status,o.audit_status,o.real_quote_user_id,o.order_source,
         o.docking_person,o.docking_person_phone,o.create_time,o.signing_time,o.parent_id,o.system_code,ioci.license_no,
         o.docking_person,o.docking_person_phone,o.create_time,o.signing_time,o.parent_id,o.system_code,ioci.license_no,
-        COALESCE(ifo.total_premium, 0) total_premium,quoteCountNum
+        COALESCE(ifo.total_premium, 0) total_premium,
         COALESCE(ifo.jq_premium, 0) jq_premium,
         COALESCE(ifo.jq_premium, 0) jq_premium,
         COALESCE(ifo.sy_premium, 0) sy_premium,
         COALESCE(ifo.sy_premium, 0) sy_premium,
         COALESCE(ifo.jy_premium, 0) jy_premium
         COALESCE(ifo.jy_premium, 0) jy_premium

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

@@ -180,7 +180,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 //            feeAuditVo.setPartnerCompanySimplyName(allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getPartnerCompanyId(),"")));
 //            feeAuditVo.setPartnerCompanySimplyName(allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getPartnerCompanyId(),"")));
             feeAuditVo.setPartnerCompanySimplyName(feeAuditVo.getPartnerCompanyName());
             feeAuditVo.setPartnerCompanySimplyName(feeAuditVo.getPartnerCompanyName());
             // auditUser 非空时,判断是名称还是手机号
             // auditUser 非空时,判断是名称还是手机号
-            feeAuditVo.setAuditUserName(userInfoService.getUserNameByMobile(feeAuditVo.getAuditUser()));
+//            feeAuditVo.setAuditUserName(userInfoService.getUserNameByMobile(feeAuditVo.getAuditUser()));
             feeAuditVo.setCreateBy(userInfoService.getUserNameByMobile(feeAuditVo.getCreateBy()));
             feeAuditVo.setCreateBy(userInfoService.getUserNameByMobile(feeAuditVo.getCreateBy()));
 
 
             // 循环每条数据,查询 ins_fee_orders 并计算权益金额
             // 循环每条数据,查询 ins_fee_orders 并计算权益金额
@@ -582,6 +582,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         audit.setIsProblem(0);
         audit.setIsProblem(0);
         // modify by lipf, 2026年5月20日10:33:03 解决缺少审核时间和审核用户的问题
         // modify by lipf, 2026年5月20日10:33:03 解决缺少审核时间和审核用户的问题
         audit.setAuditUser(userName);
         audit.setAuditUser(userName);
+        audit.setAuditUserName(userInfoService.getUserNameByMobile(audit.getAuditUser()));
         audit.setAuditTime(LocalDateTime.now());
         audit.setAuditTime(LocalDateTime.now());
         this.updateById(audit);
         this.updateById(audit);
 
 
@@ -918,6 +919,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         audit.setProblemReason(Objects.toString(problemReason,""));
         audit.setProblemReason(Objects.toString(problemReason,""));
         audit.setIsProblem(Integer.parseInt(status));
         audit.setIsProblem(Integer.parseInt(status));
         audit.setAuditUser(userName);
         audit.setAuditUser(userName);
+        audit.setAuditUserName(userInfoService.getUserNameByMobile(audit.getAuditUser()));
         audit.setAuditTime(LocalDateTime.now());
         audit.setAuditTime(LocalDateTime.now());
 
 
         // 设置疑问订单的时间
         // 设置疑问订单的时间

+ 2 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/userinfo/UserInfoServiceImpl.java

@@ -45,6 +45,8 @@ public class UserInfoServiceImpl implements UserInfoService {
                         return userName;
                         return userName;
                     }
                     }
                 }
                 }
+            }else{
+                return mobile;
             }
             }
         }
         }
         return StrUtil.EMPTY;
         return StrUtil.EMPTY;

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

@@ -9,6 +9,7 @@
         <result property="auditStatus" column="audit_status" jdbcType="VARCHAR"/>
         <result property="auditStatus" column="audit_status" jdbcType="VARCHAR"/>
         <result property="auditTime" column="audit_time" jdbcType="TIMESTAMP"/>
         <result property="auditTime" column="audit_time" jdbcType="TIMESTAMP"/>
         <result property="auditUser" column="audit_user" jdbcType="VARCHAR"/>
         <result property="auditUser" column="audit_user" jdbcType="VARCHAR"/>
+        <result property="auditUserName" column="audit_user_name" jdbcType="VARCHAR"/>
         <result property="receiveTime" column="receive_time" jdbcType="TIMESTAMP"/>
         <result property="receiveTime" column="receive_time" jdbcType="TIMESTAMP"/>
         <result property="receiveUser" column="receive_user" jdbcType="VARCHAR"/>
         <result property="receiveUser" column="receive_user" jdbcType="VARCHAR"/>
         <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
         <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
@@ -20,7 +21,7 @@
     </resultMap>
     </resultMap>
 
 
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        order_no,audit_status,audit_time,
+        order_no,audit_status,audit_time,audit_user_name,
         audit_user,receive_time,receive_user,
         audit_user,receive_time,receive_user,
         is_delete,create_time,create_by,
         is_delete,create_time,create_by,
         update_time,update_by,is_problem
         update_time,update_by,is_problem
@@ -71,6 +72,7 @@
         ioc.sum_premium as sumPremium,sd.name as deptName,ifa.create_time as createTime,
         ioc.sum_premium as sumPremium,sd.name as deptName,ifa.create_time as createTime,
         ifa.create_by as createBy,io.pay_time as payTime, ifa.audit_time as auditTime,
         ifa.create_by as createBy,io.pay_time as payTime, ifa.audit_time as auditTime,
         ifa.audit_user as auditUser,
         ifa.audit_user as auditUser,
+        ifa.audit_user_name,
         ifa.refuse,
         ifa.refuse,
         ifa.is_problem, ifa.problem_reason,
         ifa.is_problem, ifa.problem_reason,
         ifa.problem_time,
         ifa.problem_time,
@@ -224,6 +226,9 @@
             <if test="param.auditUser != null and param.auditUser != ''">
             <if test="param.auditUser != null and param.auditUser != ''">
                 and ifa.audit_user like concat('%',#{param.auditUser},'%')
                 and ifa.audit_user like concat('%',#{param.auditUser},'%')
             </if>
             </if>
+            <if test="param.auditUserName != null and param.auditUserName != ''">
+                and ifa.audit_user_name like concat('%',#{param.auditUserName},'%')
+            </if>
             <if test="param.auditStatus != null and param.auditStatus != ''">
             <if test="param.auditStatus != null and param.auditStatus != ''">
                 and ifa.audit_status = #{param.auditStatus}
                 and ifa.audit_status = #{param.auditStatus}
             </if>
             </if>
@@ -273,7 +278,7 @@
         ioc.jq_premium as jqPremium, ioc.sy_premium as syPremium, ioc.jy_premium as jyPremium,
         ioc.jq_premium as jqPremium, ioc.sy_premium as syPremium, ioc.jy_premium as jyPremium,
         ioc.sum_premium as sumPremium,sd.name as deptName,ifa.create_time as createTime,
         ioc.sum_premium as sumPremium,sd.name as deptName,ifa.create_time as createTime,
         ifa.create_by as createBy,io.pay_time as payTime, ifa.audit_time as auditTime,
         ifa.create_by as createBy,io.pay_time as payTime, ifa.audit_time as auditTime,
-        ifa.audit_user as auditUser, ifa.refuse,
+        ifa.audit_user as auditUser, ifa.refuse, ifa.audit_user_name,
         ifo.*
         ifo.*
         FROM ins_fee_audit ifa
         FROM ins_fee_audit ifa
         LEFT JOIN ins_orders io on ifa.order_no = io.id AND io.is_delete=0
         LEFT JOIN ins_orders io on ifa.order_no = io.id AND io.is_delete=0
@@ -359,6 +364,9 @@
             <if test="param.auditUser != null and param.auditUser != ''">
             <if test="param.auditUser != null and param.auditUser != ''">
                 and ifa.audit_user = #{param.auditUser}
                 and ifa.audit_user = #{param.auditUser}
             </if>
             </if>
+            <if test="param.auditUserName != null and param.auditUserName != ''">
+                and ifa.audit_user_name like concat('%',#{param.auditUserName},'%')
+            </if>
             <if test="param.auditStatus != null and param.auditStatus != ''">
             <if test="param.auditStatus != null and param.auditStatus != ''">
                 and ifa.audit_status = #{param.auditStatus}
                 and ifa.audit_status = #{param.auditStatus}
             </if>
             </if>
@@ -370,6 +378,7 @@
         select
         select
         ifa.receive_user,
         ifa.receive_user,
         ifa.audit_status,
         ifa.audit_status,
+        ifa.audit_user_name,
         ifa.problem_identify,
         ifa.problem_identify,
         count(*) as num,
         count(*) as num,
         sum(ifa.calFee) as calFee,
         sum(ifa.calFee) as calFee,
@@ -400,6 +409,7 @@
             ioci.license_no,
             ioci.license_no,
             ifa.create_time AS submitCheckTime,
             ifa.create_time AS submitCheckTime,
             ifa.audit_time AS checkTime,
             ifa.audit_time AS checkTime,
+            ifa.audit_user_name,
             CASE ifa.audit_status
             CASE ifa.audit_status
             WHEN 0 THEN '待审核'
             WHEN 0 THEN '待审核'
             WHEN 1 THEN '审核通过'
             WHEN 1 THEN '审核通过'

+ 27 - 15
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -830,25 +830,37 @@ public class ReceivableController {
 
 
     @PostMapping("receiverSettlementReport")
     @PostMapping("receiverSettlementReport")
     @Operation(summary = "对接人结算报表")
     @Operation(summary = "对接人结算报表")
-    public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {
-        Page page = settlementReportQueryVo.getPage();
-        settlementReportQueryVo.setSettlementStartTime(settlementReportQueryVo.getStartTime());
-        settlementReportQueryVo.setSettlementEndTime(settlementReportQueryVo.getEndTime());
-        if(StrUtil.isEmpty(settlementReportQueryVo.getSettlementEndTime()) && StrUtil.isEmpty(settlementReportQueryVo.getSettlementStartTime()) )  {
-            return HttpResult.ok(receivableService.receiverSettlementReport(page,settlementReportQueryVo));
+    public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo vo) {
+        Page page = vo.getPage();
+        vo.setSettlementStartTime(vo.getStartTime());
+        vo.setSettlementEndTime(vo.getEndTime());
+        if(StrUtil.isEmpty(vo.getSettlementEndTime()) && StrUtil.isEmpty(vo.getSettlementStartTime()) && StrUtil.isEmpty(vo.getReceivePaymentDateBegin()) && StrUtil.isEmpty(vo.getReceivePaymentDateEnd()))  {
+            return HttpResult.ok(receivableService.receiverSettlementReport(page,vo));
         }else{
         }else{
-            if(StrUtil.isNotEmpty(settlementReportQueryVo.getSettlementStartTime())){
-                LocalDateTime localDateTime = LocalDate.parse(settlementReportQueryVo.getSettlementStartTime()).atStartOfDay();
-                settlementReportQueryVo.setSettlementStartTime(DateUtil.formatLocalDateTime(localDateTime));
+            if(StrUtil.isNotEmpty(vo.getSettlementStartTime())){
+                LocalDateTime localDateTime = LocalDate.parse(vo.getSettlementStartTime()).atStartOfDay();
+                vo.setSettlementStartTime(DateUtil.formatLocalDateTime(localDateTime));
             }
             }
-            if(StrUtil.isNotEmpty(settlementReportQueryVo.getSettlementEndTime())){
-                LocalDateTime localDateTime = LocalDate.parse(settlementReportQueryVo.getSettlementEndTime()).plusDays(1).atStartOfDay();
-                settlementReportQueryVo.setSettlementEndTime(DateUtil.formatLocalDateTime(localDateTime));
+            if(StrUtil.isNotEmpty(vo.getSettlementEndTime())){
+                LocalDateTime localDateTime = LocalDate.parse(vo.getSettlementEndTime()).plusDays(1).atStartOfDay();
+                vo.setSettlementEndTime(DateUtil.formatLocalDateTime(localDateTime));
             }
             }
-            settlementReportQueryVo.setStartTime(null);
-            settlementReportQueryVo.setEndTime(null);
+
+
+            if(StrUtil.isNotEmpty(vo.getReceivePaymentDateBegin())){
+                LocalDateTime localDateTime = LocalDate.parse(vo.getReceivePaymentDateBegin()).atStartOfDay();
+                vo.setReceivePaymentDateBegin(DateUtil.formatLocalDateTime(localDateTime));
+            }
+            if(StrUtil.isNotEmpty(vo.getReceivePaymentDateEnd())){
+                LocalDateTime localDateTime = LocalDate.parse(vo.getReceivePaymentDateEnd()).plusDays(1).atStartOfDay();
+                vo.setReceivePaymentDateEnd(DateUtil.formatLocalDateTime(localDateTime));
+            }
+
+            vo.setStartTime(null);
+            vo.setEndTime(null);
+            // 备注一下: 对于结算时间不为空的时候,查询出来的结算状态都是已结算的数据
             // 当勾选了结算时间后,需要反着进行查询, 并且将结算金额为0的数据过滤掉
             // 当勾选了结算时间后,需要反着进行查询, 并且将结算金额为0的数据过滤掉
-            return HttpResult.ok(receivableService.receiverSettlementReportWithSettlemetnDate(page,settlementReportQueryVo));
+            return HttpResult.ok(receivableService.receiverSettlementReportWithSettlemetnDate(page,vo));
         }
         }
     }
     }
 
 

+ 178 - 51
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -622,6 +622,31 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                     return true;
                     return true;
                 };
                 };
 
 
+                // 签单月份
+                Predicate<InsPlyIncome> signMonthPredicate = insPlyIncome ->{
+                    if(!names.contains(IncomeDataVO.SearchVO.signMonth)){
+                        return true;
+                    }
+                    IncomeDataVO.SearchVO searchVO = searchVOMap.get(IncomeDataVO.SearchVO.signMonth);
+                    String type = searchVO.getType();
+                    String search = searchVO.getSearch();
+                    if("为空".equals(type)|| "不为空".equals(type)){
+                        return true;
+                    }
+                    if(StrUtil.isEmpty(search)){
+                        return true;
+                    }
+                    if("等于".equalsIgnoreCase(type) || "包含".equalsIgnoreCase(type)){
+                        List<String> signMonths = Arrays.asList(search.split(","));
+                        return signMonths.contains(insPlyIncome.getSignMonth());
+                    }
+                    if("不等于".equalsIgnoreCase(type) || "不包含".equalsIgnoreCase(type)){
+                        List<String> signMonths = Arrays.asList(search.split(","));
+                        return !signMonths.contains(insPlyIncome.getSignMonth());
+                    }
+                    return true;
+                };
+
                 // 车牌号 licenseNo
                 // 车牌号 licenseNo
                 Predicate<InsPlyIncome> licenseNoPredicate = insPlyIncome -> {
                 Predicate<InsPlyIncome> licenseNoPredicate = insPlyIncome -> {
                     if(!names.contains(IncomeDataVO.SearchVO.licenseNo)){
                     if(!names.contains(IncomeDataVO.SearchVO.licenseNo)){
@@ -727,12 +752,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 if("and".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
                 if("and".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
                     Predicate<InsPlyIncome> and = companyIdPredicate.or(companySubIdPredicate).and(signDatePredicate).
                     Predicate<InsPlyIncome> and = companyIdPredicate.or(companySubIdPredicate).and(signDatePredicate).
                             and(ptlAgreementPredicate).and(orderTypePredicate).and(signYearPredicate).and(licenseNoPredicate)
                             and(ptlAgreementPredicate).and(orderTypePredicate).and(signYearPredicate).and(licenseNoPredicate)
-                            .and(contactPredicate).and(jqPolicyNoPredicate).and(syPolicyNoPredicate).and(jyPolicyNoPredicate);
+                            .and(contactPredicate).and(jqPolicyNoPredicate).and(syPolicyNoPredicate).and(jyPolicyNoPredicate).and(signMonthPredicate);
                     filterIncomes = incomes.stream().filter(and).toList();
                     filterIncomes = incomes.stream().filter(and).toList();
                 }else if ("or".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
                 }else if ("or".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
                     Predicate<InsPlyIncome> or = companyIdPredicate.or(companySubIdPredicate).or(signDatePredicate).
                     Predicate<InsPlyIncome> or = companyIdPredicate.or(companySubIdPredicate).or(signDatePredicate).
                             or(ptlAgreementPredicate).or(orderTypePredicate).or(signYearPredicate).or(licenseNoPredicate)
                             or(ptlAgreementPredicate).or(orderTypePredicate).or(signYearPredicate).or(licenseNoPredicate)
-                            .or(contactPredicate).or(jqPolicyNoPredicate).or(syPolicyNoPredicate).or(jyPolicyNoPredicate);
+                            .or(contactPredicate).or(jqPolicyNoPredicate).or(syPolicyNoPredicate).or(jyPolicyNoPredicate).or(signMonthPredicate);
                     filterIncomes = incomes.stream().filter(or).toList();
                     filterIncomes = incomes.stream().filter(or).toList();
                 }
                 }
             }
             }
@@ -2556,8 +2581,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 errrMsg.append("该批数据的保险机构为空. ");
                 errrMsg.append("该批数据的保险机构为空. ");
             }
             }
         }
         }
-        errrMsg.append(this.validatePolicy(datas));
-        errrMsg.append(this.validateProportion(datas));
+        errrMsg.append(this.validatePolicy(datas, type));
+        errrMsg.append(this.validateProportion(datas, type));
         return errrMsg.toString();
         return errrMsg.toString();
     }
     }
 
 
@@ -2567,7 +2592,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * @author lipf
      * @author lipf
      * @date 2026/8/20 10:35
      * @date 2026/8/20 10:35
      */
      */
-    private String validatePolicy(List<ImportContentExt> datas) {
+    private String validatePolicy(List<ImportContentExt> datas, String type) {
         StringBuilder errrMsg = new StringBuilder();
         StringBuilder errrMsg = new StringBuilder();
         for (ImportContentExt data : datas) {
         for (ImportContentExt data : datas) {
             boolean all = false;
             boolean all = false;
@@ -2575,36 +2600,60 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             boolean sy = false;
             boolean sy = false;
             boolean jy = false;
             boolean jy = false;
             InsOrdersPolicy insOrdersPolicy = data.getInsOrdersPolicy();
             InsOrdersPolicy insOrdersPolicy = data.getInsOrdersPolicy();
-            if(insOrdersPolicy == null){
+            if (insOrdersPolicy == null) {
                 continue;
                 continue;
             }
             }
-            if(!Objects.equals(insOrdersPolicy.getJqPolicyNo(), data.getJqPolicyNo())){
-                all = true;
-                jq = true;
-            }
-            if(!Objects.equals(insOrdersPolicy.getSyPolicyNo(), data.getSyPolicyNo())){
-                all = true;
-                sy = true;
-            }
-            if(!Objects.equals(insOrdersPolicy.getJyPolicyNo(), data.getJyPolicyNo())){
-                all = true;
-                jy = true;
+
+            // type=20:全部校验;type=11:仅交强、商业险;type=12:仅驾意险
+            if ("20".equals(type)) {
+                // 全部校验:交强、商业、驾意
+                if (!Objects.equals(insOrdersPolicy.getJqPolicyNo(), data.getJqPolicyNo())) {
+                    all = true;
+                    jq = true;
+                }
+                if (!Objects.equals(insOrdersPolicy.getSyPolicyNo(), data.getSyPolicyNo())) {
+                    all = true;
+                    sy = true;
+                }
+                if (!Objects.equals(insOrdersPolicy.getJyPolicyNo(), data.getJyPolicyNo())) {
+                    all = true;
+                    jy = true;
+                }
+            } else if ("11".equals(type)) {
+                // 只校验交强、商业险保单号
+                if (!Objects.equals(insOrdersPolicy.getJqPolicyNo(), data.getJqPolicyNo())) {
+                    all = true;
+                    jq = true;
+                }
+                if (!Objects.equals(insOrdersPolicy.getSyPolicyNo(), data.getSyPolicyNo())) {
+                    all = true;
+                    sy = true;
+                }
+            } else if ("12".equals(type)) {
+                // 只校验驾意险保单号
+                if (!Objects.equals(insOrdersPolicy.getJyPolicyNo(), data.getJyPolicyNo())) {
+                    all = true;
+                    jy = true;
+                }
             }
             }
-            if(all){
+
+            if (all) {
                 errrMsg.append("车牌号为[").append(data.getLicenseNo()).append("]的保单号不一致: ");
                 errrMsg.append("车牌号为[").append(data.getLicenseNo()).append("]的保单号不一致: ");
-                if(jq){
+                if (jq) {
                     errrMsg.append("交强险保单号不一致. 应收数据的交强险保单号是[").append(insOrdersPolicy.getJqPolicyNo()).append("].excel维护的交强险保单号是[").append(data.getJqPolicyNo()).append("].");
                     errrMsg.append("交强险保单号不一致. 应收数据的交强险保单号是[").append(insOrdersPolicy.getJqPolicyNo()).append("].excel维护的交强险保单号是[").append(data.getJqPolicyNo()).append("].");
                 }
                 }
-                if(sy){
+                if (sy) {
                     errrMsg.append("商业险保单号不一致. 应收数据的商业险保单号是[").append(insOrdersPolicy.getSyPolicyNo()).append("].excel维护的商业险保单号是[").append(data.getSyPolicyNo()).append("].");
                     errrMsg.append("商业险保单号不一致. 应收数据的商业险保单号是[").append(insOrdersPolicy.getSyPolicyNo()).append("].excel维护的商业险保单号是[").append(data.getSyPolicyNo()).append("].");
                 }
                 }
-                if(jy){
+                if (jy) {
                     errrMsg.append("驾意险保单号不一致. 应收数据的驾意险保单号是[").append(insOrdersPolicy.getJyPolicyNo()).append("].excel维护的驾意险保单号是[").append(data.getJyPolicyNo()).append("].");
                     errrMsg.append("驾意险保单号不一致. 应收数据的驾意险保单号是[").append(insOrdersPolicy.getJyPolicyNo()).append("].excel维护的驾意险保单号是[").append(data.getJyPolicyNo()).append("].");
                 }
                 }
+                errrMsg.append(";");
             }
             }
         }
         }
         return errrMsg.toString();
         return errrMsg.toString();
     }
     }
+
     /**
     /**
      * 校验应收比例
      * 校验应收比例
      *
      *
@@ -2612,7 +2661,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * @author lipf
      * @author lipf
      * @date 2026/8/20 10:27
      * @date 2026/8/20 10:27
      */
      */
-    private static String validateProportion(List<ImportContentExt> datas) {
+    private String validateProportion(List<ImportContentExt> datas, String type) {
         StringBuilder errrMsg = new StringBuilder();
         StringBuilder errrMsg = new StringBuilder();
         for (ImportContentExt data : datas) {
         for (ImportContentExt data : datas) {
             boolean all = false;
             boolean all = false;
@@ -2620,45 +2669,113 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             boolean sy = false;
             boolean sy = false;
             boolean jy = false;
             boolean jy = false;
             InsPlyIncome insPlyIncome = data.getInsPlyIncome();
             InsPlyIncome insPlyIncome = data.getInsPlyIncome();
-            if(insPlyIncome == null){
+            if (insPlyIncome == null) {
                 continue;
                 continue;
             }
             }
-            String jqadd = BigDecimalUtil.add(insPlyIncome.getJqSuperviseCostsProportion(), insPlyIncome.getJqOtherCostsProportion());
-            BigDecimal jqsubtract = BigDecimalUtil.subtract(new BigDecimal(jqadd), new BigDecimal(data.getJqInletRatio()));
-            if(BigDecimal.ZERO.compareTo(jqsubtract) != 0){
-                all = true;
-                jq = true;
-            }
-            String syadd = BigDecimalUtil.add(insPlyIncome.getSySuperviseCostsProportion(), insPlyIncome.getSyOtherCostsProportion());
-            BigDecimal sysubtract = BigDecimalUtil.subtract(new BigDecimal(syadd), new BigDecimal(data.getSyInletRatio()));
-            if(BigDecimal.ZERO.compareTo(sysubtract) != 0){
-                all = true;
-                sy = true;
-            }
-            String jyadd = BigDecimalUtil.add(insPlyIncome.getJySuperviseCostsProportion(), insPlyIncome.getJyOtherCostsProportion());
-            BigDecimal jysubtract = BigDecimalUtil.subtract(new BigDecimal(jyadd), new BigDecimal(data.getJyInletRatio()));
-            if(BigDecimal.ZERO.compareTo(jysubtract) != 0){
-                all = true;
-                jy = true;
-            }
 
 
-            if(all){
-                errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
-                if(jq){
-                    errrMsg.append("交强险入口比例异常. 应收数据的交强险入口比例是[").append(jqadd).append("].excel维护的交强险入口比例是[").append(data.getJqInletRatio()).append("].");
+            if ("20".equals(type)) {
+                // 平台协议校验比例
+                String jqadd = BigDecimalUtil.add(insPlyIncome.getJqSuperviseCostsProportion(), insPlyIncome.getJqOtherCostsProportion());
+                String jqInletRatioStr = data.getJqInletRatio();
+                if (jqadd == null || jqInletRatioStr == null) {
+                    all = true;
+                    jq = true;
+                } else {
+                    BigDecimal jqsubtract = BigDecimalUtil.subtract(new BigDecimal(jqadd), new BigDecimal(jqInletRatioStr));
+                    if (BigDecimal.ZERO.compareTo(jqsubtract) != 0) {
+                        all = true;
+                        jq = true;
+                    }
+                }
+
+                String syadd = BigDecimalUtil.add(insPlyIncome.getSySuperviseCostsProportion(), insPlyIncome.getSyOtherCostsProportion());
+                String syInletRatioStr = data.getSyInletRatio();
+                if (syadd == null || syInletRatioStr == null) {
+                    all = true;
+                    sy = true;
+                } else {
+                    BigDecimal sysubtract = BigDecimalUtil.subtract(new BigDecimal(syadd), new BigDecimal(syInletRatioStr));
+                    if (BigDecimal.ZERO.compareTo(sysubtract) != 0) {
+                        all = true;
+                        sy = true;
+                    }
+                }
+
+                String jyadd = BigDecimalUtil.add(insPlyIncome.getJySuperviseCostsProportion(), insPlyIncome.getJyOtherCostsProportion());
+                String jyInletRatioStr = data.getJyInletRatio();
+                if (jyadd == null || jyInletRatioStr == null) {
+                    all = true;
+                    jy = true;
+                } else {
+                    BigDecimal jysubtract = BigDecimalUtil.subtract(new BigDecimal(jyadd), new BigDecimal(jyInletRatioStr));
+                    if (BigDecimal.ZERO.compareTo(jysubtract) != 0) {
+                        all = true;
+                        jy = true;
+                    }
+                }
+
+                if (all) {
+                    errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
+                    if (jq) {
+                        errrMsg.append("交强险入口比例异常. 应收数据的交强险入口比例是[").append(jqadd).append("].excel维护的交强险入口比例是[").append(jqInletRatioStr).append("].");
+                    }
+                    if (sy) {
+                        errrMsg.append("商业险入口比例异常.应收数据的商业险入口比例是[").append(syadd).append("].excel维护的商业险入口比例是[").append(syInletRatioStr).append("].");
+                    }
+                    if (jy) {
+                        errrMsg.append("驾意险入口比例异常.应收数据的驾意险入口比例是[").append(jyadd).append("].excel维护的驾意险入口比例是[").append(jyInletRatioStr).append("].");
+                    }
+                    errrMsg.append(";");
+                }
+            } else if ("11".equals(type)) {
+                // 私有协议校验比例
+                String jqDb = insPlyIncome.getJqSuperviseCostsProportion();
+                BigDecimal jqExcel = data.getJqSuperviseCostsProportion();
+                // compareTo判等,同时判空
+                if (!(StrUtil.isNotBlank(jqDb) && jqExcel != null && BigDecimalUtil.valueOf(jqDb).compareTo(jqExcel) == 0)) {
+                    all = true;
+                    jq = true;
+                }
+
+                String syDb = insPlyIncome.getSySuperviseCostsProportion();
+                BigDecimal syExcel = data.getSySuperviseCostsProportion();
+                if (!(StrUtil.isNotBlank(syDb) && syExcel != null && BigDecimalUtil.valueOf(syDb).compareTo(syExcel) == 0)) {
+                    all = true;
+                    sy = true;
+                }
+
+                if (all) {
+                    errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
+                    if (jq) {
+                        errrMsg.append("交强险手续费比例异常. 应收数据的交强险手续费比例是[").append(jqDb).append("].excel维护的交强险手续费比例是[").append(jqExcel).append("].");
+                    }
+                    if (sy) {
+                        errrMsg.append("商业险手续费比例异常.应收数据的商业险手续费比例是[").append(syDb).append("].excel维护的商业险手续费比例是[").append(syExcel).append("].");
+                    }
+                    errrMsg.append(";");
                 }
                 }
-                if(sy){
-                    errrMsg.append("商业险入口比例异常.应收数据的商业险入口比例是[").append(syadd).append("].excel维护的商业险入口比例是[").append(data.getSyInletRatio()).append("].");
+            } else if ("12".equals(type)) {
+                // 非车私有协议校验比例
+                String jyDb = insPlyIncome.getJySuperviseCostsProportion();
+                BigDecimal jyExcel = data.getJySuperviseCostsProportion();
+                if (!(StrUtil.isNotBlank(jyDb) && jyExcel != null && BigDecimalUtil.valueOf(jyDb).compareTo(jyExcel) == 0)) {
+                    all = true;
+                    jy = true;
                 }
                 }
-                if(jy){
-                    errrMsg.append("驾意险入口比例异常.应收数据的驾意险入口比例是[").append(jyadd).append("].excel维护的驾意险入口比例是[").append(data.getJyInletRatio()).append("].");
+
+                if (all) {
+                    errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
+                    if (jy) {
+                        errrMsg.append("驾意险手续费比例异常. 应收数据的驾意险手续费比例是[").append(jyDb).append("].excel维护的驾意险手续费比例是[").append(jyExcel).append("].");
+                    }
+                    errrMsg.append(";");
                 }
                 }
             }
             }
         }
         }
-
         return errrMsg.toString();
         return errrMsg.toString();
     }
     }
 
 
+
     /**
     /**
      * 解析Excel内容并填充缺失的字段
      * 解析Excel内容并填充缺失的字段
      *
      *
@@ -6107,8 +6224,18 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                              Function<CompanySuperviseSettlementReportDto, String> getter) {
                              Function<CompanySuperviseSettlementReportDto, String> getter) {
         return list.stream()
         return list.stream()
                 .map(getter)
                 .map(getter)
+                // 自定义安全转换,失败返回null
+                .map(val -> {
+                    if (!StrUtil.isNotBlank(val)) {
+                        return null;
+                    }
+                    try {
+                        return new BigDecimal(val.trim());
+                    } catch (NumberFormatException e) {
+                        return null;
+                    }
+                })
                 .filter(Objects::nonNull)
                 .filter(Objects::nonNull)
-                .map(BigDecimal::new)
                 .reduce(BigDecimal.ZERO, BigDecimal::add)
                 .reduce(BigDecimal.ZERO, BigDecimal::add)
                 .toString();
                 .toString();
     }
     }

+ 3 - 3
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoServiceImpl.java

@@ -54,10 +54,10 @@ public class SysUserJzgInfoServiceImpl extends ServiceImpl<SysUserJzgInfoMapper,
     @Override
     @Override
     public SysUserJzgInfo getByUserIdOrId(String id) {
     public SysUserJzgInfo getByUserIdOrId(String id) {
         return baseMapper.selectOne(new LambdaQueryWrapper<SysUserJzgInfo>()
         return baseMapper.selectOne(new LambdaQueryWrapper<SysUserJzgInfo>()
-                .eq(SysUserJzgInfo::getUserId,id)
                 .eq(SysUserJzgInfo::getIsDelete,0)
                 .eq(SysUserJzgInfo::getIsDelete,0)
-                .or()
-                .eq(SysUserJzgInfo::getId,id));
+                .and(wrapper -> wrapper.eq(SysUserJzgInfo::getUserId,id).or().eq(SysUserJzgInfo::getId,id))
+                .last("LIMIT 1")
+        );
     }
     }
 
 
     @Override
     @Override

+ 15 - 15
tenant/organization/src/main/java/com/jzg/organization/utils/IncomeInvoiceLinkUtil.java

@@ -145,7 +145,6 @@ public class IncomeInvoiceLinkUtil {
             InsPlyIncomeInvoiceMapper incomeInvoiceMapper,
             InsPlyIncomeInvoiceMapper incomeInvoiceMapper,
             InsPlyIncomeInvoiceSettlementMapper invoiceSettlementMapper
             InsPlyIncomeInvoiceSettlementMapper invoiceSettlementMapper
     ) {
     ) {
-
         String status = queryVo.getStatus();
         String status = queryVo.getStatus();
         String invoiceStartTime = queryVo.getInvoiceStartTime();
         String invoiceStartTime = queryVo.getInvoiceStartTime();
         String invoiceEndTime = queryVo.getInvoiceEndTime();
         String invoiceEndTime = queryVo.getInvoiceEndTime();
@@ -167,7 +166,7 @@ public class IncomeInvoiceLinkUtil {
                 .toList();
                 .toList();
 
 
         LambdaQueryWrapper<InsPlyIncomeInvoiceLink> linkWrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<InsPlyIncomeInvoiceLink> linkWrapper = new LambdaQueryWrapper<>();
-        linkWrapper.in(InsPlyIncomeInvoiceLink::getIncomeId, incomeIds);
+        linkWrapper.in(CollUtil.isNotEmpty(incomeIds), InsPlyIncomeInvoiceLink::getIncomeId, incomeIds);
         List<InsPlyIncomeInvoiceLink> linkList = incomeInvoiceLinkMapper.selectList(linkWrapper);
         List<InsPlyIncomeInvoiceLink> linkList = incomeInvoiceLinkMapper.selectList(linkWrapper);
         if (CollUtil.isEmpty(linkList)) {
         if (CollUtil.isEmpty(linkList)) {
             return new ArrayList<>(0);
             return new ArrayList<>(0);
@@ -182,20 +181,20 @@ public class IncomeInvoiceLinkUtil {
 
 
         // 查询发票
         // 查询发票
         LambdaQueryWrapper<InsPlyIncomeInvoice> invoiceWrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<InsPlyIncomeInvoice> invoiceWrapper = new LambdaQueryWrapper<>();
-        invoiceWrapper.in(InsPlyIncomeInvoice::getId, linkInvoiceIds);
-        if (StrUtil.isNotBlank(status)) {
-            invoiceWrapper.eq(InsPlyIncomeInvoice::getStatus, status);
-        }
+        invoiceWrapper.in(CollUtil.isNotEmpty(linkInvoiceIds), InsPlyIncomeInvoice::getId, linkInvoiceIds);
+        invoiceWrapper.eq(StrUtil.isNotBlank(status), InsPlyIncomeInvoice::getStatus, status);
+
         boolean invoiceTimeCond = StrUtil.isNotBlank(invoiceStartTime) && StrUtil.isNotBlank(invoiceEndTime);
         boolean invoiceTimeCond = StrUtil.isNotBlank(invoiceStartTime) && StrUtil.isNotBlank(invoiceEndTime);
-        if (invoiceTimeCond) {
-            invoiceWrapper.between(InsPlyIncomeInvoice::getInvoiceTime,
-                    toStartDateTime(invoiceStartTime),
-                    toEndDateTime(invoiceEndTime));
-        }
-        invoiceWrapper.eq(InsPlyIncomeInvoice::getInvoiceType, queryVo.getInvoiceType());
+        invoiceWrapper.between(invoiceTimeCond, InsPlyIncomeInvoice::getInvoiceTime,
+                toStartDateTime(invoiceStartTime),
+                toEndDateTime(invoiceEndTime));
+
+        invoiceWrapper.eq(StrUtil.isNotBlank(queryVo.getInvoiceType()),
+                InsPlyIncomeInvoice::getInvoiceType, queryVo.getInvoiceType());
+
         List<InsPlyIncomeInvoice> invoiceList = incomeInvoiceMapper.selectList(invoiceWrapper);
         List<InsPlyIncomeInvoice> invoiceList = incomeInvoiceMapper.selectList(invoiceWrapper);
 
 
-        if ((StrUtil.isNotBlank(status) || invoiceTimeCond) && CollUtil.isEmpty(invoiceList)) {
+        if (CollUtil.isEmpty(invoiceList)) {
             return new ArrayList<>(0);
             return new ArrayList<>(0);
         }
         }
 
 
@@ -207,8 +206,8 @@ public class IncomeInvoiceLinkUtil {
                     .collect(Collectors.toSet());
                     .collect(Collectors.toSet());
 
 
             LambdaQueryWrapper<InsPlyIncomeInvoiceSettlement> settleWrapper = new LambdaQueryWrapper<>();
             LambdaQueryWrapper<InsPlyIncomeInvoiceSettlement> settleWrapper = new LambdaQueryWrapper<>();
-            settleWrapper.in(InsPlyIncomeInvoiceSettlement::getInvoiceId, invoiceIdSet);
-            settleWrapper.between(InsPlyIncomeInvoiceSettlement::getCreateTime,
+            settleWrapper.in(CollUtil.isNotEmpty(invoiceIdSet), InsPlyIncomeInvoiceSettlement::getInvoiceId, invoiceIdSet);
+            settleWrapper.between(true, InsPlyIncomeInvoiceSettlement::getCreateTime,
                     toStartDateTime(settleStartTime),
                     toStartDateTime(settleStartTime),
                     toEndDateTime(settleEndTime));
                     toEndDateTime(settleEndTime));
 
 
@@ -247,6 +246,7 @@ public class IncomeInvoiceLinkUtil {
     }
     }
 
 
 
 
+
     /**
     /**
      * 结算状态内存过滤(无接口,函数式getter)
      * 结算状态内存过滤(无接口,函数式getter)
      * 0-已开票未结清 1-已结清 2-未开票
      * 0-已开票未结清 1-已结清 2-未开票

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

@@ -33,7 +33,13 @@
         ipiis.invoice_id = ipii.id
         ipiis.invoice_id = ipii.id
         <where>
         <where>
             ipii.invoice_type in (5, 6)
             ipii.invoice_type in (5, 6)
-            and ipiis.create_time &gt;= #{vo.settlementStartTime} and ipiis.create_time &lt;= #{vo.settlementEndTime}
+            and ipiis.is_delete = 0
+            <if test="vo.settlementStartTime!= null">
+                and ipiis.create_time &gt;= #{vo.settlementStartTime} and ipiis.create_time &lt; #{vo.settlementEndTime}
+            </if>
+            <if test="vo.receivePaymentDateBegin != null">
+                and ipiis.receive_payment_date &gt;= #{vo.receivePaymentDateBegin} and ipiis.receive_payment_date &lt; #{vo.receivePaymentDateEnd}
+            </if>
             <if test="vo.contactPerson != null and vo.contactPerson != ''">
             <if test="vo.contactPerson != null and vo.contactPerson != ''">
                 and ipii.contact_person = #{vo.contactPerson}
                 and ipii.contact_person = #{vo.contactPerson}
             </if>
             </if>

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

@@ -210,6 +210,7 @@
         io.signing_time,
         io.signing_time,
         date(io.signing_time ) as sign_date,
         date(io.signing_time ) as sign_date,
         year(io.signing_time) as sign_year,
         year(io.signing_time) as sign_year,
+        DATE_FORMAT(io.signing_time,'%Y-%m') AS sign_month,
         ipi.id,
         ipi.id,
         io.id as 'orderNo',
         io.id as 'orderNo',
         eic.name_simple as companyName,
         eic.name_simple as companyName,
@@ -675,10 +676,10 @@
                 AND ipiis.id = #{settlementQueryVo.settlementId}
                 AND ipiis.id = #{settlementQueryVo.settlementId}
             </if>
             </if>
             <if test="settlementQueryVo.settlementDateStart != null and settlementQueryVo.settlementDateStart != ''">
             <if test="settlementQueryVo.settlementDateStart != null and settlementQueryVo.settlementDateStart != ''">
-                AND ipiis.create_time >= date(#{settlementQueryVo.settlementDateStart})
+                AND ipiis.create_time &gt;= #{settlementQueryVo.settlementDateStart}
             </if>
             </if>
-            <if test="settlementQueryVo.settlementDateEndStr != null and settlementQueryVo.settlementDateEndStr != ''">
-                AND ipiis.create_time &lt;= date(#{settlementQueryVo.settlementDateEndStr})
+            <if test="settlementQueryVo.settlementDateEnd != null and settlementQueryVo.settlementDateEnd != ''">
+                AND ipiis.create_time &lt; DATE_ADD(#{settlementQueryVo.settlementDateEnd}, INTERVAL 1 DAY)
             </if>
             </if>
         </where>
         </where>
         group by
         group by
@@ -1978,6 +1979,16 @@
             <if test="settlementReportQueryVo.companyId != null and settlementReportQueryVo.companyId != ''">
             <if test="settlementReportQueryVo.companyId != null and settlementReportQueryVo.companyId != ''">
                 AND ipi.company_id = #{settlementReportQueryVo.companyId}
                 AND ipi.company_id = #{settlementReportQueryVo.companyId}
             </if>
             </if>
+            <if test="settlementReportQueryVo.settlementStatus != null ">
+                <choose >
+                    <when test=" 1 == settlementReportQueryVo.settlementStatus">
+                        and ipi.settlement_status = 1
+                    </when>
+                    <otherwise>
+                        and ipi.settlement_status != 1
+                    </otherwise>
+                </choose>
+            </if>
             <if test="settlementReportQueryVo.receiver != null and settlementReportQueryVo.receiver != ''">
             <if test="settlementReportQueryVo.receiver != null and settlementReportQueryVo.receiver != ''">
                 AND ipi.contact_person = #{settlementReportQueryVo.receiver}
                 AND ipi.contact_person = #{settlementReportQueryVo.receiver}
             </if>
             </if>