Преглед изворни кода

Merge remote-tracking branch 'origin/dev_jzg_lipf_v20260518'

jiakai пре 4 месеци
родитељ
комит
d1cca3fec2
30 измењених фајлова са 521 додато и 151 уклоњено
  1. 6 0
      commons/src/main/java/com/jzg/commons/entity/finance/dto/ReceiverSettlementReportDto.java
  2. 27 0
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeOrder.java
  3. 29 0
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeVO.java
  4. 1 2
      commons/src/main/java/com/jzg/commons/entity/finance/vo/ReceivableQueryVo.java
  5. 3 0
      commons/src/main/java/com/jzg/commons/entity/vo/AgreementRulesVo.java
  6. 13 0
      platform/src/main/java/com/jzg/controller/EsmInsCompanyController.java
  7. 10 1
      platform/src/main/java/com/jzg/service/EsmInsCompanyService.java
  8. 20 0
      platform/src/main/java/com/jzg/service/impl/EsmInsCompanyServiceImpl.java
  9. 2 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeAuditController.java
  10. 27 25
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java
  11. 11 1
      tenant/organization/src/main/java/com/jzg/organization/client/EsmInsCompanyClient.java
  12. 1 1
      tenant/organization/src/main/java/com/jzg/organization/controller/AgreementRulesController.java
  13. 7 0
      tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java
  14. 1 1
      tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementCostController.java
  15. 26 17
      tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java
  16. 2 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/ReceivableMapper.java
  17. 8 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/SysAmountAuditingMapper.java
  18. 9 2
      tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementCostService.java
  19. 7 5
      tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementUndwrtRulesService.java
  20. 15 0
      tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java
  21. 7 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java
  22. 10 1
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostServiceImpl.java
  23. 8 3
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesServiceImpl.java
  24. 130 85
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  25. 6 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java
  26. 5 2
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoBankCardServiceImpl.java
  27. 3 0
      tenant/organization/src/main/resources/application.yml
  28. 1 0
      tenant/organization/src/main/resources/mapper/PtlAgreementCostMapper.xml
  29. 86 3
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml
  30. 40 1
      tenant/organization/src/main/resources/mapper/SysAmountAuditingMapper.xml

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/finance/dto/ReceiverSettlementReportDto.java

@@ -16,6 +16,12 @@ public class ReceiverSettlementReportDto {
     @Schema(description = "保险公司")
     private String companyName;
 
+    @Schema(description = "保险公司id")
+    private String companyId;
+
+    @Schema(description = "保险公司名称及父级的名称")
+    private String companyALlName;
+
     @Schema(description = "应收总计")
     private String totalReceivable;
 

+ 27 - 0
commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeOrder.java

@@ -0,0 +1,27 @@
+package com.jzg.commons.entity.finance.po;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+public class InsPlyIncomeOrder implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 5155333518962790214L;
+    /**
+     * 序号
+     */
+    private String id;
+
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+
+    public InsPlyIncomeOrder(String id, String orderNo) {
+        this.id = id;
+        this.orderNo = orderNo;
+    }
+}

+ 29 - 0
commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeVO.java

@@ -0,0 +1,29 @@
+package com.jzg.commons.entity.finance.po;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class InsPlyIncomeVO implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -3412493517813402683L;
+    private Page insPlyIncomePage;
+
+    /**
+     * 未分页的满足条件的所有数据集的id和订单编号
+     *
+     * @date 2026/5/23 9:50
+     */
+    private List<InsPlyIncomeOrder> insPlyIncomeOrders;
+
+    public InsPlyIncomeVO(Page insPlyIncomePage, List<InsPlyIncomeOrder> insPlyIncomeOrders){
+        this.insPlyIncomePage = insPlyIncomePage;
+        this.insPlyIncomeOrders = insPlyIncomeOrders;
+    }
+
+}

+ 1 - 2
commons/src/main/java/com/jzg/commons/entity/finance/vo/ReceivableQueryVo.java

@@ -10,9 +10,8 @@ import java.util.List;
 /**
  * @author tz
  * @description 应收查询VO
- * @createDate 2024-06-26 10:49:31
+ * @date 2024-06-26 10:49:31
  */
-
 @Data
 public class ReceivableQueryVo extends PageRequest {
 

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/vo/AgreementRulesVo.java

@@ -5,12 +5,15 @@ import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.io.Serial;
 import java.util.List;
 
 @Schema(description = "协议规则列表VO")
 @Data
 public class AgreementRulesVo extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = -5729790602450150534L;
     /** 主键 */
     @Schema(description = "主键")
     private String id;

+ 13 - 0
platform/src/main/java/com/jzg/controller/EsmInsCompanyController.java

@@ -465,4 +465,17 @@ public class EsmInsCompanyController extends BaseController {
     public Map<String, String> getAllCompanyHierarchyPaths(){
         return esmInsCompanyService.getAllCompanyHierarchyPaths();
     }
+
+    /**
+     * 获取所有保险公司的对应关系
+     *
+     * @return HttpResult<Map<String,EsmInsCompany>> key是保险公司id, value是保险公司对象实体
+     * @author lipf
+     * @date 2026年5月23日09:06:47
+     */
+    @Operation(summary = "获取所有保险公司的对应关系")
+    @GetMapping("queryAllCompanyMap")
+    public HttpResult<Map<String,EsmInsCompany>> queryAllCompanyMap(){
+        return HttpResult.ok(esmInsCompanyService.queryAllCompanyMap());
+    }
 }

+ 10 - 1
platform/src/main/java/com/jzg/service/EsmInsCompanyService.java

@@ -151,7 +151,16 @@ public interface EsmInsCompanyService extends IService<EsmInsCompany> {
      * Key: 公司ID
      * Value: 总公司/分公司/支公司
      */
-    public Map<String, String> getAllCompanyHierarchyPaths();
+    Map<String, String> getAllCompanyHierarchyPaths();
+
+    /**
+     * 获取所有保险公司的全路径名称
+     *
+     * @return Map<String,EsmInsCompany> value 表示保险公司信息
+     * @author lipf
+     * @date 2026/5/23 9:12
+     */
+    Map<String,EsmInsCompany> queryAllCompanyMap();
 }
 
 

+ 20 - 0
platform/src/main/java/com/jzg/service/impl/EsmInsCompanyServiceImpl.java

@@ -1,6 +1,7 @@
 package com.jzg.service.impl;
 
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -387,6 +388,25 @@ public class EsmInsCompanyServiceImpl extends ServiceImpl<EsmInsCompanyMapper, E
         return pathCache;
     }
 
