Переглянути джерело

Merge branch 'test' into test-xq2

# Conflicts:
#	src/main/java/com/ydtech/modules/admin/controller/SysUserController.java
xuqiang 1 рік тому
батько
коміт
7918cf4ea2
69 змінених файлів з 1874 додано та 189 видалено
  1. 7 4
      src/main/java/com/ydtech/aop/LogAspect.java
  2. 4 0
      src/main/java/com/ydtech/components/TokenInterceptor.java
  3. 6 2
      src/main/java/com/ydtech/modules/admin/controller/SysUserController.java
  4. 60 40
      src/main/java/com/ydtech/modules/admin/controller/deptBalance/DeptBalanceController.java
  5. 22 0
      src/main/java/com/ydtech/modules/admin/controller/taskStatistics/TaskStatisticsController.java
  6. 86 0
      src/main/java/com/ydtech/modules/admin/dao/PartnerWalletMapper.java
  7. 3 0
      src/main/java/com/ydtech/modules/admin/dao/TaskStatisticsMapper.java
  8. 54 0
      src/main/java/com/ydtech/modules/admin/model/dto/ChannelDetailsExport.java
  9. 5 0
      src/main/java/com/ydtech/modules/admin/model/dto/SysPartnerConsoleDto.java
  10. 24 0
      src/main/java/com/ydtech/modules/admin/model/dto/partner/CopartnerAndStudioNumberDTO.java
  11. 20 0
      src/main/java/com/ydtech/modules/admin/model/dto/partner/PartnerDataDTO.java
  12. 21 0
      src/main/java/com/ydtech/modules/admin/service/PartnerWalletService.java
  13. 3 0
      src/main/java/com/ydtech/modules/admin/service/SysUserService.java
  14. 6 0
      src/main/java/com/ydtech/modules/admin/service/TaskStatisticsService.java
  15. 111 0
      src/main/java/com/ydtech/modules/admin/service/impl/PartnerWalletServiceImpl.java
  16. 6 2
      src/main/java/com/ydtech/modules/admin/service/impl/SysLoginServiceImpl.java
  17. 9 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java
  18. 70 0
      src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java
  19. 121 55
      src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java
  20. 2 2
      src/main/java/com/ydtech/modules/fee/service/FeeRuleSchemeNewService.java
  21. 19 12
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java
  22. 6 6
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  23. 12 0
      src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java
  24. 8 1
      src/main/java/com/ydtech/modules/ins/model/yc/YcBuildData.java
  25. 19 5
      src/main/java/com/ydtech/modules/ins/model/yc/ruote/Vhl.java
  26. 14 5
      src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java
  27. 54 0
      src/main/java/com/ydtech/modules/order/constants/ya/CarDamageVerification.java
  28. 54 0
      src/main/java/com/ydtech/modules/order/controller/InsCrawlerOrderController.java
  29. 11 4
      src/main/java/com/ydtech/modules/order/controller/OrderTaskImageController.java
  30. 10 0
      src/main/java/com/ydtech/modules/order/controller/QrCodeController.java
  31. 14 3
      src/main/java/com/ydtech/modules/order/controller/QuoteController.java
  32. 2 2
      src/main/java/com/ydtech/modules/order/controller/YongChengOrderApiController.java
  33. 6 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java
  34. 175 11
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/InsurePremiumRequest.java
  35. 35 6
      src/main/java/com/ydtech/modules/order/entity/api/pingan/utils/PDFUtil.java
  36. 10 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerBaseRequest.java
  37. 15 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerQuoteRequest.java
  38. 44 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/YaCrawlerSendSmsCodeRequest.java
  39. 31 0
      src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java
  40. 29 0
      src/main/java/com/ydtech/modules/order/entity/crawler/response/YaCrawlerSendSmsCodeResponse.java
  41. 66 0
      src/main/java/com/ydtech/modules/order/entity/crawler/response/YaCrawlerVerifyCodeResponse.java
  42. 4 0
      src/main/java/com/ydtech/modules/order/entity/po/InsUploadFiles.java
  43. 6 0
      src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java
  44. 6 0
      src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java
  45. 16 0
      src/main/java/com/ydtech/modules/order/service/InsCrawlerOrderService.java
  46. 8 1
      src/main/java/com/ydtech/modules/order/service/InsUploadFilesService.java
  47. 18 1
      src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java
  48. 11 0
      src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java
  49. 117 2
      src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java
  50. 8 2
      src/main/java/com/ydtech/modules/order/service/impl/InsOrderPdfUrlServiceImpl.java
  51. 8 2
      src/main/java/com/ydtech/modules/order/service/impl/InsOrderQrCodeServiceImpl.java
  52. 17 7
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  53. 68 2
      src/main/java/com/ydtech/modules/order/service/impl/InsUploadFilesServiceImpl.java
  54. 10 2
      src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java
  55. 3 1
      src/main/java/com/ydtech/modules/protocol/entity/constants/PtlCrawlerApiType.java
  56. 6 0
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlNewCarJudgeRules.java
  57. 3 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementSaveVo.java
  58. 5 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlNewCarJudgeRulesVo.java
  59. 15 0
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java
  60. 35 5
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java
  61. 3 0
      src/main/java/com/ydtech/modules/protocols/entity/vo/AgreementProductQueryVo.java
  62. 14 1
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  63. 126 0
      src/main/resources/mapper/modules/admin/PartnerWalletMapper.xml
  64. 1 1
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  65. 82 0
      src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml
  66. 2 1
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  67. 1 1
      src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml
  68. 4 0
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  69. 3 0
      src/main/resources/mapper/modules/protocols/PtlAgreementProductCostsNewMapper.xml

+ 7 - 4
src/main/java/com/ydtech/aop/LogAspect.java

@@ -2,7 +2,6 @@ package com.ydtech.aop;
 
 import cn.dev33.satoken.stp.StpUtil;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.SysLog;
 import com.ydtech.modules.admin.service.SysLogService;
