Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev_jzg_lipf_v20260506'

jiakai před 4 měsíci
rodič
revize
2225dcf0cf
30 změnil soubory, kde provedl 327 přidání a 20 odebrání
  1. 5 0
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncome.java
  2. 5 4
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeInvoice.java
  3. 5 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/InvoiceRecordResult.java
  4. 3 1
      commons/src/main/java/com/jzg/commons/entity/orders/po/InsOrders.java
  5. 4 0
      commons/src/main/java/com/jzg/commons/entity/po/EsmInsCompany.java
  6. 7 0
      commons/src/main/java/com/jzg/commons/entity/po/SysAmountAuditing.java
  7. 8 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/QuoteEchoVo.java
  8. 7 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/orders/InsOrdersVo.java
  9. 12 0
      commons/src/main/java/com/jzg/commons/entity/vo/AmountAuditVo.java
  10. 9 0
      commons/src/main/java/com/jzg/commons/entity/vo/SalesmanVo.java
  11. 14 0
      commons/src/main/java/com/jzg/commons/exception/ServiceException.java
  12. 10 0
      platform/src/main/java/com/jzg/controller/EsmInsCompanyController.java
  13. 8 0
      platform/src/main/java/com/jzg/service/EsmInsCompanyService.java
  14. 71 0
      platform/src/main/java/com/jzg/service/impl/EsmInsCompanyServiceImpl.java
  15. 16 6
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeAuditController.java
  16. 1 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeOrderController.java
  17. 13 2
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java
  18. 2 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java
  19. 9 0
      tenant/organization/src/main/java/com/jzg/organization/client/EsmInsCompanyClient.java
  20. 24 0
      tenant/organization/src/main/java/com/jzg/organization/client/InsFeeOrdersClient.java
  21. 13 0
      tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java
  22. 13 3
      tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java
  23. 9 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java
  24. 6 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysUserService.java
  25. 16 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  26. 18 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java
  27. 16 1
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserServiceImpl.java
  28. 1 1
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml
  29. 1 1
      tenant/organization/src/main/resources/mapper/SysAmountAuditingMapper.xml
  30. 1 0
      tenant/organization/src/main/resources/mapper/SysUserJzgInfoMapper.xml

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

@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.jzg.commons.core.base.BaseModel;
+import com.jzg.commons.entity.po.InsFeeOrders;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -272,4 +273,8 @@ public class InsPlyIncome extends BaseModel {
     @Schema(description = "实际签单用户手机号")
     private String realQuoteUserName;
 
+    @TableField(exist = false)
+    @Schema(description = "订单费用表")
+    private InsFeeOrders insFeeOrders;
+
 }

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

@@ -6,6 +6,7 @@ import lombok.Data;
 
 import java.io.Serial;
 import java.math.BigDecimal;
+import java.util.Objects;
 
 @Data
 @Schema(description = "财务应收开票表")
