Просмотр исходного кода

Merge branch 'refs/heads/test' into test-20240815

wks 2 лет назад
Родитель
Сommit
df71f6a3b8
54 измененных файлов с 1714 добавлено и 374 удалено
  1. 25 0
      sql/Online.sql
  2. 20 9
      src/main/java/com/ydtech/constants/InsuranceImageEnum.java
  3. 69 0
      src/main/java/com/ydtech/modules/admin/controller/InsuranceHandlingSettlementMonthController.java
  4. 25 6
      src/main/java/com/ydtech/modules/admin/controller/SysAgencyLeaderController.java
  5. 13 11
      src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java
  6. 1 1
      src/main/java/com/ydtech/modules/admin/controller/kzt/KZTRoleController.java
  7. 7 0
      src/main/java/com/ydtech/modules/admin/dao/SysRoleMenuKztMapper.java
  8. 6 0
      src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApproval.java
  9. 6 0
      src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApprovalRecord.java
  10. 6 0
      src/main/java/com/ydtech/modules/admin/model/dto/SysAgencyFeeApprovalAddDto.java
  11. 9 3
      src/main/java/com/ydtech/modules/admin/model/dto/TeamInformationDto.java
  12. 5 0
      src/main/java/com/ydtech/modules/admin/model/dto/TeamUserInfoDto.java
  13. 4 0
      src/main/java/com/ydtech/modules/admin/model/po/SysUserBankCard.java
  14. 16 0
      src/main/java/com/ydtech/modules/admin/model/vo/AAPLoginVo.java
  15. 2 1
      src/main/java/com/ydtech/modules/admin/model/vo/AgencyExtractFeeVo.java
  16. 6 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysAgencyLeaderVo.java
  17. 6 2
      src/main/java/com/ydtech/modules/admin/service/SysAgencyLeaderService.java
  18. 10 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyFeeApprovalServiceImpl.java
  19. 314 186
      src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java
  20. 2 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysRoleMenuKztServiceImpl.java
  21. 3 3
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java
  22. 39 12
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserBankCardServiceImpl.java
  23. 2 0
      src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java
  24. 25 0
      src/main/java/com/ydtech/modules/fnc/dao/InsuranceHandlingSettlementMonthMapper.java
  25. 46 0
      src/main/java/com/ydtech/modules/fnc/dto/InsuranceHandlingSettlementMonthDto.java
  26. 65 0
      src/main/java/com/ydtech/modules/fnc/entity/InsuranceHandlingSettlementMonthEntity.java
  27. 31 0
      src/main/java/com/ydtech/modules/fnc/service/InsuranceHandlingSettlementMonthService.java
  28. 66 0
      src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java
  29. 47 0
      src/main/java/com/ydtech/modules/fnc/vo/InsuranceHandlingSettlementMonthVo.java
  30. 6 2
      src/main/java/com/ydtech/modules/order/controller/BoHaiOrderApiController.java
  31. 12 1
      src/main/java/com/ydtech/modules/order/controller/PingAnOrderApiController.java
  32. 8 1
      src/main/java/com/ydtech/modules/order/dao/InsTaskImagesMapper.java
  33. 19 0
      src/main/java/com/ydtech/modules/order/dao/PinganShUploafileMapper.java
  34. 22 2
      src/main/java/com/ydtech/modules/order/entity/api/pingan/constants/dict/document/PingAnDocumentClassEnum.java
  35. 15 15
      src/main/java/com/ydtech/modules/order/entity/api/pingan/request/SubmitApplyRequest.java
  36. 149 0
      src/main/java/com/ydtech/modules/order/entity/po/PinganShUploafile.java
  37. 2 3
      src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java
  38. 2 0
      src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java
  39. 4 0
      src/main/java/com/ydtech/modules/order/entity/vo/QuoteAccidentalDrivingVo.java
  40. 25 0
      src/main/java/com/ydtech/modules/order/entity/vo/pingan/AdditionalInformation.java
  41. 2 0
      src/main/java/com/ydtech/modules/order/service/InsUploadFilesService.java
  42. 8 0
      src/main/java/com/ydtech/modules/order/service/PingAnOrderApiService.java
  43. 15 0
      src/main/java/com/ydtech/modules/order/service/PinganShUploafileService.java
  44. 20 2
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  45. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/InsUploadFilesServiceImpl.java
  46. 382 99
      src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java
  47. 22 0
      src/main/java/com/ydtech/modules/order/service/impl/PinganShUploafileServiceImpl.java
  48. 16 5
      src/main/java/com/ydtech/modules/order/utils/QrCodeGenerator.java
  49. 1 2
      src/main/resources/application-test.yml
  50. 7 0
      src/main/resources/mapper/modules/admin/SysRoleMenuKztMapper.xml
  51. 10 0
      src/main/resources/mapper/modules/ins/InsTaskImagesMapper.xml
  52. 60 0
      src/main/resources/mapper/modules/insuranceHandlingSettlementMonth/InsuranceHandlingSettlementMonthMapper.xml
  53. 4 6
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml
  54. 26 0
      src/main/resources/mapper/modules/order/PinganShUploafileMapper.xml

+ 25 - 0
sql/Online.sql