@@ -37,7 +36,8 @@ public class LogAspect {
     private SysLogService sysLogService;
 
 
-    @Pointcut("execution(public * com.ydtech.modules.*.controller.*.*(..)) ")
+    @Pointcut("@within(org.springframework.stereotype.Controller) || " +
+            "@within(org.springframework.web.bind.annotation.RestController)")
     public void log() {
 
     }
@@ -50,7 +50,8 @@ public class LogAspect {
         String userId = StpUtil.getLoginId("").toString();
         //请求人 url method ip class_method
         SysLog sysLog = new SysLog(userId, request.getRequestURL().toString(), request.getMethod(),
-                joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), request.getRemoteAddr(), new Date());
+                joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature()
+                .getName(), request.getRemoteAddr(), new Date());
 
         try {
             //获取注解注释
@@ -60,7 +61,9 @@ public class LogAspect {
             //获取请求参数
             Object[] args = joinPoint.getArgs();
             for (Object obj : args) {
-                if (null != obj && (obj.getClass().getName().startsWith("com.ydtech.modules") || obj instanceof String)) {
+                if (null != obj && (obj.getClass()
+                        .getName()
+                        .startsWith("com.ydtech.modules") || obj instanceof String)) {
                     sysLog.setParams(JSON.toJSON(obj).toString());
                 }
             }

+ 4 - 0
src/main/java/com/ydtech/components/TokenInterceptor.java

@@ -15,6 +15,9 @@ public class TokenInterceptor {
 
     public static SaInterceptor tokenInterceptor() {
         List<String> notMatchList = new ArrayList<>();
+        notMatchList.add("/insurance/crawler/yaSendCode"); // 永安接口
+        notMatchList.add("/insurance/crawler/yaVerifySendCode");
+        notMatchList.add("/insurance/crawler/yaGetMobile");
         notMatchList.add("/favicon.ico");
         notMatchList.add("/api/demo/**"); // 演示接口
         notMatchList.add("/captcha.jpg**"); // 验证码
@@ -110,6 +113,7 @@ public class TokenInterceptor {
         notMatchList.add("/APPPartner/loginWechat");
         notMatchList.add("/APPPartner/loginAlipay");
 
+
         /**
          * 天天企赋api接口回调
          */

+ 6 - 2
src/main/java/com/ydtech/modules/admin/controller/SysUserController.java

@@ -539,6 +539,12 @@ public class SysUserController extends BaseController {
         return HttpResult.ok(sysUserService.findBackUserList(sysUserDto));
     }
 
+    @ApiOperation(value = "获取财务人员")
+    @PostMapping(value = "/getFinanceUser")
+    public HttpResult getFinanceUser() {
+        return HttpResult.ok(sysUserService.getFinanceUser());
+    }
+
 
     @ApiOperation(value = "合伙人审核查询分页")
     @PostMapping(value = "/findPartnerUserList")
@@ -546,8 +552,6 @@ public class SysUserController extends BaseController {
         return HttpResult.ok(sysUserService.findPartnerUserList(sysUserDto));
     }
 
-
-
     @ApiOperation(value = "后线用户查询不分页(编辑时查询领导人)")
     @PostMapping(value = "/findBackUserList1")
     public HttpResult findBackUserList1(@RequestBody SysUserDto sysUserDto) {

+ 60 - 40
src/main/java/com/ydtech/modules/admin/controller/deptBalance/DeptBalanceController.java

@@ -6,18 +6,22 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.DeptBalanceDto;
 import com.ydtech.modules.admin.model.dto.SysPartnerConsoleDto;
 import com.ydtech.modules.admin.model.dto.SysPartnerInfoConsoleDto;
-import com.ydtech.modules.admin.model.vo.AppSysPartnerVo;
 import com.ydtech.modules.admin.model.vo.DeptBalanceVo;
 import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.model.vo.PartnerBalanceVo;
 import com.ydtech.modules.admin.service.DeptBalanceService;
+import com.ydtech.modules.admin.service.PartnerWalletService;
 import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
@@ -27,11 +31,12 @@ import java.util.List;
 @Api(tags = "机构管理费统计")
 @RequestMapping("/deptBalance")
 @RestController
+@RequiredArgsConstructor
 public class DeptBalanceController {
 
-    @Autowired
-    private DeptBalanceService deptBalanceService;
+    private final DeptBalanceService deptBalanceService;
 
+    private final PartnerWalletService partnerWalletService;
 
     /**
      * @version
@@ -46,9 +51,10 @@ public class DeptBalanceController {
         deptBalanceVo.setBeginDate(map.get("startDate"));
         deptBalanceVo.setEndDate(map.get("endDate"));
         KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
-        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
-        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
-            if("1".equals(kztGetDeptUtilsDto.getType())){
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL()
+                .toString());
+        if (ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)) {
+            if ("1".equals(kztGetDeptUtilsDto.getType())) {
                 deptBalanceVo.setDeptIds(kztGetDeptUtilsDto.getIds());
             } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
                 deptBalanceVo.setUserIds(kztGetDeptUtilsDto.getIds());
@@ -71,16 +77,16 @@ public class DeptBalanceController {
         deptBalanceVo.setBeginDate(map.get("startDate"));
         deptBalanceVo.setEndDate(map.get("endDate"));
         KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
-        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
-        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
-            if("1".equals(kztGetDeptUtilsDto.getType())){
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL()
+                .toString());
+        if (ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)) {
+            if ("1".equals(kztGetDeptUtilsDto.getType())) {
                 deptBalanceVo.setDeptIds(kztGetDeptUtilsDto.getIds());
             } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
                 deptBalanceVo.setUserIds(kztGetDeptUtilsDto.getIds());
             }
         }
-        HttpResult<IPage<SysPartnerConsoleDto>> result = deptBalanceService.queryPartnerStatistics(deptBalanceVo);
-        return result;
+        return partnerWalletService.queryPartnerStatistics(deptBalanceVo);
     }
 
 
@@ -92,6 +98,9 @@ public class DeptBalanceController {
     @PostMapping("queryPartnerInfo")
     @ApiOperation(value = "合伙人详情")
     public HttpResult<List<SysPartnerConsoleDto>> queryPartnerInfo(@RequestBody DeptBalanceVo deptBalanceVo) {
+        HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
+        deptBalanceVo.setBeginDate(map.get("startDate"));
+        deptBalanceVo.setEndDate(map.get("endDate"));
         List<SysPartnerConsoleDto> result = deptBalanceService.queryPartnerInfo(deptBalanceVo);
         return HttpResult.ok(result);
     }
@@ -104,12 +113,14 @@ public class DeptBalanceController {
     @PostMapping("queryStudioInfo")
     @ApiOperation(value = "工作室详情")
     public HttpResult<List<SysPartnerConsoleDto>> queryStudioInfo(@RequestBody DeptBalanceVo deptBalanceVo) {
+        HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
+        deptBalanceVo.setBeginDate(map.get("startDate"));
+        deptBalanceVo.setEndDate(map.get("endDate"));
         List<SysPartnerConsoleDto> result = deptBalanceService.queryPartnerInfo(deptBalanceVo);
         return HttpResult.ok(result);
     }
 
 
-
     /**
      * @version
      * @author: whp
@@ -118,6 +129,9 @@ public class DeptBalanceController {
     @PostMapping("info")
     @ApiOperation(value = "合伙人详情")
     public HttpResult<SysPartnerInfoConsoleDto> queryInfo(@RequestBody DeptBalanceVo deptBalanceVo) {
+        HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
+        deptBalanceVo.setBeginDate(map.get("startDate"));
+        deptBalanceVo.setEndDate(map.get("endDate"));
         SysPartnerInfoConsoleDto result = deptBalanceService.queryInfo(deptBalanceVo);
         return HttpResult.ok(result);
     }
@@ -131,6 +145,9 @@ public class DeptBalanceController {
     @PostMapping("/getTeamInfo")
     @ApiOperation(value = "查看机构下团队信息")
     public HttpResult<SysPartnerInfoConsoleDto> getTeamInfo(@RequestBody DeptBalanceVo deptBalanceVo) {
+        HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
+        deptBalanceVo.setBeginDate(map.get("startDate"));
+        deptBalanceVo.setEndDate(map.get("endDate"));
         SysPartnerInfoConsoleDto result = deptBalanceService.getTeamInfo(deptBalanceVo);
         return HttpResult.ok(result);
     }
@@ -144,6 +161,9 @@ public class DeptBalanceController {
     @PostMapping("/getTeamUserInfo")
     @ApiOperation(value = "查看团队下人员信息")
     public HttpResult<SysPartnerInfoConsoleDto> getTeamUserInfo(@RequestBody DeptBalanceVo deptBalanceVo) {
+        HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
+        deptBalanceVo.setBeginDate(map.get("startDate"));
+        deptBalanceVo.setEndDate(map.get("endDate"));
         SysPartnerInfoConsoleDto result = deptBalanceService.getTeamUserInfo(deptBalanceVo);
         return HttpResult.ok(result);
     }
@@ -162,7 +182,6 @@ public class DeptBalanceController {
     }
 
 
-
     /**
      * @version
      * @author: whp
@@ -176,9 +195,10 @@ public class DeptBalanceController {
         deptBalanceVo.setBeginDate(map.get("startDate"));
         deptBalanceVo.setEndDate(map.get("endDate"));
         KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
-        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
-        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
-            if("1".equals(kztGetDeptUtilsDto.getType())){
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL()
+                .toString());
+        if (ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)) {
+            if ("1".equals(kztGetDeptUtilsDto.getType())) {
                 deptBalanceVo.setDeptIds(kztGetDeptUtilsDto.getIds());
             } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
                 deptBalanceVo.setUserIds(kztGetDeptUtilsDto.getIds());
@@ -190,35 +210,35 @@ public class DeptBalanceController {
 
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/19 11:57
-     *  @Description:  通过时间类型判断
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/19 11:57
+     * @Description: 通过时间类型判断
      */
-    private static HashMap<String,String> getDateMapByType(String type, String startDate, String endDate) {
-        HashMap<String,String> map =new HashMap<>();
-        String  startDateStr="";
-        String  endDateStr="";
-        if(org.apache.commons.lang3.StringUtils.isNotBlank(startDate) && org.apache.commons.lang3.StringUtils.isNotBlank(endDate)){
-            startDateStr= org.apache.commons.lang3.StringUtils.isNotBlank(startDate)?startDate+" 00:00:00":null;
-            endDateStr= org.apache.commons.lang3.StringUtils.isNotBlank(endDate)?endDate+" 23:59:59":null;
-        }else{
-            if("1".equals(type)){
+    private static HashMap<String, String> getDateMapByType(String type, String startDate, String endDate) {
+        HashMap<String, String> map = new HashMap<>();
+        String startDateStr = "";
+        String endDateStr = "";
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(startDate) && org.apache.commons.lang3.StringUtils.isNotBlank(endDate)) {
+            startDateStr = org.apache.commons.lang3.StringUtils.isNotBlank(startDate) ? startDate + " 00:00:00" : null;
+            endDateStr = org.apache.commons.lang3.StringUtils.isNotBlank(endDate) ? endDate + " 23:59:59" : null;
+        } else {
+            if ("1".equals(type)) {
                 // 近1天
-                startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),0)+" 00:00:00";
-                endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
-            }else if("2".equals(type)){
+                startDateStr = SliceUpDateUtil.getBeforeDay(new Date(), 0) + " 00:00:00";
+                endDateStr = SliceUpDateUtil.getBeforeDay(new Date(), 0) + " 23:59:59";
+            } else if ("2".equals(type)) {
                 // 近7天
-                startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),1)+" 00:00:00";
-                endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
-            }else if("3".equals(type)){
+                startDateStr = SliceUpDateUtil.getBeforeDay(new Date(), 1) + " 00:00:00";
+                endDateStr = SliceUpDateUtil.getBeforeDay(new Date(), 0) + " 23:59:59";
+            } else if ("3".equals(type)) {
                 // 近30天
-                startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),6)+" 00:00:00";
-                endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
+                startDateStr = SliceUpDateUtil.getBeforeDay(new Date(), 6) + " 00:00:00";
+                endDateStr = SliceUpDateUtil.getBeforeDay(new Date(), 0) + " 23:59:59";
             }
         }
-        map.put("startDate",startDateStr);
-        map.put("endDate",endDateStr);
+        map.put("startDate", startDateStr);
+        map.put("endDate", endDateStr);
         return map;
     }
 

+ 22 - 0
src/main/java/com/ydtech/modules/admin/controller/taskStatistics/TaskStatisticsController.java

@@ -530,6 +530,27 @@ public class TaskStatisticsController {
         }
     }
 
+
+    /**
+     * @description:   控制台 - 业务数据 -渠道明细导出
+     * @author: whp
+     **/
+    @PostMapping("/detailExport")
+    @ApiOperation(value = "任务统计-代理人导出")
+    public HttpResult detailExport(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
+        taskStatisticsVo.filterTime();
+        return this.taskStatisticsService.detailExport(taskStatisticsVo);
+    }
+
     /**
      * @description:   控制台 - 业务数据 -代理人导出
      * @author: whp
@@ -643,6 +664,7 @@ public class TaskStatisticsController {
         }
     }
 
+
     /**
      *
      * @param taskStatisticsVo

+ 86 - 0
src/main/java/com/ydtech/modules/admin/dao/PartnerWalletMapper.java

@@ -0,0 +1,86 @@
+package com.ydtech.modules.admin.dao;
+
+import com.ydtech.modules.admin.model.dto.partner.CopartnerAndStudioNumberDTO;
+import com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface PartnerWalletMapper {
+
+    /**
+     * 获取会员总人数
+     *
+     * @param userIdList 用户列表
+     * @return 会员总人数
+     */
+    List<PartnerDataDTO> getMemberNumber(@Param("userIdList") List<String> userIdList);
+
+    /**
+     * 获取总保费
+     *
+     * @param userIdList 用户列表
+     * @return 总保费
+     */
+    List<PartnerDataDTO> getTotalPremiums(@Param("userIdList") List<String> userIdList, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    /**
+     * 获取总佣金
+     *
+     * @param userIdList 用户列表
+     * @return 佣金
+     */
+    List<PartnerDataDTO> getCommission(@Param("userIdList") List<String> userIdList, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    /**
+     * 获取合伙人工作室数量
+     *
+     * @param userIdList 人员列表
+     * @return 合伙人 工作室数量
+     */
+    List<CopartnerAndStudioNumberDTO> getCopartnerAndStudioNumber(@Param("userIdList") List<String> userIdList);
+
+
+    /**
+     * 获取各个等级下合伙人的会员数
+     *
+     * @param userId 用户id
+     * @return
+     */
+    List<PartnerDataDTO> getPartnerRankMemberNumber(@Param("userId") String userId);
+
+
+    /**
+     * 获取各个等级下合伙人 总保费
+     *
+     * @param userId 用户id
+     * @return 总保费
+     */
+    List<PartnerDataDTO> getPartnerRankTotalPremiums(@Param("userId") String userId, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    /**
+     * 获取各个等级下合伙人 总佣金
+     *
+     * @param userId 用户id
+     * @return 佣金
+     */
+    List<PartnerDataDTO> getPartnerRankCommission(@Param("userId") String userId, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    /**
+     * 各个等级下合伙人 合伙人数
+     *
+     * @param userId 用户id
+     * @return 合伙人数
+     */
+    List<PartnerDataDTO> getPartnerRankCopartnerNumber(@Param("userId") String userId);
+
+    /**
+     * 各个等级下合伙人 工作室数
+     *
+     * @param userId 用户id
+     * @return 工作室数
+     */
+    List<PartnerDataDTO> getPartnerRankStudioNumber(@Param("userId") String userId);
+}

+ 3 - 0
src/main/java/com/ydtech/modules/admin/dao/TaskStatisticsMapper.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.admin.dao;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.SysUser;
+import com.ydtech.modules.admin.model.dto.ChannelDetailsExport;
 import com.ydtech.modules.admin.model.dto.OrdersDetailsExcel;
 import com.ydtech.modules.admin.model.vo.BusinessAgentData;
 import com.ydtech.modules.admin.model.vo.BusinessOrderData;
@@ -65,4 +66,6 @@ public interface TaskStatisticsMapper extends BaseMapper<TaskStatisticsDto> {
      */
     List<OrdersDetailsExcel> ordersDetailsExcel(@Param("taskStatisticsVo") TaskStatisticsVo taskStatisticsVo);
 
+    List<ChannelDetailsExport> getAgentDataDetails(@Param("vo") TaskStatisticsVo taskStatisticsVo);
+
 }

+ 54 - 0
src/main/java/com/ydtech/modules/admin/model/dto/ChannelDetailsExport.java

@@ -0,0 +1,54 @@
+package com.ydtech.modules.admin.model.dto;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+public class ChannelDetailsExport  implements Serializable {
+    @ExcelProperty(value = "姓名", index = 0)
+    private String userName;
+
+    @ExcelProperty(value = "工号", index = 1)
+    private String userId;
+
+    @ExcelProperty(value = "归属机构", index = 2)
+    private String deptName;
+
+    @ExcelProperty(value = "管理人", index = 3)
+    private String leaderName;
+
+    @ExcelProperty(value = "机构来源", index = 4)
+    private String managementSource;
+
+
+    @ExcelProperty(value = "保险公司名称", index = 5)
+    private String insuranceCompany;
+
+    @ExcelProperty(value = "签单日期", index = 6)
+    private LocalDateTime signingTime;
+
+    @ExcelProperty(value = "车牌号", index = 7)
+    private String licenseno;
+
+
+    @ExcelProperty(value = "交强险保费", index = 8)
+    private BigDecimal jqpremium;
+
+    @ExcelProperty(value = "商业险保费", index = 9)
+    private BigDecimal sypremium;
+
+    @ExcelProperty(value = "非车险保费", index = 10)
+    private BigDecimal jypremium;
+
+
+    @ExcelIgnore
+    private String deptId;
+
+
+}

+ 5 - 0
src/main/java/com/ydtech/modules/admin/model/dto/SysPartnerConsoleDto.java

@@ -4,7 +4,11 @@ import com.ydtech.modules.admin.model.PartnerInfoVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.models.auth.In;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -12,6 +16,7 @@ import java.util.List;
 
 @Data
 @ApiModel(value = "合伙人控制台")
+@Accessors(chain = true)
 public class SysPartnerConsoleDto implements Serializable {
     /**
      * 员工id

+ 24 - 0
src/main/java/com/ydtech/modules/admin/model/dto/partner/CopartnerAndStudioNumberDTO.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.admin.model.dto.partner;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class CopartnerAndStudioNumberDTO {
+
+    private String userId;
+    /**
+     * 推荐等级(0:直接推荐;1:间接推荐)
+     */
+    private String source;
+    /**
+     * 推荐类型(0:合伙人  1:机构负责人 2:团队长  3:成员)
+     */
+    private String type;
+
+    private String count;
+
+}

+ 20 - 0
src/main/java/com/ydtech/modules/admin/model/dto/partner/PartnerDataDTO.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.admin.model.dto.partner;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class PartnerDataDTO implements Serializable {
+
+    private static final long serialVersionUID = 5947804961787692481L;
+
+    private String userId;
+
+    private String data;
+
+}

+ 21 - 0
src/main/java/com/ydtech/modules/admin/service/PartnerWalletService.java

@@ -0,0 +1,21 @@
+package com.ydtech.modules.admin.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.dto.SysPartnerConsoleDto;
+import com.ydtech.modules.admin.model.vo.DeptBalanceVo;
+
+import java.util.List;
+
+public interface PartnerWalletService {
+
+    /**
+     * 控制台 钱包管理 合伙人 首页查询
+     *
+     * @param deptBalanceVo 查询条件
+     * @return 分页结果
+     */
+    HttpResult<IPage<SysPartnerConsoleDto>> queryPartnerStatistics(DeptBalanceVo deptBalanceVo);
+
+
+}

+ 3 - 0
src/main/java/com/ydtech/modules/admin/service/SysUserService.java

@@ -39,6 +39,9 @@ public interface SysUserService extends BaseIService<SysUser> {
 //    Set<String> findPermissions(String userName);
     Set<String> findPermissions(SysUser sysUser);
 
+    List<SysUser> getFinanceUser();
+
+
     /**
      * 查找用户的角色集合
      *

+ 6 - 0
src/main/java/com/ydtech/modules/admin/service/TaskStatisticsService.java

@@ -201,4 +201,10 @@ public interface TaskStatisticsService {
      **/
     IPage<TaskStatisticsDto> costReviewer(TaskStatisticsVo taskStatisticsVo);
 
+    /**
+     *  控制台 - 业务数据 -渠道明细导出
+     * @param taskStatisticsVo
+     * @return
+     */
+    HttpResult detailExport(TaskStatisticsVo taskStatisticsVo);
 }

+ 111 - 0
src/main/java/com/ydtech/modules/admin/service/impl/PartnerWalletServiceImpl.java

@@ -0,0 +1,111 @@
+package com.ydtech.modules.admin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.dao.PartnerWalletMapper;
+import com.ydtech.modules.admin.dao.SysPartnerMapper;
+import com.ydtech.modules.admin.dao.SysRelationPersonMapper;
+import com.ydtech.modules.admin.model.SysPartner;
+import com.ydtech.modules.admin.model.SysRelationPerson;
+import com.ydtech.modules.admin.model.dto.SysPartnerConsoleDto;
+import com.ydtech.modules.admin.model.dto.partner.CopartnerAndStudioNumberDTO;
+import com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO;
+import com.ydtech.modules.admin.model.vo.DeptBalanceVo;
+import com.ydtech.modules.admin.service.PartnerWalletService;
+import com.ydtech.modules.base.controller.BaseController;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+/**
+ * @description: 控制台 钱包管理 合伙人
+ * @author: wenks
+ * @date: 2025/6/13 15:56
+ **/
+@Service
+@RequiredArgsConstructor
+public class PartnerWalletServiceImpl implements PartnerWalletService {
+
+    private final SysPartnerMapper sysPartnerMapper;
+
+    private final PartnerWalletMapper partnerWalletMapper;
+
+    private final SysRelationPersonMapper sysRelationPersonMapper;
+
+    @Override
+    public HttpResult<IPage<SysPartnerConsoleDto>> queryPartnerStatistics(DeptBalanceVo deptBalanceVo) {
+        Page<SysPartnerConsoleDto> page = new Page<>(deptBalanceVo.getPageNum(), deptBalanceVo.getPageSize());
+        IPage<SysPartnerConsoleDto> sysPartnersPage = sysPartnerMapper.queryPage(page, deptBalanceVo);
+
+        List<String> userIdList = sysPartnersPage.getRecords()
+                .stream()
+                .map(SysPartnerConsoleDto::getUserId)
+                .collect(Collectors.toList());
+
+
+        // 并行查询统计数据
+        CompletableFuture<List<PartnerDataDTO>> memberFuture = CompletableFuture.supplyAsync(
+                () -> partnerWalletMapper.getMemberNumber(userIdList));
+        CompletableFuture<List<PartnerDataDTO>> premiumFuture = CompletableFuture.supplyAsync(
+                () -> partnerWalletMapper.getTotalPremiums(userIdList, deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate()));
+        CompletableFuture<List<PartnerDataDTO>> commissionFuture = CompletableFuture.supplyAsync(
+                () -> partnerWalletMapper.getCommission(userIdList, deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate()));
+        CompletableFuture<List<CopartnerAndStudioNumberDTO>> studioFuture = CompletableFuture.supplyAsync(
+                () -> partnerWalletMapper.getCopartnerAndStudioNumber(userIdList));
+
+        LambdaQueryWrapper<SysRelationPerson> eq = new LambdaQueryWrapper<SysRelationPerson>()
+                .eq(SysRelationPerson::getSource, "0")
+                .eq(SysRelationPerson::getType, "1")
+                .in(SysRelationPerson::getSuggestId, userIdList);
+
+        CompletableFuture<List<SysRelationPerson>> sysRelationPerson = CompletableFuture.supplyAsync(
+                () -> sysRelationPersonMapper.selectList(eq));
+
+        CompletableFuture.allOf(memberFuture, premiumFuture, commissionFuture, studioFuture, sysRelationPerson).join();
+
+        // 转换为Map
+        Map<String, String> memberMap = convertToMap(memberFuture.join());
+        Map<String, String> premiumMap = convertToMap(premiumFuture.join());
+        Map<String, String> commissionMap = convertToMap(commissionFuture.join());
+        Map<String, String> studioMap = studioFuture.join().stream()
+                .collect(Collectors.toMap(
+                        x -> x.getUserId() + x.getSource() + x.getType(),
+                        CopartnerAndStudioNumberDTO::getCount));
+        Map<String, List<String>> collect = sysRelationPerson.join()
+                .stream()
+                .collect(Collectors.groupingBy(SysRelationPerson::getSuggestId, Collectors.mapping(SysRelationPerson::getAgencyLeaderId, Collectors.toList())));
+
+
+        // 填充统计数据
+        sysPartnersPage.getRecords().forEach(dto -> {
+            dto.setLoginUserId(deptBalanceVo.getUserId());
+            dto.setLeaderIds(collect.get(dto.getUserId()));
+            dto.setMemberShip(Integer.parseInt(memberMap.getOrDefault(dto.getUserId(), "0")));
+            dto.setTotalIncome(new BigDecimal(premiumMap.getOrDefault(dto.getUserId(), "0")));
+            dto.setCommission(new BigDecimal(commissionMap.getOrDefault(dto.getUserId(), "0")));
+            dto.setNumberPartners(Integer.parseInt(studioMap.getOrDefault(dto.getUserId() + "00", "0")));
+            dto.setDirectStudio(Integer.parseInt(studioMap.getOrDefault(dto.getUserId() + "01", "0")));
+            dto.setIndirectStudio(Integer.parseInt(studioMap.getOrDefault(dto.getUserId() + "11", "0")));
+        });
+
+        return HttpResult.ok(sysPartnersPage);
+    }
+
+    private Map<String, String> convertToMap(List<PartnerDataDTO> list) {
+        return Optional.ofNullable(list)
+                .orElse(Collections.emptyList())
+                .stream()
+                .collect(Collectors.toMap(PartnerDataDTO::getUserId, PartnerDataDTO::getData));
+    }
+
+}

+ 6 - 2
src/main/java/com/ydtech/modules/admin/service/impl/SysLoginServiceImpl.java

@@ -7,7 +7,9 @@ import com.ydtech.constants.SysConstants;
 import com.ydtech.constants.sys.SysPasswordEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.constants.ManagementSource;
 import com.ydtech.modules.admin.constants.UserWorkStatus;
+import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysPassword;
 import com.ydtech.modules.admin.model.SysRole;
 import com.ydtech.modules.admin.model.SysUser;
@@ -38,6 +40,8 @@ public class SysLoginServiceImpl implements SysLoginService {
 
     private final SysUserRoleService sysUserRoleService;
 
+    private final SysDeptService sysDeptService;
+
     @Override
     public HttpResult<String> loginApp(LoginBean loginBean) {
         this.verifyTheVerificationCode(loginBean);
@@ -90,8 +94,8 @@ public class SysLoginServiceImpl implements SysLoginService {
                 throw new SystemException("该用户未授权");
             }
         }
-
-        if ("2".equals(user.getManagementSource())) {
+        SysDept sysDept = sysDeptService.getById(user.getDeptId());
+        if (ManagementSource.MS_02.getCode().equals(sysDept.getManagementSource())) {
             user.setIsLock(0);
         }
         //验证用户

+ 9 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java

@@ -584,6 +584,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
         return perms;
     }
+
+    @Override
+    public List<SysUser> getFinanceUser() {
+        String financeDeptId = "9914D17";
+        List<SysUser> sysUsers = baseMapper.selectList(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getDeptId, financeDeptId)
+                .eq(SysUser::getStatus, 1));
+        return sysUsers;
+    }
 //    @Override
 //    public Set<String> findPermissions(SysUser sysUser) {
 //        Set<String> perms = new HashSet<>();

+ 70 - 0
src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java

@@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
 import java.math.BigDecimal;
@@ -38,6 +39,7 @@ import java.math.RoundingMode;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -1526,4 +1528,72 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
         return list;
     }
 
+    /**
+     *      控制台 - 业务数据 -渠道明细导出
+     * @param taskStatisticsVo
+     * @return
+     */
+    @Override
+    public HttpResult detailExport(TaskStatisticsVo taskStatisticsVo) {
+        if (StringUtils.isNotEmpty(taskStatisticsVo.getTreeType())) {
+            if ((StringUtils.isNotEmpty(taskStatisticsVo.getTreeUserId()) && "2".equals(taskStatisticsVo.getTreeType()))) {
+                List<String> userIds = this.getNextLevel(taskStatisticsVo.getTreeUserId());
+                if (!userIds.isEmpty() && userIds.get(0) != null) {
+                    taskStatisticsVo.setUserIds(userIds);
+                } else {
+                    taskStatisticsVo.setUserId(taskStatisticsVo.getTreeUserId());
+                }
+            } else if (StringUtils.isNotEmpty(taskStatisticsVo.getTreeUserId()) && "1".equals(taskStatisticsVo.getTreeType())) {
+                taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
+                taskStatisticsVo.setTreeUserId(null);
+                taskStatisticsVo.setUserIds(new ArrayList<>());
+            }
+        }
+        PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
+        Page<TaskStatisticsVo> page = new Page<>(taskStatisticsVo.getPageNum(), taskStatisticsVo.getPageSize());
+        page.setSearchCount(false).setOptimizeCountSql(false);//关闭count查询
+        pageVo.setPageNum(taskStatisticsVo.getPageNum());
+        pageVo.setPageSize(taskStatisticsVo.getPageSize());
+
+        HashMap<String, String> dateMapByType = getDateMapByTypeNew(taskStatisticsVo.getDateType(), taskStatisticsVo.getCreatetimeStart(), taskStatisticsVo.getCreatetimeEnd());
+        taskStatisticsVo.setCreatetimeStart(dateMapByType.get("startDate"));
+        taskStatisticsVo.setCreatetimeEnd(dateMapByType.get("endDate"));
+        getDateByType(taskStatisticsVo.getDateType(), taskStatisticsVo);
+
+        IPage<BusinessAgentData> list = this.taskStatisticsMapper.getBusinessAgentData(page, taskStatisticsVo);
+        List<BusinessAgentData> records = list.getRecords();
+        List<String> ids = records.stream()
+                .map(BusinessAgentData::getUserId)  // 提取每个对象的id属性
+                .collect(Collectors.toList());  // 收集到新的List中
+        if(!CollectionUtils.isEmpty(taskStatisticsVo.getUserIds())){
+            ids.addAll(taskStatisticsVo.getUserIds());
+        }
+        taskStatisticsVo.setUserIds(ids);
+
+        List<ChannelDetailsExport> result = taskStatisticsMapper.getAgentDataDetails(taskStatisticsVo);
+        for (ChannelDetailsExport channelDetailsExport : result) {
+            BusinessAgentData businessAgentData = new BusinessAgentData();
+            businessAgentData.setDeptId(channelDetailsExport.getDeptId());
+            this.appendName(businessAgentData);
+            if (StringUtils.isNotEmpty(businessAgentData.getDeptName())) {
+                channelDetailsExport.setDeptName(businessAgentData.getDeptName());
+            }
+        }
+
+        String uploadPath = this.uploadPath + "/excel/";
+        Path path = Paths.get(uploadPath);
+        if (!Files.exists(path)) {
+            try {
+                Files.createDirectories(path);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String formattedDate = sdf.format(new Date());
+        String fileName = EasyExcelUtils.downExcel(uploadPath, "1".equals(taskStatisticsVo.getManagementSource()) ? "业务数据渠道明细导出": "业务数据代理人明细导出"+formattedDate, ChannelDetailsExport.class, result);
+        return HttpResult.ok("", uploadUrl + "excel/" + fileName);
+    }
+
 }

+ 121 - 55
src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java

@@ -9,7 +9,6 @@ import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
-import com.ydtech.modules.order.entity.api.bohai.constants.VehicleUsage;
 import com.ydtech.modules.order.entity.api.dajia.constants.TypeVehicleMapping;
 import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
@@ -24,6 +23,7 @@ import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.regex.Pattern;
 
 /**
@@ -81,7 +81,8 @@ public class RuleAttrMappingVo {
         LocalDate currentDate = LocalDate.now();
 
         //特种车判断
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("SpecialVehicle", Objects.nonNull(carInfo.getImportFlag()) && carInfo.getImportFlag().equals("特种车类") ? "1" : "0"));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("SpecialVehicle", Objects.nonNull(carInfo.getImportFlag()) && carInfo.getImportFlag()
+                .equals("特种车类") ? "1" : "0"));
 
         //交强起保日期
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("JqStartTime", insAreaCompany.getJqStartDate()));
@@ -90,8 +91,9 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyStartTime", insAreaCompany.getSyStartDate()));
 
         // 中煤不浮动原因
-        if(Objects.nonNull(quoteRespVo)) {
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("RateFloatFlag", ZmTransferType.getByCode(quoteRespVo.getRateFloatFlag())));
+        if (Objects.nonNull(quoteRespVo)) {
+            String rateFloatFlag = ZmTransferType.getByCode(quoteRespVo.getRateFloatFlag());
+            ruleAttrMappingVoList.add(new RuleAttrMappingVo("RateFloatFlag", rateFloatFlag == null ? "null" : rateFloatFlag));
         }
 
         boolean isNoLicenseFlag = false;
@@ -117,7 +119,6 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleAge", String.valueOf(between)));
 
 
-
         //发证日期
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("DateofIssuance", carInfo.getIssueDate()));
         //车长
@@ -128,17 +129,20 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyRenewalOfInsurance", insAreaCompany.getSyRenewal()));
 
         CustomerInfoVo ownerInfo = insOrders.getOwnerinfo().toJavaObject(CustomerInfoVo.class);
-        if(StringUtils.isBlank(ownerInfo.getProperty()) || !"0".equals(ownerInfo.getProperty())) {
+        if (StringUtils.isBlank(ownerInfo.getProperty()) || !"0".equals(ownerInfo.getProperty())) {
             //车主 证件号码(前6位)
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersIDNumber", ownerInfo.getIdentifyNumber()));
             //车主 年龄
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersAge", ownerInfo.getAge()));
             //车主 性别
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersSex", ownerInfo.getGender().equals("男") ? "1" : "2"));
+            ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersSex", ownerInfo.getGender()
+                    .equals("男") ? "1" : "2"));
             //车主地址
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersAddress", ownerInfo.getAddr()));
             // 车主生日
-            String carOwnersBirthday = ownerInfo.getIdentifyNumber().substring(6,10) + "-" + ownerInfo.getIdentifyNumber().substring(10,12) + "-" + ownerInfo.getIdentifyNumber().substring(12,14);
+            String carOwnersBirthday = ownerInfo.getIdentifyNumber()
+                    .substring(6, 10) + "-" + ownerInfo.getIdentifyNumber()
+                    .substring(10, 12) + "-" + ownerInfo.getIdentifyNumber().substring(12, 14);
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersBirthday", carOwnersBirthday));
 
         }
@@ -146,81 +150,103 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnerName", ownerInfo.getName()));
 
         CustomerInfoVo policyHolderInfo = insOrders.getApplyinfo().toJavaObject(CustomerInfoVo.class);
-        if(StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())) {
+        if (StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())) {
             //投保人 证件号码(前6位)
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantIDNumber", policyHolderInfo.getIdentifyNumber()));
             //投保人 年龄
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantAge", policyHolderInfo.getAge()));
             //投保人 性别
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantSex", policyHolderInfo.getGender().equals("男") ? "1" : "2"));
+            ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantSex", policyHolderInfo.getGender()
+                    .equals("男") ? "1" : "2"));
             //投保人地址
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantAddress", policyHolderInfo.getAddr()));
             // 投保人生日
-            String applicantBirthday = policyHolderInfo.getIdentifyNumber().substring(6,10) + "-" + policyHolderInfo.getIdentifyNumber().substring(10,12) + "-" + policyHolderInfo.getIdentifyNumber().substring(12,14);
+            String applicantBirthday = policyHolderInfo.getIdentifyNumber()
+                    .substring(6, 10) + "-" + policyHolderInfo.getIdentifyNumber()
+                    .substring(10, 12) + "-" + policyHolderInfo.getIdentifyNumber().substring(12, 14);
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantBirthday", applicantBirthday));
         }
 
         CustomerInfoVo insuredPersonInfo = insOrders.getInsureinfo().toJavaObject(CustomerInfoVo.class);
-        if(StringUtils.isBlank(insuredPersonInfo.getProperty()) || !"0".equals(insuredPersonInfo.getProperty())) {
+        if (StringUtils.isBlank(insuredPersonInfo.getProperty()) || !"0".equals(insuredPersonInfo.getProperty())) {
             //被保人 证件号码(前6位)
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredIDNumber", insuredPersonInfo.getIdentifyNumber()));
             //被保人 年龄
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredAge", insuredPersonInfo.getAge()));
             //被保人 性别
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredSex", insuredPersonInfo.getGender().equals("男") ? "1" : "2"));
+            ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredSex", insuredPersonInfo.getGender()
+                    .equals("男") ? "1" : "2"));
             //被保人地址
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredAddress", insuredPersonInfo.getAddr()));
             //被保人生日
-            String insuredBirthday = insuredPersonInfo.getIdentifyNumber().substring(6,10) + "-" + insuredPersonInfo.getIdentifyNumber().substring(10,12) + "-" + insuredPersonInfo.getIdentifyNumber().substring(12,14);
+            String insuredBirthday = insuredPersonInfo.getIdentifyNumber()
+                    .substring(6, 10) + "-" + insuredPersonInfo.getIdentifyNumber()
+                    .substring(10, 12) + "-" + insuredPersonInfo.getIdentifyNumber().substring(12, 14);
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredBirthday", insuredBirthday));
         }
         String OPIConsistent = "0";
-        if(StringUtils.isNotBlank(ownerInfo.getProperty())){
-            boolean boo = ownerInfo.getProperty().equals(insuredPersonInfo.getProperty()) && insuredPersonInfo.getProperty().equals(policyHolderInfo.getProperty());
-            if(boo){
-                if("0".equals(ownerInfo.getProperty())){
-                    if((ownerInfo.getName().equals(insuredPersonInfo.getName()) && insuredPersonInfo.getName().equals(policyHolderInfo.getName())) &&
-                            (ownerInfo.getOrganizationCode().equals(insuredPersonInfo.getOrganizationCode()) && insuredPersonInfo.getOrganizationCode().equals(policyHolderInfo.getOrganizationCode()))){
+        if (StringUtils.isNotBlank(ownerInfo.getProperty())) {
+            boolean boo = ownerInfo.getProperty()
+                    .equals(insuredPersonInfo.getProperty()) && insuredPersonInfo.getProperty()
+                    .equals(policyHolderInfo.getProperty());
+            if (boo) {
+                if ("0".equals(ownerInfo.getProperty())) {
+                    if ((ownerInfo.getName().equals(insuredPersonInfo.getName()) && insuredPersonInfo.getName()
+                            .equals(policyHolderInfo.getName())) &&
+                            (ownerInfo.getOrganizationCode()
+                                    .equals(insuredPersonInfo.getOrganizationCode()) && insuredPersonInfo.getOrganizationCode()
+                                    .equals(policyHolderInfo.getOrganizationCode()))) {
                         OPIConsistent = "1";
                     }
-                }else{
-                    if((ownerInfo.getName().equals(insuredPersonInfo.getName()) && insuredPersonInfo.getName().equals(policyHolderInfo.getName())) &&
-                            (ownerInfo.getIdentifyNumber().equals(insuredPersonInfo.getIdentifyNumber()) && insuredPersonInfo.getIdentifyNumber().equals(policyHolderInfo.getIdentifyNumber()))){
+                } else {
+                    if ((ownerInfo.getName().equals(insuredPersonInfo.getName()) && insuredPersonInfo.getName()
+                            .equals(policyHolderInfo.getName())) &&
+                            (ownerInfo.getIdentifyNumber()
+                                    .equals(insuredPersonInfo.getIdentifyNumber()) && insuredPersonInfo.getIdentifyNumber()
+                                    .equals(policyHolderInfo.getIdentifyNumber()))) {
                         OPIConsistent = "1";
                     }
                 }
             }
-        }else {
-            if ((ownerInfo.getName().equals(insuredPersonInfo.getName()) && insuredPersonInfo.getName().equals(policyHolderInfo.getName())) &&
-                    (ownerInfo.getIdentifyNumber().equals(insuredPersonInfo.getIdentifyNumber()) && insuredPersonInfo.getIdentifyNumber().equals(policyHolderInfo.getIdentifyNumber()))) {
+        } else {
+            if ((ownerInfo.getName().equals(insuredPersonInfo.getName()) && insuredPersonInfo.getName()
+                    .equals(policyHolderInfo.getName())) &&
+                    (ownerInfo.getIdentifyNumber()
+                            .equals(insuredPersonInfo.getIdentifyNumber()) && insuredPersonInfo.getIdentifyNumber()
+                            .equals(policyHolderInfo.getIdentifyNumber()))) {
                 OPIConsistent = "1";
             }
         }
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("OPIConsistent",OPIConsistent));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("OPIConsistent", OPIConsistent));
         String PIConsistent = "0";
 
-        if(StringUtils.isNotBlank(insuredPersonInfo.getProperty())){
+        if (StringUtils.isNotBlank(insuredPersonInfo.getProperty())) {
             boolean boo = insuredPersonInfo.getProperty().equals(policyHolderInfo.getProperty());
-            if(boo){
-                if("0".equals(insuredPersonInfo.getProperty())){
+            if (boo) {
+                if ("0".equals(insuredPersonInfo.getProperty())) {
                     //投被保人是否一致
-                    if(insuredPersonInfo.getName().equals(policyHolderInfo.getName()) && insuredPersonInfo.getOrganizationCode().equals(policyHolderInfo.getOrganizationCode())){
+                    if (insuredPersonInfo.getName()
+                            .equals(policyHolderInfo.getName()) && insuredPersonInfo.getOrganizationCode()
+                            .equals(policyHolderInfo.getOrganizationCode())) {
                         PIConsistent = "1";
                     }
-                }else{
+                } else {
                     //投被保人是否一致
-                    if(insuredPersonInfo.getName().equals(policyHolderInfo.getName()) && insuredPersonInfo.getIdentifyNumber().equals(policyHolderInfo.getIdentifyNumber())){
+                    if (insuredPersonInfo.getName()
+                            .equals(policyHolderInfo.getName()) && insuredPersonInfo.getIdentifyNumber()
+                            .equals(policyHolderInfo.getIdentifyNumber())) {
                         PIConsistent = "1";
                     }
                 }
             }
-        }else{
+        } else {
             //投被保人是否一致
-            if(insuredPersonInfo.getName().equals(policyHolderInfo.getName()) && insuredPersonInfo.getIdentifyNumber().equals(policyHolderInfo.getIdentifyNumber())){
+            if (insuredPersonInfo.getName().equals(policyHolderInfo.getName()) && insuredPersonInfo.getIdentifyNumber()
+                    .equals(policyHolderInfo.getIdentifyNumber())) {
                 PIConsistent = "1";
             }
-       }
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("PIConsistent",PIConsistent));
+        }
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("PIConsistent", PIConsistent));
 
         //2024-06-20 起保日期 月份判断
         if (insAreaCompany.getJqStartDate() != null && !insAreaCompany.getJqStartDate().equals("")) {
@@ -236,69 +262,86 @@ public class RuleAttrMappingVo {
         //险别信息
         kindInfoVos.forEach(kindInfoVo -> {
             //机动车损失险
-            if (InsurKind.A.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.A.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("MotorVehicleDamageInsurance", String.valueOf(kindInfoVo.getAmount())));
+            }
             //第三者责任险
-            if (InsurKind.B.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.B.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("ThirdPartyLiabilityInsurance",
                         String.valueOf(Double.valueOf(kindInfoVo.getAmount()).intValue())));
+            }
             //司机责任险
-            if (InsurKind.D3.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.D3.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("DriverLiabilityInsurance", String.valueOf(kindInfoVo.getAmount())));
+            }
             //乘客责任险
-            if (InsurKind.D4.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.D4.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("PassengerLiabilityInsurance", String.valueOf(kindInfoVo.getUnitAmount())));
+            }
             //车身划痕险
-            if (InsurKind.L.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.L.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarScratchInsurance", String.valueOf(kindInfoVo.getAmount())));
+            }
             //绝对免赔率特约险(车损)
-            if (InsurKind.MJ1.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.MJ1.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleDamageAbsoluteDeductibleSpecialInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //绝对免赔率特约险(三者)
-            if (InsurKind.MJ2.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.MJ2.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("ThirdAbsoluteDeductibleSpecialInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //绝对免赔率特约险(司机)
-            if (InsurKind.MJ3.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.MJ3.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("DriverAbsoluteDeductibleSpecialInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //绝对免赔率特约险(乘客)
-            if (InsurKind.MJ4.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.MJ4.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("PassengerAbsoluteDeductibleSpecialInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //附加医保-三者
-            if (InsurKind.SY_FJ_YBW1.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.SY_FJ_YBW1.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("ThirdPartyAdditionalMedicalInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //附加医保-座位险(乘客)
-            if (InsurKind.SY_FJ_YBW2.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.SY_FJ_YBW2.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("PassengerAdditionalMedicalInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //附加医保-座位险(司机)
-            if (InsurKind.SY_FJ_YBW3.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.SY_FJ_YBW3.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("DriverAdditionalMedicalInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //法定节假日限额翻倍险
-            if (InsurKind.BD.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.BD.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("LegalHolidayLimitDoublingInsurance",
                         String.valueOf(kindInfoVo.getAmount())));
+            }
             //道路救援服务特约条款
-            if (InsurKind.TY1.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.TY1.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("RoadsideAssistanceServiceSpecialClause",
                         String.valueOf(kindInfoVo.getServiceTimes())));
+            }
             //车辆安全检测特约条款
-            if (InsurKind.TY2.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.TY2.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleSafetyInspectionSpecialClause",
                         String.valueOf(kindInfoVo.getServiceTimes())));
+            }
             //代为驾驶服务特约条款
-            if (InsurKind.TY3.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.TY3.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("SubstituteDrivingServiceSpecialClause",
                         String.valueOf(kindInfoVo.getServiceTimes())));
+            }
             //代为送检服务特约条款
-            if (InsurKind.TY4.getCode().equals(kindInfoVo.getKindCode()))
+            if (InsurKind.TY4.getCode().equals(kindInfoVo.getKindCode())) {
                 ruleAttrMappingVoList.add(new RuleAttrMappingVo("SubstituteInspectionServiceSpecialClause",
                         String.valueOf(kindInfoVo.getServiceTimes())));
+            }
         });
 
         //交强保费
@@ -314,6 +357,28 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("CompulsoryInsuranceDiscount", String.valueOf(insAreaCompany.getJqAdjustRate())));
         //商业折扣
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("CommercialDiscount", String.valueOf(insAreaCompany.getSyAdjustRate())));
+
+        //永安评分
+        Optional.ofNullable(quoteRespVo)
+                .map(quoteRespVo1 -> quoteRespVo.getYaScore())
+                .ifPresent(x -> {
+                    ruleAttrMappingVoList.add(new RuleAttrMappingVo("YaScore", x));
+                });
+
+        //永安交强费用浮动
+        Optional.ofNullable(quoteRespVo)
+                .map(quoteRespVo1 -> quoteRespVo.getCifeeFloat())
+                .ifPresent(x -> {
+                    ruleAttrMappingVoList.add(new RuleAttrMappingVo("CifeeFloat", x));
+                });
+
+        //永安商业费用浮动
+        Optional.ofNullable(quoteRespVo)
+                .map(quoteRespVo1 -> quoteRespVo.getBifeeFloat())
+                .ifPresent(x -> {
+                    ruleAttrMappingVoList.add(new RuleAttrMappingVo("BifeeFloat", x));
+                });
+
         //数值型总评分
         Pattern pattern = Pattern.compile("[0-9]*");
         if (insAreaCompany.getScore() != null) {
@@ -358,7 +423,8 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("GreenYellowAndRedAreas", insAreaCompany.getTpColorScore()));
         if (insAreaCompany.getAccidentalDriving() != null) {
             //非车名称
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", insAreaCompany.getAccidentalDriving().getRideRiskName()));
+            ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", insAreaCompany.getAccidentalDriving()
+                    .getRideRiskName()));
             //非车份数
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity",
                     String.valueOf(insAreaCompany.getAccidentalDriving().getQuantity())));

+ 2 - 2
src/main/java/com/ydtech/modules/fee/service/FeeRuleSchemeNewService.java

@@ -57,7 +57,7 @@ public interface FeeRuleSchemeNewService {
      * @param insAreaCompany
      * @param insOrders
      */
-    void verificationCostFactor(QuoteRespVo quoteRespVo, InsAreaCompany insAreaCompany, InsOrders insOrders, StringBuilder logs);
+    void verificationCostFactor(QuoteRespVo quoteRespVo, InsAreaCompany insAreaCompany, InsOrders insOrders, StringBuilder logs, boolean isInternalAgreement);
 
     /**
      * 查找匹配承保规则的因子
@@ -96,7 +96,7 @@ public interface FeeRuleSchemeNewService {
      *
      * @param costsId
      */
-    void calcCosts(String costsId, InsAreaCompany insAreaCompany);
+    void calcCosts(String costsId, InsAreaCompany insAreaCompany, boolean isInternalAgreement);
 
 
     void calcCostsTest(String costsId, InsAreaCompany insAreaCompany);

+ 19 - 12
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -48,6 +48,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.math.RoundingMode;
 import java.text.DateFormat;
 import java.time.LocalDate;
@@ -138,7 +139,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
      * 校验费用因子
      */
     @Override
-    public void verificationCostFactor(QuoteRespVo quoteRespVo, InsAreaCompany insAreaCompany, InsOrders insOrders, StringBuilder logs) {
+    public void verificationCostFactor(QuoteRespVo quoteRespVo, InsAreaCompany insAreaCompany, InsOrders insOrders, StringBuilder logs, boolean isInternalAgreement) {
 
         List<AgreementProductCosts> agreementProductCostsNoMatched =
                 ptlAgreementProductCostsNewService.costsGetList(insAreaCompany.getAgreementId(), insAreaCompany.getProductid());
@@ -198,7 +199,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
             //遍历费用因子
             String costsId = verificationCosts(agreementProductCosts, quoteRespVo, insAreaCompany, insOrders, logs);
             if (costsId != null) {
-                calcCosts(costsId, insAreaCompany);
+                calcCosts(costsId, insAreaCompany, isInternalAgreement);
                 log.debug("费用因子校验通过,子订单id:" + insAreaCompany.getId() + ",费用id:" + costsId);
             }
         } else {
@@ -335,7 +336,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
      * @param insAreaCompany
      */
     @Override
-    public void calcCosts(String costsId, InsAreaCompany insAreaCompany) {
+    public void calcCosts(String costsId, InsAreaCompany insAreaCompany, boolean isInternalAgreement) {
         //获取协议信息
         PtlAgreement ptlAgreement = ptlAgreementService.getById(insAreaCompany.getAgreementId());
         InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
@@ -468,8 +469,13 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
                 .add(retailProportion.getNoRetailLevel2Proportion())
                 .add(retailProportion.getNoRetailLevel3Proportion());
 
-        // 外部订单比例
-        BigDecimal enterProportion = sysSwitchConfigService.getEnterProportion(insOrders.getDeptid(), insOrders.getEntryStatus());
+        BigDecimal enterProportion = new BigDecimal(BigInteger.ZERO);
+        
+        // 待客录单订单比例 根据前端传值 判断是否使用待客录单比例
+        if(!isInternalAgreement){
+            enterProportion = sysSwitchConfigService.getEnterProportion(insOrders.getDeptid(), insOrders.getEntryStatus());
+        }
+        
 
         //重新计算比例  入口是否超出支付的比例
         ReCalcuLateProportion jqReCalcuLateProportion = recalculateProportion(
@@ -2793,7 +2799,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         //获取所有费用属性
         List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         //获取新旧车信息
-        PtlNewCarJudgeRules carJudgeRule = getCarJudgeRule(insAreaCompany.getCompanyId());
+        PtlNewCarJudgeRules carJudgeRule = getCarJudgeRule(insAreaCompany.getCompanyId(), insOrders.getCarinfo().getString("cimodelclass"));
         //获取所有费用属性关联
         List<RuleAttrMappingVo> ruleAttrMappingVoList = RuleAttrMappingVo.getRuleAttrMappingVoList(quoteRespVo, insAreaCompany, insOrders,
                 undwrtRulesAttrList, carJudgeRule);
@@ -2826,7 +2832,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         //获取所有费用属性关联
         List<RuleAttrMappingVo> ruleAttrMappingVoList = RuleAttrMappingVo.getRuleAttrMappingVoList(null,insAreaCompany, insOrders,
-                undwrtRulesAttrList, getCarJudgeRule(insAreaCompany.getCompanyId()));
+                undwrtRulesAttrList, getCarJudgeRule(insAreaCompany.getCompanyId(),insOrders.getCarinfo().getString("cimodelclass")));
 
 
         for (int i = 0; i < ptlAgreementUndwrtRulesNews.size(); i++) {
@@ -3288,8 +3294,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
             return true;
         }
         // 不包含的情况
-        if (ptlAgreementProductCostsAttrLink.getMin()!= null && ptlAgreementProductCostsAttrLink.getMin().contains(value) && ptlAgreementProductCostsAttrLink.getOperator().equals("1")) {
-            return false;
+        if (ptlAgreementProductCostsAttrLink.getMin()!= null && !ptlAgreementProductCostsAttrLink.getMin().contains(value) && ptlAgreementProductCostsAttrLink.getOperator().equals("1")) {
+            return true;
         }
         return false;
     }
@@ -3524,11 +3530,12 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
      * @param companyId
      * @return
      */
-    private PtlNewCarJudgeRules getCarJudgeRule(String companyId) {
+    private PtlNewCarJudgeRules getCarJudgeRule(String companyId, String vehicleType) {
         //获取车辆新旧车信息
         List<PtlNewCarJudgeRules> list =
-                ptlNewCarJudgeRulesService.list(new LambdaQueryWrapper<PtlNewCarJudgeRules>().eq(PtlNewCarJudgeRules::getCompanyId,
-                        companyId));
+                ptlNewCarJudgeRulesService.list(new LambdaQueryWrapper<PtlNewCarJudgeRules>()
+                        .eq(PtlNewCarJudgeRules::getCompanyId,companyId)
+                        .eq(PtlNewCarJudgeRules::getVehicleType,vehicleType));
         if (list.size() > 0) {
             return list.get(0);
         }

+ 6 - 6
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -2290,12 +2290,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             }
             List<SettlementDocumentaryFeesEntity> settleInsPlyIncomes = settlementDocumentaryFeesService.queryAmount(params);  //金额总数
             for (SettlementDocumentaryFeesEntity settleInsPlyIncome : settleInsPlyIncomes) {
-                BigDecimal settleIcommissionFeevalue = settleInsPlyIncome.getSettlementAmount();// 已结算金额
-                readyCommissionFeevalue = readyCommissionFeevalue.add(settleIcommissionFeevalue);  //已结算总
-
-                BigDecimal divide = new BigDecimal(100).subtract(settleInsPlyIncome.getTaxPoints()).divide(new BigDecimal(100));
-                expendAmount = expendAmount.add(settleInsPlyIncome.getSettlementAmount().multiply(divide));
-
+                if(ObjectUtils.isNotEmpty(settleInsPlyIncome)){
+                    BigDecimal settleIcommissionFeevalue = settleInsPlyIncome.getSettlementAmount().compareTo(BigDecimal.ZERO) > 0 ? settleInsPlyIncome.getSettlementAmount() : BigDecimal.ZERO;// 已结算金额
+                    readyCommissionFeevalue = readyCommissionFeevalue.add(settleIcommissionFeevalue);  //已结算总
+                    BigDecimal divide = new BigDecimal(100).subtract(settleInsPlyIncome.getTaxPoints()).divide(new BigDecimal(100));
+                    expendAmount = expendAmount.add(settleInsPlyIncome.getSettlementAmount().multiply(divide));
+                }
             }
             params.put("settlementStatus", 0);  //未开票金额
             List<SettlementDocumentaryFeesEntity> noInvoicInsPlyIncomes = settlementDocumentaryFeesService.queryNew(params);  //金额总数

+ 12 - 0
src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java

@@ -223,6 +223,18 @@ public class QuoteRespVo {
     @ApiModelProperty("中煤浮动")
     private String rateFloatFlag;
 
+    @ApiModelProperty("永安评分")
+    private String yaScore;
+
+    @ApiModelProperty("永安交强费用浮动")
+    private String cifeeFloat;
+
+    @ApiModelProperty("永安商业费用浮动")
+    private String bifeeFloat;
+
+    @ApiModelProperty("人保商业折扣")
+    private String preDiscount;
+
     @ApiModelProperty("报价记录")
     private List<SysQuoteRecord> quoteRecords;
 

+ 8 - 1
src/main/java/com/ydtech/modules/ins/model/yc/YcBuildData.java

@@ -68,7 +68,14 @@ public class YcBuildData {
         rd.getCvrgListSY().getCvrgSY().forEach(a -> {
 
             String kindcode = a.getCCvrgNo();
-            int i = ArrayUtil.indexOf(InsuranceTypeCorrespondence.getYongchengConnectInsuranceType(), kindcode);
+            int i = -1;
+            // 燃油
+            if(rd.getVhl().getFuelType().equals("32773001")){
+                i = ArrayUtil.indexOf(InsuranceTypeCorrespondence.getYongchengConnectInsuranceType(), kindcode);
+            }else{
+                // 新能源
+                i = ArrayUtil.indexOf(InsuranceTypeCorrespondence.getYongchengConnectInsuranceTypeNewEmergy(), kindcode);
+            }
             InsurKind insurKind = Enum.valueOf(InsurKind.class, InsuranceTypeCorrespondence.getJinZhangGuiType()[i]);
 
             double premium = StringUtils.parseDouble(a.getNPrm());

+ 19 - 5
src/main/java/com/ydtech/modules/ins/model/yc/ruote/Vhl.java

@@ -8,6 +8,7 @@ import com.ydtech.utils.StringUtils;
 import lombok.Data;
 import org.apache.http.client.utils.DateUtils;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.util.Date;
 
@@ -122,11 +123,12 @@ public class Vhl {
      */
     @JacksonXmlProperty(localName = "CRegVhlTyp")
     private String CRegVhlTyp;
-//    /**
-//     * 吨位
-//     */
-//    @JacksonXmlProperty(localName = "NTonage")
-//    private String NTonage;
+
+    /**
+     * 吨位
+     */
+    @JacksonXmlProperty(localName = "NTonage")
+    private String NTonage;
     /**
      * 功率
      */
@@ -195,6 +197,10 @@ public class Vhl {
      */
     @JacksonXmlProperty(localName = "NPoWeight")
     private String NPoWeight;
+
+    @JacksonXmlProperty(localName = "WholeWeight")
+    private String WholeWeight;
+
     /**
      * 折旧价
      */
@@ -368,6 +374,7 @@ public class Vhl {
         vhl.setCBusType("0");
         vhl.setCMortgageMrk("0");
         vhl.setNPoWeight(carInfo.getCompleteKerbMass());
+        vhl.setWholeWeight(carInfo.getCompleteKerbMass());
         //305005001:未验 305005002:已验车 305005003:免验车 305005004:需验车
         vhl.setCInspectionCde("305005003");
         vhl.setCDevice8Mrk("0");
@@ -422,6 +429,10 @@ public class Vhl {
 
         //车辆用于是否是 营业  非营业货运
         if(carInfo.getVehicleUse().equals("04") || carInfo.getVehicleUse().equals("08")){
+            //货车 吨位
+            BigDecimal limitLoad = new BigDecimal(carInfo.getLimitLoad());
+            vhl.setNTonage(limitLoad.divide(BigDecimal.valueOf(1000), 4, BigDecimal.ROUND_HALF_UP).toString());
+
             //货车
             //2吨以下
             if(Integer.parseInt(carInfo.getLimitLoad()) < 2000){
@@ -451,6 +462,9 @@ public class Vhl {
 
         vhl.setCQryCdeJQ(cQryCdeJQ);
         vhl.setCQryCdeSY(cQryCdeSY);
+
+
+
         return vhl;
     }
 

+ 14 - 5
src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java

@@ -35,11 +35,9 @@ import com.ydtech.modules.protocol.constants.TaxSourceStatusConstants;
 import com.ydtech.modules.protocol.dao.PtlTaxSourceNewMapper;
 import com.ydtech.modules.protocol.entity.dto.TaxSourceExcludeDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementGroupLinkAgreement;
 import com.ydtech.modules.protocol.entity.po.PtlTaxSourceNew;
-import com.ydtech.modules.protocol.service.ITaxSourceExcludeService;
-import com.ydtech.modules.protocol.service.PtlAgreementDeptService;
-import com.ydtech.modules.protocol.service.PtlAgreementService;
-import com.ydtech.modules.protocol.service.PtlTaxSourceNewService;
+import com.ydtech.modules.protocol.service.*;
 import com.ydtech.modules.protocol.service.impl.TaxSourceServiceImpl;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
 import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
@@ -111,6 +109,8 @@ public class QuoteVerificationAspect {
 
     private final SysQuoteRedisService sysQuoteRedisService;
 
+    private final PtlAgreementGroupLinkAgreementService ptlAgreementGroupLinkAgreementService;
+
     @AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
     public void doAfter(HttpResult<QuoteRespVo> result) {
         //计算费用因子
@@ -120,6 +120,15 @@ public class QuoteVerificationAspect {
                     insAreaCompanyAccidentalDrivingService.getByCompanyId(insAreaCompany.getId());
             insAreaCompany.setAccidentalDriving(insAreaCompanyAccidentalDriving);
             InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+            String agreementId = insAreaCompany.getAgreementId();
+            boolean isInternalAgreement = false;
+            // 查找是否是内部协议
+            PtlAgreementGroupLinkAgreement ptlAgreementGroupLinkAgreement = ptlAgreementGroupLinkAgreementService.getOne(new LambdaQueryWrapper<PtlAgreementGroupLinkAgreement>()
+                    .eq(PtlAgreementGroupLinkAgreement::getPtlAgreementId, agreementId)
+                    .eq(PtlAgreementGroupLinkAgreement::getPtlAgreementGroupId, 2));
+            if (ptlAgreementGroupLinkAgreement != null){
+                isInternalAgreement = true;
+            }
             // 更新数据
             if (StringUtils.isNotEmpty(insAreaCompany.getLeaderId())) {
                 SysUser sysUser = sysUserService.getById(insOrders.getUserid());
@@ -132,7 +141,7 @@ public class QuoteVerificationAspect {
             StringBuilder logs = new StringBuilder();
             //再进行费用因子判断
             try {
-                feeRuleSchemeNewService.verificationCostFactor(result.getData(), insAreaCompany, insOrders, logs);
+                feeRuleSchemeNewService.verificationCostFactor(result.getData(), insAreaCompany, insOrders, logs, isInternalAgreement);
                 InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getInsFeeOrderNewByCompanyId(insAreaCompany.getId());
                 if (insFeeOrderNew != null) {
                     //出口

+ 54 - 0
src/main/java/com/ydtech/modules/order/constants/ya/CarDamageVerification.java

@@ -0,0 +1,54 @@
+package com.ydtech.modules.order.constants.ya;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 永安车损校验字典
+ */
+@Getter
+@AllArgsConstructor
+public enum CarDamageVerification {
+
+
+    CarDamage01(1, "按期续保,未增加损失类险种"),
+    CarDamage02(2,"已验车,验车合格"),
+    CarDamage03(3,"未投保损失类险种"),
+    CarDamage04(4,"新车免验车"),
+    CarDamage05(5,"已验车,验车不合格"),
+    CarDamage06(6,"需验车,验车资料后补"),
+    CarDamage07(7,"团单免验"),
+    CarDamage08(8,"新车本地上牌"),
+    CarDamage09(9,"已提供完税证明"),
+    CarDamage10(10,"其他"),;
+
+    private final Integer code;
+
+    private final String desc;
+
+    public static String getDesc(Integer code){
+        for( CarDamageVerification carDamageVerification : CarDamageVerification.values()){
+            if(carDamageVerification.getCode().equals(code)){
+                return carDamageVerification.getDesc();
+            }
+        }
+        return "";
+    }
+
+    public static List<Map<String, Object>> getAllList() {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (CarDamageVerification item : CarDamageVerification.values()) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("code", item.getCode());
+            map.put("desc", item.getDesc());
+            list.add(map);
+        }
+        return list;
+    }
+}
+

+ 54 - 0
src/main/java/com/ydtech/modules/order/controller/InsCrawlerOrderController.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.order.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.base.controller.BaseController;
@@ -8,10 +9,16 @@ import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.order.aop.AuditVerification;
 import com.ydtech.modules.order.aop.QuoteVerification;
 import com.ydtech.modules.order.components.InsOrdersComponents;
+import com.ydtech.modules.order.constants.ya.CarDamageVerification;
+import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.crawler.response.YaCrawlerSendSmsCodeResponse;
+import com.ydtech.modules.order.entity.crawler.response.YaCrawlerVerifyCodeResponse;
 import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.QuoteAccidentalDrivingVo;
+import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsCrawlerOrderService;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
@@ -22,6 +29,8 @@ import lombok.RequiredArgsConstructor;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Objects;
+
 @Api(tags = "爬虫对接")
 @RequestMapping("/insurance/crawler")
 @RestController
@@ -34,6 +43,8 @@ public class InsCrawlerOrderController extends BaseController {
 
     private final InsOrdersService insOrdersService;
 
+    private final InsAreaCompanyService insAreaCompanyService;
+
 
     @QuoteVerification("报价授权")
     @PostMapping("/quote")
@@ -134,5 +145,48 @@ public class InsCrawlerOrderController extends BaseController {
     }
 
 
+    @GetMapping(value = "/yaGetMobile")
+    @ApiOperation(value = "永安获取订单验证码")
+    public HttpResult yaGetMobile(String companyId) {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
+        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+        if(Objects.isNull(insOrders)){
+            return HttpResult.error("订单不存在");
+        }
+        JSONObject applyinfo = insOrders.getApplyinfo();
+        String mobile = applyinfo.get("mobile").toString();
+
+        return HttpResult.ok(mobile);
+    }
+
+    @PostMapping(value = "/yaSendCode")
+    @ApiOperation(value = "永安发送客户信息确认验证码")
+    public HttpResult yaSendCode(@RequestBody JSONObject jsonObject) {
+
+        YaCrawlerSendSmsCodeResponse result = insuranceCrawlerOrderService.yaSendCode(jsonObject.getString("companyId"),jsonObject.getString("smsCode"));
+        if(result.getCode() == 200){
+            return HttpResult.ok("发送成功!");
+        }else{
+            return HttpResult.error(result.getMessage());
+        }
+    }
+
+    @PostMapping(value = "/yaVerifySendCode")
+    @ApiOperation(value = "永安发送客户信息校验验证码")
+    public HttpResult yaVerifySendCode(@RequestBody JSONObject jsonObject) throws Exception {
+
+        YaCrawlerVerifyCodeResponse result = insuranceCrawlerOrderService.yaVerifyCode(jsonObject.getString("companyId"),jsonObject.getString("smsCode"));
+        if(result.getCode() == 200){
+            return HttpResult.ok("验证成功",result.getPay_url());
+        }else{
+            return HttpResult.error("验证失败");
+        }
+    }
+
+    @GetMapping(value = "getYaCarDamageVerificationDict")
+    @ApiOperation(value = "永安车损验证字典获取")
+    public HttpResult getYaCarDamageVerificationDict() {
+        return HttpResult.ok(CarDamageVerification.getAllList());
+    }
 
 }

+ 11 - 4
src/main/java/com/ydtech/modules/order/controller/OrderTaskImageController.java

@@ -137,8 +137,15 @@ public class OrderTaskImageController extends BaseController {
     }
 
 
-
-
-
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/6/25 8:46
+     *  @Description:  交强保单和商业保单上传解析签单时间
+     */
+    @PostMapping("/uploadFileToTraferSignDateTime")
+    @ApiOperation(value = "文件上传并解析签单时间")
+    public HttpResult<InsUploadFiles> uploadFileToTraferSignDateTime(@CheckObjectNotNull(message = "上传文件不能为空") MultipartFile multipartFile, String type, String companyId,String fileType,HttpServletRequest request) throws IOException {
+        return insUploadFilesService.uploadFileToTraferSignDateTime(multipartFile, getUserName(), type,companyId,fileType);
+    }
 }

+ 10 - 0
src/main/java/com/ydtech/modules/order/controller/QrCodeController.java

@@ -108,6 +108,14 @@ public class QrCodeController {
             }
             QrCodeVo qrCodeVo = new QrCodeVo();
             String qrCodeUrl = qrCodeGenAddress + "?areaCompanyId=" + areaCompanyId;
+            if(insAreaCompany.getCompanyId().equals("YAIC1000000")){
+                if(insAreaCompany.getPaymentLink() == null || insAreaCompany.getPaymentLink().contains("pages/orders/verificationPage")) {
+                    qrCodeUrl = "https://sxzgkj.baoxianzhanggui.com/h5/#/pages/orders/verificationPage" + "?companyId=" + areaCompanyId;
+                }else{
+                    qrCodeUrl = insAreaCompany.getPaymentLink();
+                }
+            }
+
             qrCodeVo.setQrCodeUrl(qrCodeUrl);
             qrCodeVo.setInscompany(insAreaCompany.getInscompany());//保险公司
             qrCodeVo.setSumpremium(insAreaCompany.getSumpremium());//总保费
@@ -137,6 +145,7 @@ public class QrCodeController {
         return modelAndView;
     }
 
+
     @PostMapping(value = "/destructionQrCode")
     @ApiOperation(value = "销毁二维码")
     public ModelAndView destructionQrCode(String areaCompanyId) {
@@ -261,6 +270,7 @@ public class QrCodeController {
         }
     }
 
+
     private static List<SysBarcodeConfig> getConfigs(List<SysBarcodeConfig> configs) {
         return configs;
     }

+ 14 - 3
src/main/java/com/ydtech/modules/order/controller/QuoteController.java

@@ -141,9 +141,20 @@ public class QuoteController extends BaseController {
 
         if (PtlApiType.PTL_API_2.getCode() == ptlAgreementAttribution.getApiType()) {
             BaseQuoteVo<QuoteAccidentalDrivingVo> quoteVo1 = new BaseQuoteVo<>();
-            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(quoteVo.getAccidentalDrivingVo()));
-            QuoteAccidentalDrivingVo javaObject = jsonObject.toJavaObject(QuoteAccidentalDrivingVo.class);
-            BeanUtils.copyProperties(quoteVo, quoteVo1);
+            QuoteAccidentalDrivingVo javaObject = new QuoteAccidentalDrivingVo();
+            if(quoteVo.getCompanyId().equals("ZKIC1000000")){
+                JSONArray objects = JSONArray.parseArray(JSONArray.toJSONString(quoteVo.getAccidentalDrivingVo()));
+                JSONObject jsonObject = new JSONObject();
+                if(objects.size()> 0){
+                    jsonObject = objects.getJSONObject(0);
+                }
+                javaObject = jsonObject.toJavaObject(QuoteAccidentalDrivingVo.class);
+                BeanUtils.copyProperties(quoteVo, quoteVo1);
+            }else {
+                JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(quoteVo.getAccidentalDrivingVo()));
+                javaObject = jsonObject.toJavaObject(QuoteAccidentalDrivingVo.class);
+                BeanUtils.copyProperties(quoteVo, quoteVo1);
+            }
             quoteVo1.setAccidentalDrivingVo(javaObject);
             quoteVo1.setSeatNum(quoteInfo.getCarInfo().getSeatCount());
             BaseQuoteVo baseQuoteVo = insOrdersService.convertDriving(quoteVo1);

+ 2 - 2
src/main/java/com/ydtech/modules/order/controller/YongChengOrderApiController.java

@@ -63,8 +63,8 @@ public class YongChengOrderApiController {
     @ApiOperation(value = "永诚API方式 - 影像上传")
     @PostMapping(value = "/uploadImage")
     public HttpResult uploadImageApi(@RequestSingleParam(value = "companyId") String companyId) {
-//        return yongchengOrderApiService.uploadImageApi(companyId);
-        return HttpResult.ok("ok");
+        return yongchengOrderApiService.uploadImageApi(companyId);
+//        return HttpResult.ok("ok");
     }
 
     @ApiOperation(value = "永诚API方式 -电子保单")

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -589,6 +589,12 @@ public class InsAreaCompany implements Serializable {
     @TableField(value = "merge_cost_rate")
     private String mergeCostRate;
 
+    /**
+     * 对接人
+     */
+    @TableField(value = "docking_person")
+    private String dockingPerson;
+
     //入口总金额
     @TableField(exist = false)
     private BigDecimal entranceAllFee;

+ 175 - 11
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/InsurePremiumRequest.java

@@ -3,10 +3,10 @@ package com.ydtech.modules.order.entity.api.chengtai.request;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.vo.PersonAreaVo;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
@@ -50,12 +50,171 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
     private String orderId;
     @JsonProperty("handlerCode")
     private String handlerCode;
+    @JsonProperty("applicant")
+    private ApplicantDTO applicant;
+    @JsonProperty("insured")
+    private InsuredDTO insured;
+
+    @Data
+    public static class InsuredDTO {
+        @JsonProperty("type")
+        private String type;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("identifyTypeCode")
+        private String identifyTypeCode;
+        @JsonProperty("identifyNumber")
+        private String identifyNumber;
+        @JsonProperty("identifyValidDate")
+        private String identifyValidDate;
+        @JsonProperty("identifyValidEndDate")
+        private String identifyValidEndDate;
+        @JsonProperty("identifyTypeName")
+        private String identifyTypeName;
+        @JsonProperty("sex")
+        private String sex;
+        @JsonProperty("age")
+        private Integer age;
+        @JsonProperty("birthday")
+        private String birthday;
+        @JsonProperty("longTerm")
+        private String longTerm;
+        @JsonProperty("province")
+        private String province;
+        @JsonProperty("city")
+        private String city;
+        @JsonProperty("district")
+        private String district;
+        @JsonProperty("addr")
+        private String addr;
+        @JsonProperty("mobile")
+        private String mobile;
+        @JsonProperty("relationWithInsured")
+        private String relationWithInsured;
+        @JsonProperty("relationWithCar")
+        private String relationWithCar;
+        @JsonProperty("organizationCode")
+        private String organizationCode;
+        @JsonProperty("tel")
+        private String tel;
+        @JsonProperty("linkerName")
+        private String linkerName;
+        @JsonProperty("unitTypeCode")
+        private String unitTypeCode;
+
+        public InsuredDTO(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo personAreaVo){
+            // 获取投保人信息
+            CustomerInfoVo insureInfo = quoteInfoVo.getInsuredPersonInfo();
+            if("0".equals(insureInfo.getProperty())){
+                this.type = "2";
+                this.identifyTypeCode = "4";
+                this.identifyNumber = insureInfo.getOrganizationCode();
+                this.organizationCode = insureInfo.getOrganizationCode();
+                this.tel = insureInfo.getTel();
+                this.linkerName = insureInfo.getName();
+                this.unitTypeCode = "900"; // 单位性质 900:其他
+            }else{
+                this.type = "1";
+                this.identifyTypeCode = "01";
+                this.identifyNumber = insureInfo.getIdentifyNumber();
+                this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+                this.birthday = IDCardUtils.GetBirthday(insureInfo.getIdentifyNumber());
+                this.relationWithInsured = "0";
+                this.relationWithCar = "1";
+            }
+            this.name = insureInfo.getName();
+            this.province = personAreaVo.getProvinceCode();
+            this.city = personAreaVo.getCityCode();
+            this.district = personAreaVo.getCountyCode();
+            this.addr = insureInfo.getAddr();
+            this.mobile = insureInfo.getMobile();
+            this.identifyValidDate = insureInfo.getIdentifyValidDate();
+            this.identifyValidEndDate = insureInfo.getIdentifyValidEndDate();
+            this.longTerm = "0";
+        }
+    }
+
+    @Data
+    public static class ApplicantDTO {
+        @JsonProperty("type")
+        private String type;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("identifyTypeCode")
+        private String identifyTypeCode;
+        @JsonProperty("identifyNumber")
+        private String identifyNumber;
+        @JsonProperty("identifyValidDate")
+        private String identifyValidDate;
+        @JsonProperty("identifyValidEndDate")
+        private String identifyValidEndDate;
+        @JsonProperty("identifyTypeName")
+        private String identifyTypeName;
+        @JsonProperty("sex")
+        private String sex;
+        @JsonProperty("age")
+        private Integer age;
+        @JsonProperty("birthday")
+        private String birthday;
+        @JsonProperty("longTerm")
+        private String longTerm;
+        @JsonProperty("province")
+        private String province;
+        @JsonProperty("city")
+        private String city;
+        @JsonProperty("district")
+        private String district;
+        @JsonProperty("addr")
+        private String addr;
+        @JsonProperty("mobile")
+        private String mobile;
+        @JsonProperty("organizationCode")
+        private String organizationCode;
+        @JsonProperty("tel")
+        private String tel;
+        @JsonProperty("linkerName")
+        private String linkerName;
+        @JsonProperty("unitTypeCode")
+        private String unitTypeCode;
+
+
+        public ApplicantDTO(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo applyPersonAreaVo){
+            // 获取投保人信息
+            CustomerInfoVo applyInfo = quoteInfoVo.getPolicyHolderInfo();
+            if("0".equals(applyInfo.getProperty())){
+                this.type = "2";
+                this.identifyTypeCode = "4";
+                this.identifyNumber = applyInfo.getOrganizationCode();
+                this.organizationCode = applyInfo.getOrganizationCode();
+                this.tel = applyInfo.getTel();
+                this.linkerName = applyInfo.getName();
+                this.unitTypeCode = "900"; // 单位性质 900:其他
+            }else{
+                this.type = "1";
+                this.identifyTypeCode = "01";
+                this.identifyNumber = applyInfo.getIdentifyNumber();
+                this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+                this.birthday = IDCardUtils.GetBirthday(applyInfo.getIdentifyNumber());
+            }
+            this.name = applyInfo.getName();
+            this.province = applyPersonAreaVo.getProvinceCode();
+            this.city = applyPersonAreaVo.getCityCode();
+            this.district = applyPersonAreaVo.getCountyCode();
+            this.addr = applyInfo.getAddr();
+            this.mobile = applyInfo.getMobile();
+            this.identifyValidDate = applyInfo.getIdentifyValidDate();
+            this.identifyValidEndDate = applyInfo.getIdentifyValidEndDate();
+            this.longTerm = "0";
+        }
+    }
 
     public InsurePremiumRequest(BaseQuoteInfoVo quoteInfoVo,
                                 CarInfoResponse.CarModelListDTO carModelListDTO,
                                 QueryCarActualValueResponse carActualValueResponse,
                                 ChengTaiConfigureParameters parameters,
-                                BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo){
+                                BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo,
+                                PersonAreaVo applyPersonAreaVo,
+                                PersonAreaVo insurePersonAreaVo){
         super(parameters.getPartnerCode());
         // 标的信息
         InsuredObjectDTO insuredObject = new InsuredObjectDTO(quoteInfoVo, carModelListDTO,carActualValueResponse);
@@ -97,7 +256,10 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
         }
 
         this.handlerCode = parameters.getUserId();
-
+        InsuredDTO insured = new InsuredDTO(quoteInfoVo,insurePersonAreaVo);
+        this.insured = insured;
+        ApplicantDTO applicant = new ApplicantDTO(quoteInfoVo, applyPersonAreaVo);
+        this.applicant = applicant;
     }
 
     @NoArgsConstructor
@@ -202,14 +364,16 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
                 coverageDTO2.setShortRateType("2");
                 coverageDTO2.setShortRate("100");
                 coverageDTOS.add(coverageDTO2);
-                CoverageDTO coverageDTO3 = new CoverageDTO();
-                coverageDTO3.setKindCode("ct_111603");
-                coverageDTO3.setIfMainKind("2");
-                coverageDTO3.setQuantity(0);
-                coverageDTO3.setCalculateFlag("1");
-                coverageDTO3.setShortRateType("2");
-                coverageDTO3.setShortRate("100");
-                coverageDTOS.add(coverageDTO3);
+                if(!ctQuoteAccidentVo.getProjectName().contains("1座")){
+                    CoverageDTO coverageDTO3 = new CoverageDTO();
+                    coverageDTO3.setKindCode("ct_111603");
+                    coverageDTO3.setIfMainKind("2");
+                    coverageDTO3.setQuantity(0);
+                    coverageDTO3.setCalculateFlag("1");
+                    coverageDTO3.setShortRateType("2");
+                    coverageDTO3.setShortRate("100");
+                    coverageDTOS.add(coverageDTO3);
+                }
                 return coverageDTOS;
             }
         }

+ 35 - 6
src/main/java/com/ydtech/modules/order/entity/api/pingan/utils/PDFUtil.java

@@ -445,11 +445,17 @@ public class PDFUtil {
             payDate = payDate.replaceAll("\\s+", "");
             payDate = payDate.replaceAll("[\u4e00-\u9fa5]", "");
             System.out.println(payDate.length());
-            if(payDate.length() == 18){
+            if(payDate.length() == 18 ){
                 payDate = payDate.substring(0,10)+" "+ payDate.substring(10,18);
             }else if(payDate.length() == 15){
-                    payDate = payDate.substring(0,10)+" "+ payDate.substring(10,15)+":00";
-            }else if(payDate.length() == 10){
+                payDate = payDate.substring(0,10)+" "+ payDate.substring(10,15)+":00";
+            }else if(payDate.length() == 16 || payDate.length() == 17){
+               //截取后8位
+                String minutes_str = payDate.substring(payDate.length() - 8);
+                String day_str = payDate.replaceAll(minutes_str, "");
+                payDate = getContentStrByLine(day_str,1)+" "+minutes_str;
+            }
+            else if(payDate.length() == 10){
                 payDate = payDate+" 00:00:00";
             }
             return LocalDateTime.parse(payDate, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
@@ -494,7 +500,24 @@ public class PDFUtil {
     }
 
     public static String  getContentStr(String input){
-        Pattern pattern = Pattern.compile("(\\d{4})年(\\d{1,2})月(\\d{1,2})日");
+        Pattern pattern =  Pattern.compile("(\\d{4})年(\\d{1,2})月(\\d{1,2})日");
+        Matcher matcher = pattern.matcher(input);
+        if (matcher.matches()) {
+            String year = matcher.group(1);
+            String month = matcher.group(2);
+            String day = matcher.group(3);
+            return year+"-"+((Integer.parseInt(month)<10 && month.length()==1) ?"0"+month:month)+"-"+((Integer.parseInt(day)<10 && day.length()==1)  ?"0"+day:day);
+        } else {
+            return null;
+        }
+    }
+    public static String  getContentStrByLine(String input,int type){
+        Pattern pattern = null;
+        if(type == 1){
+            pattern = Pattern.compile("(\\d{4})-(\\d{1,2})-(\\d{1,2})");
+        }else if(type == 2){
+            pattern = Pattern.compile("(\\d{4})/(\\d{1,2})/(\\d{1,2})");
+        }
         Matcher matcher = pattern.matcher(input);
         if (matcher.matches()) {
             String year = matcher.group(1);
@@ -505,7 +528,6 @@ public class PDFUtil {
             return null;
         }
     }
-
     public static String  getContentStr(String input, String beginStr, String endStr){
         // 创建正则表达式,其中"(?s)"表示忽略换行符,"."匹配任何字符(包括换行符)
         String regex = "(?s)" + Pattern.quote(beginStr) + "(.+?)" + Pattern.quote(endStr);
@@ -513,7 +535,14 @@ public class PDFUtil {
         Matcher matcher = pattern.matcher(input);
 
         if (matcher.find()) {
-            return matcher.group(1);
+            String groupStr = matcher.group(1);
+            //String regexNew = "[\\u4e00-\\u9fa5&&[^年月日时]]";
+            String regexNew = "[a-zA-Z]|[\u4E00-\u9FFF&&[^年月日时]]";
+            //去除年月日时之外的汉字
+            if(groupStr!=null && !"".equals(groupStr)){
+                return groupStr.replaceAll(regexNew, "");
+            }
+            return null;
         } else {
             return null;
         }

+ 10 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerBaseRequest.java

@@ -26,4 +26,14 @@ public class CrawlerBaseRequest implements Serializable {
     @JsonProperty(value = "username")
     private String username;
 
+    /**
+     * 紫金核保需要的订单id
+     */
+    @JsonProperty(value = "proposalCheckNo")
+    private String proposalCheckNo;
+
+    public CrawlerBaseRequest(String orderNo, String username){
+        this.orderNo = orderNo;
+        this.username = username;
+    }
 }

+ 15 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerQuoteRequest.java

@@ -71,4 +71,19 @@ public class CrawlerQuoteRequest extends BaseQuoteInfoVo {
      */
     private String netpointcode;
 
+    /**
+     * 永安车损验车事项
+     */
+    private String carChecker;
+
+    /**
+     * 人保赔付优化申请
+     */
+    private String preDiscount;
+
+    /**
+     * 太平传递 applyNo   决策单元代码
+     */
+    private String applyNo;
+
 }

+ 44 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/YaCrawlerSendSmsCodeRequest.java

@@ -0,0 +1,44 @@
+package com.ydtech.modules.order.entity.crawler.request;
+
+import cn.hutool.core.collection.CollUtil;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
+import com.ydtech.utils.StringUtils;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+
+@Data
+@NoArgsConstructor
+public class YaCrawlerSendSmsCodeRequest implements Serializable {
+
+    private static final long serialVersionUID = 01404102263425770704306L;
+
+    /**
+     * 账号
+     */
+    @JsonProperty(value = "username")
+    private String username;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "plyappno")
+    private String plyappno;
+
+    /**
+     * 验证码
+     */
+    @JsonProperty(value = "smsCode")
+    private String smsCode;
+
+    public YaCrawlerSendSmsCodeRequest(PtlAgreementAttributionDto attribution,String plyappno,String smsCode) {
+        this.username = attribution.getUsername();
+        this.plyappno = plyappno;
+        this.smsCode = smsCode;
+
+    }
+
+}

+ 31 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java

@@ -222,6 +222,12 @@ public class CrawlerQuoteResponse extends CrawlerBaseResponse {
 
         private static final long serialVersionUID = -7644262314380189512L;
 
+        /**
+         * 紫金订单号
+         */
+        @JsonProperty("proposalCheckNo")
+        private String proposalCheckNo;
+
         /**
          * 总评分
          */
@@ -332,6 +338,30 @@ public class CrawlerQuoteResponse extends CrawlerBaseResponse {
         @JsonProperty("rateFloatFlag")
         private String rateFloatFlag;
 
+        // 永安交强费用浮动
+        @JsonProperty("cifeefloat")
+        private String cifeeFloat;
+
+        // 永安交强费用浮动
+        @JsonProperty("bifeefloat")
+        private String bifeeFloat;
+
+        // 永安评分
+        @JsonProperty("score")
+        private String score;
+
+        /**
+         * 人保交强折扣
+         */
+        @JsonProperty("CiDiscount")
+        private String ciDiscount;
+
+        /**
+         * 人保商业折扣
+         */
+        @JsonProperty("BiDiscount")
+        private String biDiscount;
+
 
 
         public String getDiscount() {
@@ -410,6 +440,7 @@ public class CrawlerQuoteResponse extends CrawlerBaseResponse {
         @JsonProperty("seatCount")
         private String seatCount;
 
+
         public CoreModelsVo toCoreModelsVo() {
             CoreModelsVo coreModelsVo = new CoreModelsVo();
             coreModelsVo.setModelCode(this.modelCode);

+ 29 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/YaCrawlerSendSmsCodeResponse.java

@@ -0,0 +1,29 @@
+package com.ydtech.modules.order.entity.crawler.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class YaCrawlerSendSmsCodeResponse implements Serializable {
+
+    private static final long serialVersionUID = 01404102263425770704306L;
+
+    /**
+     * 账号
+     */
+    @JsonProperty(value = "code")
+    private int code;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "message")
+    private String message;
+
+
+}

+ 66 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/YaCrawlerVerifyCodeResponse.java

@@ -0,0 +1,66 @@
+package com.ydtech.modules.order.entity.crawler.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class YaCrawlerVerifyCodeResponse implements Serializable {
+
+    private static final long serialVersionUID = 01404102263425770704306L;
+
+    /**
+     * 账号
+     */
+    @JsonProperty(value = "code")
+    private int code;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "message")
+    private String message;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "JQ_Policy")
+    private String JQ_Policy;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "JYX_Policy")
+    private String JYX_Policy;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "SY_Policy")
+    private String SY_Policy;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "pay_url")
+    private String pay_url;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "Application")
+    private String Application;
+
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "payenddata")
+    private String payenddata;
+
+
+
+
+}

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/po/InsUploadFiles.java

@@ -56,4 +56,8 @@ public class InsUploadFiles implements Serializable {
 
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
+
+    //add  by  hxl  2025-06-25  添加签单时间
+    @TableField(exist = false)
+    private String signTime;
 }

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java

@@ -182,4 +182,10 @@ public class BaseQuoteVo<T> {
     // 人保车损保额折扣
     private String priceCoefficient;
 
+    @ApiModelProperty("永安车损验车事项")
+    private String carChecker;
+
+    @ApiModelProperty("人保赔付优化申请")
+    private String preDiscount;
+
 }

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java

@@ -199,6 +199,12 @@ public class OrderQueryVo {
     @ApiModelProperty("费用类型 0.现金 1.权益包")
     private String type;
 
+    @ApiModelProperty("审核时间开始时间")
+    private String auditTimeStart;
+
+    @ApiModelProperty("审核时间结束时间")
+    private String auditTimeEnd;
+
 
 
     public LocalDate getEndDatePlusOneDay() {

+ 16 - 0
src/main/java/com/ydtech/modules/order/service/InsCrawlerOrderService.java

@@ -3,6 +3,8 @@ package com.ydtech.modules.order.service;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.crawler.response.YaCrawlerSendSmsCodeResponse;
+import com.ydtech.modules.order.entity.crawler.response.YaCrawlerVerifyCodeResponse;
 import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
 import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
@@ -119,4 +121,18 @@ public interface InsCrawlerOrderService extends BaseOrderService<Object> {
      * @param smscode
      */
     void taishanLogin(String agreementId, String smscode);
+
+    /**
+     * 永安发送客户确认验证码
+     * @param companyId
+     */
+    YaCrawlerSendSmsCodeResponse yaSendCode(String companyId, String smsCode);
+
+    /**
+     * 永安校验客户验证码
+     * @param companyId
+     * @param smsCode
+     * @return
+     */
+    YaCrawlerVerifyCodeResponse yaVerifyCode(String companyId, String smsCode) throws Exception;
 }

+ 8 - 1
src/main/java/com/ydtech/modules/order/service/InsUploadFilesService.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.order.service;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.order.entity.po.InsUploadFiles;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import org.springframework.web.multipart.MultipartFile;
@@ -42,5 +43,11 @@ public interface InsUploadFilesService extends IService<InsUploadFiles> {
         return insUploadFiles;
     }
 
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/6/25 8:50
+     *  @Description: 上传文件并解析签单时间
+     */
+    HttpResult uploadFileToTraferSignDateTime(MultipartFile multipartFile, String userName, String type, String companyId,String fileType) throws IOException;
 }

+ 18 - 1
src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java

@@ -138,8 +138,25 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
         QueryCarActualValueRequest carActualValueRequest = new QueryCarActualValueRequest(quoteInfoVo,carModelListDTO, parameters);
         QueryCarActualValueResponse carActualValueResponse = chengTaiRequestApiComponents.queryActualValue(carActualValueRequest,httpHeaders);
 
+        CustomerInfoVo applyInfo = quoteInfoVo.getPolicyHolderInfo();
+        CustomerInfoVo insureInfo = quoteInfoVo.getInsuredPersonInfo();
+        String applyProperty = applyInfo.getProperty();
+        String insureProperty = insureInfo.getProperty();
+        PersonAreaVo applyPersonAreaVo;
+        PersonAreaVo insurePersonAreaVo;
+        if ("0".equals(applyProperty)) {
+            applyPersonAreaVo = new PersonAreaVo(applyInfo);
+        }else{
+            applyPersonAreaVo = sysAreaService.queryByAddressYc(applyInfo.getAddr(), applyInfo.getIdentifyNumber());
+        }
+        if ("0".equals(insureProperty)) {
+            insurePersonAreaVo = new PersonAreaVo(insureInfo);
+        }else{
+            insurePersonAreaVo = sysAreaService.queryByAddressYc(insureInfo.getAddr(), insureInfo.getIdentifyNumber());
+        }
+
         /** 4. 报价 */
-        InsurePremiumRequest insurePremiumRequest = new InsurePremiumRequest(quoteInfoVo,carModelListDTO, carActualValueResponse,parameters,quoteVo);
+        InsurePremiumRequest insurePremiumRequest = new InsurePremiumRequest(quoteInfoVo,carModelListDTO, carActualValueResponse,parameters,quoteVo,applyPersonAreaVo,insurePersonAreaVo);
         // 重复报价
         InsurePremiumResponse insurePremiumResponse = this.getResponse(insurePremiumRequest, httpHeaders,quoteInfoVo, quoteVo,maxQuoteNum,sysQuoteRecords);
 

+ 11 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -186,6 +186,11 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
     @Override
     @Transactional
     public String insertCompanyAndOrders(InsAreaCompany insAreaCompany, InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
+        // 添加协议里的对接人字段
+        String agreementId = insAreaCompany.getAgreementId();
+        PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(agreementId);
+        insAreaCompany.setDockingPerson(byAgreementIdNew.getDockingPerson());
+
         //add by hxl   解决部分数据更新不了险种信息
         insAreaCompany = updateEntityPruductAndPruductid(insAreaCompany);
 
@@ -219,6 +224,11 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
 
     @Override
     public String insertCompanyAndOrders(String subOrderNo, InsAreaCompany insAreaCompany, InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
+        // 添加协议里的对接人字段
+        String agreementId = insAreaCompany.getAgreementId();
+        PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(agreementId);
+        insAreaCompany.setDockingPerson(byAgreementIdNew.getDockingPerson());
+
         insAreaCompany = updateEntityPruductAndPruductid(insAreaCompany);
 
         //更新主订单的投保时间
@@ -739,6 +749,7 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         insAreaCompany.setApplyInfo(JSON.toJSONString(quoteInfo.getPolicyHolderInfo()));
         insAreaCompany.setOwnerInfo(JSON.toJSONString(quoteInfo.getOwnerInfo()));
         insAreaCompany.setInsureInfo(JSON.toJSONString(quoteInfo.getInsuredPersonInfo()));
+        insAreaCompany.setDockingPerson(ptlAgreement.getDockingPerson());
         //保存子订单
         this.insertCompanyAndOrders(insAreaCompany);
 

+ 117 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -30,6 +30,7 @@ import com.ydtech.modules.order.entity.po.SysQuoteRecord;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.service.*;
+import com.ydtech.modules.order.utils.QrCodeGenerator;
 import com.ydtech.modules.protocol.entity.constants.PtlCrawlerApiType;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
 import com.ydtech.modules.protocol.entity.dto.PtlAttributionTemplateDto;
@@ -50,8 +51,12 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.net.URL;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
@@ -138,6 +143,10 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         BeanUtils.copyProperties(quoteInfoVo, crawlerQuoteRequest);
         crawlerQuoteRequest.setMaxQuoteNum(maxQuoteNum);
         crawlerQuoteRequest.setUsername(ptlAgreementAttribution.getUsername());
+        // 人保赔付优化申请
+        crawlerQuoteRequest.setPreDiscount(t.getPreDiscount());
+        // 永安验车事项
+        crawlerQuoteRequest.setCarChecker(t.getCarChecker());
         // 前端传入的驾意险信息
         crawlerQuoteRequest.setAccidentalDriving(t.getAccidentalDrivingVo());
         //  自主定价系数
@@ -170,6 +179,17 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             crawlerQuoteRequest.setPricecoefficient(t.getPriceCoefficient() == null ? "1" : t.getPriceCoefficient());
         }
 
+        // 太平添加applyNo参数
+        if (ptlAgreementAttribution.getInsCompanyId().equals("TPIC1000000")){
+            JSONArray fields = ptlAgreementAttribution.getFields();
+            for(int k=0;k<fields.size();k++){
+                JSONObject jsonObject = fields.getJSONObject(k);
+                if("applyNo".equals(jsonObject.getString("field"))){
+                    crawlerQuoteRequest.setApplyNo(jsonObject.getString("value"));
+                }
+            }
+        }
+
         // 中煤添加netpointcode 代码
         if (ptlAgreementAttribution.getInsCompanyId().equals("ZMBX1000000")){
             JSONArray fields = ptlAgreementAttribution.getFields();
@@ -258,6 +278,8 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
                 BigDecimal rounded = total.setScale(2, RoundingMode.HALF_UP);
                 quoteRespVo.setJyPremium(rounded.doubleValue());
             }
+        } else if (t.getCompanyId().equals("PICC000000")) {
+            quoteRespVo.setPreDiscount(response.getOther().getBiDiscount());
         }
 
         //处理订单信息
@@ -338,7 +360,15 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         // 请求地址
         String apiUrl = ptlCrawlerApiService.getApiUrl(insAreaCompany.getAgreementId(), PtlCrawlerApiType.API_4);
         //组装参数
-        CrawlerBaseRequest crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
+        CrawlerBaseRequest crawlerBaseRequest;
+        if(insAreaCompany.getCompanyId().equals("ZKIC1000000")) {
+            String extendInfoStr = String.valueOf(insAreaCompany.getExtendInfo());
+            JSONObject extendInfo = JSONObject.parseObject(extendInfoStr);
+            crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(),
+                    ptlAgreementAttribution.getUsername(), extendInfo.getString("proposalCheckNo"));
+        }else {
+            crawlerBaseRequest = new CrawlerBaseRequest(insAreaCompany.getInsOrderNo(), ptlAgreementAttribution.getUsername());
+        }
         CrawlerAuditResponse crawlerAuditResponse = insCrawlerOrderComponents.request(apiUrl, insAreaCompany.getCompanyId(),
                 PtlCrawlerApiType.API_4.getDesc(), crawlerBaseRequest, CrawlerAuditResponse.class);
 
@@ -539,6 +569,15 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         quoteRespVo.setJqScore(other.getJqMark());
         quoteRespVo.setSyScore(other.getSyMark());
 
+
+        //永安
+        // 评分
+        quoteRespVo.setYaScore(other.getScore());
+        // 交强费用浮动
+        quoteRespVo.setCifeeFloat(other.getCifeeFloat());
+        // 商业费用浮动
+        quoteRespVo.setBifeeFloat(other.getBifeeFloat());
+
         quoteRespVo.setTotalAdjustRate(StringUtils.toDouble(other.getDiscount()));
         quoteRespVo.setJqAdjustRate(other.getJqDiscount());
         quoteRespVo.setSyAdjustRate(other.getSyDiscount());
@@ -592,6 +631,10 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         if(other.getRateFloatFlag() != null && !other.getRateFloatFlag().isEmpty()){
             quoteRespVo.setRateFloatFlag(other.getRateFloatFlag());
         }
+        // 人保商业折扣
+        if(other.getBiDiscount() != null && !other.getBiDiscount().isEmpty()){
+            quoteRespVo.setPreDiscount(other.getBiDiscount());
+        }
         return quoteRespVo;
     }
 
@@ -649,13 +692,34 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             }
         }
 
+//        if(Objects.nonNull(response.getOther().getScore())){
+//            insAreaCompany.setYaScore(response.getOther().getScore());
+//        }
+//
+//        if(Objects.nonNull(response.getOther().getCifeeFloat())){
+//            insAreaCompany.setCifeeFloat(response.getOther().getCifeeFloat());
+//        }
+//
+//        if(Objects.nonNull(response.getOther().getBifeeFloat())){
+//            insAreaCompany.setBifeeFloat(response.getOther().getBifeeFloat());
+//        }
+
         // 保险公司订单号
         insAreaCompany.setInsOrderNo(response.getOrderNo());
+        // 紫金 爬虫 添加订单id 到扩展字段中
+        if(insAreaCompany.getApiType() == 2 && insAreaCompany.getCompanyId().equals("ZKIC1000000")){
+            JSONObject extendInfo = new JSONObject();
+            extendInfo.put("proposalCheckNo",response.getOther().getProposalCheckNo());
+            insAreaCompany.setExtendInfo(extendInfo.toString());
+        }
+
+
+
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDriving);
         //清空驾意险信息 重新复制
 //        quoteRespVo.getAccident().clear();
-
         quoteRespVo.setCompanyId(insAreaCompany.getId());
+
         return quoteRespVo;
     }
 
@@ -924,4 +988,55 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             throw new SystemException("验证码已失效!请重新发送!");
         }
     }
+
+    @Override
+    public YaCrawlerSendSmsCodeResponse yaSendCode(String companyId,String smsCode) {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
+        PtlAgreementAttribution attribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        PtlAgreementAttributionDto attributionDto = new PtlAgreementAttributionDto();
+        BeanUtils.copyProperties(attribution, attributionDto);
+        String apiUrl = ptlCrawlerApiService.getByTemplateId(attributionDto.getTemplateId(), PtlCrawlerApiType.API_12);
+        YaCrawlerSendSmsCodeRequest crawlerSendSmsCodeRequest = new YaCrawlerSendSmsCodeRequest(attributionDto,insAreaCompany.getInsOrderNo(),"" );
+        YaCrawlerSendSmsCodeResponse response = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.YAIC.getCode(), "获取验证码",
+                crawlerSendSmsCodeRequest, YaCrawlerSendSmsCodeResponse.class);
+        return response;
+    }
+
+
+    @Override
+    public YaCrawlerVerifyCodeResponse yaVerifyCode(String companyId,String smsCode) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
+        PtlAgreementAttribution attribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        PtlAgreementAttributionDto attributionDto = new PtlAgreementAttributionDto();
+        BeanUtils.copyProperties(attribution, attributionDto);
+        String apiUrl = ptlCrawlerApiService.getByTemplateId(attributionDto.getTemplateId(), PtlCrawlerApiType.API_13);
+        YaCrawlerSendSmsCodeRequest crawlerSendSmsCodeRequest = new YaCrawlerSendSmsCodeRequest(attributionDto,insAreaCompany.getInsOrderNo(),smsCode );
+        YaCrawlerVerifyCodeResponse response = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.YAIC.getCode(), "校验验证码",
+                crawlerSendSmsCodeRequest, YaCrawlerVerifyCodeResponse.class);
+        if (response.getCode() == 200){
+            //回写订单数据
+            insAreaCompany.setJqapplyno(response.getJQ_Policy());
+            insAreaCompany.setSyapplyno(response.getSY_Policy());
+            BufferedImage bufferedImage = ImageFromUrl(response.getPay_url());
+            if (bufferedImage != null) {
+                String pay_url = QrCodeGenerator.decodeQrCode(bufferedImage);
+                insAreaCompany.setPaymentLink(pay_url);
+            }
+            insAreaCompanyService.updateById(insAreaCompany);
+        }
+
+        return response;
+    }
+
+
+    public BufferedImage ImageFromUrl(String urlAddr) {
+        try {
+            URL url = new URL(urlAddr); // 网络图片URL
+            BufferedImage image = ImageIO.read(url);
+            return image;
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
 }

+ 8 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsOrderPdfUrlServiceImpl.java

@@ -221,7 +221,8 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
         }
         //永安财险 YAIC   无驾意险保单
         else if(subOrder.getCompanyId().contains(InsuranceEnum.YAIC.getCode())){
-            throw  new SystemException("永安财险报价暂不支持获取保单");
+//            throw  new SystemException("永安财险报价暂不支持获取保单");
+            return insCrawlerOrderService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
             //return yongAnOrderService.getPolicyByCompanyIdPdfList(subOrder,null,flag);
         }
         //华泰财险 HTIC 无驾意险保单
@@ -250,7 +251,12 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
         }
         //紫金财险 ZKIC  测试通过
         else if(subOrder.getCompanyId().contains(InsuranceEnum.ZKIC.getCode())){
-            return zijinOrderApiService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
+            if(subOrder.getApiType()!=null && subOrder.getApiType()==1){
+                return zijinOrderApiService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
+                //爬虫 测试通过
+            }else if(subOrder.getApiType()!=null && subOrder.getApiType()==2){
+                return insCrawlerOrderService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
+            }
         }
         //诚泰财险 ZKIC  测试通过
         else if(subOrder.getCompanyId().contains(InsuranceEnum.CHAC.getCode())){

+ 8 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsOrderQrCodeServiceImpl.java

@@ -65,8 +65,14 @@ public class InsOrderQrCodeServiceImpl extends ServiceImpl<InsOrderQrCodeMapper,
         if (Objects.isNull(insOrderQrCode)) {
             //如果订单状态等于 待缴费 或 撤销二维码
             if (insAreaCompany.getOrderstatus().equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
-                if (Objects.isNull(insAreaCompany.getPaymentLink())) {
-                    throw new SystemException("该订单没有缴费链接");
+                if(!insAreaCompany.getCompanyId().equals("YAIC1000000")) {
+                    if (Objects.isNull(insAreaCompany.getPaymentLink())) {
+                        throw new SystemException("该订单没有缴费链接");
+                    }
+                }else{
+                    // 永安目前还没有获取到缴费连接  需要默认给一个url 过下一步判断
+                    String qrCodeUrl = "https://sxzgkj.baoxianzhanggui.com/h5/#/pages/orders/verificationPage" + "?companyId=" + companyId;
+                    insAreaCompany.setPaymentLink(qrCodeUrl);
                 }
                 save(insAreaCompany.getOrderno(), insAreaCompany.getId(), insAreaCompany.getCompanyId(),
                         insAreaCompany.getPaymentLink(), isWx);

+ 17 - 7
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -1120,13 +1120,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         // 永安财险
         if (InsuranceEnum.YAIC.getCode().equals(orderAndAreaCompany.getCompanyId().substring(0, 4)) && orderAndAreaCompany.getIsExternal() == 0) {
             JSONObject reptxt = orderAndAreaCompany.getReptxt();
-            ResponseDataC2 responseDataC2 = JSON.toJavaObject(reptxt, ResponseDataC2.class);
-            List<ExtendInfoDto> extendInfoDtos = responseDataC2.getResponseBody().getExtendInfo();
-            Map<String, String> stringStringMap = extendInfoDtos.stream().collect(LinkedHashMap::new,
-                    (m, v) -> m.put(v.getKey(),
-                            v.getValue()), LinkedHashMap::putAll);
-            yaExtendInfoDto = new YaExtendInfoDto(stringStringMap);
-            orderAndAreaCompany.setExtendInfo(yaExtendInfoDto);
+//            ResponseDataC2 responseDataC2 = JSON.toJavaObject(reptxt, ResponseDataC2.class);
+//            List<ExtendInfoDto> extendInfoDtos = responseDataC2.getResponseBody().getExtendInfo();
+//            Map<String, String> stringStringMap = extendInfoDtos.stream().collect(LinkedHashMap::new,
+//                    (m, v) -> m.put(v.getKey(),
+//                            v.getValue()), LinkedHashMap::putAll);
+//            yaExtendInfoDto = new YaExtendInfoDto(stringStringMap);
+//            orderAndAreaCompany.setExtendInfo(yaExtendInfoDto);
         }
         InsAreaCompany iac = insAreaCompanyService.getById(companyId);
         yaExtendInfoDto.setInsAreaCompany(iac);
@@ -2192,6 +2192,16 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             ygQuoteAccidentVo.setQuantityCasualty(String.valueOf(accidentalDrivingVo.getQuantity()));
             yangguangBaseQuoteVo.setAccidentalDrivingVo(Collections.singletonList(ygQuoteAccidentVo));
             return yangguangBaseQuoteVo;
+        } else if (baseQuoteVo.getCompanyId().equals("ZKIC1000000")) {
+            //紫金财险
+            BaseQuoteVo<Object> ziJinYangBaseQuoteVo = new BaseQuoteVo<>();
+            BeanUtils.copyProperties(baseQuoteVo, ziJinYangBaseQuoteVo);
+            JSONObject accidentObject = JSONObject.parseObject(JSONObject.toJSONString(ziJinYangBaseQuoteVo.getAccidentalDrivingVo()));
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("planId", accidentObject.getString("projectCode"));
+            jsonObject.put("rideRiskCode", accidentObject.getString("riskCode"));
+            ziJinYangBaseQuoteVo.setAccidentalDrivingVo(jsonObject);
+            return ziJinYangBaseQuoteVo;
         }
 
         return null;

+ 68 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsUploadFilesServiceImpl.java

@@ -2,16 +2,24 @@ package com.ydtech.modules.order.service.impl;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.constants.enums.FileType;
+import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.dao.InsUploadFilesMapper;
+import com.ydtech.modules.order.entity.api.pingan.utils.PDFUtil;
+import com.ydtech.modules.order.entity.po.InsOrderReadPdf;
 import com.ydtech.modules.order.entity.po.InsUploadFiles;
+import com.ydtech.modules.order.service.InsOrderReadPdfService;
 import com.ydtech.modules.order.service.InsUploadFilesService;
 import com.ydtech.utils.ImageCompressionUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -19,7 +27,11 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * @author wenks
@@ -39,6 +51,10 @@ public class InsUploadFilesServiceImpl extends ServiceImpl<InsUploadFilesMapper,
 
     private static final int desFileSize = 300;
 
+    @Lazy
+    @Autowired
+    private InsOrderReadPdfService insOrderReadPdfService;
+
     @Override
     public InsUploadFiles uploadFile(MultipartFile multipartFile, String username, String type) throws IOException {
         String fileMD5 = DigestUtils.md5Hex(multipartFile.getBytes());
@@ -99,8 +115,6 @@ public class InsUploadFilesServiceImpl extends ServiceImpl<InsUploadFilesMapper,
             throw new SystemException("上传过程中出错" + e.getMessage());
         }
     }
-
-
     /**
      * 自动生成目录
      *
@@ -126,6 +140,58 @@ public class InsUploadFilesServiceImpl extends ServiceImpl<InsUploadFilesMapper,
         return stringBuilder.toString();
     }
 
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/6/25 8:52
+     *  @Description:  上传文件并解析签单时间
+     */
+    @Override
+    public HttpResult uploadFileToTraferSignDateTime(MultipartFile multipartFile, String userName, String type, String companyId,String fileType) {
+
+        InsUploadFiles insUploadFiles =null;
+        try {
+            insUploadFiles = uploadFile(multipartFile, userName, type);
+        }catch (Exception e){
+            return HttpResult.error("上传文件失败!");
+        }
+        if(StringUtils.isNotBlank(fileType) &&("1".equals(fileType) || "2".equals(fileType))){
+             if(StringUtils.isBlank(companyId)){
+                 return HttpResult.error("保险公司不能为空!");
+             }
+             if(StringUtils.isBlank(fileType)){
+                 return HttpResult.error("保单类型不能为空!");
+             }
+            if(insUploadFiles!=null){
+                //通过保险公司配置读取截取的前缀和后缀
+                LambdaQueryWrapper<InsOrderReadPdf> qws = new LambdaQueryWrapper<>();
+                qws.eq(InsOrderReadPdf::getCompanyId, companyId);
+                qws.eq(InsOrderReadPdf::getType, fileType);
+                List<InsOrderReadPdf> list = insOrderReadPdfService.list(qws);
+                HashMap<String, LocalDateTime> map = new HashMap<>();
+                String pdfText = PDFUtil.getPdfText(insUploadFiles.getFilePath());
+                if (StringUtils.isNotBlank(pdfText)) {
+                    if (list != null && list.size() > 0) {
+                        for (InsOrderReadPdf insOrderReadPdf : list) {
+                            LocalDateTime pdfContentDate =null;
+                            try{
+                                pdfContentDate = PDFUtil.getPdfContentDate(pdfText, insOrderReadPdf.getReadBegin(), insOrderReadPdf.getReadEnd(), insOrderReadPdf.getReadType());
+                            }catch (Exception e){
+
+                            }
+                            map.put(insOrderReadPdf.getOrderMsg(), pdfContentDate);
+                        }
+                    }
+                }
+                if(map.get("signingTime")!=null){
+                    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                    String  signingTimeStr = map.get("signingTime").format(formatter);
+                    insUploadFiles.setSignTime(signingTimeStr);
+                }
+            }
+        }
+        return HttpResult.ok(insUploadFiles);
+    }
 }
 
 

+ 10 - 2
src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java

@@ -105,6 +105,14 @@ public class PtlAgreementController extends BaseController {
         return ptlAgreementService.reviseAgreement(userName, agreementId, agreement);
     }
 
+    @PostMapping("/checkLogin")
+    @ApiOperation("校验登录")
+    public HttpResult<Object> checkLogin(@RequestBody PtlAgreementSaveVo agreement) {
+        String userName = getUserName();
+        boolean result = ptlAgreementService.checkLogin(userName, agreement.getAgreementId(), agreement);
+        return result ? HttpResult.ok("登录成功") : HttpResult.error("登录失败");
+    }
+
     @PostMapping("/batch")
     @ApiOperation("批量修改协议是否启用状态")
     public HttpResult<Object> batchRevise(@RequestBody PltAgreementBatchVo pltAgreementBatchVo) {
@@ -260,10 +268,10 @@ public class PtlAgreementController extends BaseController {
     @PostMapping("/updateFeeFile")
     @ApiOperation("上传费用文件")
     public HttpResult updateFeeFile(@CheckObjectNotNull(message = "上传文件不能为空") MultipartFile multipartFile, String agreementId) throws IOException {
-        agreementId = agreementId.replace(",","");
+        agreementId = agreementId.replace(",", "");
         InsUploadFiles insUploadFiles = insUploadFilesService.uploadFile(multipartFile, getUserName(), "file");
         PtlAgreement byId = ptlAgreementService.getById(agreementId);
-        if(Objects.isNull(byId)){
+        if (Objects.isNull(byId)) {
             throw new SystemException("找不到协议");
         }
         byId.setFeeFileId(insUploadFiles.getId());

+ 3 - 1
src/main/java/com/ydtech/modules/protocol/entity/constants/PtlCrawlerApiType.java

@@ -17,7 +17,9 @@ public enum PtlCrawlerApiType {
     API_8(8, "人工核保状态刷新"),
     API_9(9, "撤销订单"),
     API_10(10, "验车码"),
-    API_11(11, "验证码配置");
+    API_11(11, "验证码配置"),
+    API_12(12, "客户信息确认验证码"),
+    API_13(13, "客户信息校验验证码");
 
     private final int code;
 

+ 6 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlNewCarJudgeRules.java

@@ -31,6 +31,12 @@ public class PtlNewCarJudgeRules implements Serializable {
     @TableField(value = "company_id")
     private String companyId;
 
+    /**
+     * 车辆类型
+     */
+    @TableField(value = "vehicle_type")
+    private String vehicleType;
+
     /**
      * 单位  month-月 day-天
      */

+ 3 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementSaveVo.java

@@ -15,6 +15,9 @@ import java.util.List;
 @ApiModel("协议信息上传")
 public class PtlAgreementSaveVo {
 
+    @ApiModelProperty("协议id")
+    private String agreementId;
+
     @ApiModelProperty("协议信息")
     private PtlAgreementSaveDto agreement;
 

+ 5 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlNewCarJudgeRulesVo.java

@@ -14,8 +14,13 @@ public class PtlNewCarJudgeRulesVo extends BasePageVO {
 
     @ApiModelProperty(value = "保险公司")
     private String companyId;
+
+    @ApiModelProperty(value = "车辆类型")
+    private String vehicleType;
+
     @ApiModelProperty(value = "单位")
     private String unitTypeCode;
+
     @ApiModelProperty(value = "单位值")
     private String unitTypeValue;
 

+ 15 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java

@@ -13,6 +13,7 @@ import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementUndwrtRules;
 import com.ydtech.modules.protocol.entity.vo.*;
 import com.ydtech.modules.protocols.entity.vo.AgreementAllInformationCopyVo;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.HashMap;
 import java.util.List;
@@ -287,4 +288,18 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      * @param agreementAllInformationCopyVo 复制协议对象
      */
     void agreementAllInformationCopyVo(AgreementAllInformationCopyVo agreementAllInformationCopyVo);
+
+    /**
+     * 校验登录
+     * @param agreementId
+     * @param agreement
+     * @return
+     */
+    boolean checkLogin(String userName, String agreementId, PtlAgreementSaveVo agreement);
+
+    /**
+     * 修改去除登录校验
+     * @return
+     */
+    EsmInsCompany getEsmInsCompany(PtlAgreement ptlAgreement,PtlAgreementSaveDto agreementSaveDto);
 }

+ 35 - 5
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -254,9 +254,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         attribution.setCheck(pythonCheck);
         PtlAgreement ptlAgreement = new PtlAgreement();
         BeanUtils.copyProperties(agreementSaveDto, ptlAgreement);
+        EsmInsCompany esmInsCompany = getEsmInsCompany(ptlAgreement, agreementSaveDto);
 
-        EsmInsCompany esmInsCompany = proxyObject.verifyLogin(ptlAgreement, agreementSaveDto, attribution, true);
-//        ptlAgreement.setId(IdGenerate.nextId());
         ptlAgreement.setProductsCode(agreementSaveDto.getProductsCode());
         ptlAgreement.setCreator(userName);
         ptlAgreement.setCreateTime(LocalDateTime.now());
@@ -796,16 +795,18 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         return HttpResult.ok("删除成功");
     }
 
+
+
     @Override
     @Transactional
     public HttpResult<Object> reviseAgreement(String userName, String agreementId, PtlAgreementSaveVo agreement) {
+        PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
         PtlAgreementSaveDto agreementSaveDto = agreement.getAgreement();
         PtlAgreementAttributionDto attribution = agreement.getAttribution();
         attribution.setCheck(pythonCheck);
-        PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
+
         BeanUtils.copyProperties(agreementSaveDto, ptlAgreement);
-        EsmInsCompany esmInsCompany = proxyObject.verifyLogin(ptlAgreement, agreementSaveDto, attribution,
-                "1".equals(ptlAgreement.getValidStatus()));
+        EsmInsCompany esmInsCompany = getEsmInsCompany(ptlAgreement, agreementSaveDto);
         ptlAgreement.setIsExternal(agreementSaveDto.getIsExternal());
         ptlAgreement.setProductsCode(agreementSaveDto.getProductsCode());
         ptlAgreement.setModifiedBy(userName);
@@ -1224,4 +1225,33 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         ptlAgreementUndwrtRulesNewService.copyUndwrtRules(ptlAgreementUndwrtRulesNews, ptlAgreement.getId());
     }
 
+    @Override
+    public boolean checkLogin(String userName,String agreementId, PtlAgreementSaveVo agreement) {
+        PtlAgreementSaveDto agreementSaveDto = agreement.getAgreement();
+        PtlAgreementAttributionDto attribution = agreement.getAttribution();
+        attribution.setCheck(pythonCheck);
+        PtlAgreement ptlAgreement = new PtlAgreement();
+        if (Objects.nonNull(agreementId)) {
+            ptlAgreement = proxyObject.ifExistsById(agreementId);
+        }
+        BeanUtils.copyProperties(agreementSaveDto, ptlAgreement);
+        proxyObject.verifyLogin(ptlAgreement, agreementSaveDto, attribution,
+                "1".equals(ptlAgreement.getValidStatus()));
+        return true;
+    }
+
+    @Override
+    public EsmInsCompany getEsmInsCompany(PtlAgreement ptlAgreement,PtlAgreementSaveDto agreementSaveDto) {
+        EsmInsCompany esmInsCompany;
+
+        esmInsCompany = esmInsCompanyService.getBySubsidiary(agreementSaveDto.getPartnerCompaniesId());
+
+        ptlAgreement.setCompaniesType(esmInsCompany.getType());
+        ptlAgreement.setInsuranceCompanyId(esmInsCompany.getId());
+        ptlAgreement.setInsuranceCompany(esmInsCompany.getNamesimple());
+        // 生成协议id
+        ptlAgreement.generateTheProtocolCode();
+        return esmInsCompany;
+    }
+
 }

+ 3 - 0
src/main/java/com/ydtech/modules/protocols/entity/vo/AgreementProductQueryVo.java

@@ -78,6 +78,9 @@ public class AgreementProductQueryVo extends PageRequest {
     @ApiModelProperty("现询费用id")
     private String nowCostsId;
 
+    @ApiModelProperty("审核人id")
+    private String auditPerson;
+
 
 
 }

+ 14 - 1
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -375,7 +375,20 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                         }
                         desc = desc.substring(0, desc.length() - 1);
                         desc += "\n";
-                    } else {
+                    } else if(ptlAgreementUndwrtRulesAttr.getAttrCode().equals("RateFloatFlag")){
+                        String[] split = v.get(i).getMin().split(",");
+                        if(v.get(i).getOperator().equals("0")) {
+                            desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含";
+                        }
+                        if (v.get(i).getOperator().equals("1")) {
+                            desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "不包含";
+                        }
+                        for (String s : split) {
+                            desc += s + ",";
+                        }
+                        desc = desc.substring(0, desc.length() - 1);
+                        desc += "\n";
+                    }else {
                         desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含" + v.get(i).getMin() + "\n";
                     }
                 }

+ 126 - 0
src/main/resources/mapper/modules/admin/PartnerWalletMapper.xml

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ydtech.modules.admin.dao.PartnerWalletMapper">
+
+    <select id="getMemberNumber" resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        SELECT COALESCE(p.suggest_id, l.suggest_id) AS userId,
+        COUNT(*) AS data
+        FROM sys_user u
+        INNER JOIN sys_dept d ON u.dept_id = d.id
+        INNER JOIN sys_agency_leader l ON l.dept_id = d.parent_id
+        LEFT JOIN sys_relation_person p ON l.suggest_id = p.agency_leader_id
+        WHERE (p.suggest_id IN
+        <foreach collection="userIdList" item="item" index="index"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        OR l.suggest_id IN
+        <foreach collection="userIdList" item="item" index="index"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>)
+        AND u.status != '0'
+        GROUP BY COALESCE(p.suggest_id, l.suggest_id);
+    </select>
+
+    <select id="getTotalPremiums" resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        select user_id as userId, sum(sumpremium) as data
+        from sys_premium_details
+        where user_id  IN
+        <foreach collection="userIdList" item="item" index="index"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        and status = '1'
+        and source = '1'
+        and create_time &gt; #{beginDate}
+        and create_time &lt; #{endDate}
+        GROUP BY user_id
+    </select>
+
+    <select id="getCommission" resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        select user_id as userId, sum(extract_fee) as data
+        from sys_premium_details
+        where user_id IN
+        <foreach collection="userIdList" item="item" index="index"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        and status = '1'
+        and create_time &gt; #{beginDate}
+        and create_time &lt; #{endDate}
+        GROUP BY user_id
+    </select>
+
+    <select id="getCopartnerAndStudioNumber"
+            resultType="com.ydtech.modules.admin.model.dto.partner.CopartnerAndStudioNumberDTO">
+        SELECT suggest_id as userId, source as source, type as type, COUNT(1) as count
+        FROM sys_relation_person
+        WHERE suggest_id in
+        <foreach collection="userIdList" item="item" index="index"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        GROUP BY suggest_id, source, type;
+    </select>
+
+    <select id="getPartnerRankMemberNumber"
+            resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        select p.type as userId, count(*) as data
+        from sys_user u
+                 LEFT join sys_dept d on u.dept_id = d.id
+                 LEFT join sys_agency_leader l on d.parent_id = l.dept_id
+                 LEFT join sys_relation_person rp on rp.agency_leader_id = l.suggest_id
+                 INNER JOIN sys_partner p ON p.user_id = rp.suggest_id
+        WHERE p.suggest_id = #{userId}
+        GROUP BY p.type;
+    </select>
+
+    <select id="getPartnerRankTotalPremiums"
+            resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        select p.type as userId, sum(sumpremium) as data
+        from sys_premium_details d
+                 left join sys_partner p ON p.user_id = d.user_id
+        where d.create_time &gt; #{beginDate}
+            and d.create_time &lt; #{endDate}
+            and p.suggest_id = #{userId}
+            and d.status = '1'
+            and d.source = p.type
+        GROUP BY p.type;
+    </select>
+
+    <select id="getPartnerRankCommission"
+            resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        select p.type as userId, sum(extract_fee) as data
+        from sys_premium_details d
+                 left join sys_partner p ON p.user_id = d.user_id
+        where d.create_time &gt; #{beginDate}
+            and d.create_time &lt; #{endDate}
+            and p.suggest_id = #{userId}
+            and d.status = '1'
+            and d.source = p.type
+        GROUP BY p.type;
+    </select>
+
+    <select id="getPartnerRankCopartnerNumber"
+            resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        SELECT p.type as userId, COUNT(*) as data
+        FROM sys_relation_person rp
+                 INNER JOIN sys_partner p ON p.user_id = rp.agency_leader_id
+        WHERE p.suggest_id = #{userId}
+        GROUP BY p.type;
+    </select>
+
+    <select id="getPartnerRankStudioNumber"
+            resultType="com.ydtech.modules.admin.model.dto.partner.PartnerDataDTO">
+        SELECT p.type as userId, COUNT(*) as data
+        FROM sys_relation_person rp
+                 INNER JOIN sys_agency_leader l ON rp.agency_leader_id = l.suggest_id
+                 INNER JOIN sys_partner p ON p.user_id = rp.agency_leader_id
+        WHERE p.suggest_id = #{userId}
+        GROUP BY p.type;
+    </select>
+
+</mapper>

+ 1 - 1
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -916,7 +916,7 @@
         LEFT JOIN sys_role t4 ON t3.role_id = t4.id
         AND sd.del_flag = '0'
         WHERE
-        su.status != 0 AND su.id LIKE '%M%' and su.id!='admin'
+        (su.status != 0 and su.status != 9) AND su.id LIKE '%M%' and su.id!='admin'
         <if test='user !=null  '>
             <if test='user.name !=null and user.name!="" '>
                 and su.name like concat('%', #{user.name}, '%')

+ 82 - 0
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -724,4 +724,86 @@
 
 
     </select>
+
+    <select id="getAgentDataDetails" resultType="com.ydtech.modules.admin.model.dto.ChannelDetailsExport">
+        SELECT
+        io.userid AS "userId",
+        sd.id as"deptId",
+        sd.name as"deptName",
+        pa.insurance_company as "insuranceCompany",
+        CASE
+        WHEN sd.management_source = '1' THEN '渠道'
+        WHEN sd.management_source = '2' THEN '代理人'
+        WHEN sd.management_source = '3' THEN '电销'
+        END AS "managementSource",
+        io.licenseno as "licenseno",
+        su.id as "userId",
+        su.name AS "userName",
+        su.dept_id AS "deptId",
+        su.leader_name AS "leaderName",
+        iac.signing_time as "signingTime",
+        iac.jypremium,
+        sd.management_source AS "managementSource",
+        IFNULL(jqpremium, 0) + IFNULL(sypremium, 0) + IFNULL(jypremium, 0) AS "sumpremium",
+        IFNULL(jqpremium, 0) AS "jqpremium",
+        IFNULL(sypremium, 0) AS "sypremium",
+        IFNULL(taxamount, 0) AS "taxamount",
+        IFNULL(jypremium, 0) AS "jypremium"
+        FROM
+        ins_area_company iac
+        LEFT JOIN ins_orders io ON io.orderno = iac.orderno
+        LEFT JOIN sys_user su ON su.id = io.userid
+        LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
+        LEFT JOIN sys_dept sd ON sd.id = su.dept_id
+        LEFT JOIN sys_user_role sur ON sur.user_id = su.id
+        left join ptl_agreement pa on pa.id = iac.agreement_id
+        WHERE
+        iac.orderstatus = '3'
+        AND (iac.del_flag = '1' OR io.del_flag IS NULL OR io.del_flag = 1)
+        <if test="vo.signingTimeStart != null and vo.signingTimeStart!='' and vo.signingTimeEnd != null and vo.signingTimeEnd != ''">
+            AND iac.signing_time BETWEEN #{vo.signingTimeStart} AND #{vo.signingTimeEnd}
+        </if>
+        <if test="vo.enterTimeStart != null and vo.enterTimeStart!='' and vo.enterTimeEnd != null and vo.enterTimeEnd != ''">
+            AND iac.createtime BETWEEN #{vo.enterTimeStart} AND #{vo.enterTimeEnd}
+        </if>
+
+        <if test="vo.leaderName != null and vo.leaderName!='' ">
+            AND iac.leader_name = #{vo.leaderName}
+        </if>
+        <if test="vo.userIds  !=null  and vo.userIds!=''  and vo.userIds.size()>0">
+            AND su.leader_id IN
+            <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+            AND sd.id IN
+            <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="vo.managementSource !=null  and vo.managementSource!=''">
+            AND sd.management_source = #{vo.managementSource}
+        </if>
+        <if test="vo.deptId !=null  and vo.deptId!=''">
+            AND sd.id LIKE CONCAT('%', #{vo.deptId}, '%')
+        </if>
+
+        <if test="vo.userId !=null  and vo.userId!=''">
+            AND su.id = #{vo.userId}
+        </if>
+        <if test="vo.userName !=null  and vo.userName!=''">
+            AND su.name = #{vo.userName}
+        </if>
+        <choose>
+            <when test='vo.managementSource == "2"'>
+                AND (sur.role_id = 20 OR sur.role_id = 21)
+            </when>
+            <when test='vo.managementSource == "1"'>
+                AND (sur.role_id = 19 OR sur.role_id = 21)
+            </when>
+            <otherwise>
+            </otherwise>
+        </choose>
+    </select>
 </mapper>

+ 2 - 1
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -163,13 +163,14 @@
         su2.name as "updateUserName",
         CONCAT_WS( '-', pa.agreement_abbreviation, NULLIF( pa.business_description, '' ), NULLIF( pa.job_description, '' ) ) AS agreementName,
         pa.agreement_type  as "agreementType",
-        pa.docking_person  as "dockingPerson",
+        iac.docking_person  as "dockingPerson",
         pa.is_external  as "isExternal",
         upf.url as "imageUrl",
         su.name  as "userName",
         b.name as "deptName",
         <include refid="income_com"/>
         from  ins_ply_income a
+        LEFT  JOIN  ins_area_company  iac on a.orderno = iac.id
         LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
         LEFT  JOIN  sys_user   su  on su.id=a.user_id
         LEFT  JOIN  sys_user   su1  on su1.id=a.settlement_user_id

+ 1 - 1
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -324,7 +324,7 @@
         a.agree_ment_id as "agreeMentId",
         a.partner_companies_id as "partnerCompaniesId",
         a.invoicing_method as "invoicingMethod",
-        a.tax_points as "taxPoints",
+        ifnull(a.tax_points,0) as "taxPoints",
         a.expend_amount as "expendAmount",
         a.parent_id as "parentId",
         a.handling_fees_status as "handlingFeesStatus",

+ 4 - 0
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -328,6 +328,10 @@
                 #{key}
             </foreach>
         </if>
+        <if test="params.auditTimeStart != null and params.auditTimeStart != '' and params.auditTimeEnd != null and params.auditTimeEnd != ''">
+            and DATE_FORMAT(ifa.audittime, '%Y-%m-%d') between #{params.auditTimeStart} AND
+            #{params.auditTimeEnd}
+        </if>
         order by iac.createtime desc
     </select>
 

+ 3 - 0
src/main/resources/mapper/modules/protocols/PtlAgreementProductCostsNewMapper.xml

@@ -55,6 +55,9 @@
         <if test="params.costsEndDate != null and params.costsEndDate != ''">
             and papcn.costs_end_date &lt;= #{params.costsEndDate}
         </if>
+        <if test="params.auditPerson != null and params.auditPerson!= ''">
+            AND papcn.audit_person = #{params.auditPerson}
+        </if>
 
     </select>