@@ -26,11 +27,11 @@ public class InsPlyIncomeInvoice extends BaseModel {
     @Schema(description = "虚增金额")
     private BigDecimal overinflatedAmount;
 
+    @Schema(description = "应收项")
+    private String invoickRiskType;
+
     public BigDecimal getOverinflatedAmount(){
-        if(this.overinflatedAmount == null){
-            return BigDecimal.ZERO;
-        }
-        return this.overinflatedAmount;
+        return Objects.requireNonNullElse(this.overinflatedAmount, BigDecimal.ZERO);
     }
 
     @Schema(description = "应收费用")

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

@@ -23,6 +23,11 @@ public class InvoiceRecordResult extends PageRequest {
      */
     private String companyName;
 
+    /**
+     * 保险公司名称及父级的名称,例如
+     */
+    private String companyALlName;
+
     /**
      * 开票方
      */

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

@@ -7,13 +7,15 @@ import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
-import java.time.LocalDate;
+import java.io.Serial;
 import java.time.LocalDateTime;
 
 @Data
 @Schema(description = "保险订单表")
 public class InsOrders extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = -5057873662529403780L;
     @Schema(description = "订单ID")
     @TableId(value = "id", type = IdType.ASSIGN_ID)
     private String id;

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

@@ -6,11 +6,15 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jzg.commons.core.base.BaseModel;
 import lombok.Data;
+
+import java.io.Serial;
 import java.util.List;
 @TableName(value = "esm_ins_company")
 @Data
 public class EsmInsCompany extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = 3082765270221772930L;
     @TableId(type = IdType.ASSIGN_ID)
     private String id;
 

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysAmountAuditing.java

@@ -65,6 +65,13 @@ public class SysAmountAuditing extends BaseModel {
     @Schema(description = "驳回原因")
     private String rejectReason;
 
+    @Schema(description = "驳回时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime rejectTime;
+
+    @Schema(description = "驳回人")
+    private String rejectPerson;
+
     @Schema(description = "账户名称")
     private String accountName;
 

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

@@ -120,6 +120,12 @@ public class QuoteEchoVo extends QuoteVo {
 
         @Schema(description = "业务员租户简称")
         private String systemShortName;
+        // 业务员对应的管理员的id(sys_user表的id)
+        @Schema(description = "业务员对应的管理员的id(sys_user表的id)")
+        private String realQuoteUserManagerId;
+        // 业务员对应的管理员的手机号
+        @Schema(description = "业务员对应的管理员的手机号")
+        private String realQuoteUserManagerUseName;
     }
 
 
@@ -315,6 +321,8 @@ public class QuoteEchoVo extends QuoteVo {
             salesman.setSystemCode(insOrdersVo.getSalesmanInfo().getSystemCode());
             salesman.setSystemName(insOrdersVo.getSalesmanInfo().getSystemName());
             salesman.setSystemShortName(insOrdersVo.getSalesmanInfo().getSystemShortName());
+            salesman.setRealQuoteUserManagerId(insOrdersVo.getSalesmanInfo().getRealQuoteUserManagerId());
+            salesman.setRealQuoteUserManagerUseName(insOrdersVo.getSalesmanInfo().getRealQuoteUserManagerUseName());
         }
         this.setSalesmanInfo(salesman);
         this.setErrorMessage(insOrdersVo.getErrorMessage());

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

@@ -126,6 +126,13 @@ public class InsOrdersVo extends QuoteVo {
 
     @Data
     public static class Salesman{
+
+        // 业务员对应的管理员的id(sys_user表的id)
+        @Schema(description = "业务员对应的管理员的id(sys_user表的id)")
+        private String realQuoteUserManagerId;
+        // 业务员对应的管理员的手机号
+        @Schema(description = "业务员对应的管理员的手机号")
+        private String realQuoteUserManagerUseName;
         @Schema(description = "业务员姓名")
         private String name;
 

+ 12 - 0
commons/src/main/java/com/jzg/commons/entity/vo/AmountAuditVo.java

@@ -1,5 +1,6 @@
 package com.jzg.commons.entity.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -77,6 +78,17 @@ public class AmountAuditVo  extends BaseModel {
     @Schema(description = "内部银行卡开户行号")
     private String bankNum;
 
+    @ExcelProperty("驳回原因")
+    @Schema(description = "驳回原因")
+    private String rejectReason;
 
+    @ExcelProperty("驳回时间")
+    @Schema(description = "驳回时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime rejectTime;
+
+    @ExcelProperty("驳回人")
+    @Schema(description = "驳回人")
+    private String rejectPerson;
 
 }

+ 9 - 0
commons/src/main/java/com/jzg/commons/entity/vo/SalesmanVo.java

@@ -9,6 +9,15 @@ import lombok.Data;
 
 @Data
 public class SalesmanVo {
+
+    // 业务员的领导id(sys_user_jzg_info表的id)
+    private String leaderId;
+
+    // 业务员对应的管理员的id(sys_user表的id)
+    private String realQuoteUserManagerId;
+    // 业务员对应的管理员的手机号
+    private String realQuoteUserManagerUseName;
+
     private String id;
 
     private String name;

+ 14 - 0
commons/src/main/java/com/jzg/commons/exception/ServiceException.java

@@ -0,0 +1,14 @@
+package com.jzg.commons.exception;
+
+import java.io.Serial;
+
+
+public class ServiceException extends RuntimeException{
+    @Serial
+    private static final long serialVersionUID = -1477293094627064589L;
+
+
+    public ServiceException(String msg) {
+        super(msg);
+    }
+}

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

@@ -455,4 +455,14 @@ public class EsmInsCompanyController extends BaseController {
         return HttpResult.ok(esmInsCompanyService.getTopCompanyId(companyId));
     }
 
+    /**
+     * 获取所有保险公司的全路径名称
+     * Key: 公司ID
+     * Value: 总公司/分公司/支公司
+     */
+    @Operation(summary = "获取所有保险公司的全路径名称")
+    @GetMapping("getAllCompanyHierarchyPaths")
+    public Map<String, String> getAllCompanyHierarchyPaths(){
+        return esmInsCompanyService.getAllCompanyHierarchyPaths();
+    }
 }

+ 8 - 0
platform/src/main/java/com/jzg/service/EsmInsCompanyService.java

@@ -9,6 +9,7 @@ import com.jzg.commons.entity.vo.EsmInsCompanyVo;
 
 
 import java.util.List;
+import java.util.Map;
 
 public interface EsmInsCompanyService extends IService<EsmInsCompany> {
 
@@ -144,6 +145,13 @@ public interface EsmInsCompanyService extends IService<EsmInsCompany> {
      * @return
      */
     String getTopCompanyId(String companyId);
+
+    /**
+     * 获取所有保险公司的全路径名称
+     * Key: 公司ID
+     * Value: 总公司/分公司/支公司
+     */
+    public Map<String, String> getAllCompanyHierarchyPaths();
 }
 
 

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

@@ -359,6 +359,77 @@ public class EsmInsCompanyServiceImpl extends ServiceImpl<EsmInsCompanyMapper, E
     public String getTopCompanyId(String companyId) {
         return baseMapper.getTopCompanyId(companyId);
     }
+
+    /**
+     * 获取所有保险公司的全路径名称
+     * Key: 公司ID
+     * Value: 总公司/分公司/支公司
+     */
+    public Map<String, String> getAllCompanyHierarchyPaths() {
+        log.info("获取所有保险公司的全路径名称");
+        // 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));
+
+        // 3. 结果缓存 Map (ID -> "A/B/C" Path)
+        // 使用 ConcurrentHashMap 或者普通 HashMap 均可,视并发需求而定
+        Map<String, String> pathCache = new HashMap<>();
+
+        // 4. 遍历所有公司,构建路径
+        for (EsmInsCompany company : allCompanies) {
+            buildPath(company.getId(), companyMap, pathCache);
+        }
+        log.info("构建得到的公司的层级结构如下: [{}]", JSONUtil.toJsonStr(pathCache));
+        return pathCache;
+    }
+
+    /**
+     * 递归构建单个公司的路径(带缓存优化,防止重复计算)
+     */
+    private String buildPath(String currentId, Map<String, EsmInsCompany> companyMap, Map<String, String> pathCache) {
+        // 如果已经计算过,直接返回(记忆化搜索,防止重复递归)
+        if (pathCache.containsKey(currentId)) {
+            return pathCache.get(currentId);
+        }
+
+        EsmInsCompany currentCompany = companyMap.get(currentId);
+        if (currentCompany == null) {
+            return "";
+        }
+
+        // 获取父级 ID
+        String parentId = currentCompany.getParentId();
+
+        String fullPath;
+
+        // 判断是否有父级 (根据数据库设计,根节点的 parent_id 通常为 0 或 null)
+        if (parentId == null || parentId.equals("0")) {
+            // 如果是根节点,路径就是它自己的名字
+            //fullPath = currentCompany.getName();
+            fullPath = currentCompany.getNameSimple();
+        } else {
+            // 如果有父级,递归获取父级的路径,然后拼接当前名字
+            // 注意:这里递归调用 buildPath,利用缓存避免死循环和重复计算
+            String parentPath = buildPath(parentId, companyMap, pathCache);
+
+            if (parentPath.isEmpty()) {
+                //fullPath = currentCompany.getName();
+                fullPath = currentCompany.getNameSimple();
+            } else {
+                //fullPath = parentPath + "/" + currentCompany.getName();
+                fullPath = parentPath + "/" + currentCompany.getNameSimple();
+            }
+        }
+
+        // 存入缓存
+        pathCache.put(currentId, fullPath);
+        return fullPath;
+    }
+
 }
 
 

+ 16 - 6
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsFeeAuditController.java

@@ -1,10 +1,10 @@
 package com.jzg.quotation.summary.controller;
 
 
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.dto.FeeAuditAddParam;
 import com.jzg.commons.entity.dto.FeeAuditParam;
 import com.jzg.commons.entity.dto.VerifyOrderParam;
 import com.jzg.commons.entity.orders.vo.AuditCostInfoVo;
@@ -14,6 +14,8 @@ import com.jzg.commons.entity.vo.PtlAgreementCostRatioVo;
 import com.jzg.quotation.summary.service.InsFeeAuditService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -24,6 +26,8 @@ import java.util.List;
 @RequestMapping("/feeAudit")
 public class InsFeeAuditController {
 
+    private static final Logger log = LoggerFactory.getLogger(InsFeeAuditController.class);
+
     @Autowired
     private InsFeeAuditService insFeeAuditService;
 
@@ -36,7 +40,7 @@ public class InsFeeAuditController {
      */
     @PostMapping("/auditList")
     @Operation(summary = "订单审核列表分页")
-    public HttpResult auditList(@RequestBody FeeAuditParam param){
+    public HttpResult<Page<FeeAuditVo>> auditList(@RequestBody FeeAuditParam param){
         param.setSystemCode(baseController.getUserSystemCode());
         Page<FeeAuditVo> result = insFeeAuditService.queryPage(param);
         return HttpResult.ok(result);
@@ -55,11 +59,11 @@ public class InsFeeAuditController {
 
     /**
      * 订单审核详情
-     * @return
+     * @return HttpResult<QuoteEchoVo>
      */
     @GetMapping("/auditInfo")
     @Operation(summary = "订单审核详情")
-    public HttpResult auditInfo(String orderNo){
+    public HttpResult<QuoteEchoVo> auditInfo(String orderNo){
         QuoteEchoVo detailVo = insFeeAuditService.auditInfo(orderNo);
         return HttpResult.ok(detailVo);
     }
@@ -113,8 +117,14 @@ public class InsFeeAuditController {
      */
     @PostMapping("/verifyOrder")
     @Operation(summary = "审核订单")
-    public HttpResult verifyOrder(@RequestBody VerifyOrderParam param){
-        insFeeAuditService.verifyOrder(param);
+    public HttpResult<String> verifyOrder(@RequestBody VerifyOrderParam param){
+        try{
+            insFeeAuditService.verifyOrder(param);
+        }catch (Exception e){
+            log.info("审核订单发生异常:param=[{}], e", JSONUtil.toJsonStr(param), e);
+            return HttpResult.ok(e.getMessage());
+        }
+
         return HttpResult.ok("订单审核成功");
     }
 

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

@@ -54,7 +54,7 @@ public class InsFeeOrderController {
         return insFeeOrdersService.getInsFeeOrderAudit(userId);
     }
 
-    @GetMapping("/getInsFeeOrderByOrderNo")
+    @RequestMapping(value = "/getInsFeeOrderByOrderNo", method = {RequestMethod.GET, RequestMethod.POST})
     @Operation(summary = "订单费用列表通过订单号查询")
     public List<InsFeeOrders> getInsFeeOrderByOrderNo(String orderNo){
         return insFeeOrdersService.getInsFeeOrderByOrderNo(orderNo);

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

@@ -24,6 +24,7 @@ import com.jzg.commons.entity.quote.vo.aggregated.QuoteEchoVo;
 import com.jzg.commons.entity.rights.po.InsOrderRights;
 import com.jzg.commons.entity.rights.po.InsOrderRightsPackage;
 import com.jzg.commons.entity.vo.*;
+import com.jzg.commons.exception.ServiceException;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.PDFUtil;
@@ -62,7 +63,7 @@ import java.util.concurrent.TimeUnit;
 /**
 * @author dongxin
 * @description 针对表【ins_fee_audit(费用审核表)】的数据库操作Service实现
-* @createDate 2025-07-02 14:35:50
+* @date 2025-07-02 14:35:50
 */
 @Service
 @RequiredArgsConstructor
@@ -122,7 +123,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 
     @Override
     public Page<FeeAuditVo> queryPage(FeeAuditParam param) {
-        log.info("订单审核-任务中心,查询待审核任务。 param=[{}]", JSONUtil.toJsonStr(param));
+        log.info("订单审核-任务中心,查询待审核任务。param=[{}]", JSONUtil.toJsonStr(param));
         // 获取选中的保险公司条件
         String companyId = param.getCompanyId();
         if(StringUtils.isNotBlank(companyId)){
@@ -214,6 +215,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 
     @Override
     public QuoteEchoVo auditInfo(String orderNo) {
+        //险种和订单类型以及业务员对应的管理员
         log.info("查看订单审核详情:orderNo=[{}]",JSONUtil.toJsonStr(orderNo));
         QuoteEchoVo detailVo = insOrdersService.getOrderDetail(orderNo);
         log.debug("查看订单审核详情:orderNo=[{}], detailVo=[{}]",orderNo, JSONUtil.toJsonStr(detailVo));
@@ -347,7 +349,16 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 
     @Override
     public void verifyOrder(VerifyOrderParam param) {
+        log.info("审核订单. param=[{}]", JSONUtil.toJsonStr(param));
         InsFeeAudit audit = this.getById(param.getOrderNo());
+        if(audit == null){
+            throw new ServiceException("要审核的订单不存在");
+        }
+        // modify by lipf 2026年5月16日11:44:07 疑问订单无法直接审核通过
+        if(audit.getIsProblem() == 1){
+            log.info("订单号为[{}]的订单为疑问订单,无法直接审核通过",param.getOrderNo());
+            throw new ServiceException("疑问订单无法直接审核通过,请先取消疑问");
+        }
         InsOrders orders = insOrdersService.getById(audit.getOrderNo());
         if(audit.getAuditStatus() > 0){
             AssertionUtils.isFail(true, "订单已审核刷新订单详情页!");

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

@@ -488,6 +488,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             salesman.setSystemCode(salesmanInfo.getSystemCode());
             salesman.setSystemName(salesmanInfo.getSystemName());
             salesman.setSystemShortName(salesmanInfo.getSystemShortName());
+            salesman.setRealQuoteUserManagerId(salesmanInfo.getRealQuoteUserManagerId());
+            salesman.setRealQuoteUserManagerUseName(salesmanInfo.getRealQuoteUserManagerUseName());
             insOrdersVo.setSalesmanInfo(salesman);
         }
         // 2. 处理车辆用户信息列表

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/client/EsmInsCompanyClient.java

@@ -9,11 +9,20 @@ import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 @FeignClient(name = "jzg-platform")
 public interface EsmInsCompanyClient {
 
 
+    /**
+     * 获取所有保险公司的全路径名称
+     * Key: 公司ID
+     * Value: 总公司/分公司/支公司
+     */
+    @GetMapping("esmInsCompany/getAllCompanyHierarchyPaths")
+    public Map<String, String> getAllCompanyHierarchyPaths();
+
     /**
      * 根据id获取保险公司信息
      *

+ 24 - 0
tenant/organization/src/main/java/com/jzg/organization/client/InsFeeOrdersClient.java

@@ -0,0 +1,24 @@
+package com.jzg.organization.client;
+
+import com.jzg.commons.entity.po.InsFeeOrders;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+/**
+ * 订单费用接口
+ */
+@FeignClient(name = "jzg-insurance")
+public interface InsFeeOrdersClient {
+
+    /**
+     * 订单费用列表通过订单号查询
+     * @param orderNo
+     * @return
+     */
+    @PostMapping("/insFeeOrder/getInsFeeOrderByOrderNo")
+    List<InsFeeOrders> getInsFeeOrderByOrderNo(@RequestParam String orderNo);
+
+}

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

@@ -14,6 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
+
 @Tag(name="提现申请管理接口")
 @RestController
 @RequestMapping("/amountAuditing")
@@ -33,6 +35,17 @@ public class AmountAuditingController extends BaseController {
         return HttpResult.ok(result);
     }
 
+    /**
+     * 提现申请列表分页
+     * @return
+     */
+    @PostMapping("/queryTotalWithdrawalAmount")
+    @Operation(summary = "提现金额总计")
+    public HttpResult<BigDecimal> queryTotalWithdrawalAmount(@RequestBody AmountAuditParam param){
+        BigDecimal bigDecimal = sysAmountAuditingService.queryTotalWithdrawalAmount(param);
+        return HttpResult.ok(bigDecimal);
+    }
+
     @PostMapping("/exportAuditList")
     @Operation(summary = "导出申请列表")
     public HttpResult<String> exportAuditList(@RequestBody AmountAuditParam param) {

+ 13 - 3
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 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.po.InsPlyIncome;
 import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
 import com.jzg.commons.entity.finance.vo.*;
@@ -74,8 +75,13 @@ public class ReceivableController {
     @PostMapping("getCommissionReceivableList")
     @Operation(summary = "获取私有协议手续费列表")
     public HttpResult<Page<InsPlyIncome>> getCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
-        receivableQueryVo.setQueryType("2");
-        receivableQueryVo.setAgreementType("2");
+        if (StrUtil.isBlank(receivableQueryVo.getQueryType())){
+            receivableQueryVo.setQueryType("2");
+        }
+        // 协议类型 1 平台协议  2 私有协议
+        if (StrUtil.isBlank(receivableQueryVo.getAgreementType())){
+            receivableQueryVo.setAgreementType("2");
+        }
         return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
     }
 
@@ -222,6 +228,10 @@ public class ReceivableController {
         if (StrUtil.isBlank(receivableQueryVo.getQueryType())){
             receivableQueryVo.setQueryType("1");
         }
+        // 协议类型 1 平台协议  2 私有协议
+        if (StrUtil.isBlank(receivableQueryVo.getAgreementType())){
+            receivableQueryVo.setAgreementType("1");
+        }
         return HttpResult.ok(receivableService.getPlatFormReceivableList(receivableQueryVo));
     }
 
@@ -280,7 +290,7 @@ public class ReceivableController {
 
     @PostMapping("superviseSettlementExcel")
     @Operation(summary = "应收手续费结算记录")
-    public HttpResult superviseSettlementExcel(@RequestBody SettlementQueryVo settlementQueryVo) {
+    public HttpResult<Page<ExportSuperviseSettlementExcelDto>> superviseSettlementExcel(@RequestBody SettlementQueryVo settlementQueryVo) {
         Page page = settlementQueryVo.getPage();
         return HttpResult.ok(receivableService.superviseSettlementExcel(page,settlementQueryVo));
     }

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

@@ -9,6 +9,8 @@ import com.jzg.commons.entity.dto.ApplyWithdrawParam;
 import com.jzg.commons.entity.po.SysAmountAuditing;
 import com.jzg.commons.entity.vo.AmountAuditVo;
 
+import java.math.BigDecimal;
+
 /**
 * @author dongxin
 * @description 针对表【sys_amount_auditing(提现申请表)】的数据库操作Service
@@ -23,6 +25,13 @@ public interface SysAmountAuditingService extends IService<SysAmountAuditing> {
      */
     Page<AmountAuditVo> queryPage(AmountAuditParam param);
 
+    /**
+     * 查询提现金额总计
+     * @param param
+     * @return
+     */
+    BigDecimal queryTotalWithdrawalAmount(AmountAuditParam param);
+
     /**
      * 领取提现申请
      *

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

@@ -205,6 +205,12 @@ public interface SysUserService extends IService<SysUser> {
 
     SysUser getUserByMobile(String mobile);
 
+    /**
+     * 通过电话获取业务员信息
+     *
+     * @author lipf
+     * @date 2026/5/16 11:55
+     */
     SalesmanVo getUserInfoBySystemCodeAndUserId(String userId);
 
     /**

+ 16 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -20,6 +20,7 @@ import com.jzg.commons.entity.finance.po.*;
 import com.jzg.commons.entity.finance.vo.*;
 import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.entity.po.EsmInsCompany;
+import com.jzg.commons.entity.po.InsFeeOrders;
 import com.jzg.commons.entity.po.PtlAgreement;
 import com.jzg.commons.entity.po.SysUploadFiles;
 import com.jzg.commons.exception.SystemException;
@@ -29,6 +30,7 @@ import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.util.ServletUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.organization.client.EsmInsCompanyClient;
+import com.jzg.organization.client.InsFeeOrdersClient;
 import com.jzg.organization.excel.listener.JyExcelListener;
 import com.jzg.organization.excel.listener.OtherExcelListener;
 import com.jzg.organization.excel.listener.ReceivbleExcelListener;
@@ -109,6 +111,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     @Autowired
     private SysUserJzgInfoSalesmanService sysUserJzgInfoSalesmanService;
 
+    @Autowired
+    private InsFeeOrdersClient insFeeOrdersClient;
+
     @Value("${upload.file.path}")
     private String uploadPath;
 
@@ -405,6 +410,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 String typeAttrName = Constant.ywyAttrTypeMap.get(typeAttr);
                 insPlyIncome.setTypeAttr(typeAttr);
                 insPlyIncome.setTypeAttrName(typeAttrName);
+                // 费用信息
+                List<InsFeeOrders> insFeeOrderByOrderNo = insFeeOrdersClient.getInsFeeOrderByOrderNo(insPlyIncome.getOrderNo());
+                insPlyIncome.setInsFeeOrders(CollUtil.getFirst(insFeeOrderByOrderNo));
             });
         }
         return records;
@@ -495,6 +503,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             invoice.setId(IdGenerate.nextId());
             invoice.setCompanyId(invoicingVo.getCompanyId());
             invoice.setInvoiceType(invoicingVo.getInvoiceType());
+            // 开票类型  1 手续费  2 跟单费  3 驾意险手续费 4 驾意险跟单费
+            if("1".equals(invoicingVo.getInvoiceType()) || "2".equals(invoicingVo.getInvoiceType())){
+                invoice.setInvoickRiskType("10");
+            }else{
+                invoice.setInvoickRiskType("20");
+            }
             invoice.setInvoiceParty(invoicingVo.getInvoiceParty());
             invoice.setOverinflatedAmount(invoicingVo.getOverinflatedAmount());
             invoice.setReceivableSupervisePremium(invoicingVo.getReceivablePremium());
@@ -1188,6 +1202,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         Page<InvoiceRecordResult> invoiceRecordList = baseMapper.getInvoiceRecordList(invoiceRecordQueryVo.getPage(), invoiceRecordQueryVo);
         List<InvoiceRecordResult> records = invoiceRecordList.getRecords();
         if(CollUtil.isNotEmpty(records)){
+            Map<String, String> allCompanyHierarchyPaths = esmInsCompanyClient.getAllCompanyHierarchyPaths();
             records = records.stream().peek(action->{
                 String settlementStatusName = Constant.settlementStatusMap.get(Objects.toString(action.getStatus(),""));
                 action.setSettlementStatusName(settlementStatusName);
@@ -1206,6 +1221,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 action.setSettlementAmount(settlementAmount);
                 // 设置待结算金额
                 action.setRemainSettlementAmount(remainSettlementAmount);
+                action.setCompanyALlName(allCompanyHierarchyPaths.get(Objects.toString(action.getCompanyId(),"")));
             }).toList();
             invoiceRecordList.setRecords(records);
         }

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

@@ -1,5 +1,6 @@
 package com.jzg.organization.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -72,6 +73,21 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         return page;
     }
 
+    @Override
+    public BigDecimal queryTotalWithdrawalAmount(AmountAuditParam param) {
+        BigDecimal bigDecimal = new BigDecimal(0);
+        Page<AmountAuditVo> page = baseMapper.queryPage(param.getPage(), param);
+        // 计算提现金额总计
+        if (CollUtil.isNotEmpty(page.getRecords())){
+            for (AmountAuditVo record : page.getRecords()) {
+                if (null != record && null != record.getAmount()){
+                    bigDecimal = bigDecimal.add(record.getAmount());
+                }
+            }
+        }
+        return bigDecimal;
+    }
+
     @Override
     public void auditReceive(String id) {
         SysAmountAuditing audit = this.getById(id);
@@ -205,6 +221,8 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         StateResult stateFailResult = auditStateListener.statusChange(AuditState.AuditStateEnum.FAIL_AUDIT,audit.getAuditingStatus()+"");
         audit.setAuditingStatus(stateFailResult.getCurrentState());
         audit.setRejectReason(param.getRejectReason());
+        audit.setRejectPerson(userName);
+        audit.setRejectTime(LocalDateTime.now());
         this.updateById(audit);
     }
 

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

@@ -1306,7 +1306,22 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
     @Override
     public SalesmanVo getUserInfoBySystemCodeAndUserId(String userId) {
-        return sysUserJzgInfoMapper.getUserInfoBySystemCodeAndUserId(userId);
+        SalesmanVo salesmanVo = sysUserJzgInfoMapper.getUserInfoBySystemCodeAndUserId(userId);
+        String leaderId = salesmanVo.getLeaderId();
+        if(StrUtil.isEmpty(leaderId)){
+            return salesmanVo;
+        }
+        SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoMapper.selectById(leaderId);
+        if(sysUserJzgInfo == null){
+            return salesmanVo;
+        }
+        String leaderUserId = sysUserJzgInfo.getUserId();
+        salesmanVo.setRealQuoteUserManagerId(leaderUserId);
+        SysUser sysUser = sysUserMapper.selectById(leaderUserId);
+        if(sysUser != null){
+            salesmanVo.setRealQuoteUserManagerUseName(sysUser.getUsername());
+        }
+        return salesmanVo;
     }
 
     @Override

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

@@ -279,7 +279,7 @@
             left join sys_user su on su.id = suji.user_id
             where sujis.type_attr =#{receivableQueryVo.typeAttr})
         </if>
-        <if test = "receivableQueryVo.agreementType != null and receivableQueryVo.agreementType == 1">
+        <if test = "receivableQueryVo.agreementType != null and receivableQueryVo.agreementType != ''">
             AND ipi.agreement_type = #{receivableQueryVo.agreementType}
         </if>
         <if test = "receivableQueryVo.ids != null and receivableQueryVo.ids.size > 0">

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

@@ -47,7 +47,7 @@
         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, suji.id as userJzgInfoId,
-        saa.payment_time as paymentTime
+        saa.payment_time as paymentTime, saa.reject_reason as rejectReason, saa.reject_time as rejectTime, saa.reject_person as rejectPerson
         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

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

@@ -333,6 +333,7 @@
         SELECT
             suji.name,
             suji.dept_Id as deptId,
+            suji.leader_id,
             sd.name as deptName,
             suji.type_attr as typeAttr,
             su.mobile as mobile ,