@@ -42,6 +42,10 @@ CREATE TABLE `sys_agency_fee_approval` (
                                            `user_name` varchar(50) DEFAULT NULL COMMENT '员工姓名',
                                            `dept_id` varchar(30) DEFAULT NULL COMMENT '机构id',
                                            `dept_name` varchar(50) DEFAULT NULL COMMENT '机构名称',
+                                           `real_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '银行卡户主',
+                                           `bank_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '银行卡号',
+                                           `bank_account` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开户行',
+                                           `bank_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '开户行地址',
                                            `number` varchar(255) DEFAULT NULL COMMENT '提现编号',
                                            `sumpremium` decimal(10,2) DEFAULT NULL COMMENT '总保费',
                                            `proportional` varchar(10) DEFAULT NULL COMMENT '抽成比例(总保费抽成)',
@@ -67,6 +71,10 @@ CREATE TABLE `sys_agency_fee_approval_record` (
                                                   `user_name` varchar(50) DEFAULT NULL COMMENT '员工姓名',
                                                   `dept_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构id',
                                                   `dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构名称',
+                                                  `real_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '银行卡户主',
+                                                  `bank_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '银行卡号',
+                                                  `bank_account` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开户行',
+                                                  `bank_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '开户行地址',
                                                   `number` varchar(255) DEFAULT NULL COMMENT '提现编号',
                                                   `sumpremium` decimal(10,2) DEFAULT NULL COMMENT '总保费',
                                                   `proportional` varchar(10) DEFAULT NULL COMMENT '抽成比例(总保费抽成)',
@@ -130,6 +138,7 @@ CREATE TABLE `sys_relation_person` (
                                        `del_flag` tinyint NOT NULL DEFAULT '1' COMMENT '删除( 0:删除 1:正常)',
                                        PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='合伙人/推荐人和机构负责人关系表';
+ALTER TABLE `sys_user_bank_card` ADD COLUMN `ascription` tinyint DEFAULT NULL COMMENT '归属端 1:渠道 2:个代 a:合伙人 b:机构负责人';
 
 --add by caiyaru 20240813
 ALTER TABLE `sys_user_bank_card` ADD COLUMN `bank_verify` tinyint  DEFAULT 0 COMMENT '0 未验证 1 已验证';
@@ -161,3 +170,19 @@ CREATE TABLE `sys_user_role_kzt`  (
                                       `last_update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                       PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '控制台用户关联角色' ROW_FORMAT = Dynamic;
+
+
+-- 保险手续费结算关联表
+DROP TABLE IF EXISTS `sys_insurance_handling_settlement_month`;
+CREATE TABLE `sys_insurance_handling_settlement_month`  (
+                                                            `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
+                                                            `task_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务id',
+                                                            `settlement_documentary_fees_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '结算id',
+                                                            `settlement_amount` decimal(15,5) DEFAULT NULL COMMENT '结算金额',
+                                                            `total_amount` decimal(15,5) DEFAULT NULL COMMENT '开票金额',
+                                                            `remaining_amount` decimal(15,5) DEFAULT NULL COMMENT '剩余结算金额',
+                                                            `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+                                                            `signing_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+                                                            `creater_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
+                                                            PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '保险手续费结算关联表' ROW_FORMAT = Dynamic;

+ 20 - 9
src/main/java/com/ydtech/constants/InsuranceImageEnum.java

@@ -43,15 +43,26 @@ public enum InsuranceImageEnum {
     D04("D04", "被保人身份证反面"),
     Y04("Y04", "被保人营业执照"),
 
-    LZ_01("LZ_01","离职表");
-
-
-//    C0500("C0500", "验车照(车架)"),
-//    C0501("C0501", "验车照(后左)"),
-//    C0502("C0502", "验车照(后右)"),
-//    C0503("C0503", "验车照(前右)"),
-//    C0504("C0504", "验车照(前左)"),
-//    C0505("C0505", "验车照(人车合影)");
+    LZ_01("LZ_01","离职表"),
+
+    //  add by 2024-08-16  添加平安上传资料
+    //平安添加验车照上传类型
+    C0500("C0500", "验车照(车架)"),
+    C0501("C0501", "验车照(后左)"),
+    C0502("C0502", "验车照(后右)"),
+    C0503("C0503", "验车照(前右)"),
+    C0504("C0504", "验车照(前左)"),
+    C0505("C0505", "验车照(人车合影)"),
+    C0506("C0506", "验车照(正前)"),
+    C0507("C0507", "验车照(正后)"),
+    C0508("C0508", "验车照(地标合影)"),
+    C0509("C0509", "验车照(工作台)"),
+    C0510("C0510", "验车照(天窗)"),
+
+    //平安上传旧车登记证书
+    TAR05("TAR05", "机动车辆登记证书"),
+    // 平安上年保单
+    INSURANCE_POLICY("LAST_INSURANCE_POLICY", "上年商业险保单");
 
 
     private final String code;

+ 69 - 0
src/main/java/com/ydtech/modules/admin/controller/InsuranceHandlingSettlementMonthController.java

@@ -0,0 +1,69 @@
+package com.ydtech.modules.admin.controller;
+
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
+import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+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.validation.Valid;
+import java.util.List;
+
+/**
+ * <p>
+ *    保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+@RestController
+@Api(tags = "保险手续费结算")
+@RequestMapping("SettlementHandling")
+public class InsuranceHandlingSettlementMonthController {
+
+    @Autowired
+    private InsuranceHandlingSettlementMonthService  insuranceHandlingSettlementMonthService;
+
+    /**
+     *
+     * @param insuranceHandlingSettlementMonthVo  结算传参
+     * @return  返回结算信息
+     */
+    @PostMapping("/queryList")
+    @ApiModelProperty(value = "查询")
+    public HttpResult<List<InsuranceHandlingSettlementMonthDto>> queryList(@RequestBody @Valid InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        List<InsuranceHandlingSettlementMonthDto> result = insuranceHandlingSettlementMonthService.queryList(insuranceHandlingSettlementMonthVo);
+        return HttpResult.ok(result);
+    }
+
+    /**
+     * 结算新增
+     * @param insuranceHandlingSettlementMonthVo
+     * @return
+     */
+    @PostMapping("/insert")
+    @ApiModelProperty(value = "新增")
+    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(@RequestBody InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        return insuranceHandlingSettlementMonthService.insertByEntity(insuranceHandlingSettlementMonthVo);
+    }
+
+
+
+
+
+
+
+
+
+
+}

+ 25 - 6
src/main/java/com/ydtech/modules/admin/controller/SysAgencyLeaderController.java

@@ -163,11 +163,21 @@ public class SysAgencyLeaderController extends BaseController {
     /**
      * 查询机构下所有团队的信息
      */
-    @PostMapping("/queryTeamInfo")
-    @ApiOperation(value = "查询机构下所有团队的信息")
-    public HttpResult<List<TeamInformation>> queryTeamInfo(@RequestBody TeamInformationDto teamInformationDto){
+//    @PostMapping("/queryTeamInfo")
+//    @ApiOperation(value = "查询机构下所有团队的信息")
+//    public HttpResult<List<TeamInformation>> queryTeamInfo(@RequestBody TeamInformationDto teamInformationDto){
+//
+//        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfo(teamInformationDto));
+//    }
+
+    /**
+     * 分页查询机构下所有团队的信息
+     */
+    @PostMapping("/queryTeamInfoPage")
+    @ApiOperation(value = "分页查询机构下所有团队的信息")
+    public HttpResult<BasePageResult<TeamInformation>> queryTeamInfoPage(@RequestBody TeamInformationDto teamInformationDto){
 
-        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfo(teamInformationDto));
+        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfoPage(teamInformationDto));
     }
 
     /**
@@ -175,12 +185,21 @@ public class SysAgencyLeaderController extends BaseController {
      */
 
     @PostMapping("/queryTeamUser")
-    @ApiOperation(value = "根据团队id查询团队下人员信息")
-    public HttpResult<List<TeamUserInfoVo>> queryTeamUser(@RequestBody TeamUserInfoDto teamUserInfoDto) {
+    @ApiOperation(value = "分页查询团队下人员信息")
+    public HttpResult<BasePageResult<TeamUserInfoVo>> queryTeamUser(@RequestBody TeamUserInfoDto teamUserInfoDto) {
 
         return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamUser(teamUserInfoDto));
     }
 
+    /**
+     * 查询合伙人下的机构负责人
+     */
+    @GetMapping("/queryAgencyLeader")
+    @ApiOperation(value = "查询合伙人下的机构负责人")
+    public HttpResult<List<SysAgencyLeaderVo>> queryAgencyLeader(){
+
+        return HttpResult.ok("success", this.sysAgencyLeaderService.queryAgencyLeader(getUserId()));
+    }
 
 
 }

+ 13 - 11
src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java

@@ -16,10 +16,7 @@ import com.ydtech.modules.admin.model.SysPassword;
 import com.ydtech.modules.admin.model.SysRole;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.po.SysUserLinkSys;
-import com.ydtech.modules.admin.model.vo.LoginBean;
-import com.ydtech.modules.admin.model.vo.LoginTicket;
-import com.ydtech.modules.admin.model.vo.PhoneLoginVo;
-import com.ydtech.modules.admin.model.vo.QrCodeStatusEnum;
+import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.*;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.security.utils.PasswordUtils;
@@ -252,7 +249,8 @@ public class SysLoginController {
      */
     @PostMapping(value = "/aapLogin")
     @ApiOperation(value = "合伙人和机构负责人登录APP接口")
-    public HttpResult aapLogin(@RequestBody LoginBean loginBean, HttpServletRequest request) {
+    public HttpResult<AAPLoginVo> aapLogin(@RequestBody LoginBean loginBean, HttpServletRequest request) {
+        AAPLoginVo aapLoginVo = new AAPLoginVo();
         String username = loginBean.getAccount();
         String password = loginBean.getPassword();
         String captcha = loginBean.getCaptcha();
@@ -262,10 +260,14 @@ public class SysLoginController {
         //校验登录用户是否为合伙人或者是机构负责人
         boolean a = sysPartnerService.checkPartner(user.getId());
         boolean b = sysAgencyLeaderService.checkUserId(user.getId());
-        if (!a ) {
-            if (!b) {
-                throw  new SystemException("该用户无权限登录AAP,只能合伙人或者机构负责人才能登录!");
-            }
+        if (a ) {
+            //类型:1.合伙人;2机构负责人
+            aapLoginVo.setType(1);
+        }else if (b) {
+            aapLoginVo.setType(2);
+        }else {
+            throw  new SystemException("该用户无权限登录AAP,只能合伙人或者机构负责人才能登录!");
+
         }
 
 
@@ -316,8 +318,8 @@ public class SysLoginController {
         // 获取这个人的token
         String token = StpUtil.createLoginSession(user.getId());
         StpUtil.getSessionByLoginId(user.getId()).set(SaSession.USER, user);
-
-        return HttpResult.ok("登录成功", token);
+        aapLoginVo.setToken(token);
+        return HttpResult.ok("登录成功", aapLoginVo);
 
     }
 

+ 1 - 1
src/main/java/com/ydtech/modules/admin/controller/kzt/KZTRoleController.java

@@ -103,7 +103,7 @@ public class KZTRoleController extends BaseController {
      *  @Description:  控制台所有角色
      */
     @ApiOperation(value = "控制台所有角色")
-    @PostMapping(value = "/findAll")
+    @GetMapping(value = "/findAll")
     public HttpResult findAll(String sysType) {
         if (StringUtils.isBlank(sysType)) {
             throw new SystemException("系統类型不能为空,传2为控制台!!");

+ 7 - 0
src/main/java/com/ydtech/modules/admin/dao/SysRoleMenuKztMapper.java

@@ -22,6 +22,13 @@ public interface SysRoleMenuKztMapper extends BaseMapper<SysRoleMenuKzt> {
      *  @Description: 通过角色id查询控制台关联的菜单
      */
     List<SysMenu> findMenuIdsByRoleId(@Param("roleId") Long roleId, @Param("sysType") String sysType);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/15 14:40
+     *  @Description:   通过角色id删除数据
+     */
+    void deleteByRoleId(@Param("roleId") Long roleId);
 }
 
 

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApproval.java

@@ -47,6 +47,12 @@ public class SysAgencyFeeApproval implements Serializable {
      */
     @ApiModelProperty(value = "机构id")
     private String deptId;
+
+    /**
+     * 银行卡户主
+     */
+    @ApiModelProperty(value = "银行卡户主")
+    private String realUserName;
     /**
      * 机构name
      */

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApprovalRecord.java

@@ -45,6 +45,12 @@ public class SysAgencyFeeApprovalRecord {
     @ApiModelProperty(value = "机构name")
     private String deptName;
 
+    /**
+     * 银行卡户主
+     */
+    @ApiModelProperty(value = "银行卡户主")
+    private String realUserName;
+
     /**
      * 银行卡号
      */

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/dto/SysAgencyFeeApprovalAddDto.java

@@ -13,6 +13,12 @@ import java.util.Date;
 @Data
 @ApiModel(value = "机构保费抽成提交审批入参")
 public class SysAgencyFeeApprovalAddDto {
+    /**
+     * 银行卡户主
+     */
+    @ApiModelProperty(value = "银行卡户主")
+    private String realUserName;
+
     /**
      * 银行卡号
      */

+ 9 - 3
src/main/java/com/ydtech/modules/admin/model/dto/TeamInformationDto.java

@@ -8,10 +8,11 @@ import org.springframework.format.annotation.DateTimeFormat;
 @Data
 @ApiModel(value = "查询机构下团队信息")
 public class TeamInformationDto {
-    @ApiModelProperty(value = "首页为1,详情为2")
-    private Integer type;
 
-    @ApiModelProperty(value = "用户id")
+    @ApiModelProperty(value = "机构负责人id")
+    private String userId;
+
+    @ApiModelProperty(value = "团队name")
     private String deptName;
 
     @ApiModelProperty(value = "开始时间")
@@ -20,4 +21,9 @@ public class TeamInformationDto {
     @ApiModelProperty(value = "结束时间")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     private String endTime;
+
+    @ApiModelProperty(value = "页数")
+    private int pageNum;
+    @ApiModelProperty(value = "每页条数")
+    private int pageSize;
 }

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

@@ -25,5 +25,10 @@ public class TeamUserInfoDto {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     private String endTime;
 
+    @ApiModelProperty(value = "页数")
+    private int pageNum;
+    @ApiModelProperty(value = "每页条数")
+    private int pageSize;
+
 
 }

+ 4 - 0
src/main/java/com/ydtech/modules/admin/model/po/SysUserBankCard.java

@@ -94,4 +94,8 @@ public class SysUserBankCard implements Serializable {
 
     @TableField(value = "bank_verify")
     private Integer bankVerify;
+
+    @TableField(value = "ascription")
+    private String ascription;
+
 }

+ 16 - 0
src/main/java/com/ydtech/modules/admin/model/vo/AAPLoginVo.java

@@ -0,0 +1,16 @@
+package com.ydtech.modules.admin.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "AAP登录返参")
+public class AAPLoginVo {
+
+    @ApiModelProperty(value = "个人的token")
+    private String token;
+
+    @ApiModelProperty(value = "类型:1.合伙人;2机构负责人")
+    private int type;
+}

+ 2 - 1
src/main/java/com/ydtech/modules/admin/model/vo/AgencyExtractFeeVo.java

@@ -11,7 +11,8 @@ import java.util.Date;
 @Data
 @ApiModel(value = "机构抽成返回实体")
 public class AgencyExtractFeeVo {
-        @ApiModelProperty(value = "员工id")
+
+    @ApiModelProperty(value = "员工id")
     private String userId;
     /**
      * 员工姓名

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysAgencyLeaderVo.java

@@ -33,6 +33,12 @@ public class SysAgencyLeaderVo {
      */
     @ApiModelProperty(value = "机构name")
     private String deptName;
+
+    @ApiModelProperty(value = "推荐人id")
+    private String suggestId;
+
+    @ApiModelProperty(value = "推荐人name")
+    private String suggestName;
     /**
      * 机构等级
      */

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

@@ -51,7 +51,11 @@ public interface SysAgencyLeaderService extends IService<SysAgencyLeader> {
 
     BasePageResult<AgencyExtractFeeVo> queryExtractFeeAll(SysAgencyLeaderPageDto sysAgencyLeaderPageDto);
 
-    List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto);
+//    List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto);
 
-    List<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto);
+    BasePageResult<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto);
+
+    BasePageResult<TeamInformation> queryTeamInfoPage(TeamInformationDto teamInformationDto);
+
+    List<SysAgencyLeaderVo> queryAgencyLeader(String userId);
 }

+ 10 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyFeeApprovalServiceImpl.java

@@ -10,8 +10,10 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.dao.SysAgencyFeeApprovalMapper;
 import com.ydtech.modules.admin.dao.SysAgencyFeeApprovalRecordMapper;
+import com.ydtech.modules.admin.dao.SysDeptMapper;
 import com.ydtech.modules.admin.model.SysAgencyFeeApproval;
 import com.ydtech.modules.admin.model.SysAgencyFeeApprovalRecord;
+import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalAddDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalDto;
@@ -20,6 +22,7 @@ import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalPageDto;
 import com.ydtech.modules.admin.model.vo.AgencyExtractFee;
 import com.ydtech.modules.admin.service.SysAgencyFeeApprovalService;
 import com.ydtech.modules.admin.service.SysAgencyLeaderService;
+import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
@@ -52,6 +55,9 @@ public class SysAgencyFeeApprovalServiceImpl extends ServiceImpl<SysAgencyFeeApp
     @Resource
     private SysAgencyLeaderService sysAgencyLeaderService;
 
+    @Resource
+    private SysDeptMapper sysDeptMapper;
+
 
 
 
@@ -77,7 +83,10 @@ public class SysAgencyFeeApprovalServiceImpl extends ServiceImpl<SysAgencyFeeApp
         sysAgencyFeeApproval.setUserId(user.getId());
         sysAgencyFeeApproval.setUserName(user.getName());
         sysAgencyFeeApproval.setDeptId(user.getDeptId());
-        sysAgencyFeeApproval.setDeptName(user.getDeptName());
+        SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getId, user.getDeptId()).eq(SysDept::getDelFlag, 0));
+        if (sysDept != null) {
+            sysAgencyFeeApproval.setDeptName(sysDept.getName());
+        }
         sysAgencyFeeApproval.setNumber(IdGenerate.nextId());
         //总保费
         sysAgencyFeeApproval.setSumpremium(agencyExtractFee.getSumpremium());

+ 314 - 186
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java

@@ -15,7 +15,9 @@ import com.ydtech.modules.admin.model.dto.TeamInformationDto;
 import com.ydtech.modules.admin.model.dto.TeamUserInfoDto;
 import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.SysAgencyLeaderService;
+import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysPartnerService;
+import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
 import com.ydtech.modules.order.dao.InsOrdersMapper;
@@ -46,10 +48,14 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
 
     @Resource
     private SysDeptMapper sysDeptMapper;
+    @Resource
+    private SysDeptService sysDeptService;
 
     @Resource
     private SysUserMapper sysUserMapper;
 
+    @Resource
+    private SysUserService sysUserService;
     @Resource
     private InsOrdersMapper insOrdersMapper;
 
@@ -228,7 +234,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         if (sysAgencyLeaders.size() > 0) {
             for (SysAgencyLeader record : sysAgencyLeaders) {
                 for (SysAgencyLeaderVo sysAgencyLeaderVo : sysAgencyLeaderVos) {
-                    if (record.getId().equals(sysAgencyLeaderVo.getId()) ) {
+                    if (record.getId().equals(sysAgencyLeaderVo.getId())) {
                         String source = record.getSource();
                         if (!StringUtils.isNullOrEmpty(source)) {
                             String[] split = source.split(",");
@@ -257,7 +263,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         if (records.size() > 0) {
             for (SysAgencyLeader record : records) {
                 for (SysAgencyLeaderVo sysAgencyLeaderVo : sysAgencyLeaderVos) {
-                    if (record.getId().equals(sysAgencyLeaderVo.getId()) ) {
+                    if (record.getId().equals(sysAgencyLeaderVo.getId())) {
                         String source = record.getSource();
                         if (!StringUtils.isNullOrEmpty(source)) {
                             String[] split = source.split(",");
@@ -380,7 +386,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                     agencyExtractFee.setHistoryFee(historyFee);
                     //可提现 = 总抽成-已提现
                     agencyExtractFee.setCashFee(multiply.subtract(historyFee));
-                }else {
+                } else {
                     agencyExtractFee.setHistoryFee(new BigDecimal("0.00"));
                     agencyExtractFee.setCashFee(multiply.subtract(new BigDecimal("0.00")));
                 }
@@ -455,7 +461,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                     agencyExtractFee.setHistoryFee(historyFee);
                     //可提现 = 总抽成-已提现
                     agencyExtractFee.setCashFee(multiply.subtract(historyFee));
-                }else {
+                } else {
                     agencyExtractFee.setHistoryFee(new BigDecimal("0.00"));
                     agencyExtractFee.setCashFee(multiply.subtract(new BigDecimal("0.00")));
                 }
@@ -538,7 +544,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                     agencyExtractFee.setHistoryFee(historyFee);
                     //可提现 = 总抽成-已提现
                     agencyExtractFee.setCashFee(multiply.subtract(historyFee));
-                }else {
+                } else {
                     agencyExtractFee.setHistoryFee(new BigDecimal("0.00"));
                     agencyExtractFee.setCashFee(multiply.subtract(new BigDecimal("0.00")));
                 }
@@ -552,218 +558,339 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                 agencyExtractFeeList);
     }
 
+//    @Override
+//    public List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto) {
+//        String userId = BaseController.getUser().getId();
+//        List<TeamInformation> informationList = new ArrayList<>();
+//        //合伙人
+//        boolean c = sysPartnerService.checkPartner(userId);
+//        if (c) {
+//            return extracted(userId, informationList, teamInformationDto);
+//        }
+//        //校验当前用户是否为机构负责人
+//        boolean b = this.checkUserId(userId);
+//        if (b) {
+//            //机构负责人查询机构下的团队
+//            SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
+//                    .eq(SysAgencyLeader::getDelFlag, 1));
+//            String[] split = sysAgencyLeaders.getSource().split(",");
+//            //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
+//            List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>().likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
+//                    .isNull(SysDept::getComlevel).eq(SysDept::getDelFlag, 0).in(SysDept::getManagementSource, split)
+//                    .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()), SysDept::getName, teamInformationDto.getDeptName()));
+//            if (sysDeptList.size() > 0) {
+//                //总保费
+//                BigDecimal bigDecimal = new BigDecimal("0.00");
+//                for (SysDept sysDept : sysDeptList) {
+//                    TeamInformation teamInformation = new TeamInformation();
+//                    teamInformation.setDeptId(sysDept.getId());
+//                    teamInformation.setDeptName(sysDept.getName());
+//                    List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
+//                    teamInformation.setDeptManNum(sysUsers.size());
+//                    List<InsOrders> insOrderList;
+//                    //筛选订单,选择时间
+//                    Date updateTime = sysAgencyLeaders.getUpdateTime();
+//                    if (updateTime == null) {
+//                        //机构下所有订单
+//                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
+//                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                        teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
+//
+//                    } else {
+//                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                .ge(InsOrders::getCreatetime, updateTime)
+//                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                        teamInformation.setStartTime(updateTime);
+//                    }
+//
+//                    if (insOrderList.size() > 0) {
+//                        for (InsOrders insOrders : insOrderList) {
+//                            //查询订单下的所有子订单
+//                            List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                    .eq(InsAreaCompany::getOrderstatus, 3));
+//                            if (insAreaCompanies.size() > 0) {
+//                                for (InsAreaCompany insAreaCompany : insAreaCompanies) {
+//                                    //累加每一个子订单的交强险费用+商业险费用+驾意险费用
+//                                    bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+//
+//                                }
+//                            }
+//                        }
+//                    }
+//                    teamInformation.setSumpremium(bigDecimal);
+//                    int num = 0;
+//                    // 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
+//                    List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+//                    for (String s : userIdList) {
+//                        List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
+//                        if (collect.size() > 0) {
+//                            InsOrders insOrders = collect.get(0);
+//                            List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                    .eq(InsAreaCompany::getOrderstatus, 3));
+//                            if (insAreaCompanies1.size() > 0) {
+//                                num++;
+//                            }
+//
+//                        }
+//                    }
+//                    teamInformation.setOrderManNum(num);
+//                    informationList.add(teamInformation);
+//                    Integer type = teamInformationDto.getType();
+//                    if (type == 1) {
+//                        int size = informationList.size();
+//                        if (size == 2) {
+//                            return informationList;
+//                        }
+//                    }
+//                }
+//
+//            }
+//            return informationList;
+//        }
+//
+//
+//        return informationList;
+//    }
+//
+//    private List<TeamInformation> extracted(String userId, List<TeamInformation> informationList, TeamInformationDto teamInformationDto) {
+//        //查询所有推荐的机构负责人核算总保费
+//        List<SysRelationPerson> sysRelationPeople = sysRelationPersonMapper.selectList(new LambdaQueryWrapper<SysRelationPerson>()
+//                .eq(SysRelationPerson::getSuggestId, userId).eq(SysRelationPerson::getType, 1));
+//        if (sysRelationPeople.size() > 0) {
+//            //总保费
+//            BigDecimal bigDecimal = new BigDecimal("0.00");
+//            //获取所有推荐的机构负责人id
+//            List<String> agencyLeaderIds = sysRelationPeople.stream().map(SysRelationPerson::getAgencyLeaderId).collect(Collectors.toList());
+//            for (String agencyLeaderId : agencyLeaderIds) {
+//                //获取机构负责人信息
+//                SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>()
+//                        .eq(SysAgencyLeader::getUserId, agencyLeaderId)
+//                        .eq(SysAgencyLeader::getDelFlag, 1));
+//                String[] split = sysAgencyLeaders.getSource().split(",");
+//                //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
+//                List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>()
+//                        .likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
+//                        .isNull(SysDept::getComlevel)
+//                        .eq(SysDept::getDelFlag, 0)
+//                        .in(SysDept::getManagementSource, split)
+//                        .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()), SysDept::getName, teamInformationDto.getDeptName()));
+//                if (sysDeptList.size() > 0) {
+//                    for (SysDept sysDept : sysDeptList) {
+//                        TeamInformation teamInformation = new TeamInformation();
+//                        teamInformation.setDeptId(sysDept.getId());
+//                        teamInformation.setDeptName(sysDept.getName());
+//                        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
+//                                .likeRight(SysUser::getId, sysDept.getId())
+//                                .eq(SysUser::getStatus, 1));
+//                        teamInformation.setDeptManNum(sysUsers.size());
+//                        List<InsOrders> insOrderList;
+//                        //筛选订单,选择时间
+//                        Date updateTime = sysAgencyLeaders.getUpdateTime();
+//                        if (updateTime == null) {
+//                            //机构下所有订单
+//                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                    .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
+//                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                            teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
+//                        } else {
+//                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                    .ge(InsOrders::getCreatetime, updateTime)
+//                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                            teamInformation.setStartTime(updateTime);
+//                        }
+//
+//                        if (insOrderList.size() > 0) {
+//                            for (InsOrders insOrders : insOrderList) {
+//                                //查询订单下的所有子订单
+//                                List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
+//                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                        .eq(InsAreaCompany::getOrderstatus, 3));
+//                                if (insAreaCompanies.size() > 0) {
+//                                    for (InsAreaCompany insAreaCompany : insAreaCompanies) {
+//                                        //累加每一个子订单的交强险费用+商业险费用+驾意险费用
+//                                        bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+//
+//                                    }
+//                                }
+//                            }
+//                        }
+//                        teamInformation.setSumpremium(bigDecimal);
+//                        int num = 0;
+//                        // 查团队有几人出单 :子订单中userid相等同时在 子订单表中状态为3已承保才为出单
+//                        List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+//                        for (String s : userIdList) {
+//                            List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
+//                            if (collect.size() > 0) {
+//                                InsOrders insOrders = collect.get(0);
+//                                List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
+//                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                        .eq(InsAreaCompany::getOrderstatus, 3));
+//                                if (insAreaCompanies1.size() > 0) {
+//                                    num++;
+//                                }
+//
+//                            }
+//                        }
+//                        teamInformation.setOrderManNum(num);
+//                        informationList.add(teamInformation);
+//                        Integer type = teamInformationDto.getType();
+//                        if (type == 1) {
+//                            int size = informationList.size();
+//                            if (size == 2) {
+//                                return informationList;
+//                            }
+//                        }
+//                    }
+//                }
+//            }
+//        }
+//        return informationList;
+//    }
+
+
     @Override
-    public List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto) {
-        String userId = BaseController.getUser().getId();
-        List<TeamInformation> informationList = new ArrayList<>();
-        //合伙人
-        boolean c = sysPartnerService.checkPartner(userId);
-        if (c) {
-            return extracted(userId, informationList,teamInformationDto);
+    public BasePageResult<TeamInformation> queryTeamInfoPage(TeamInformationDto teamInformationDto) {
+        String userId = teamInformationDto.getUserId();
+        if (userId == null) {
+            userId=BaseController.getUserId();
         }
-        //校验当前用户是否为机构负责人
-        boolean b = this.checkUserId(userId);
-        if (b) {
-            //机构负责人查询机构下的团队
-            SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
-                    .eq(SysAgencyLeader::getDelFlag, 1));
-            String[] split = sysAgencyLeaders.getSource().split(",");
-            //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
-            List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>().likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
-                    .isNull(SysDept::getComlevel).eq(SysDept::getDelFlag, 0).in(SysDept::getManagementSource, split)
-                    .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()),SysDept::getName,teamInformationDto.getDeptName()));
-            if (sysDeptList.size() > 0) {
-                //总保费
-                BigDecimal bigDecimal = new BigDecimal("0.00");
-                for (SysDept sysDept : sysDeptList) {
-                    TeamInformation teamInformation = new TeamInformation();
-                    teamInformation.setDeptId(sysDept.getId());
-                    teamInformation.setDeptName(sysDept.getName());
-                    List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
-                    teamInformation.setDeptManNum(sysUsers.size());
-                    List<InsOrders> insOrderList;
-                    //筛选订单,选择时间
-                    Date updateTime = sysAgencyLeaders.getUpdateTime();
-                    if (updateTime == null) {
-                        //机构下所有订单
-                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
-                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                        teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
-
-                    } else {
-                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                .ge(InsOrders::getCreatetime, updateTime)
-                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                        teamInformation.setStartTime(updateTime);
-                    }
+        List<TeamInformation> informationList = new ArrayList<>();
+        //机构负责人查询机构下的团队
+        SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
+                .eq(SysAgencyLeader::getDelFlag, 1));
+        if (sysAgencyLeaders == null) return null;
+        String[] split = sysAgencyLeaders.getSource().split(",");
 
-                    if (insOrderList.size() > 0) {
-                        for (InsOrders insOrders : insOrderList) {
-                            //查询订单下的所有子订单
-                            List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                    .eq(InsAreaCompany::getOrderstatus, 3));
-                            if (insAreaCompanies.size() > 0) {
-                                for (InsAreaCompany insAreaCompany : insAreaCompanies) {
-                                    //累加每一个子订单的交强险费用+商业险费用+驾意险费用
-                                    bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+        Page<SysDept> page = new Page<>(teamInformationDto.getPageNum(), teamInformationDto.getPageSize());
 
-                                }
-                            }
-                        }
-                    }
-                    teamInformation.setSumpremium(bigDecimal);
-                    int num = 0;
-                    // 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
-                    List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
-                    for (String s : userIdList) {
-                        List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
-                        if (collect.size() > 0) {
-                            InsOrders insOrders = collect.get(0);
-                            List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                    .eq(InsAreaCompany::getOrderstatus, 3));
-                            if (insAreaCompanies1.size() > 0) {
-                                num++;
-                            }
+        LambdaQueryWrapper<SysDept> wrapper = new LambdaQueryWrapper<>();
+        wrapper.likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
+                .isNull(SysDept::getComlevel).eq(SysDept::getDelFlag, 0).in(SysDept::getManagementSource, split)
+                .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()), SysDept::getName, teamInformationDto.getDeptName());
+
+        Page<SysDept> insOrdersPage = sysDeptService.page(page, wrapper);
+        List<SysDept> sysDeptList = insOrdersPage.getRecords();
 
+        if (sysDeptList.size() > 0) {
+            //总保费
+            BigDecimal bigDecimal = new BigDecimal("0.00");
+            for (SysDept sysDept : sysDeptList) {
+                TeamInformation teamInformation = new TeamInformation();
+                teamInformation.setDeptId(sysDept.getId());
+                teamInformation.setDeptName(sysDept.getName());
+                List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
+                teamInformation.setDeptManNum(sysUsers.size());
+                List<InsOrders> insOrderList;
+                //筛选订单,选择时间
+                Date updateTime = sysAgencyLeaders.getUpdateTime();
+                if (updateTime == null) {
+                    //机构下所有订单
+                    insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+                            .likeRight(InsOrders::getDeptid, sysDept.getId())
+                            .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
+                            .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+                            .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+                    teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
+
+                } else {
+                    insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+                            .likeRight(InsOrders::getDeptid, sysDept.getId())
+                            .ge(InsOrders::getCreatetime, updateTime)
+                            .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+                            .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+                    teamInformation.setStartTime(updateTime);
+                }
+
+                if (insOrderList.size() > 0) {
+                    for (InsOrders insOrders : insOrderList) {
+                        //查询订单下的所有子订单
+                        List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+                                .eq(InsAreaCompany::getOrderstatus, 3));
+                        if (insAreaCompanies.size() > 0) {
+                            for (InsAreaCompany insAreaCompany : insAreaCompanies) {
+                                //累加每一个子订单的交强险费用+商业险费用+驾意险费用
+                                bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+
+                            }
                         }
                     }
-                    teamInformation.setOrderManNum(num);
-                    informationList.add(teamInformation);
-                    Integer type = teamInformationDto.getType();
-                    if (type == 1) {
-                        int size = informationList.size();
-                        if (size == 2) {
-                            return informationList;
+                }
+                teamInformation.setSumpremium(bigDecimal);
+                int num = 0;
+                // 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
+                List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+                for (String s : userIdList) {
+                    List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
+                    if (collect.size() > 0) {
+                        InsOrders insOrders = collect.get(0);
+                        List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+                                .eq(InsAreaCompany::getOrderstatus, 3));
+                        if (insAreaCompanies1.size() > 0) {
+                            num++;
                         }
+
                     }
                 }
+                teamInformation.setOrderManNum(num);
+                informationList.add(teamInformation);
 
             }
-            return informationList;
-        }
-
 
-        return informationList;
+        }
+        return new BasePageResult<>(teamInformationDto.getPageNum(), page.getSize(), insOrdersPage.getTotal(), page.getPages(),
+                informationList);
     }
 
-    private List<TeamInformation> extracted(String userId, List<TeamInformation> informationList,TeamInformationDto teamInformationDto) {
-        //查询所有推荐的机构负责人核算总保费
+    @Override
+    public List<SysAgencyLeaderVo> queryAgencyLeader(String userId) {
         List<SysRelationPerson> sysRelationPeople = sysRelationPersonMapper.selectList(new LambdaQueryWrapper<SysRelationPerson>()
                 .eq(SysRelationPerson::getSuggestId, userId).eq(SysRelationPerson::getType, 1));
         if (sysRelationPeople.size() > 0) {
-            //总保费
-            BigDecimal bigDecimal = new BigDecimal("0.00");
             //获取所有推荐的机构负责人id
             List<String> agencyLeaderIds = sysRelationPeople.stream().map(SysRelationPerson::getAgencyLeaderId).collect(Collectors.toList());
-            for (String agencyLeaderId : agencyLeaderIds) {
-                //获取机构负责人信息
-                SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>()
-                        .eq(SysAgencyLeader::getUserId, agencyLeaderId)
-                        .eq(SysAgencyLeader::getDelFlag, 1));
-                String[] split = sysAgencyLeaders.getSource().split(",");
-                //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
-                List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>()
-                                          .likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
-                                          .isNull(SysDept::getComlevel)
-                                          .eq(SysDept::getDelFlag, 0)
-                                          .in(SysDept::getManagementSource, split)
-                                          .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()),SysDept::getName,teamInformationDto.getDeptName()));
-                if (sysDeptList.size() > 0) {
-                    for (SysDept sysDept : sysDeptList) {
-                        TeamInformation teamInformation = new TeamInformation();
-                        teamInformation.setDeptId(sysDept.getId());
-                        teamInformation.setDeptName(sysDept.getName());
-                        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
-                                .likeRight(SysUser::getId, sysDept.getId())
-                                .eq(SysUser::getStatus, 1));
-                        teamInformation.setDeptManNum(sysUsers.size());
-                        List<InsOrders> insOrderList;
-                        //筛选订单,选择时间
-                        Date updateTime = sysAgencyLeaders.getUpdateTime();
-                        if (updateTime == null) {
-                            //机构下所有订单
-                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                    .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
-                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                            teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
-                        } else {
-                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                    .ge(InsOrders::getCreatetime, updateTime)
-                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                            teamInformation.setStartTime(updateTime);
-                        }
 
-                        if (insOrderList.size() > 0) {
-                            for (InsOrders insOrders : insOrderList) {
-                                //查询订单下的所有子订单
-                                List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
-                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                        .eq(InsAreaCompany::getOrderstatus, 3));
-                                if (insAreaCompanies.size() > 0) {
-                                    for (InsAreaCompany insAreaCompany : insAreaCompanies) {
-                                        //累加每一个子订单的交强险费用+商业险费用+驾意险费用
-                                        bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
-
-                                    }
-                                }
-                            }
-                        }
-                        teamInformation.setSumpremium(bigDecimal);
-                        int num = 0;
-                        // 查团队有几人出单 :子订单中userid相等同时在 子订单表中状态为3已承保才为出单
-                        List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
-                        for (String s : userIdList) {
-                            List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
-                            if (collect.size() > 0) {
-                                InsOrders insOrders = collect.get(0);
-                                List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
-                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                        .eq(InsAreaCompany::getOrderstatus, 3));
-                                if (insAreaCompanies1.size() > 0) {
-                                    num++;
-                                }
+            //获取机构负责人信息
+            List<SysAgencyLeader> sysAgencyLeaders = sysAgencyLeaderMapper.selectList(new LambdaQueryWrapper<SysAgencyLeader>()
+                    .in(SysAgencyLeader::getUserId, agencyLeaderIds)
+                    .eq(SysAgencyLeader::getDelFlag, 1));
 
-                            }
-                        }
-                        teamInformation.setOrderManNum(num);
-                        informationList.add(teamInformation);
-                        Integer type = teamInformationDto.getType();
-                        if (type == 1) {
-                            int size = informationList.size();
-                            if (size == 2) {
-                                return informationList;
-                            }
-                        }
-                    }
-                }
-            }
+            return BeanUtil.copyToList(sysAgencyLeaders, SysAgencyLeaderVo.class);
         }
-        return informationList;
+
+        return null;
     }
 
 
     @Override
-    public List<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto) {
+    public BasePageResult<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto) {
         List<TeamUserInfoVo> teamUserInfoVoList = new ArrayList<>();
-        //团队下的人员 报价笔数 核保笔数 出单笔数 签单保费
-        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
-                .likeRight(SysUser::getId, teamUserInfoDto.getDeptId())
-                .eq(SysUser::getStatus, 1));
+        Page<SysUser> page = new Page<>(teamUserInfoDto.getPageNum(), teamUserInfoDto.getPageSize());
+        LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
+        wrapper.likeRight(SysUser::getId, teamUserInfoDto.getDeptId()).eq(SysUser::getStatus, 1);
+
+        Page<SysUser> insOrdersPage = sysUserService.page(page, wrapper);
+        List<SysUser> sysUsers = insOrdersPage.getRecords();
+
+
+//        //团队下的人员 报价笔数 核保笔数 出单笔数 签单保费
+//        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
+//                .likeRight(SysUser::getId, teamUserInfoDto.getDeptId())
+//                .eq(SysUser::getStatus, 1));
         //总保费
         for (SysUser sysUser : sysUsers) {
             List<InsOrders> insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
                     .ge(InsOrders::getCreatetime, teamUserInfoDto.getStartTime())
-                    .ge(StringUtils.isNotEmpty(teamUserInfoDto.getBeginTime()),InsOrders::getCreatetime,teamUserInfoDto.getBeginTime())
-                    .le(StringUtils.isNotEmpty(teamUserInfoDto.getEndTime()),InsOrders::getCreatetime,teamUserInfoDto.getEndTime())
+                    .ge(StringUtils.isNotEmpty(teamUserInfoDto.getBeginTime()), InsOrders::getCreatetime, teamUserInfoDto.getBeginTime())
+                    .le(StringUtils.isNotEmpty(teamUserInfoDto.getEndTime()), InsOrders::getCreatetime, teamUserInfoDto.getEndTime())
                     .eq(InsOrders::getUserid, sysUser.getId()));
             //总保费
             BigDecimal bigDecimal = new BigDecimal("0.00");
@@ -807,7 +934,8 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
             }
         }
 
-        return teamUserInfoVoList;
+        return new BasePageResult<>(teamUserInfoDto.getPageNum(), page.getSize(), insOrdersPage.getTotal(), page.getPages(),
+                teamUserInfoVoList);
     }
 
 

+ 2 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysRoleMenuKztServiceImpl.java

@@ -41,6 +41,8 @@ public class SysRoleMenuKztServiceImpl extends ServiceImpl<SysRoleMenuKztMapper,
         String sysType = kZTRoleAndMenuDto.getSysType();
         List<Long> menuIds = kZTRoleAndMenuDto.getMenuIds();
         List<SysRoleMenuKzt>  list =new ArrayList<>();
+
+        sysRoleMenuKztMapper.deleteByRoleId(roleId);
         if(menuIds!=null && menuIds.size()>0){
             for(Long  menuId: menuIds){
                 SysRoleMenuKzt  sysRoleMenuKzt =new  SysRoleMenuKzt(null, roleId, menuId, sysType, new BaseController().getUserId(), new Date(), new BaseController().getUserId(),  new Date());

+ 3 - 3
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java

@@ -29,7 +29,6 @@ import com.ydtech.modules.order.dao.InsOrdersMapper;
 import com.ydtech.modules.order.dao.InsUploadFilesMapper;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
-import com.ydtech.modules.order.entity.po.InsUploadFiles;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
 import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
@@ -1155,8 +1154,9 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             }else{
                 //add  by   hxl   2024-07-09 添加银行回单的路径
                 if(audi!=null && StringUtils.isNotBlank(audi.getPicId())){
-                    InsUploadFiles insUploadFiles = insUploadFilesMapper.selectById(audi.getPicId());
-                    withdrawalDetalsDto.setBankReceipt(insUploadFiles==null?"":insUploadFiles.getUrl());
+                    //add by hxl  2024-08-15 屏蔽银行回单的路径
+                   // InsUploadFiles insUploadFiles = insUploadFilesMapper.selectById(audi.getPicId());
+                   // withdrawalDetalsDto.setBankReceipt(insUploadFiles==null?"":insUploadFiles.getUrl());
                 }
                 recordList.add(dto4);
             }

+ 39 - 12
src/main/java/com/ydtech/modules/admin/service/impl/SysUserBankCardServiceImpl.java

@@ -14,9 +14,7 @@ import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.po.SysUserBankCardHistory;
 import com.ydtech.modules.admin.model.vo.SysUserBankCardVO;
-import com.ydtech.modules.admin.service.SysUserBankCardHistoryService;
-import com.ydtech.modules.admin.service.SysUserBankCardService;
-import com.ydtech.modules.admin.service.SysUserService;
+import com.ydtech.modules.admin.service.*;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
@@ -47,6 +45,11 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
     private UnionPayRequestApiComponent unionPayRequestApiComponent;
     @Resource
     private SysUserService sysUserService;
+    @Resource
+    private SysPartnerService sysPartnerService;
+    @Resource
+    private SysAgencyLeaderService sysAgencyLeaderService;
+
 
     @Override
     public BasePageResult<SysUserBankCard> queryByVo(SysUserBankCardVO sysUserBankCardVO) {
@@ -145,11 +148,21 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
 
     @Override
     @Transactional
-    public  HttpResult<Object> insertByBankNumber(SysUserBankCardVO sysUserBankCardVO) {
+    public HttpResult<Object> insertByBankNumber(SysUserBankCardVO sysUserBankCardVO) {
         //个贷验证银行卡
-        SysUser sysUser = sysUserService.getByUserId(StpUtil.getLoginId().toString());
+        SysUser sysUser;
+        String userId = sysUserBankCardVO.getUserId();
+
+        // 传入userid为后台绑定
+        if (StringUtils.isNotEmpty(userId)) {
+            sysUser = sysUserService.getByUserId(userId);
+            //不传为应用绑定
+        } else {
+            sysUser = sysUserService.getByUserId(StpUtil.getLoginId().toString());
+        }
+
         UnionPayResponse response = new UnionPayResponse();
-        if ("2".equals(sysUser.getManagementSource())){
+        if ("2".equals(sysUser.getManagementSource())) {
             UnionPayRequest request = new UnionPayRequest();
             request.setCardNo(sysUserBankCardVO.getBankNumber());
             request.setPhoneNo(sysUserBankCardVO.getPhoneNo());
@@ -157,7 +170,7 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
             request.setCertNo(sysUser.getIdentity());
             response = unionPayRequestApiComponent.bankCardVerifyRequest(request);
             if (response != null && !"00".equals(response.getRespCode())) {
-                return HttpResult.error("未通过银行卡认证:"+response.getDetailRespMsg());
+                return HttpResult.error("未通过银行卡认证:" + response.getDetailRespMsg());
             }
         }
         SysUserBankCard findSysUserBankCard = sysUserBankCardService.getOne(new LambdaQueryWrapper<SysUserBankCard>()
@@ -173,7 +186,7 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
             findSysUserBankCard.setBankAddress(sysUserBankCardVO.getBankAddress());
             findSysUserBankCard.setBankAccount(sysUserBankCardVO.getBankAccount());
             findSysUserBankCard.setRealUserName(sysUserBankCardVO.getRealUserName());
-            findSysUserBankCard.setBankVerify(response != null && "00".equals(response.getRespCode())?1:0);
+            findSysUserBankCard.setBankVerify(response != null && "00".equals(response.getRespCode()) ? 1 : 0);
             sysUserBankCardService.updateById(findSysUserBankCard);
             SysUserBankCardHistory sysUserBankCardHistory = new SysUserBankCardHistory();
             sysUserBankCardHistory.setBankNumber(sysUserBankCardVO.getBankNumber());
@@ -182,7 +195,7 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
             sysUserBankCardHistory.setCreator(BaseController.getUser().getId());
             sysUserBankCardHistory.setBankNumberUserId(findSysUserBankCard.getUserId());
             sysUserBankCardHistoryService.save(sysUserBankCardHistory);
-        }else {
+        } else {
             SysUserBankCard sysUserBankCard = new SysUserBankCard();
             BeanUtils.copyProperties(sysUserBankCardVO, sysUserBankCard);
             sysUserBankCard.setDelFlag("0");
@@ -192,7 +205,20 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
             sysUserBankCard.setBankNumber(sysUserBankCardVO.getBankNumber().replaceAll("\\s+", ""));
             sysUserBankCard.setUserName(sysUserBankCardVO.getUserName());
             sysUserBankCard.setUserId(sysUserBankCardVO.getUserId());
-            sysUserBankCard.setBankVerify(response != null && "00".equals(response.getRespCode())?1:0);
+            sysUserBankCard.setBankVerify(response != null && "00".equals(response.getRespCode()) ? 1 : 0);
+            //校验登录用户是否为合伙人或者是机构负责人
+            boolean a = sysPartnerService.checkPartner(sysUser.getId());
+            boolean b = sysAgencyLeaderService.checkUserId(sysUser.getId());
+            if (a) {
+                //a:合伙人绑卡
+                sysUserBankCard.setAscription("a");
+            } else if (b) {
+                //b:机构负责人绑卡
+                sysUserBankCard.setAscription("b");
+            } else {
+                sysUserBankCard.setAscription(sysUser.getManagementSource());
+            }
+
             baseMapper.insert(sysUserBankCard);
             SysUserBankCardHistory sysUserBankCardHistory = new SysUserBankCardHistory();
             sysUserBankCardHistory.setBankNumber(sysUserBankCardVO.getBankNumber());
@@ -208,8 +234,8 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
     @Override
     @Transactional
     public void auditByBankNumber(SysUserBankCardVO sysUserBankCardVO) {
-        SysUserBankCard sysUserBankCard =  sysUserBankCardService.getById(sysUserBankCardVO.getId());
-        if(sysUserBankCard != null && StringUtils.isNotBlank(sysUserBankCard.getAuditStatus()) && !"0".equals(sysUserBankCard.getAuditStatus())){
+        SysUserBankCard sysUserBankCard = sysUserBankCardService.getById(sysUserBankCardVO.getId());
+        if (sysUserBankCard != null && StringUtils.isNotBlank(sysUserBankCard.getAuditStatus()) && !"0".equals(sysUserBankCard.getAuditStatus())) {
             throw new SystemException("账户已审核不能重复审核");
         }
         sysUserBankCard.setAuditStatus(sysUserBankCardVO.getAuditStatus());
@@ -237,6 +263,7 @@ public class SysUserBankCardServiceImpl extends ServiceImpl<SysUserBankCardMappe
             sysUserBankCardHistoryService.save(sysUserBankCardHistory);
         }
     }
+
     @Override
     public List<SysUserBankCard> queryUsableCard(SysUserBankCard sysUserBankCard) {
         return baseMapper.queryUsableCard(sysUserBankCard);

+ 2 - 0
src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java

@@ -56,6 +56,8 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("NatureOfUse", TypeVehicleMapping.getByCode(carInfo.getVehicleUse())));
         //车辆种类
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarType", VehicleType.getByCode(carInfo.getCimodelclass())));
+        //车辆类型
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarClass", carInfo.getCartype()));
         //核定载质量
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("AuthorizedLoadWeight", carInfo.getLimitLoad()));
         //整备质量

+ 25 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsuranceHandlingSettlementMonthMapper.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.fnc.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ *    保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+@Mapper
+public interface InsuranceHandlingSettlementMonthMapper extends BaseMapper<InsuranceHandlingSettlementMonthEntity> {
+    List<InsuranceHandlingSettlementMonthDto> queryList( @Param("vo") InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
+
+}

+ 46 - 0
src/main/java/com/ydtech/modules/fnc/dto/InsuranceHandlingSettlementMonthDto.java

@@ -0,0 +1,46 @@
+package com.ydtech.modules.fnc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@ApiModel("保险手续费结算关联表返回dto")
+public class InsuranceHandlingSettlementMonthDto implements Serializable {
+    @ApiModelProperty("id")
+    private String id;
+
+    @ApiModelProperty("任务id")
+    private String taskId;
+
+    @ApiModelProperty("结算id")
+    private String settlementDocumentaryFeesId;
+
+    @ApiModelProperty("结算金额")
+    private BigDecimal settlementAmount;
+
+    @ApiModelProperty("开票金额")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty("剩余结算金额")
+    private BigDecimal remainingAmount;
+
+    @ApiModelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("签单时间")
+    private LocalDateTime signingTime;
+
+    @ApiModelProperty("创建人")
+    private String createrId;
+
+    @ApiModelProperty("合作公司id")
+    private String partnerCompaniesId;
+
+    @ApiModelProperty("开票手续费")
+    private String invoiccommissionFeevalue;
+}

+ 65 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsuranceHandlingSettlementMonthEntity.java

@@ -0,0 +1,65 @@
+package com.ydtech.modules.fnc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ *
+ */
+@Getter
+@Setter
+@TableName("sys_insurance_handling_settlement_month")
+@ApiModel(value = "InsuranceHandlingSettlementMonthEntity对象", description = "保险手续费结算关联表")
+@NoArgsConstructor
+public class InsuranceHandlingSettlementMonthEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("id")
+    @TableField("id")
+    private String id;
+
+    @ApiModelProperty("任务id")
+    @TableField("task_id")
+    private String taskId;
+
+    @ApiModelProperty("结算id")
+    @TableField("settlement_documentary_fees_id")
+    private String settlementDocumentaryFeesId;
+
+    @ApiModelProperty("结算金额")
+    @TableField("settlement_amount")
+    private BigDecimal settlementAmount;
+
+    @ApiModelProperty("开票金额")
+    @TableField("total_amount")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty("剩余结算金额")
+    @TableField("remaining_amount")
+    private BigDecimal remainingAmount;
+
+    @ApiModelProperty("创建时间")
+    @TableField("create_time")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("创建时间")
+    @TableField("signing_time")
+    private LocalDateTime signingTime;
+
+    @ApiModelProperty("创建人")
+    @TableField("creater_id")
+    private String createrId;
+
+    @ApiModelProperty("合作公司id")
+    @TableField("partner_companies_id")
+    private String partnerCompaniesId;
+}

+ 31 - 0
src/main/java/com/ydtech/modules/fnc/service/InsuranceHandlingSettlementMonthService.java

@@ -0,0 +1,31 @@
+package com.ydtech.modules.fnc.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+
+import java.util.List;
+
+/**
+ * <p>
+ *    保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+public interface InsuranceHandlingSettlementMonthService  extends IService<InsuranceHandlingSettlementMonthEntity> {
+
+    List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
+    /**
+     * 结算新增
+     * @param insuranceHandlingSettlementMonthVo
+     * @return
+     */
+    HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
+}

+ 66 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java

@@ -0,0 +1,66 @@
+package com.ydtech.modules.fnc.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.fnc.dao.InsuranceHandlingSettlementMonthMapper;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+@Slf4j
+@Service
+public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<InsuranceHandlingSettlementMonthMapper, InsuranceHandlingSettlementMonthEntity> implements InsuranceHandlingSettlementMonthService {
+
+    @Override
+    public List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        List<InsuranceHandlingSettlementMonthDto> resultList = baseMapper.queryList(insuranceHandlingSettlementMonthVo);
+
+        List<InsuranceHandlingSettlementMonthDto> latestRecords = resultList.stream()
+                // 根据taskId分组,并收集每个taskId对应的所有记录
+                .collect(Collectors.groupingBy(
+                        InsuranceHandlingSettlementMonthDto::getTaskId,
+                        Collectors.toList()
+                ))
+                // 遍历每个分组,找出每组中createTime最新的记录
+                .entrySet().stream()
+                .map(entry -> entry.getValue().stream()
+                        .max(Comparator.comparing(InsuranceHandlingSettlementMonthDto::getCreateTime))
+                        .orElse(null) // 如果没有记录,则返回null(这里根据需求决定是否处理null)
+                )
+                // 收集结果到新的List中
+                .collect(Collectors.toList());
+
+        return resultList;
+    }
+
+    /**
+     * 结算新增
+     *
+     * @param insuranceHandlingSettlementMonthVo
+     * @return
+     */
+    @Override
+    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        InsuranceHandlingSettlementMonthEntity insuranceHandlingSettlementMonthEntity = new InsuranceHandlingSettlementMonthEntity();
+        BeanUtils.copyProperties(insuranceHandlingSettlementMonthVo, insuranceHandlingSettlementMonthEntity);
+        baseMapper.insert(insuranceHandlingSettlementMonthEntity);
+        return HttpResult.ok("结算成功");
+    }
+}

+ 47 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsuranceHandlingSettlementMonthVo.java

@@ -0,0 +1,47 @@
+package com.ydtech.modules.fnc.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@ApiModel("保险手续费结算关联表查询Vo")
+public class InsuranceHandlingSettlementMonthVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("id")
+    private String id;
+
+    @ApiModelProperty("任务id")
+    private String taskId;
+
+    @ApiModelProperty("结算id")
+    private String settlementDocumentaryFeesId;
+
+    @ApiModelProperty("结算金额")
+    private BigDecimal settlementAmount;
+
+    @ApiModelProperty("开票金额")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty("剩余结算金额")
+    private BigDecimal remainingAmount;
+
+    @ApiModelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("签单时间")
+    private LocalDateTime signingTime;
+
+    @ApiModelProperty("创建人")
+    private String createrId;
+
+    @ApiModelProperty("合作公司id")
+    private String partnerCompaniesId;
+}

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

@@ -17,10 +17,12 @@ import com.ydtech.modules.order.entity.api.bohai.response.NonAutomotiveProductsR
 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.entity.vo.bohai.BoHaiQuoteAccidentVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductQueryVo;
 import com.ydtech.modules.order.service.BoHaiOrderApiService;
+import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.order.utils.SignatureUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -46,6 +48,7 @@ public class BoHaiOrderApiController {
 
     private final BohaiApiConfigurationProperties properties;
 
+    private final InsOrdersService insOrdersService;
 
     @PostMapping("/productQuery")
     @ApiOperation("车+X产品查询接口")
@@ -62,9 +65,10 @@ public class BoHaiOrderApiController {
     @QuoteVerification("报价授权")
     @PostMapping("/quote")
     @ApiOperation("报价")
-    public HttpResult<QuoteRespVo> quote(@RequestBody BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo) throws Exception {
+    public HttpResult<QuoteRespVo> quote(@RequestBody BaseQuoteVo<QuoteAccidentalDrivingVo> quoteVo) throws Exception {
+        BaseQuoteVo<List<BoHaiQuoteAccidentVo>> baseQuoteVo = insOrdersService.convertDriving(quoteVo);
         BaseQuoteInfoVo quoteInfo = this.insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(), quoteVo.getAgreementId());
-        return this.boHaiOrderApiService.quote(quoteInfo, quoteVo);
+        return this.boHaiOrderApiService.quote(quoteInfo, baseQuoteVo);
     }
 
     @PostMapping(value = "/submitImage")

+ 12 - 1
src/main/java/com/ydtech/modules/order/controller/PingAnOrderApiController.java

@@ -111,7 +111,18 @@ public class PingAnOrderApiController {
         return this.pingAnOrderApiService.auditStatusQuery(companyId);
     }
 
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/7/23 18:46
+     *  @Description: 事后资料补传
+     */
+    //@AuditVerification("核保")
+    @PostMapping(value = "/additionalInformation")
+    @ApiOperation(value = "事后资料补传")
+    public HttpResult<Object> additionalInformation(@RequestBody AdditionalInformation additionalInformation) throws Exception {
+        return this.pingAnOrderApiService.additionalInformation(additionalInformation);
+    }
 
     /**
      *  @version

+ 8 - 1
src/main/java/com/ydtech/modules/order/dao/InsTaskImagesMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ydtech.modules.order.entity.dto.InsTaskImagesDto;
 import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.po.InsTaskImages;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,7 +19,13 @@ public interface InsTaskImagesMapper extends BaseMapper<InsTaskImages> {
     List<InsTaskImagesDto> getByQuoteNoInsTaskImagesDtoList(String quoteNo);
 
     List<InsUploadImagesDto> getByOrderNoInsUploadImagesDtoList(String orderNo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/16 20:00
+     *  @Description: 通过ids查询数据
+     */
+    List<InsUploadImagesDto> findByIds(@Param("list") List<String> imageList);
 }
 
 

+ 19 - 0
src/main/java/com/ydtech/modules/order/dao/PinganShUploafileMapper.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.order.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.order.entity.po.PinganShUploafile;
+
+
+/**
+* @author Administrator
+* @description 针对表【pingan_sh_uploafile(平安事后文件上传资料)】的数据库操作Mapper
+* @createDate 2024-08-16 18:22:00
+* @Entity generator.domain.PinganShUploafile
+*/
+public interface PinganShUploafileMapper extends BaseMapper<PinganShUploafile> {
+
+}
+
+
+
+

+ 22 - 2
src/main/java/com/ydtech/modules/order/entity/api/pingan/constants/dict/document/PingAnDocumentClassEnum.java

@@ -31,6 +31,7 @@ public enum PingAnDocumentClassEnum {
 
     C01("C01", "行驶证正面", "T04", "TAR04"),
     D01("D01", "行驶证反面", "T04", "TAR04"),
+    TAR05("TAR05", "机动车辆登记证书", "T04", "TAR05"),
 
     C02("C02", "车主身份证正面", "T03", "001"),
     D02("D02", "车主身份证反面", "T03", "001"),
@@ -38,8 +39,27 @@ public enum PingAnDocumentClassEnum {
     C03("C03", "投保人身份证正面", "T01", "001"),
     D03("D03", "投保人身份证反面", "T01", "001"),
 
-    C04("C04", "被保人身份证正面", "T02", "001"),
-    D04("D04", "被保人身份证反面", "T02", "001");
+    C04("C04", "被保人身份证正面", "T09", "001"),
+    D04("D04", "被保人身份证反面", "T09", "001"),
+
+    C0500("C0500", "验车照(车架)", "T09", "OT99"),
+    C0501("C0501", "验车照(后左)", "T09", "OT99"),
+
+    C0502("C0502", "验车照(后右)", "T09", "OT99"),
+    C0503("C0503", "验车照(前右)", "T09", "OT99"),
+
+    C0504("C0504", "验车照(前左)", "T09", "OT99"),
+    C0506("C0506", "验车照(正前)", "T09", "OT99"),
+
+    C0507("C0507", "验车照(正后)", "T09", "OT99"),
+    C0505("C0505", "验车照(人车合影)", "T09", "OT99"),
+
+    C0508("C0508", "验车照(地标合影)", "T09", "OT99"),
+    C0509("C0509", "验车照(工作台)", "T09", "OT99"),
+
+    C0510("C0510", "验车照(天窗)", "T09", "OT99"),
+
+    INSURANCE_POLICY("LAST_INSURANCE_POLICY", "上年商业险保单", "T09", "OT01");
 
 
     private final String code;

+ 15 - 15
src/main/java/com/ydtech/modules/order/entity/api/pingan/request/SubmitApplyRequest.java

@@ -343,6 +343,19 @@ public class SubmitApplyRequest extends PingAnBaseRequest {
      * 文件集合
      */
     private List<DocListDTO> docList;
+    /***
+     * 车辆驾驶类型
+     * String类型 1-人工驾驶, 2-自动化驾驶
+     * o
+     */
+    private String carDriverType;
+    /***
+     * 发展阶段
+     * String类型 1-道路测试, 2-示范应用, 3-示范运营
+     * o
+     */
+    private String developmentStage;
+
     //todo
     public SubmitApplyRequest(PingAnConfigureParameters parameters, String flowid, String isApply, InsOrders insOrders,List<DocListDTO> docList,List<BizSpecialPromiseListDTO> bizSpecialPromiseList,List<BizSpecialPromiseListDTO> forceSpecialPromiseList) {
 
@@ -766,23 +779,12 @@ public class SubmitApplyRequest extends PingAnBaseRequest {
          * c
          */
         private String certificateEndDate;
-        /***
-         * 车辆驾驶类型
-         * String类型 1-人工驾驶, 2-自动化驾驶
-         * o
-         */
-        private String carDriverType;
-        /***
-         * 发展阶段
-         * String类型 1-道路测试, 2-示范应用, 3-示范运营
-         * o
-         */
-        private String developmentStage;
+
 
         public DocListDTO() {
         }
 
-        public DocListDTO(String docId, String documentClass, String documentType, String documentName, String documentFormat, String documentSize, String certificateBeginDate, String certificateEndDate, String carDriverType, String developmentStage) {
+        public DocListDTO(String docId, String documentClass, String documentType, String documentName, String documentFormat, String documentSize, String certificateBeginDate, String certificateEndDate) {
             this.docId = docId;
             this.documentClass = documentClass;
             this.documentType = documentType;
@@ -791,8 +793,6 @@ public class SubmitApplyRequest extends PingAnBaseRequest {
             this.documentSize = documentSize;
             this.certificateBeginDate = certificateBeginDate;
             this.certificateEndDate = certificateEndDate;
-            this.carDriverType = carDriverType;
-            this.developmentStage = developmentStage;
         }
 
         public DocListDTO(String docId, String documentClass, String documentType, String documentName, String documentFormat) {

+ 149 - 0
src/main/java/com/ydtech/modules/order/entity/po/PinganShUploafile.java

@@ -0,0 +1,149 @@
+package com.ydtech.modules.order.entity.po;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 平安事后文件上传资料
+ * @TableName pingan_sh_uploafile
+ */
+@TableName(value ="pingan_sh_uploafile")
+@Data
+public class PinganShUploafile implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 子订单id
+     */
+    private String subOrderNo;
+
+    /**
+     * 文件大类编码
+     */
+    private String documentClass;
+
+    /**
+     * 文件大类名称
+     */
+    private String documentClassName;
+
+    /**
+     * 是否以上之一均可【1-是,0-否】
+ 1表示当前大类,只需要上传其中一种小类 0表示全部上传
+     */
+    private String isAnyOne;
+
+    /**
+     * 文件小类编码
+     */
+    private String documentType;
+
+    /**
+     * 文件小类名称
+     */
+    private String documentTypeName;
+
+    /**
+     * 是否需要事中审核【1-需要,0-不需要】
+     */
+    private String isNeedDuringAudit;
+
+    /**
+     * 是否上传
+     */
+    private String status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        PinganShUploafile other = (PinganShUploafile) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getSubOrderNo() == null ? other.getSubOrderNo() == null : this.getSubOrderNo().equals(other.getSubOrderNo()))
+            && (this.getDocumentClass() == null ? other.getDocumentClass() == null : this.getDocumentClass().equals(other.getDocumentClass()))
+            && (this.getDocumentClassName() == null ? other.getDocumentClassName() == null : this.getDocumentClassName().equals(other.getDocumentClassName()))
+            && (this.getIsAnyOne() == null ? other.getIsAnyOne() == null : this.getIsAnyOne().equals(other.getIsAnyOne()))
+            && (this.getDocumentType() == null ? other.getDocumentType() == null : this.getDocumentType().equals(other.getDocumentType()))
+            && (this.getDocumentTypeName() == null ? other.getDocumentTypeName() == null : this.getDocumentTypeName().equals(other.getDocumentTypeName()))
+            && (this.getIsNeedDuringAudit() == null ? other.getIsNeedDuringAudit() == null : this.getIsNeedDuringAudit().equals(other.getIsNeedDuringAudit()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getSubOrderNo() == null) ? 0 : getSubOrderNo().hashCode());
+        result = prime * result + ((getDocumentClass() == null) ? 0 : getDocumentClass().hashCode());
+        result = prime * result + ((getDocumentClassName() == null) ? 0 : getDocumentClassName().hashCode());
+        result = prime * result + ((getIsAnyOne() == null) ? 0 : getIsAnyOne().hashCode());
+        result = prime * result + ((getDocumentType() == null) ? 0 : getDocumentType().hashCode());
+        result = prime * result + ((getDocumentTypeName() == null) ? 0 : getDocumentTypeName().hashCode());
+        result = prime * result + ((getIsNeedDuringAudit() == null) ? 0 : getIsNeedDuringAudit().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", subOrderNo=").append(subOrderNo);
+        sb.append(", documentClass=").append(documentClass);
+        sb.append(", documentClassName=").append(documentClassName);
+        sb.append(", isAnyOne=").append(isAnyOne);
+        sb.append(", documentType=").append(documentType);
+        sb.append(", documentTypeName=").append(documentTypeName);
+        sb.append(", isNeedDuringAudit=").append(isNeedDuringAudit);
+        sb.append(", status=").append(status);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public PinganShUploafile() {
+    }
+
+    public PinganShUploafile(String subOrderNo, String documentClass, String documentClassName, String isAnyOne, String documentType, String documentTypeName, String isNeedDuringAudit, String status, Date createTime) {
+        this.subOrderNo = subOrderNo;
+        this.documentClass = documentClass;
+        this.documentClassName = documentClassName;
+        this.isAnyOne = isAnyOne;
+        this.documentType = documentType;
+        this.documentTypeName = documentTypeName;
+        this.isNeedDuringAudit = isNeedDuringAudit;
+        this.status = status;
+        this.createTime = createTime;
+    }
+}

+ 2 - 3
src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java

@@ -123,8 +123,10 @@ public class OrderQueryVo {
 
     @ApiModelProperty(value = "起保开始时间")
     private String attachStartDateStr;
+
     @ApiModelProperty(value = "起保结束时间")
     private String attachEndDateStr;
+
     @ApiModelProperty(value = "机构来源")
     private String managementSource;
 
@@ -153,9 +155,6 @@ public class OrderQueryVo {
     @ApiModelProperty(value = "非车保单号")
     private String noPolicyNo;
 
-    @ApiModelProperty(value = "业务来源")
-    private String source;
-
     public LocalDate getEndDatePlusOneDay() {
         if(ObjectUtils.isEmpty(endDate)){
             return endDate;

+ 2 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java

@@ -501,4 +501,6 @@ public class OrderVo implements Serializable {
     @ApiModelProperty(value = "是否是外部订单")
     private Integer isExternal;
 
+    @ApiModelProperty(value = "机构来源(渠道、个代)")
+    private String source;
 }

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/vo/QuoteAccidentalDrivingVo.java

@@ -35,4 +35,8 @@ public class QuoteAccidentalDrivingVo {
 
     @ApiModelProperty("保费")
     private String sumPremium;
+
+    @ApiModelProperty("附加code")
+    private String riskCode;
+
 }

+ 25 - 0
src/main/java/com/ydtech/modules/order/entity/vo/pingan/AdditionalInformation.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.order.entity.vo.pingan;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/8/16 19:42
+ *  @Description:  补传资料实体
+ */
+@Data
+@ApiModel(value = "补传资料实体")
+public class AdditionalInformation {
+
+    @ApiModelProperty("子订单id")
+    private String companyId;
+
+    @ApiModelProperty("影像集合id")
+    private List<String>  imageList=new ArrayList<String>();
+}

+ 2 - 0
src/main/java/com/ydtech/modules/order/service/InsUploadFilesService.java

@@ -29,6 +29,8 @@ public interface InsUploadFilesService extends IService<InsUploadFiles> {
         InsUploadFiles uploadFiles1 = getById(insUploadFiles.getId());
         if (ObjectUtil.isEmpty(uploadFiles1)) {
             save(insUploadFiles);
+        }else{
+            updateById(insUploadFiles);
         }
         return insUploadFiles;
     }

+ 8 - 0
src/main/java/com/ydtech/modules/order/service/PingAnOrderApiService.java

@@ -10,6 +10,7 @@ import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
 import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
+import com.ydtech.modules.order.entity.vo.pingan.AdditionalInformation;
 import com.ydtech.modules.order.entity.vo.pingan.PingAnQuoteVo;
 import com.ydtech.modules.order.entity.vo.pingan.RenewalConfirmVo;
 import com.ydtech.modules.order.entity.vo.pingan.StorefrontQueryVo;
@@ -262,4 +263,11 @@ public interface PingAnOrderApiService {
      *  @Description:  支付回调
      */
     HttpResult<Object> payReturn(PayReturnRequest payReturnRequest);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/16 19:45
+     *  @Description:  事后补传资料
+     */
+    HttpResult<Object> additionalInformation(AdditionalInformation additionalInformation);
 }

+ 15 - 0
src/main/java/com/ydtech/modules/order/service/PinganShUploafileService.java

@@ -0,0 +1,15 @@
+package com.ydtech.modules.order.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.order.entity.po.PinganShUploafile;
+
+
+/**
+* @author Administrator
+* @description 针对表【pingan_sh_uploafile(平安事后文件上传资料)】的数据库操作Service
+* @createDate 2024-08-16 18:22:00
+*/
+public interface PinganShUploafileService extends IService<PinganShUploafile> {
+
+
+}

+ 20 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -53,6 +53,7 @@ import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
 import com.ydtech.modules.order.entity.dto.InquiryDetalsQueryDto;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
 import com.ydtech.modules.order.entity.vo.*;
+import com.ydtech.modules.order.entity.vo.bohai.BoHaiQuoteAccidentVo;
 import com.ydtech.modules.order.entity.vo.guoren.GuoRenQuoteVo;
 import com.ydtech.modules.order.entity.vo.guoren.GuorenAccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.ya.YaExtendInfoDto;
@@ -999,8 +1000,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         Page<InsOrders> orderVoPage = new Page<>();
         //注释逻辑给前台返回数据
         if (agentUserIds != null && !agentUserIds.isEmpty() || !agreeIds.isEmpty()) {
-            orderVoPage = baseMapper.queryPageOrderByLinkType(page, orderQueryVo, agentUserIds, agreeIds, deptIds, flag,type);
-            total = baseMapper.queryPageOrderByLinkTypeCount(orderQueryVo, agentUserIds, agreeIds, deptIds, flag,type);
+            orderVoPage = baseMapper.queryPageOrderByLinkType(page, orderQueryVo, agentUserIds, agreeIds, deptIds, flag, type);
+            total = baseMapper.queryPageOrderByLinkTypeCount(orderQueryVo, agentUserIds, agreeIds, deptIds, flag, type);
         }
         orderVoPage.setTotal(total);
         return new BasePageResult<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize(), orderVoPage.getTotal(),
@@ -1031,6 +1032,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         OrderVo orderAndAreaCompany = baseMapper.getOrderAndAreaCompany(companyId);
         //团队归属信息
+        SysDept dept = sysDeptService.getById(orderAndAreaCompany.getDeptid());
+        // 业务来源
+        orderAndAreaCompany.setSource(dept.getManagementSource());
         String areaInfo = sysDeptService.queryBelongArea(orderAndAreaCompany.getDeptid());
         SysUser sysUser = sysUserService.getById(orderAndAreaCompany.getUserid());
         SysUserInfo sysUserInfo = sysUserInfoService.getById(orderAndAreaCompany.getUserid());
@@ -1320,6 +1324,20 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             dajiaBaseQuoteVo.setAccidentalDrivingVo(jsonObject);
             return dajiaBaseQuoteVo;
         }
+
+        if (baseQuoteVo.getCompanyId().equals("BPIC1000000")) {
+            // 渤海财险
+            BaseQuoteVo<List<BoHaiQuoteAccidentVo>> bohaiBaseQuoteVo = new BaseQuoteVo<>();
+            BeanUtils.copyProperties(baseQuoteVo, bohaiBaseQuoteVo);
+            QuoteAccidentalDrivingVo accidentalDrivingVo = baseQuoteVo.getAccidentalDrivingVo();
+            BoHaiQuoteAccidentVo boHaiQuoteAccidentVo = new BoHaiQuoteAccidentVo();
+            boHaiQuoteAccidentVo.setPackageCode(accidentalDrivingVo.getRiskCode());
+            boHaiQuoteAccidentVo.setProductCode(accidentalDrivingVo.getProjectCode());
+            boHaiQuoteAccidentVo.setCopies(String.valueOf(accidentalDrivingVo.getQuantity()));
+            bohaiBaseQuoteVo.setAccidentalDrivingVo(Collections.singletonList(boHaiQuoteAccidentVo));
+            return bohaiBaseQuoteVo;
+        }
+
         return null;
     }
 

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

@@ -44,7 +44,7 @@ public class InsUploadFilesServiceImpl extends ServiceImpl<InsUploadFilesMapper,
         String fileMD5 = DigestUtils.md5Hex(multipartFile.getBytes());
         InsUploadFiles uploadFiles = getById(fileMD5);
         if (ObjectUtil.isNotEmpty(uploadFiles)) {
-            return uploadFiles;
+           // return uploadFiles;
         }
 
         // 文件上传实体

+ 382 - 99
src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java

@@ -37,14 +37,12 @@ import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
 import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.po.InsTaskImages;
 import com.ydtech.modules.order.entity.po.InsUploadFiles;
+import com.ydtech.modules.order.entity.po.PinganShUploafile;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
 import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
-import com.ydtech.modules.order.entity.vo.pingan.InsDrivingIntentionInsuranceSonVo;
-import com.ydtech.modules.order.entity.vo.pingan.PingAnQuoteVo;
-import com.ydtech.modules.order.entity.vo.pingan.RenewalConfirmVo;
-import com.ydtech.modules.order.entity.vo.pingan.StorefrontQueryVo;
+import com.ydtech.modules.order.entity.vo.pingan.*;
 import com.ydtech.modules.order.service.*;
 import com.ydtech.modules.order.utils.MD5Util;
 import com.ydtech.modules.order.utils.PingAnUpLoadUtils;
@@ -67,6 +65,8 @@ import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.stream.Collectors;
+
 /**
  *  @version  平安接口相关api
  *  @author: hxl
@@ -111,6 +111,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
 
     private final QrCodeGenerator  qrCodeGenerator;
 
+    private final PinganShUploafileService pinganShUploafileService;
+
     /**
      * @Description 获取财意险险种套餐列表  调用 4.4
      * @Author hxl
@@ -585,9 +587,11 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                 String fileName = file.getName();
                 String documentName = fileName.split("\\.")[0];
                 String documentFormat = fileName.split("\\.")[1];
-                boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
-                if(!upLoadFileFlag){
-                    throw new SystemException("上传影像文件失败");
+                if(StringUtils.isBlank(insUploadImagesDto.getPinganKey())){
+                    boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
+                    if(!upLoadFileFlag){
+                        throw new SystemException("上传影像文件失败");
+                    }
                 }
                 UploadFilesRequest.DocListDTO docListDTO = new UploadFilesRequest.DocListDTO(key, documentClass, documentType, documentName,documentFormat ,
                         null);
@@ -645,9 +649,9 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         //商业特约
         List<SubmitApplyRequest.BizSpecialPromiseListDTO> forceSpecialPromiseList=new ArrayList<SubmitApplyRequest.BizSpecialPromiseListDTO>();
         //UploadFilesResponse uploadFilesResponse = getUploadResponseByParam(insAreaCompany,pinganApiLog,parameters.getUserId());
-       // if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
+        // if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
         //    throw new SystemException(uploadFilesResponse.getResultMessage());
-       // }
+        // }
         //调用6.1 补充信息并核保
         SubmitApplyRequest submitApplyRequest = new SubmitApplyRequest(parameters,flowid, "true",insOrders,null,null,null);
         SubmitApplyResponse submitApplyResponse = null;
@@ -656,112 +660,298 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         } catch (Exception e) {
             throw new SystemException(e.getMessage());
         }
+        Map<String,Map<String,String>> docListMap=new HashMap<String,Map<String,String>>();
+        List<InsUploadImagesDto> imgList = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(insAreaCompany.getOrderno());
+        List<SubmitApplyRequest.DocListDTO> list = new ArrayList<>();
+        for (InsUploadImagesDto insUploadImagesDto : imgList) {
+            InsUploadFiles fiels = insUploadFilesService.getById(insUploadImagesDto.getImageId());
+            String key="";
+            File file =new File(fiels.getFilePath());
+            PingAnDocumentClassEnum fileEnum = PingAnDocumentClassEnum.getCode(insUploadImagesDto.getImageType());
+            String documentClass=fileEnum.getDocument();
+            String documentType=fileEnum.getDocumentType();
+            String fileName = file.getName();
+            String documentName = fileName.split("\\.")[0];
+            String documentFormat = fileName.split("\\.")[1];
+            if(StringUtils.isBlank(insUploadImagesDto.getPinganKey())){
+                key=parameters.getUserId()+"-"+new SimpleDateFormat("yyyyMMddhhmmss").format(new Date())+"-"+UUID.randomUUID();
+                boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
+                if(!upLoadFileFlag){
+                    throw new SystemException("上传影像文件失败");
+                }
+            }else{
+                key=insUploadImagesDto.getPinganKey();
+            }
+            if(!docListMap.containsKey(documentClass)){
+                Map<String,String> docMap =new HashMap<String,String>();
+                docMap.put(documentType,fileEnum.getDesc());
+                docListMap.put(fileEnum.getDocument(),docMap);
+            }else{
+                Map<String,String> docMap  =docListMap.get(documentClass);
+                docMap.put(documentType,fileEnum.getDesc());
+                docListMap.put(fileEnum.getDocument(),docMap);
+            }
+            SubmitApplyRequest.DocListDTO docListDTO = new SubmitApplyRequest.DocListDTO(key, documentClass, documentType, documentName,documentFormat);
+            list.add(docListDTO);
+        }
         if (submitApplyResponse != null) {
-            // 事中资料  15 时上传资料
-            if("15".equals(submitApplyResponse.getResultCode())){
-                submitApplyRequest.setDocList(null);
-                try {
-                    submitApplyResponse = pinganRequestApiComponents.submitApply(submitApplyRequest,pinganApiLog);
-                } catch (Exception e) {
-                    throw new SystemException(e.getMessage());
+            //验证上传图片信息
+            List<SubmitApplyResponse.BizMissFileDTO> bizMissFilelist = submitApplyResponse.getBizMissFilelist();
+            List<SubmitApplyResponse.BizMissFileDTO> forceMissFilelist = submitApplyResponse.getForceMissFilelist();
+
+            //商业险上传文件缺失集合
+            String msg="";
+            if(bizMissFilelist!=null && bizMissFilelist.size()>0){
+                for(SubmitApplyResponse.BizMissFileDTO  dto : bizMissFilelist){
+                    //验证文件是否上传
+                    msg+=checkDocList(docListMap,dto,"1");
+                }
+            }
+            //交强
+            if(forceMissFilelist!=null && forceMissFilelist.size()>0){
+                for(SubmitApplyResponse.BizMissFileDTO  dto : forceMissFilelist){
+                    //验证文件是否上传
+                    msg+=checkDocList(docListMap,dto,"1");
                 }
             }
+            if(StringUtils.isNotBlank(msg)){
+                throw  new  SystemException(msg);
+            }
+
+            //商业险上传文件缺失集合保存
+            List<PinganShUploafile> shDocList = getSHDocList(bizMissFilelist, forceMissFilelist, insAreaCompany.getId());
+            // 事中资料  15 时上传资料   5 为验证
+            if("15".equals(submitApplyResponse.getResultCode())  ||  "5".equals(submitApplyResponse.getResultCode()) ){
+                /**
+                 //更新为待核保状态
+                 insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
+                 insAreaCompanyService.updateById(insAreaCompany);
+                 //获取上传的事中资料
+                 submitApplyRequest.setDocList(!list.isEmpty() ?list:null);
+                 pinganApiLog.setId(null);
+                 try {
+                 submitApplyResponse = pinganRequestApiComponents.submitApply(submitApplyRequest,pinganApiLog);
+                 } catch (Exception e) {
+                 throw new SystemException(e.getMessage());
+                 }
+                 **/
+            }
             //核保成功
-            if("0".equals(submitApplyResponse.getResultCode())) {
-                //查询核保状态
-                String bizApplyNo = submitApplyResponse.getBizApplyNo()==null?"":submitApplyResponse.getBizApplyNo();
-                String forceApplyNo = submitApplyResponse.getForceApplyNo()==null?"":submitApplyResponse.getForceApplyNo();
+            if("0".equals(submitApplyResponse.getResultCode())  || (submitApplyResponse.getResultMessage().contains("商业险核保结果:申请投保完成!; 交强险核保结果:申请投保完成!"))) {
+                //保存事后上传资料
+                if(shDocList!=null &&  shDocList.size()>0){
+                    pinganShUploafileService.saveBatch(shDocList);
+                }
+                String bizApplyNo = submitApplyResponse.getBizApplyNo()==null?"": submitApplyResponse.getBizApplyNo();
+                String forceApplyNo = submitApplyResponse.getForceApplyNo()==null?"": submitApplyResponse.getForceApplyNo();
                 List<SubmitApplyResponse.AccidentApplyPolicyNoDTO> accidentApplyPolicyNoList = submitApplyResponse.getAccidentApplyPolicyNoList();
                 String accidentApplyNo =null;
                 if(accidentApplyPolicyNoList!=null && accidentApplyPolicyNoList.size()>0){
                     SubmitApplyResponse.AccidentApplyPolicyNoDTO accidentApplyPolicyNoDTO = accidentApplyPolicyNoList.get(0);
                     accidentApplyNo = accidentApplyPolicyNoDTO.getPolicyAppNumber();
                 }
-                List<String> list = new ArrayList<String>();
-                if (StringUtils.isNotBlank(bizApplyNo)) {
-                    list.add(bizApplyNo);
-                }
-                if (StringUtils.isNotBlank(forceApplyNo)) {
-                    list.add(forceApplyNo);
-                }
-                if (StringUtils.isNotBlank(accidentApplyNo)) {
-                    // list.add(accidentApplyNo);
-                }
-                pinganApiLog.setId(null);
-                DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
-                DocumentStatusListResponse documentStatusListResponse = null;
-                try {
-                    documentStatusListResponse = pinganRequestApiComponents.getDocumentStatusList(documentStatusListRequest,pinganApiLog);
-                } catch (Exception e) {
-                    throw new SystemException(e.getMessage());
+                submitApplyRequest.setDocList(!list.isEmpty() ?list:null);
+                //查询核保状态
+                return getObjectHttpResult(submitApplyResponse, pinganApiLog, parameters, insAreaCompany,forceApplyNo,bizApplyNo,accidentApplyNo);
+            }else{
+                Map<String, String> map = getNoByStr(submitApplyResponse.getResultMessage());
+                if(map!=null && map.size()>0) {
+                    return getObjectHttpResult(submitApplyResponse, pinganApiLog, parameters, insAreaCompany,map.get("jqpolicyno"),map.get("sypolicyno"),map.get("application"));
                 }
-                if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
-                    ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
-                    if (documentList != null && documentList.size() > 0) {
-                        Boolean jqflag = false;
-                        Boolean sqflag = false;
-                        Boolean fcflag = false;
-                        String jyPlicyNo=null;
-                        //B2 为 未缴费
-                        for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
-                            if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(bizApplyNo) && bizApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
-                                sqflag = true;
-                            }
-                            if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
-                                jqflag = true;
-                            }
-                            List<DocumentStatusListResponse.DocumentDTO.UnAutoListInfoDTO> unAutoListInfo = dto.getUnAutoListInfo();
-                            String applyNo=null;
-                            String policyNo=null;
-                            if(unAutoListInfo!=null && unAutoListInfo.size()>0){
-                                applyNo = unAutoListInfo.get(0).getApplyNo();
-                                policyNo = unAutoListInfo.get(0).getPolicyNo();
-                            }
-                            if (StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(applyNo == null ? "" : applyNo)) {
-                                fcflag = true;
-                                jyPlicyNo=policyNo;
-                            }
-                            if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(policyNo)) {
-                                fcflag = true;
-                            }
-                        }
-                        if (jqflag) {
-                            insAreaCompany.setJqapplyno(forceApplyNo);
-                        }
-                        if(sqflag){
-                            insAreaCompany.setSyapplyno(bizApplyNo);
-                        }
-                        if(fcflag){
-                            List<Map<String,String>> jyList =new ArrayList<Map<String,String>>();
-                            Map<String,String> map =new HashMap<String,String>();
-                            //投保单号
-                            map.put("application",accidentApplyNo);
-                            map.put("policy","");
-                            jyList.add(map);
-                            JSONArray objects = JSON.parseArray(JSON.toJSONString(jyList));
-                            insAreaCompany.setCrossInsurance(objects);
+                throw new SystemException(submitApplyResponse.getResultMessage());
+            }
+        }
+        return HttpResult.error("提交核保接口失败");
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/16 18:00
+     *  @Description:  获取事后资料上传文件
+     */
+    private List<PinganShUploafile> getSHDocList(List<SubmitApplyResponse.BizMissFileDTO> bizMissFilelist, List<SubmitApplyResponse.BizMissFileDTO> forceMissFilelist, String subOrderNo) {
+        List<PinganShUploafile>  list = new ArrayList<>();
+        if(bizMissFilelist!=null && bizMissFilelist.size()>0){
+            for(SubmitApplyResponse.BizMissFileDTO  dto:bizMissFilelist){
+                //文件大类
+                String documentClass = dto.getDocumentClass();
+                //文件大类名称
+                String documentClassName = dto.getDocumentClassName();
+                // 1. 其中1个  0 全部上传
+                String isAnyOne = dto.getIsAnyOne();
+                //子类集合
+                List<SubmitApplyResponse.BizMissFileDTO.DocTypeDTO> docTypeList = dto.getDocTypeList();
+                if(docTypeList!=null && docTypeList.size()>0) {
+                    for (SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList) {
+                        //验证核保时上传的资料
+                        if ("0".equals(vo.getIsNeedDuringAudit())) {
+                            PinganShUploafile  entity = new PinganShUploafile(subOrderNo, documentClass, documentClassName, isAnyOne, vo.getDocumentType(), vo.getDocumentTypeName(), vo.getIsNeedDuringAudit(), "0", new Date());
+                            list.add(entity);
                         }
-                        pinganApiLog.setId(null);
-                        //上传影像
+                    }
+                }
+            }
+        }
+        return list;
+    }
 
-                        //说明核保成功,更新大订单和小订单的状态为1  更新为已核保待缴费
-                        insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
-                        insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
-                        UploadFilesResponse uploadFilesResponse = getUploadResponseByParam(insAreaCompany,pinganApiLog,parameters.getUserId());
-                        if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
-                             throw new SystemException(uploadFilesResponse.getResultMessage());
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/16 16:23
+     *  @Description: 验证上传的资料
+     *  1需要核保时上传,0是事后资料通过uploadFiles接口上传
+     */
+    private String checkDocList(Map<String,Map<String,String>> map, SubmitApplyResponse.BizMissFileDTO dto,String type) {
+        //文件大类
+        String documentClass = dto.getDocumentClass();
+        //文件大类名称
+        String documentClassName = dto.getDocumentClassName();
+        // 1. 其中1个  0 全部上传
+        String isAnyOne = dto.getIsAnyOne();
+        //子类集合
+        List<SubmitApplyResponse.BizMissFileDTO.DocTypeDTO> docTypeList = dto.getDocTypeList();
+        int count =0;
+        String msg="";
+        if(docTypeList!=null && docTypeList.size()>0){
+            if(map!=null && map.size()>0){
+                Map<String, String> docMap= map.get(documentClass);
+                if(docMap==null || docMap.size()==0){
+                    msg+="(" +documentClassName +")";
+                    for(SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList){
+                        //验证核保时上传的资料
+                        if(type.equals(vo.getIsNeedDuringAudit())){
+                            msg+=vo.getDocumentTypeName()+"/";
+                        }
+                    }
+                }else{
+                    msg+="(" +documentClassName +")";
+                    for(SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList){
+                        //验证核保时上传的资料
+                        if(type.equals(vo.getIsNeedDuringAudit())){
+                            String val = docMap.get(vo.getDocumentType());
+                            msg+=vo.getDocumentTypeName()+"/";
+                            if(StringUtils.isNotBlank(val)){
+                                count++;
+                            }
                         }
-                        return HttpResult.ok("提交核保成功");
                     }
-                } else {
-                    throw new SystemException(documentStatusListResponse.getResultMessage());
                 }
             }else{
-                throw new SystemException(submitApplyResponse.getResultMessage());
+                msg+="(" +documentClassName +")";
+                for(SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList){
+                    //验证核保时上传的资料
+                    if(type.equals(vo.getIsNeedDuringAudit())){
+                        msg+=vo.getDocumentTypeName()+"/";
+                    }
+                }
+            }
+            if("1".equals(isAnyOne) && count==0){
+                msg+="中必须上传一个,请确认!!";
+            }
+            if("0".equals(isAnyOne) && count!=docTypeList.size()){
+                msg+="中必须全部上传,请确认!!";
             }
         }
-        return HttpResult.error("提交核保接口失败");
+        return msg;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/16 11:47
+     *  @Description: 核保更新
+     */
+    private HttpResult<Object> getObjectHttpResult(SubmitApplyResponse submitApplyResponse, PinganApiLog pinganApiLog, PingAnConfigureParameters parameters, InsAreaCompany insAreaCompany,String  forceApplyNo,String bizApplyNo,String accidentApplyNo) {
+
+        List<String> list = new ArrayList<String>();
+        if (StringUtils.isNotBlank(bizApplyNo)) {
+            list.add(bizApplyNo);
+        }
+        if (StringUtils.isNotBlank(forceApplyNo)) {
+            list.add(forceApplyNo);
+        }
+        if (StringUtils.isNotBlank(accidentApplyNo)) {
+            // list.add(accidentApplyNo);
+        }
+        pinganApiLog.setId(null);
+        DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
+        DocumentStatusListResponse documentStatusListResponse = null;
+        try {
+            documentStatusListResponse = pinganRequestApiComponents.getDocumentStatusList(documentStatusListRequest, pinganApiLog);
+        } catch (Exception e) {
+            throw new SystemException(e.getMessage());
+        }
+        if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
+            ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
+            if (documentList != null && documentList.size() > 0) {
+                Boolean jqflag = false;
+                Boolean sqflag = false;
+                Boolean fcflag = false;
+                String jyPlicyNo=null;
+                String status="";
+                //B2 为 未缴费
+                for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
+                    status = dto.getStatus();
+                    if (StringUtils.isNotBlank(bizApplyNo) && bizApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
+                        sqflag = true;
+                    }
+                    if (StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
+                        jqflag = true;
+                    }
+                    List<DocumentStatusListResponse.DocumentDTO.UnAutoListInfoDTO> unAutoListInfo = dto.getUnAutoListInfo();
+                    String applyNo=null;
+                    String policyNo=null;
+                    if(unAutoListInfo!=null && unAutoListInfo.size()>0){
+                        applyNo = unAutoListInfo.get(0).getApplyNo();
+                        policyNo = unAutoListInfo.get(0).getPolicyNo();
+                    }
+                    if (StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(applyNo == null ? "" : applyNo)) {
+                        fcflag = true;
+                        jyPlicyNo=policyNo;
+                    }
+                    if (StringUtils.isNotBlank(policyNo)) {
+                        fcflag = true;
+                    }
+                }
+                if (jqflag) {
+                    insAreaCompany.setJqapplyno(forceApplyNo);
+                }
+                if(sqflag){
+                    insAreaCompany.setSyapplyno(bizApplyNo);
+                }
+                if(fcflag){
+                    List<Map<String,String>> jyList =new ArrayList<Map<String,String>>();
+                    Map<String,String> map =new HashMap<String,String>();
+                    //投保单号
+                    map.put("application",accidentApplyNo);
+                    map.put("policy","");
+                    jyList.add(map);
+                    JSONArray objects = JSON.parseArray(JSON.toJSONString(jyList));
+                    insAreaCompany.setCrossInsurance(objects);
+                }
+                pinganApiLog.setId(null);
+                //更新狀態
+                if((OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) ||   OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status)) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()))){
+                    //说明核保成功,更新大订单和小订单的状态为2  更新为已核保待缴费
+                    insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
+                }else if((OrderStatusCodeEnum.ORDER_STATUS_CODE_BH.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_BE.getCode().equals(status)
+                        ||  OrderStatusCodeEnum.ORDER_STATUS_CODE_B1.getCode().equals(status)  || OrderStatusCodeEnum.ORDER_STATUS_CODE_B6.getCode().equals(status) )  && ("0".equals(insAreaCompany.getOrderstatus()))){
+                    // 待验车 BH 资料人工审核-BE B1 B6
+                    insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
+                }
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                //UploadFilesResponse uploadFilesResponse = getUploadResponseByParam(insAreaCompany, pinganApiLog, parameters.getUserId());
+                //if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
+                //    throw new SystemException(uploadFilesResponse.getResultMessage());
+                // }
+                return HttpResult.ok("提交核保成功");
+            }
+        } else {
+            throw new SystemException(documentStatusListResponse.getResultMessage());
+        }
+        return null;
+    }
+
     /**
      *  @version
      *  @author: hxl
@@ -1014,8 +1204,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
 
         InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
         //调用单证查询接口
-        String applyno = !StringUtils.isEmpty(insAreaCompany.getJqapplyno()) ? insAreaCompany.getJqapplyno() :
-                insAreaCompany.getSyapplyno();
         // 账号信息
         PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
         // 通过 协议id获取配置实体
@@ -1389,8 +1577,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                     insAreaCompany.setCrossInsurance(objects);
                 }
                 logger.info(documentStatusListResponse.toString()+"调用状态查询接口");
-                if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) )){
-                    //说明核保成功,更新大订单和小订单的状态为1  更新为已核保待缴费
+                if((OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) ||   OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status)) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) )){
+                    //说明核保成功,更新大订单和小订单的状态为1  更新为已核保待缴费 B6  自核
                     insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode() );
                     insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
                 }else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) || "2".equals(insAreaCompany.getOrderstatus()))) {
@@ -1399,6 +1587,10 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                     insAreaCompany.setPayDate(LocalDateTime.now());
                     insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
                     logger.info(insAreaCompany.toString()+"更新为承保状态!!!");
+                }else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_BH.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_BE.getCode().equals(status)
+                        ||  OrderStatusCodeEnum.ORDER_STATUS_CODE_B1.getCode().equals(status)  || OrderStatusCodeEnum.ORDER_STATUS_CODE_B6.getCode().equals(status)){
+                    // 待验车 BH 资料人工审核-BE B1 B6
+                    insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
                 }
             }
             return HttpResult.ok(documentStatusListResponse);
@@ -2031,6 +2223,69 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             return HttpResult.error("支付失败");
         }
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/16 19:45
+     *  @Description:  事后补传资料
+     */
+    @Override
+    public HttpResult<Object> additionalInformation(AdditionalInformation additionalInformation) {
+        String companyId = additionalInformation.getCompanyId();
+        if(StringUtils.isBlank(companyId)){
+            throw new SystemException("子订单id不能为空!!!");
+        }
+        List<String> imageList = additionalInformation.getImageList();
+        if(imageList ==null  || imageList.size()==0){
+            throw new SystemException("补传资料不能为空!!!");
+        }
+        //通过子订单id查询需要补传的数据集合
+        LambdaQueryWrapper<PinganShUploafile> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(PinganShUploafile::getSubOrderNo, companyId);
+        queryWrapper.eq(PinganShUploafile::getStatus, "0");
+        List<PinganShUploafile> list = pinganShUploafileService.list(queryWrapper);
+        //判断前台数据是否包含所有的回传资料
+        String msg ="";
+        String errorMsg="";
+        if(list ==null ||  list.size()==0){
+            throw new SystemException("没有事后补传资料不必上传!!!");
+        }else{
+            msg ="需要补传资料为:";
+            //判断上传的资料是否包含需要补传的信息资料不包含提示信息
+            List<InsUploadImagesDto> imgList = insTaskImagesMapper.findByIds(imageList);
+
+            if(imgList!=null && imgList.size()>0){
+
+                Map<String, String> map = new HashMap<>();
+                for(InsUploadImagesDto  dto :imgList){
+                    PingAnDocumentClassEnum fileEnum = PingAnDocumentClassEnum.getCode(dto.getImageType());
+                    String documentType = fileEnum.getDocumentType();
+                    map.put(documentType,documentType);
+                }
+                for(PinganShUploafile  dto :list){
+                    String val = map.get(dto.getDocumentType());
+                    if(StringUtils.isBlank(val)){
+                        errorMsg+=dto.getDocumentClassName()+"-"+dto.getDocumentTypeName()+";";
+                    }
+                    msg+=dto.getDocumentClassName()+"-"+dto.getDocumentTypeName()+";";
+                }
+                errorMsg+="未上传";
+            }
+            if(StringUtils.isNotBlank(errorMsg)){
+                throw  new SystemException(msg+"("+errorMsg+")");
+            }else{
+                //将补传资料的数据更新为1
+                List<PinganShUploafile> newList = list.stream()
+                        .map(item -> {
+                            item.setStatus("1");
+                            return item;
+                        })
+                        .collect(Collectors.toList());
+                pinganShUploafileService.updateBatchById(newList);
+            }
+        }
+        return HttpResult.ok("补传资料成功!!");
+    }
 
     /**
      * @version
@@ -2094,4 +2349,32 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         }
         return list;
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/16 11:41
+     *  @Description: 获取返回
+     */
+    public Map<String,String>  getNoByStr(String msg){
+        Map<String,String> map=new HashMap<String,String>();
+        //本次已生成商业险投保单号:53301003900251463997, 交强险投保单号:53301003900251463998, 本次不能再投保
+        if(StringUtils.isNotBlank(msg) && msg.contains("本次不能再投保")){
+            String[] strs = msg.replaceAll("本次不能再投保", "").split(",");
+            if(strs!=null && strs.length>0){
+                for(String s :strs){
+                    if(StringUtils.isNotBlank(s) && s.contains(":") && s.contains("商业险投保单号")){
+                        map.put("sypolicyno",s.split(":")[1]);
+                    }else if(StringUtils.isNotBlank(s)  && s.contains(":") && s.contains("交强险投保单号")){
+                        map.put("jqpolicyno",s.split(":")[1]);
+                    }
+                    else if(StringUtils.isNotBlank(s)  && s.contains(":") && s.contains("意险投保单号")){
+                        map.put("application",s.split(":")[1]);
+                    }
+                }
+            }
+
+        }
+        return map;
+    }
 }

+ 22 - 0
src/main/java/com/ydtech/modules/order/service/impl/PinganShUploafileServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.order.dao.PinganShUploafileMapper;
+import com.ydtech.modules.order.entity.po.PinganShUploafile;
+import com.ydtech.modules.order.service.PinganShUploafileService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 针对表【pingan_sh_uploafile(平安事后文件上传资料)】的数据库操作Service实现
+* @createDate 2024-08-16 18:22:00
+*/
+@Service
+public class PinganShUploafileServiceImpl extends ServiceImpl<PinganShUploafileMapper, PinganShUploafile>
+    implements PinganShUploafileService {
+
+}
+
+
+
+

+ 16 - 5
src/main/java/com/ydtech/modules/order/utils/QrCodeGenerator.java

@@ -181,11 +181,22 @@ public class QrCodeGenerator {
         String fileName = orderNo+"_"+subOrderNo+"_rwm.jpg";
         String saveFilePath = uploadPath+"//" + EXCEL_PATH +fileName;
         String resultPath = UPLOAD_PATH + fileName;
-        try{
-            bufferedImage = toBufferedImage(createBitMatrix(url, 300, 300));
-            ImageIO.write(bufferedImage, "png", new File(saveFilePath));
-        }catch(Exception e){
-          throw new SystemException("转为二维码报错,请重试!!");
+        // 创建File对象
+        File dir = new File(saveFilePath);
+        // 判断目录是否存在
+        if (!dir.exists()) {
+            boolean created = dir.mkdirs();
+            if (created) {
+                try{
+                    bufferedImage = toBufferedImage(createBitMatrix(url, 300, 300));
+                    ImageIO.write(bufferedImage, "png", new File(saveFilePath));
+                }catch(Exception e){
+                    throw new SystemException("转为二维码报错,请重试!!");
+                }
+            }else{
+                throw new SystemException("目录不存在,请重试!!");
+            }
+
         }
         return resultPath;
     }

+ 1 - 2
src/main/resources/application-test.yml

@@ -411,8 +411,7 @@ pingan:
     bucket: icore-pts-openapi-dmz-stg-pri
     ak: 8CJK29FVFY2IK9W0Y8IIdKWD06MI202F
     sk: K9VIM2C6W2YWDWDVK6966F29229dYMDF
-    signatureUrl: https://test.baoxianzhanggui.com/web-api
-
+    signatureUrl: https://test.baoxianzhanggui.com/#/Signature
 
 xxl:
   job:

+ 7 - 0
src/main/resources/mapper/modules/admin/SysRoleMenuKztMapper.xml

@@ -20,6 +20,13 @@
         sys_type,create_by,create_time,
         last_update_by,last_update_time
     </sql>
+    <delete id="deleteByRoleId">
+        delete
+        FROM
+            sys_role_menu_kzt
+        WHERE
+            role_id =#{roleId}
+    </delete>
     <select id="findMenuIdsByRoleId" resultType="com.ydtech.modules.admin.model.SysMenu">
         SELECT
             t.id,

+ 10 - 0
src/main/resources/mapper/modules/ins/InsTaskImagesMapper.xml

@@ -37,5 +37,15 @@
         where i.quote_no =
               (select quoteno from ins_orders where orderno = #{orderNo})
     </select>
+    <select id="findByIds" resultType="com.ydtech.modules.order.entity.dto.InsUploadImagesDto">
+        select i.quote_no, i.image_type, i.image_id, f.file_name, f.file_path,i.pingan_key,i.id
+        from ins_task_images as i
+                 left join ins_upload_files as f
+                           on i.image_id = f.id
+        where f.id in
+        <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
 
 </mapper>

+ 60 - 0
src/main/resources/mapper/modules/insuranceHandlingSettlementMonth/InsuranceHandlingSettlementMonthMapper.xml

@@ -0,0 +1,60 @@
+<?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.fnc.dao.InsuranceHandlingSettlementMonthMapper">
+
+    <sql id="insuranceHandling_com">
+                a.id  as  "id",
+                a.task_id  as  "taskId",
+                a.settlement_documentary_fees_id  as  "settlementDocumentaryFeesId",
+                a.partner_companies_id  as  "partnerCompaniesId",
+                a.settlement_amount  as  "settlementAmount",
+                a.total_amount  as  "totalAmount",
+                a.remaining_amount  as  "remainingAmount",
+                a.create_time  as  "createTime",
+                a.signing_time  as  "signingTime",
+                a.creater_id  as  "createrId"
+    </sql>
+
+    <select id="queryList" resultType="com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto">
+        select ipi.task_id as "taskId" ,
+        sum(IFNULL(ipi.commission_feevalue),0) as"invoiccommissionFeevalue"
+        from
+        ins_ply_income ipi
+        left join ptl_agreement pa on pa.id=ipi.agreement_id
+        left join (
+        select
+        <include refid="insuranceHandling_com"/>
+        from
+        sys_insurance_handling_settlement_month a
+        <where>
+            1=1
+            <if test="vo.partnerCompaniesId  !=null  and  vo.partnerCompaniesId!=''">
+                AND  a.partner_companies_id=#{vo.partnerCompaniesId}
+            </if>
+            <if test="vo.taskId  !=null  and  vo.taskId!=''">
+                AND  a.task_id=#{vo.taskId}
+            </if>
+        </where>
+        )  b on b. taskId =ipi.task_id
+        <where>
+            pa.agreement_type ='2'
+            AND ipi.task_id is  not  null
+            <if test="vo.isNotCar  !=null and vo.isNotCar !=''">
+                AND ipi.is_not_car =#{vo.isNotCar}
+            </if>
+            <if test="vo.isnotDocumentary !=null and vo.isnotDocumentary !=''">
+                AND ipi.is_not_documentary =#{vo.isnotDocumentary}
+            </if>
+            <if test="vo.taskId  !=null  and  vo.taskId!=''">
+                AND  a.task_id=#{vo.taskId}
+            </if>
+        </where>
+        group by ipi.task_id
+
+
+    </select>
+
+
+
+
+</mapper>

+ 4 - 6
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -951,8 +951,8 @@
                 and iac.id = #{orderQueryVo.orderNo}
             </if>
 
-            <if test="orderQueryVo.source != null and orderQueryVo.source != ''">
-                and dept.management_source = #{orderQueryVo.orderNo.source}
+            <if test="orderQueryVo.managementSource != null and orderQueryVo.managementSource != ''">
+                and dept.management_source = #{orderQueryVo.managementSource}
             </if>
 
             <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
@@ -1077,11 +1077,9 @@
             <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
                 and iac.id = #{orderQueryVo.orderNo}
             </if>
-
-            <if test="orderQueryVo.source != null and orderQueryVo.source != ''">
-                and dept.management_source = #{orderQueryVo.orderNo.source}
+            <if test="orderQueryVo.managementSource != null and orderQueryVo.managementSource != ''">
+                and dept.management_source = #{orderQueryVo.managementSource}
             </if>
-
             <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
                 and io.deptid like "${orderQueryVo.deptId}%"
             </if>

+ 26 - 0
src/main/resources/mapper/modules/order/PinganShUploafileMapper.xml

@@ -0,0 +1,26 @@
+<?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.order.dao.PinganShUploafileMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.order.entity.po.PinganShUploafile">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="subOrderNo" column="sub_order_no" jdbcType="VARCHAR"/>
+            <result property="documentClass" column="document_class" jdbcType="VARCHAR"/>
+            <result property="documentClassName" column="document_class_name" jdbcType="VARCHAR"/>
+            <result property="isAnyOne" column="is_any_one" jdbcType="VARCHAR"/>
+            <result property="documentType" column="document_type" jdbcType="VARCHAR"/>
+            <result property="documentTypeName" column="document_type_name" jdbcType="VARCHAR"/>
+            <result property="isNeedDuringAudit" column="is_need_during_audit" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,sub_order_no,document_class,
+        document_class_name,is_any_one,document_type,
+        document_type_name,is_need_during_audit,status,
+        create_time
+    </sql>
+</mapper>