+    /**
+     * 获取所有保险公司的全路径名称
+     *
+     * @return Map<String,EsmInsCompany> value 表示保险公司信息
+     * @author lipf
+     * @date 2026/5/23 9:12
+     */
+    @Override
+    public Map<String,EsmInsCompany> queryAllCompanyMap(){
+        // 1. 查询所有未删除的保险公司(一次性加载,避免循环查库)
+        List<EsmInsCompany> allCompanies = baseMapper.selectList(null);
+        allCompanies = allCompanies.stream().filter(action->action.getIsDelete()==0).toList();
+        // 2. 将列表转换为 Map,以便通过 ID 快速查找对象 (ID -> Company Object)
+        Map<String, EsmInsCompany> companyMap = allCompanies.stream()
+                .collect(Collectors.toMap(EsmInsCompany::getId, c -> c));
+        log.debug("查询出[{}]个有效的保险公司", CollUtil.size(allCompanies));
+        return companyMap;
+    }
+
     /**
      * 递归构建单个公司的路径(带缓存优化,防止重复计算)
      */

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

@@ -81,7 +81,8 @@ public class InsFeeAuditController {
 
     /**
      * 领取待审核订单
-     * @return
+     *
+     * @return HttpResult<String> 领取结果。可能成功,可能被限额
      */
     @PostMapping("/auditReceive")
     @Operation(summary = "领取审核订单")

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

@@ -253,32 +253,34 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
                 AssertionUtils.isFail(true, "订单审核驳回,刷新订单列表");
             }
         // 未审核
+        }
+        String userName = baseController.getUserName();
+        if(StringUtils.isNotBlank(audit.getReceiveUser())){
+            if(userName.equals(audit.getReceiveUser())){
+                // redis 锁定按钮
+                RBucket<Object> bucket = redissonClient.getBucket(ORDER_LOCK_PREFIX + orderNo);
+                bucket.set(1, 30, TimeUnit.MINUTES);
+            }else{
+                AssertionUtils.isFail(true, "订单已被" + audit.getReceiveUser() + "领取!");
+            }
         }else{
-            String userName = baseController.getUserName();
-            if(StringUtils.isNotBlank(audit.getReceiveUser())){
-                if(userName.equals(audit.getReceiveUser())){
-                    // redis 锁定按钮
-                    RBucket<Object> bucket = redissonClient.getBucket(ORDER_LOCK_PREFIX + orderNo);
-                    bucket.set(1, 30, TimeUnit.MINUTES);
-                }else{
-                    AssertionUtils.isFail(true, "订单已被" + audit.getReceiveUser() + "领取!");
-                }
+            int countLimit = 10;
+            LambdaQueryWrapper<InsFeeAudit> wrapper = new LambdaQueryWrapper<>();
+            // modify by lipf 2026年5月23日10:15:32 判断是领取限制,需要添加一个未审核的状态
+            wrapper.eq(InsFeeAudit::getAuditStatus,0);
+            wrapper.like(InsFeeAudit::getReceiveUser, userName);
+            long count = this.count(wrapper);
+            if(count >= countLimit){
+                AssertionUtils.isFail(true, "超出"+countLimit+"次领取限制,请先审核后再领取订单!");
             }else{
-                LambdaQueryWrapper<InsFeeAudit> wrapper = new LambdaQueryWrapper<>();
-                wrapper.like(InsFeeAudit::getReceiveUser, userName);
-                long count = this.count(wrapper);
-                if(count >= 10){
-                    AssertionUtils.isFail(true, "超出10次领取限制,请先审核后再领取订单!");
-                }else{
-                    // 领取订单
-                    audit.setReceiveUser(userName);
-                    audit.setReceiveTime(LocalDateTime.now());
-                    this.updateById(audit);
-
-                    // redis 锁定按钮
-                    RBucket<Object> bucket = redissonClient.getBucket(ORDER_LOCK_PREFIX + orderNo);
-                    bucket.set(1, 30, TimeUnit.MINUTES);
-                }
+                // 领取订单
+                audit.setReceiveUser(userName);
+                audit.setReceiveTime(LocalDateTime.now());
+                this.updateById(audit);
+
+                // redis 锁定按钮
+                RBucket<Object> bucket = redissonClient.getBucket(ORDER_LOCK_PREFIX + orderNo);
+                bucket.set(1, 30, TimeUnit.MINUTES);
             }
         }
     }
@@ -322,7 +324,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         InsOrdersPdfUrl pdfUrl = ordersPdfUrlService.getById(orderNo);
         AssertionUtils.isFail(Objects.isNull(pdfUrl), "未生成电子保单!");
         String url = null;
-        Integer type = 0;
+        int type = 0;
         if(StringUtils.isNotBlank(pdfUrl.getJqUrl())){
             url = pdfUrl.getJqUrl();
             type = 1;

+ 11 - 1
tenant/organization/src/main/java/com/jzg/organization/client/EsmInsCompanyClient.java

@@ -21,7 +21,17 @@ public interface EsmInsCompanyClient {
      * Value: 总公司/分公司/支公司
      */
     @GetMapping("esmInsCompany/getAllCompanyHierarchyPaths")
-    public Map<String, String> getAllCompanyHierarchyPaths();
+    Map<String, String> getAllCompanyHierarchyPaths();
+
+    /**
+     * 获取所有保险公司的对应关系
+     *
+     * @return HttpResult<Map<String,EsmInsCompany>> key是保险公司id, value是保险公司对象实体
+     * @author lipf
+     * @date 2026年5月23日09:06:47
+     */
+    @GetMapping("esmInsCompany/queryAllCompanyMap")
+    HttpResult<Map<String,EsmInsCompany>> queryAllCompanyMap();
 
     /**
      * 根据id获取保险公司信息

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

@@ -28,7 +28,7 @@ public class AgreementRulesController extends BaseController {
 
     @GetMapping("/rulesList")
     @Operation(summary = "协议承保规则列表")
-    public HttpResult rulesList(String agreementId){
+    public HttpResult<List<AgreementRulesVo>> rulesList(String agreementId){
         List<AgreementRulesVo> rulesVos = agreementRulesService.queryList(agreementId);
         return HttpResult.ok(rulesVos);
     }

+ 7 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java

@@ -113,6 +113,13 @@ public class AmountAuditingController extends BaseController {
         return HttpResult.ok(amountAuditVoPage);
     }
 
+    @PostMapping("/myPaymentTotalWithdrawalAmount")
+    @Operation(summary = "我的付款提现金额总计")
+    public HttpResult<String> myPaymentTotalWithdrawalAmount(@RequestBody AmountAuditParam param){
+        BigDecimal b = sysAmountAuditingService.myPaymentTotalWithdrawalAmount(param);
+        return HttpResult.ok(b.toString());
+    }
+
     @PostMapping("/applyWithdraw")
     @Operation(summary = "申请提现")
     public HttpResult applyWithdraw(@RequestBody ApplyWithdrawParam applyWithdrawParam){

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

@@ -58,7 +58,7 @@ public class PtlAgreementCostController {
 
     @Operation(summary = "协议费用管理查询")
     @GetMapping("queryById")
-    public HttpResult queryById(@NotNull(message = "id不能为空") Long id){
+    public HttpResult<PtlAgreementCostVo> queryById(@NotNull(message = "id不能为空") Long id){
         return ptlAgreementCostService.queryById(id);
     }
 

+ 26 - 17
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -6,8 +6,11 @@ import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.finance.dto.CompanySuperviseSettlementReportDto;
 import com.jzg.commons.entity.finance.dto.ExportSuperviseSettlementExcelDto;
+import com.jzg.commons.entity.finance.dto.ReceiverSettlementReportDto;
 import com.jzg.commons.entity.finance.po.InsPlyIncome;
 import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
+import com.jzg.commons.entity.finance.po.InsPlyIncomeOrder;
+import com.jzg.commons.entity.finance.po.InsPlyIncomeVO;
 import com.jzg.commons.entity.finance.vo.*;
 import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.request.RequestSingleParam;
@@ -58,7 +61,7 @@ public class ReceivableController {
     @PostMapping("getUnauditedOrder")
     @Operation(summary = "获取未审核的订单")
     public HttpResult getUnauditedOrder(@RequestBody ReceivableQueryVo receivableQueryVo){
-        if (Objects.isNull(receivableQueryVo.getAgreementType()) || receivableQueryVo.getAgreementType().equals("")) {
+        if (Objects.isNull(receivableQueryVo.getAgreementType()) || receivableQueryVo.getAgreementType().isEmpty()) {
             receivableQueryVo.setAgreementType("1");
         }
         InsPlyIncome auditedOrder  = receivableService.getUnauditedOrder(receivableQueryVo);
@@ -78,7 +81,7 @@ public class ReceivableController {
 
     @PostMapping("getCommissionReceivableList")
     @Operation(summary = "获取私有协议手续费列表")
-    public HttpResult<Page<InsPlyIncome>> getCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
+    public HttpResult<InsPlyIncomeVO> getCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
         if (StrUtil.isBlank(receivableQueryVo.getQueryType())){
             receivableQueryVo.setQueryType("2");
         }
@@ -86,7 +89,10 @@ public class ReceivableController {
         if (StrUtil.isBlank(receivableQueryVo.getAgreementType())){
             receivableQueryVo.setAgreementType("2");
         }
-        return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        HttpResult<Page<InsPlyIncome>> ok = HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        Page<InsPlyIncome> data = ok.getData();
+        List<InsPlyIncomeOrder> receivablePageIds = receivableService.getReceivablePageIds(receivableQueryVo);
+        return HttpResult.ok(new InsPlyIncomeVO(data, receivablePageIds));
     }
 
     /**
@@ -103,26 +109,36 @@ public class ReceivableController {
 
     @PostMapping("getOtherReceivableList")
     @Operation(summary = "获取私有协议跟单费列表")
-    public HttpResult getOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
+    public HttpResult<InsPlyIncomeVO> getOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
         receivableQueryVo.setQueryType("2");
         receivableQueryVo.setAgreementType("2");
-        return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        //return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        HttpResult<Page<InsPlyIncome>> ok = HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        Page<InsPlyIncome> data = ok.getData();
+        List<InsPlyIncomeOrder> receivablePageIds = receivableService.getReceivablePageIds(receivableQueryVo);
+        return HttpResult.ok(new InsPlyIncomeVO(data, receivablePageIds));
     }
 
     @PostMapping("getJyCommissionReceivableList")
     @Operation(summary = "获取私有协议驾意险手续费列表")
-    public HttpResult getJyCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
+    public HttpResult<InsPlyIncomeVO> getJyCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
         receivableQueryVo.setQueryType("3");
         receivableQueryVo.setAgreementType("2");
-        return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        HttpResult<Page<InsPlyIncome>> ok = HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        Page<InsPlyIncome> data = ok.getData();
+        List<InsPlyIncomeOrder> receivablePageIds = receivableService.getReceivablePageIds(receivableQueryVo);
+        return HttpResult.ok(new InsPlyIncomeVO(data, receivablePageIds));
     }
 
     @PostMapping("getJyOtherReceivableList")
     @Operation(summary = "获取私有协议驾意险跟单费列表")
-    public HttpResult getJyOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
+    public HttpResult<InsPlyIncomeVO> getJyOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
         receivableQueryVo.setQueryType("2");
         receivableQueryVo.setAgreementType("2");
-        return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        HttpResult<Page<InsPlyIncome>> ok = HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
+        Page<InsPlyIncome> data = ok.getData();
+        List<InsPlyIncomeOrder> receivablePageIds = receivableService.getReceivablePageIds(receivableQueryVo);
+        return HttpResult.ok(new InsPlyIncomeVO(data, receivablePageIds));
     }
 
     //@PostMapping("getSelectedReceivableList")
@@ -131,13 +147,6 @@ public class ReceivableController {
         return HttpResult.ok(receivableService.getReceivableList(receivableQueryVo));
     }
 
-
-//    @PostMapping("getPlatformReceivableList")
-//    @Operation(summary = "获取平台协议驾意险列表")
-//    public void getPlatformReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
-//
-//    }
-
     @PostMapping("commissionInvoicing")
     @Operation(summary = "手续费开票")
     public HttpResult commissionInvoicing(@RequestBody InvoicingVo invoicingVo){
@@ -386,7 +395,7 @@ public class ReceivableController {
 
     @PostMapping("receiverSettlementReport")
     @Operation(summary = "对接人结算报表")
-    public HttpResult receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {
+    public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {
         Page page = settlementReportQueryVo.getPage();
         return HttpResult.ok(receivableService.receiverSettlementReport(page,settlementReportQueryVo));
     }

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

@@ -177,4 +177,6 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
      * 获取开票记录
      */
     Page<InvoiceRecordResult> getInvoiceRecordList(Page page, @Param("invoiceRecordQueryVo") InvoiceRecordQueryVo invoiceRecordQueryVo);
+
+    List<CompanySuperviseSettlementReportDto> selectAllCompanyReports(@Param("queryVo") SettlementReportQueryVo queryVo);
 }

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/SysAmountAuditingMapper.java

@@ -40,6 +40,14 @@ public interface SysAmountAuditingMapper extends BaseMapper<SysAmountAuditing> {
      * @return
      */
     Page<AmountAuditVo> queryPaymentPage(Page page,@Param("param") AmountAuditParam param,@Param("userName") String userName);
+
+    /**
+     * 我的付款列表分页
+     * @param page
+     * @param param
+     * @return
+     */
+    List<AmountAuditVo> queryPaymentList(Page page,@Param("param") AmountAuditParam param,@Param("userName") String userName);
 }
 
 

+ 9 - 2
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementCostService.java

@@ -7,6 +7,7 @@ import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.po.PtlAgreementCost;
 import com.jzg.commons.entity.vo.CostListVo;
 import com.jzg.commons.entity.vo.CostsListVo;
+import com.jzg.commons.entity.vo.PtlAgreementCostVo;
 import jakarta.validation.constraints.NotNull;
 import java.util.List;
 
@@ -29,8 +30,14 @@ public interface PtlAgreementCostService extends IService<PtlAgreementCost> {
      */
     HttpResult<String> update(PtlAgreementCostEnd costEndList);
 
-
-    HttpResult queryById(@NotNull(message = "id不能为空") Long id);
+    /**
+     * 查询协议的费用信息
+     *
+     * @param id 费用id
+     * @author lipf
+     * @date 2026/5/23 14:34
+     */
+    HttpResult<PtlAgreementCostVo> queryById(@NotNull(message = "id不能为空") Long id);
 
     List<CostListVo> queryByAgreementIdAndCoverRuleId(CostAgreementParam costAgreementParam);
 

+ 7 - 5
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementUndwrtRulesService.java

@@ -9,15 +9,17 @@ import com.jzg.commons.entity.vo.AgreementRulesVo;
 import java.util.List;
 
 /**
-* @author dongxin
-* @description 针对表【ptl_agreement_undwrt_rules(协议承保规则)】的数据库操作Service
-* @createDate 2025-02-20 09:32:09
-*/
+ * 针对表【ptl_agreement_undwrt_rules(协议承保规则)】的数据库操作Service
+ *
+ * @author dongxin
+ * @date 2025-02-20 09:32:09
+ */
 public interface PtlAgreementUndwrtRulesService extends IService<PtlAgreementUndwrtRules> {
 
     /**
      * 协议规则列表
-     * @return
+     *
+     * @return List<AgreementRulesVo> 协议规则
      */
     List<AgreementRulesVo> queryList(String agreementId);
 

+ 15 - 0
tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java

@@ -6,6 +6,7 @@ import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.finance.dto.*;
 import com.jzg.commons.entity.finance.po.InsPlyIncome;
 import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
+import com.jzg.commons.entity.finance.po.InsPlyIncomeOrder;
 import com.jzg.commons.entity.finance.vo.*;
 import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.entity.po.EsmInsCompany;
@@ -48,6 +49,14 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      */
     Page<InsPlyIncome> getReceivablePage(ReceivableQueryVo receivableQueryVo);
 
+    /**
+     * 获取私有协议手续费满足条件数据的id集合
+     *
+     * @param receivableQueryVo 前端传过来的查询条件
+     * @author lipf
+     * @date 2026/5/23 9:40
+     */
+    List<InsPlyIncomeOrder> getReceivablePageIds(ReceivableQueryVo receivableQueryVo);
 
     List<InsPlyIncome> getReceivableList(ReceivableQueryVo receivableQueryVo);
     /**
@@ -268,6 +277,12 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      */
     List<CompanySuperviseSettlementReportDto> companySuperviseSettlementReport(SettlementReportQueryVo settlementReportQueryVo);
 
+    /**
+     * 对接人结算报表
+     *
+     * @author modify by lipf
+     * @date 2026/5/23 8:57
+     */
     Page<ReceiverSettlementReportDto> receiverSettlementReport(Page page,SettlementReportQueryVo settlementReportQueryVo);
 
     void exportReceiverSettlementReportExcel(Page page,SettlementReportQueryVo settlementReportQueryVo);

+ 7 - 0
tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java

@@ -71,6 +71,13 @@ public interface SysAmountAuditingService extends IService<SysAmountAuditing> {
      */
     Page<AmountAuditVo> myPayment(AmountAuditParam param);
 
+    /**
+     * 我的付款
+     * @param param
+     * @return
+     */
+    BigDecimal myPaymentTotalWithdrawalAmount(AmountAuditParam param);
+
     /**
      * 申请提现
      * @param applyWithdrawParam

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

@@ -48,6 +48,7 @@ import org.springframework.util.CollectionUtils;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -223,8 +224,15 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         return false;
     }
 
+    /**
+     * 查询协议的费用信息
+     *
+     * @param id 费用id
+     * @author lipf
+     * @date 2026/5/23 14:34
+     */
     @Override
-    public HttpResult queryById(Long id) {
+    public HttpResult<PtlAgreementCostVo> queryById(Long id) {
         log.info("查询协议的费用信息:协议费用id=[{}]", id);
         PtlAgreementCostVo ptlAgreementCostVo = ptlAgreementCostMapper.queryById(id);
         if (ObjectUtil.isEmpty(ptlAgreementCostVo)){
@@ -238,6 +246,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                     ruleCondition.setMinArray(Arrays.asList(ruleCondition.getMin().split(",")));
                 }else {
                     ruleCondition.setMinArray(Arrays.asList(ruleCondition.getMin()));
+                    //ruleCondition.setMinArray(Collections.singletonList(ruleCondition.getMin()));
                 }
 
             }

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

@@ -59,6 +59,11 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
     @Autowired
     private PtlAgreementCostService ptlAgreementCostService;
 
+    /**
+     * 协议规则列表
+     *
+     * @return List<AgreementRulesVo> 协议规则
+     */
     @Override
     public List<AgreementRulesVo> queryList(String agreementId) {
         log.info("查询协议承保规则列表。 agreementId=[{}]", JSONUtil.toJsonStr(agreementId));
@@ -273,14 +278,14 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
 
     private String checkBoxIdentifying(PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr, PtlAgreementUndwrtRulesAttrLink linkList) {
         StringBuilder returnMsg = new StringBuilder();
-        returnMsg.append(ptlAgreementUndwrtRulesAttr.getAttrName() + "为");
+        returnMsg.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("为");
         for(int i=0;i<linkList.getMinArray().length;i++) {
             int finalI = i;
             if(ptlAgreementUndwrtRulesAttr.getAttrCode().equals("LicenseNo") || ptlAgreementUndwrtRulesAttr.getAttrCode().equals("LicenseArea")) {
-                returnMsg.append(linkList.getMinArray()[i] + ",");
+                returnMsg.append(linkList.getMinArray()[i]).append(",");
             }else {
                 PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x -> x.getCode().equals(linkList.getMinArray()[finalI])).findAny().get();
-                returnMsg.append(ptlAgreementUndwrtRulesDictLabal.getName() + ",");
+                returnMsg.append(ptlAgreementUndwrtRulesDictLabal.getName()).append(",");
             }
         }
         return returnMsg.toString();

+ 130 - 85
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -189,6 +189,25 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         return page;
     }
 
+    /**
+     * 获取私有协议手续费满足条件数据的id集合
+     *
+     * @param receivableQueryVo 前端传过来的查询条件
+     * @author lipf
+     * @date 2026/5/23 9:40
+     */
+    @Override
+    public List<InsPlyIncomeOrder> getReceivablePageIds(ReceivableQueryVo receivableQueryVo) {
+        log.info("获取私有协议手续费应收列表的id集合。receivableQueryVo=[{}]", JSONUtil.toJsonStr(receivableQueryVo));
+        // 设置page的searhCount 为false,则不会查询总数,会直接查询具体的值
+        Page<InsPlyIncome> page1 = new Page<>(1, 10000, false);
+        Page<InsPlyIncome> page = baseMapper.getReceivablePage(page1, receivableQueryVo);
+        List<InsPlyIncomeOrder> res = page.getRecords().stream()
+                .map(action -> new InsPlyIncomeOrder(action.getId(), action.getOrderNo())).toList();
+        log.info("获取私有协议手续费应收列表的id集合。receivableQueryVo=[{}]. ids.size=[{}]", JSONUtil.toJsonStr(receivableQueryVo), CollUtil.size(res));
+        return res;
+    }
+
     /**
      * 应收数据二次过滤
      *
@@ -1000,11 +1019,11 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
 
     @Override
     public ImportUpdateExcelResultVo importPlatFormReceivable(MultipartFile file) {
+        String userName = baseController.getUserName();
+        log.info("用户[{}]导入平台协议文件",userName);
         ImportUpdateExcelResultVo importExcelResultVo = new ImportUpdateExcelResultVo();
-
         List<ReceivableExportExcelVo> receivableExportExcelVos = importReceivableExcel(file);
         AssertionUtils.isEmpty(receivableExportExcelVos, "数据处理失败,导入失败");
-
         // 获取保司名称
         HttpResult<List<EsmInsCompany>> listHttpResult = esmInsCompanyClient.liveCompanyList();
         AssertionUtils.isFail(listHttpResult.getCode() != 200, listHttpResult.getMsg());
@@ -1734,106 +1753,111 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportOtherSettlementDetailJyExcelDto.class, list, "非车险跟单费结算明细");
     }
 
+
     /**
-     * 查询保险公司结算报表
+     * 查询保险公司结算报表(平台协议)
      *
-     * @date 2026/4/30 14:48
+     * @author lipf
+     * @date 2026/5/23 16:28
      */
     @Override
-    public List<CompanySuperviseSettlementReportDto> companySuperviseSettlementReport(SettlementReportQueryVo settlementReportQueryVo) {
-        log.info("保险公司结算报表:查询结算报表:settlementReportQueryVo=[{}]", JSONUtil.toJsonStr(settlementReportQueryVo));
-
-        // 1. 预加载手续费应开票金额(全局唯一一次查询)
-        List<InvoiceAmountDto> commissionInvoicingAmount = baseMapper.getSuperviseAmount();
-        Map<String, BigDecimal> invoicingAmountMap = commissionInvoicingAmount.stream()
-                .filter(action-> BigDecimal.ZERO.compareTo(action.getSuperviseAmount()) != 0)
-                .collect(Collectors.toMap(
-                        InvoiceAmountDto::getCompanyId,
-                        dto -> dto.getSuperviseAmount() != null ? dto.getSuperviseAmount() : BigDecimal.ZERO,
-                        (existing, replacement) -> existing
-                ));
-        // 有结算数据的保险公司的id集
-        Set<String> companyIds = invoicingAmountMap.keySet();
-
-        // 2. 固定开票类型,只初始化一次
-        List<String> invoiceTypes = java.util.Arrays.asList("1", "3");
-        settlementReportQueryVo.setInvoiceTypes(invoiceTypes);
-
-        // 3. 一次性查询所有公司数据
-        List<CompanySuperviseSettlementReportDto> allCompanies = baseMapper.selectAllCompanies(settlementReportQueryVo);
-        allCompanies = allCompanies.stream().filter(action-> companyIds.contains(action.getCompanyId())).toList();
-        if (allCompanies == null || allCompanies.isEmpty()) {
-            return java.util.Collections.emptyList();
+    public List<CompanySuperviseSettlementReportDto> companySuperviseSettlementReport(
+            SettlementReportQueryVo queryVo) {
+        log.info("保险公司结算报表查询:{}", JSONUtil.toJsonStr(queryVo));
+        // 查询所有公司
+        List<CompanySuperviseSettlementReportDto> allCompanies =
+                baseMapper.selectAllCompanyReports(queryVo);
+        if (CollUtil.isEmpty(allCompanies)) {
+            return Collections.emptyList();
         }
-
-        // 4. 内存构建树形结构
-        Map<String, CompanySuperviseSettlementReportDto> companyMap = allCompanies.stream()
-                .collect(java.util.stream.Collectors.toMap(
-                        CompanySuperviseSettlementReportDto::getCompanyId,
-                        dto -> dto,
-                        (o1, o2) -> o1
-                ));
-
-        List<CompanySuperviseSettlementReportDto> rootNodes = new ArrayList<>();
-        for (CompanySuperviseSettlementReportDto company : allCompanies) {
-            // 根节点 parent_id = 0
-            if ("0".equals(company.getParentId())) {
-                rootNodes.add(company);
-            } else {
-                CompanySuperviseSettlementReportDto parent = companyMap.get(company.getParentId());
-                if (parent != null) {
-                    if (parent.getChildren() == null) {
-                        parent.setChildren(new ArrayList<>());
-                    }
-                    parent.getChildren().add(company);
+        // 查询应开票金额
+        Map<String, BigDecimal> superviseAmountMap =
+                baseMapper.getSuperviseAmount()
+                        .stream()
+                        .collect(Collectors.toMap(
+                                InvoiceAmountDto::getCompanyId,
+                                dto -> defaultZero(dto.getSuperviseAmount())
+                        ));
+        // companyId -> dto
+        Map<String, CompanySuperviseSettlementReportDto> companyMap =
+                allCompanies.stream()
+                        .collect(Collectors.toMap(
+                                CompanySuperviseSettlementReportDto::getCompanyId,
+                                Function.identity(),
+                                (a, b) -> a
+                        ));
+        // 构建树
+        List<CompanySuperviseSettlementReportDto> roots = new ArrayList<>();
+        for (CompanySuperviseSettlementReportDto dto : allCompanies) {
+            initAmount(dto);
+            if (StrUtil.isBlank(dto.getParentId())
+                    || "0".equals(dto.getParentId())) {
+
+                roots.add(dto);
+                continue;
+            }
+            CompanySuperviseSettlementReportDto parent =
+                    companyMap.get(dto.getParentId());
+            if (parent != null) {
+                if (parent.getChildren() == null) {
+                    parent.setChildren(new ArrayList<>());
                 }
+                parent.getChildren().add(dto);
             }
         }
-
-        // 5. 一次递归完成:汇总 + 未开票计算
-        for (CompanySuperviseSettlementReportDto root : rootNodes) {
-            calculateTreeData(root, invoicingAmountMap);
+        // 自底向上汇总
+        for (CompanySuperviseSettlementReportDto root : roots) {
+            aggregate(root, superviseAmountMap);
         }
-
-        return rootNodes;
+        return roots;
     }
 
-    /**
-     * 递归:子公司金额汇总 + 未开票金额计算
-     */
-    private void calculateTreeData(CompanySuperviseSettlementReportDto dto, Map<String, BigDecimal> invoicingAmountMap) {
-        BigDecimal totalReceivable = toBigDecimal(dto.getTotalReceivable());
-        BigDecimal superviseFee = toBigDecimal(dto.getSuperviseFee());
-        BigDecimal invoicedAmount = toBigDecimal(dto.getInvoicedAmount());
-        BigDecimal settledAmount = toBigDecimal(dto.getSettledAmount());
-        BigDecimal unSettledAmount = toBigDecimal(dto.getUnSettledAmount());
-
-        List<CompanySuperviseSettlementReportDto> children = dto.getChildren();
-        if (children != null && !children.isEmpty()) {
-            for (CompanySuperviseSettlementReportDto child : children) {
-                calculateTreeData(child, invoicingAmountMap);
 
-                totalReceivable = totalReceivable.add(toBigDecimal(child.getTotalReceivable()));
-                superviseFee = superviseFee.add(toBigDecimal(child.getSuperviseFee()));
-                invoicedAmount = invoicedAmount.add(toBigDecimal(child.getInvoicedAmount()));
-                settledAmount = settledAmount.add(toBigDecimal(child.getSettledAmount()));
-                unSettledAmount = unSettledAmount.add(toBigDecimal(child.getUnSettledAmount()));
+    private void aggregate(
+            CompanySuperviseSettlementReportDto node,
+            Map<String, BigDecimal> superviseAmountMap) {
+        List<CompanySuperviseSettlementReportDto> children = node.getChildren();
+        if (CollUtil.isNotEmpty(children)) {
+            for (CompanySuperviseSettlementReportDto child : children) {
+                aggregate(child, superviseAmountMap);
+                node.setTotalReceivable(
+                        add(new BigDecimal(node.getTotalReceivable()), new BigDecimal(child.getTotalReceivable())).toString());
+                node.setSuperviseFee(
+                        add(new BigDecimal(node.getSuperviseFee()), new BigDecimal(child.getSuperviseFee())).toString());
+                node.setFollowFee(
+                        add(new BigDecimal(node.getFollowFee()), new BigDecimal(child.getFollowFee())).toString());
+                node.setInvoicedAmount(
+                        add(new BigDecimal(node.getInvoicedAmount()), new BigDecimal(child.getInvoicedAmount())).toString());
+                node.setSettledAmount(
+                        add(new BigDecimal(node.getSettledAmount()), new BigDecimal(child.getSettledAmount())).toString());
+                node.setUnSettledAmount(
+                        add(new BigDecimal(node.getUnSettledAmount()), new BigDecimal(child.getUnSettledAmount())).toString());
             }
         }
 
-        // 回填汇总金额
-        dto.setTotalReceivable(totalReceivable.toString());
-        dto.setSuperviseFee(superviseFee.toString());
-        dto.setInvoicedAmount(invoicedAmount.toString());
-        dto.setSettledAmount(settledAmount.toString());
-        dto.setUnSettledAmount(unSettledAmount.toString());
+        // 计算未开票金额
+        BigDecimal superviseAmount = superviseAmountMap.getOrDefault(node.getCompanyId(), BigDecimal.ZERO);
+        node.setUnInvoicedAmount(superviseAmount.subtract(defaultZero(new BigDecimal(StrUtil.nullToDefault(node.getInvoicedAmount(), "0")))).toString());
+    }
+
+    private void initAmount(CompanySuperviseSettlementReportDto dto) {
+        dto.setTotalReceivable(defaultZero(new BigDecimal(StrUtil.nullToDefault(dto.getTotalReceivable(), "0"))).toString());
+        dto.setSuperviseFee(defaultZero(new BigDecimal(StrUtil.nullToDefault(dto.getSuperviseFee(), "0"))).toString());
+        dto.setFollowFee(defaultZero(new BigDecimal(StrUtil.nullToDefault(dto.getFollowFee(), "0"))).toString());
+        dto.setInvoicedAmount(defaultZero(new BigDecimal(StrUtil.nullToDefault(dto.getInvoicedAmount(), "0"))).toString());
+        dto.setSettledAmount(defaultZero(new BigDecimal(StrUtil.nullToDefault(dto.getSettledAmount(), "0"))).toString());
+        dto.setUnSettledAmount(defaultZero(new BigDecimal(StrUtil.nullToDefault(dto.getUnSettledAmount(), "0"))).toString());
+    }
+
+    private BigDecimal add(BigDecimal a, BigDecimal b) {
+        return defaultZero(a).add(defaultZero(b));
+    }
 
-        // 计算未开票
-        BigDecimal shouldInvoice = invoicingAmountMap.getOrDefault(dto.getCompanyId(), BigDecimal.ZERO);
-        BigDecimal unInvoice = shouldInvoice.subtract(invoicedAmount);
-        dto.setUnInvoicedAmount(unInvoice.toString());
+    private BigDecimal defaultZero(BigDecimal val) {
+        return val == null ? BigDecimal.ZERO : val;
     }
 
+
     /**
      * 字符串转 BigDecimal,空值返回 0
      */
@@ -1853,7 +1877,28 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
 
     @Override
     public Page<ReceiverSettlementReportDto> receiverSettlementReport(Page page, SettlementReportQueryVo settlementReportQueryVo) {
-        return baseMapper.getReceiverSettlementReport(page, settlementReportQueryVo);
+        log.info("平台协议应收-结算报表-对接人结算报表查询。 settlementReportQueryVo=[{}]", JSONUtil.toJsonStr(settlementReportQueryVo));
+        Page<ReceiverSettlementReportDto> receiverSettlementReport = baseMapper.getReceiverSettlementReport(page, settlementReportQueryVo);
+        List<ReceiverSettlementReportDto> records = receiverSettlementReport.getRecords();
+        if(CollUtil.isNotEmpty(records)) {
+            HttpResult<Map<String, EsmInsCompany>> mapHttpResult = esmInsCompanyClient.queryAllCompanyMap();
+            Map<String, EsmInsCompany> esmInsCompanyMap;
+            if(mapHttpResult.getCode() == 200) {
+                esmInsCompanyMap = mapHttpResult.getData();
+            } else {
+                esmInsCompanyMap = new HashMap<>();
+            }
+            Map<String, String> allCompanyHierarchyPaths = esmInsCompanyClient.getAllCompanyHierarchyPaths();
+            records = records.stream().peek(action->{
+                EsmInsCompany esmInsCompany = esmInsCompanyMap.get(Objects.toString(action.getCompanyId()));
+                if(esmInsCompany != null) {
+                    action.setCompanyName(esmInsCompany.getNameSimple());
+                }
+                action.setCompanyALlName(allCompanyHierarchyPaths.get(action.getCompanyId()));
+            }).toList();
+            receiverSettlementReport.setRecords(records);
+        }
+        return receiverSettlementReport;
     }
 
     @Override

+ 6 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java

@@ -238,6 +238,12 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         return amountAuditVoPage;
     }
 
+    @Override
+    public BigDecimal myPaymentTotalWithdrawalAmount(AmountAuditParam param) {
+        List<AmountAuditVo> amountAuditVos = baseMapper.queryPaymentList(param.getPage(), param, baseController.getUserName());
+        return CollUtil.isNotEmpty(amountAuditVos) ? amountAuditVos.stream().map(AmountAuditVo::getAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO) : BigDecimal.ZERO;
+    }
+
     @Override
     public Boolean applyWithdraw(ApplyWithdrawParam applyWithdrawParam) {
 

+ 5 - 2
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoBankCardServiceImpl.java

@@ -79,8 +79,11 @@ public class SysUserJzgInfoBankCardServiceImpl extends ServiceImpl<SysUserJzgInf
             sysUserJzgInfoBankCardDto.setSysUserJzgInfoBankCardRecordList(sysUserJzgInfoBankCardRecordList);
             // 填充最新的驳回日期和驳回原因
             if(CollUtil.isNotEmpty(sysUserJzgInfoBankCardRecordList)){
-                List<SysUserJzgInfoBankCardRecord> list = sysUserJzgInfoBankCardRecordList.stream().filter(action -> "2".equals(action.getStatus()))
-                        .sorted(Comparator.comparing(SysUserJzgInfoBankCardRecord::getCreateTime)).toList();
+                // 过滤出状态=2的驳回记录,并按创建时间 倒序排列
+                List<SysUserJzgInfoBankCardRecord> list = sysUserJzgInfoBankCardRecordList.stream()
+                        .filter(action -> "2".equals(action.getStatus()))
+                        .sorted(Comparator.comparing(SysUserJzgInfoBankCardRecord::getCreateTime).reversed())
+                        .toList();
                 if(CollUtil.isNotEmpty(list)){
                     SysUserJzgInfoBankCardRecord sysUserJzgInfoBankCardRecord = list.get(0);
                     if(sysUserJzgInfoBankCardRecord != null){

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

@@ -105,6 +105,8 @@ tenant:
     - ptl_new_car_judge_rules
     - t
   ignoreLoginNames:
+  ignoreFunction:
+    - /userBankCard/queryUserBankCardList
 
 data-scope:
   tables:
@@ -117,6 +119,7 @@ data-scope:
     - getTeamUserPage
     - getOrganizationUser
     - deleteOrganizationUser
+    - getBankCardPageList
 
 
 logging:

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

@@ -180,6 +180,7 @@
     <select id="selectCostById"  resultMap="CostResultMap">
         SELECT
             t.id,
+            t.priority_level,
             t.ptl_agreement_id,
             t.product_name,
             t.product_id,

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

@@ -1100,7 +1100,7 @@
                 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
         WHERE
-            1=1
+            1=1 and ipii.is_delete = 0
         <if test="invoiceRecordQueryVo.invoiceType != null and invoiceRecordQueryVo.invoiceType != ''">
             AND ipii.invoice_type = #{invoiceRecordQueryVo.invoiceType}
         </if>
@@ -1207,6 +1207,89 @@
         GROUP BY eic.id, eic.name, eic.parent_id;
     </select>
 
+
+    <select id="selectAllCompanyReports" resultMap="BaseResultMap">
+
+        SELECT
+        eic.id              AS company_id,
+        eic.parent_id       AS parent_id,
+        eic.name            AS company_name,
+
+        COALESCE(SUM(
+        ipi.jq_receivable_premium +
+        ipi.sy_receivable_premium +
+        ipi.jy_receivable_premium
+        ),0) AS total_receivable,
+
+        COALESCE(SUM(
+        ipi.jq_supervise_costs_premiums +
+        ipi.sy_supervise_costs_premiums +
+        ipi.jy_supervise_costs_premiums
+        ),0) AS supervise_fee,
+
+        COALESCE(SUM(
+        ipi.jq_other_costs_premiums +
+        ipi.sy_other_costs_premiums +
+        ipi.jy_other_costs_premiums
+        ),0) AS follow_fee,
+
+        COALESCE(SUM(invoice_summary.total_invoice),0)
+        AS invoiced_amount,
+
+        COALESCE(SUM(invoice_summary.settled_invoice),0)
+        AS settled_amount,
+
+        COALESCE(SUM(invoice_summary.unsettled_invoice),0)
+        AS un_settled_amount
+
+        FROM esm_ins_company eic
+
+        LEFT JOIN ins_ply_income ipi
+        ON eic.id = ipi.company_id
+        AND ipi.agreement_type = #{queryVo.agreementType}
+
+        LEFT JOIN (
+        SELECT
+        ipiil.income_id,
+
+        SUM(ipii.receivable_supervise_premium)
+        AS total_invoice,
+
+        SUM(
+        CASE WHEN ipii.status = 1
+        THEN ipii.receivable_supervise_premium
+        ELSE 0 END
+        ) AS settled_invoice,
+
+        SUM(
+        CASE WHEN ipii.status = 0
+        THEN ipii.receivable_supervise_premium
+        ELSE 0 END
+        ) AS unsettled_invoice
+
+        FROM ins_ply_income_invoice_link ipiil
+
+        LEFT JOIN ins_ply_income_invoice ipii
+        ON ipii.id = ipiil.invoice_id
+
+        GROUP BY ipiil.income_id
+
+        ) invoice_summary
+        ON invoice_summary.income_id = ipi.id
+
+        WHERE 1=1
+
+        <if test="queryVo.companyId != null and queryVo.companyId != ''">
+            AND eic.id = #{queryVo.companyId}
+        </if>
+
+        GROUP BY
+        eic.id,
+        eic.parent_id,
+        eic.name
+
+    </select>
+
     <!-- 获取根级保险公司(parent_id为0) -->
     <select id="selectRootCompanies" resultMap="BaseResultMap">
         SELECT
@@ -1342,7 +1425,7 @@
     <select id="getReceiverSettlementReport" resultType="com.jzg.commons.entity.finance.dto.ReceiverSettlementReportDto">
         SELECT
             ipi.contact_person AS receiver,
-            ipi.company_name AS companyName,
+            ipi.company_id,
             -- 原有的应收费用合计
             SUM(ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums) AS superviseFee,
             SUM(ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums) AS followFee,
@@ -1378,7 +1461,7 @@
         </if>
         GROUP BY
             ipi.contact_person,
-            ipi.company_name
+            ipi.company_id
     </select>
     <!-- 根据发票序号查询结算明细 lipf 2026年5月15日10:58:36 -->
     <select id="queryInvoiceSettlementByInvoiceId"

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

@@ -158,7 +158,46 @@
             1=1
         and saa.receive_user = #{userName}
             <if test="param.salesman != null and param.salesman != ''">
-                and (su.username = #{param.salesman} or su.mobile = #{param.salesman})
+                and (su.username like concat('%', #{param.salesman}, '%') or su.mobile like concat('%', #{param.salesman}, '%'))
+            </if>
+            <if test="param.attrType != null ">
+                and suji.type_attr = #{param.attrType}
+            </if>
+
+            <if test="param.createTimeStart != null and param.createTimeEnd != null">
+                and DATE_FORMAT(saa.create_time, '%Y-%m-%d') between #{param.createTimeStart} AND #{param.createTimeEnd}
+            </if>
+            <if test="param.auditTimeStart != null and param.auditTimeEnd != null">
+                and DATE_FORMAT(saa.auditing_time, '%Y-%m-%d') between #{param.auditTimeStart} AND #{param.auditTimeEnd}
+            </if>
+            <if test="param.auditingUser != null and param.auditingUser != ''">
+                and (sua.username = #{param.auditingUser} or sua.mobile = #{param.auditingUser})
+            </if>
+
+            <if test="param.auditingStatus != null ">
+                and saa.auditing_status = #{param.auditingStatus}
+            </if>
+        ORDER BY saa.create_time desc
+    </select>
+
+    <select id="queryPaymentList" resultType="com.jzg.commons.entity.vo.AmountAuditVo">
+        SELECT
+        saa.id,suji.name as name, su.mobile as mobile,suji.type_attr as attrType,
+        sujim.name as managerName,sum.mobile as managerMobile,saa.create_time as createTime,
+        saa.amount, saa.balance_amount as balanceAmount,saa.account_name AS accountName,
+        saa.bank_card_num as bankCardNum, saa.bank_name as bankName, saa.bank_num as bankNum
+        FROM sys_amount_auditing saa
+        LEFT JOIN sys_user_jzg_info suji on saa.user_id = suji.user_id
+        LEFT JOIN sys_user su on su.id = saa.user_id
+        LEFT JOIN sys_user_jzg_info sujim on saa.manager_user_id = sujim.user_id
+        LEFT JOIN sys_user sum on sum.id = saa.manager_user_id
+        LEFT JOIN sys_user_jzg_info sujia on saa.auditing_user_id = sujia.user_id
+        LEFT JOIN sys_user sua on sua.id = saa.auditing_user_id
+        where
+            1=1
+        and saa.receive_user = #{userName}
+            <if test="param.salesman != null and param.salesman != ''">
+                and (su.username like concat('%', #{param.salesman}, '%') or su.mobile like concat('%', #{param.salesman}, '%'))
             </if>
             <if test="param.attrType != null ">
                 and suji.type_attr = #{param.attrType}