Forráskód Böngészése

Merge branch 'refs/heads/test' into test-2024-08-27

wks 2 éve
szülő
commit
9eac392211

+ 3 - 0
sql/Online.sql

@@ -229,3 +229,6 @@ CREATE TABLE `pingan_sh_uploafile`  (
                                         `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                         PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '平安事后文件上传资料' ROW_FORMAT = Dynamic;
+
+--add by helixiao 20240827
+ALTER TABLE `sys_partner` ADD COLUMN `type` tinyint NOT NULL DEFAULT '1' COMMENT '合伙人等级';

+ 3 - 0
src/main/java/com/ydtech/modules/admin/model/SysPartner.java

@@ -35,6 +35,9 @@ public class SysPartner implements Serializable {
      */
     @ApiModelProperty(value = "员工姓名")
     private String userName;
+
+    @ApiModelProperty(value = "合伙人等级")
+    private int type;
     /**
      * 抽成比例(总保费抽成)
      */

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

@@ -704,7 +704,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
 
                 }
                 teamInformation.setSumpremium(bigDecimal);
-//                int num = 0;
+                int num = 0;
                 // 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
                 List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
                 for (String s : userIdList) {
@@ -714,13 +714,13 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                         List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
                                 .in(InsAreaCompany::getOrderno, insOrders)
                                 .eq(InsAreaCompany::getOrderstatus, 3));
-//                        if (insAreaCompanies1.size() > 0) {
-//                            num++;
-//                        }
+                        if (insAreaCompanies1.size() > 0) {
+                            num++;
+                        }
 
-                        teamInformation.setOrderManNum(insAreaCompanies1.size());
                     }
                 }
+                teamInformation.setOrderManNum(num);
                 informationList.add(teamInformation);
 
             }

+ 38 - 26
src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.aop.exception.DescribeException;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.dao.*;
 import com.ydtech.modules.admin.model.*;
 import com.ydtech.modules.admin.model.dto.SysPartnerAPPPageDto;
@@ -81,20 +82,20 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
     public BasePageResult<SysUserPartner> queryByPage(SysPartnerPageDto sysPartnerPageDto) {
         Page<SysUser> page = new Page<>(sysPartnerPageDto.getPageNum(), sysPartnerPageDto.getPageSize());
         List<SysAgencyLeader> sysAgencyLeaders = sysAgencyLeaderMapper.selectList(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getDelFlag, 1));
-        List<String> stringList =null;
-        if (sysAgencyLeaders.size()>0) {
+        List<String> stringList = null;
+        if (sysAgencyLeaders.size() > 0) {
             stringList = sysAgencyLeaders.stream().map(SysAgencyLeader::getUserId).collect(Collectors.toList());
 
         }
-        List<String> idList =null;
-        List<SysDept> sysDeptLists = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>().eq(SysDept::getComlevel, 4).eq(SysDept::getDelFlag,0));
-        if (sysDeptLists.size()>0) {
+        List<String> idList = null;
+        List<SysDept> sysDeptLists = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>().eq(SysDept::getComlevel, 4).eq(SysDept::getDelFlag, 0));
+        if (sysDeptLists.size() > 0) {
             List<String> collect = sysDeptLists.stream().map(SysDept::getId).collect(Collectors.toList());
 
             List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>()
                     .in(SysDept::getParentId, collect)
-                    .eq(SysDept::getDelFlag,0).isNull(SysDept::getComlevel).eq(SysDept::getDeptType,"D"));
-            if (sysDeptList.size()>0) {
+                    .eq(SysDept::getDelFlag, 0).isNull(SysDept::getComlevel).eq(SysDept::getDeptType, "D"));
+            if (sysDeptList.size() > 0) {
                 idList = sysDeptList.stream().map(SysDept::getId).collect(Collectors.toList());
             }
         }
@@ -102,8 +103,8 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
         wrapper.eq(SysUser::getStatus, 1);
         wrapper.likeRight(StringUtils.isNotEmpty(sysPartnerPageDto.getDeptId()), SysUser::getId, sysPartnerPageDto.getDeptId());
         wrapper.notLike(SysUser::getId, "M");
-        wrapper.notIn(CollectionUtil.isNotEmpty(stringList),SysUser::getId, stringList);
-        wrapper.in(CollectionUtil.isNotEmpty(idList),SysUser::getDeptId, idList);
+        wrapper.notIn(CollectionUtil.isNotEmpty(stringList), SysUser::getId, stringList);
+        wrapper.in(CollectionUtil.isNotEmpty(idList), SysUser::getDeptId, idList);
         wrapper.orderByDesc(SysUser::getCreateTime);
 
         Page<SysUser> insOrdersPage = sysUserService.page(page, wrapper);
@@ -157,8 +158,15 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
         SysPartner sysPartner = BeanUtil.copyProperties(sysPartnerDto, SysPartner.class);
         sysPartner.setCreateTime(new Date());
         sysPartner.setCreateBy(BaseController.getUser().getId());
-        boolean b = sysPartnerMapper.insert(sysPartner) > 0;
+        boolean b = false;
         if (sysPartnerDto.getSuggestId() != null) {
+            SysPartner sysPartnerSuggest = sysPartnerMapper.selectOne(new LambdaQueryWrapper<SysPartner>()
+                    .eq(SysPartner::getUserId, sysPartnerDto.getSuggestId())
+                    .eq(SysPartner::getDelFlag, 1));
+            if (sysPartnerSuggest == null) throw new SystemException("推荐人不存在");
+            sysPartner.setType(sysPartnerSuggest.getType() + 1);
+            b = sysPartnerMapper.insert(sysPartner) > 0;
+            //保存关系
             SysRelationPerson sysRelationPerson = new SysRelationPerson();
             sysRelationPerson.setAgencyLeaderId(sysPartnerDto.getUserId());
             sysRelationPerson.setSuggestId(sysPartnerDto.getSuggestId());
@@ -186,6 +194,10 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                     sysRelationPersonMapper.insert(sysRelationPerson1);
                 }
             }
+        } else {
+            //无推荐人,等级为一级
+            sysPartner.setType(1);
+            b = sysPartnerMapper.insert(sysPartner) > 0;
         }
 
         return b;
@@ -289,18 +301,18 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                             }
                             if (insOrderList.size() > 0) {
                                 List<String> collect = insOrderList.stream().map(InsOrders::getOrderno).collect(Collectors.toList());
-                                    //查询订单下的所有子订单
-                                    List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
-                                            .in(InsAreaCompany::getOrderno, collect)
-                                            .eq(InsAreaCompany::getOrderstatus, 3));
-                                    if (insAreaCompanies.size() > 0) {
-                                        //累加每一个子订单的交强险费用+商业险费用+驾意险费用
-                                        BigDecimal jqpremium = insAreaCompanies.stream().map(InsAreaCompany::getJqpremium).reduce(BigDecimal.ZERO, BigDecimal::add);
-                                        BigDecimal sypremium = insAreaCompanies.stream().map(InsAreaCompany::getSypremium).reduce(BigDecimal.ZERO, BigDecimal::add);
-                                        BigDecimal jypremium = insAreaCompanies.stream().map(InsAreaCompany::getJypremium).reduce(BigDecimal.ZERO, BigDecimal::add);
-
-                                        bigDecimal = jqpremium.add(sypremium).add(jypremium);
-                                    }
+                                //查询订单下的所有子订单
+                                List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
+                                        .in(InsAreaCompany::getOrderno, collect)
+                                        .eq(InsAreaCompany::getOrderstatus, 3));
+                                if (insAreaCompanies.size() > 0) {
+                                    //累加每一个子订单的交强险费用+商业险费用+驾意险费用
+                                    BigDecimal jqpremium = insAreaCompanies.stream().map(InsAreaCompany::getJqpremium).reduce(BigDecimal.ZERO, BigDecimal::add);
+                                    BigDecimal sypremium = insAreaCompanies.stream().map(InsAreaCompany::getSypremium).reduce(BigDecimal.ZERO, BigDecimal::add);
+                                    BigDecimal jypremium = insAreaCompanies.stream().map(InsAreaCompany::getJypremium).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+                                    bigDecimal = jqpremium.add(sypremium).add(jypremium);
+                                }
 
                             }
                         }
@@ -311,7 +323,7 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                         BigDecimal multiply = bigDecimal.multiply(new BigDecimal(agencyExtractFee.getProportional())
                                 .divide(new BigDecimal("100"))).setScale(2, RoundingMode.DOWN);
                         agencyExtractFee.setExtractFee(multiply);
-                    }else {
+                    } else {
                         agencyExtractFee.setExtractFee(new BigDecimal("0.00"));
                     }
                     // 填充 已提现抽成费用和可提现抽成费用
@@ -334,7 +346,7 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                         agencyExtractFee.setCashFee(extractFee.subtract(new BigDecimal("0.00")));
                     }
 
-                }else {
+                } else {
                     agencyExtractFee.setSumpremium(BigDecimal.ZERO);
                     agencyExtractFee.setExtractFee(BigDecimal.ZERO);
                     agencyExtractFee.setHistoryFee(BigDecimal.ZERO);
@@ -461,7 +473,7 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                         BigDecimal multiply = bigDecimal.multiply(new BigDecimal(sysPartner.getProportional())
                                 .divide(new BigDecimal("100"))).setScale(2, RoundingMode.DOWN);
                         sysPartnerAPPPageVo.setExtractFee(multiply);
-                    }else {
+                    } else {
                         sysPartnerAPPPageVo.setExtractFee(new BigDecimal("0.00"));
                     }
 
@@ -521,7 +533,7 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                     sysRelationPersonMapper.insert(sysRelationPerson1);
                 }
             }
-        }else {
+        } else {
             SysPartner partner = new SysPartner();
             partner.setId(sysPartner.getId());
             partner.setProportional(sysPartnerDto.getProportional());

+ 135 - 2
src/main/java/com/ydtech/modules/ins/model/guoren/InsuranceSlipReq.java

@@ -4,8 +4,8 @@ import com.alibaba.fastjson.annotation.JSONField;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
-import com.ydtech.modules.order.entity.api.guoren.constants.GuoRenRiskCode;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import lombok.Data;
@@ -28,7 +28,6 @@ public class InsuranceSlipReq {
 
     @JsonProperty(value = "prpTinsured")
     @JSONField(name = "prpTinsured")
-
     private PrpTinsuredDTO prpTinsured;
 
     @JsonProperty(value = "biPrptenages")
@@ -42,6 +41,11 @@ public class InsuranceSlipReq {
     @JsonProperty(value = "order")
     @JSONField(name = "order")
     private String order;
+
+    @JsonProperty(value = "ocrOrder")
+    @JSONField(name = "ocrOrder")
+    private OcrOrderDTO ocrOrderDTO;
+
     /**
      * 构造请求参数
      */
@@ -107,6 +111,10 @@ public class InsuranceSlipReq {
 
         req.setBiPrptenages(biPrptenages);
         req.setCiPrptenages(ciPrptenages);
+
+        OcrOrderDTO orderDTO = new OcrOrderDTO(yaQuoteInfoVo);
+        req.setOcrOrderDTO(orderDTO);
+
         return req;
 
     }
@@ -182,4 +190,129 @@ public class InsuranceSlipReq {
         private String insuredIDValidDate;
     }
 
+
+    @NoArgsConstructor
+    @Data
+    public static class OcrOrderDTO {
+
+        @JsonProperty(value = "ocrCarOwner")
+        @JSONField(name = "ocrCarOwner")
+        private String ocrCarOwner;
+        @JsonProperty(value = "ocrCarOwnerIdentifyNumber")
+        @JSONField(name = "ocrCarOwnerIdentifyNumber")
+        private String ocrCarOwnerIdentifyNumber;
+        @JsonProperty(value = "ocrCarAddress")
+        @JSONField(name = "ocrCarAddress")
+        private String ocrCarAddress;
+        @JsonProperty(value = "ocrIdvalidStartDate")
+        @JSONField(name = "ocrIdvalidStartDate")
+        private String ocrIdvalidStartDate;
+        @JsonProperty(value = "ocrIdvalidDate")
+        @JSONField(name = "ocrIdvalidDate")
+        private String ocrIdvalidDate;
+
+        @JsonProperty(value = "ocrInsuredName")
+        @JSONField(name = "ocrInsuredName")
+        private String ocrInsuredName;
+        @JsonProperty(value = "ocrInsuredIdentifyNumber")
+        @JSONField(name = "ocrInsuredIdentifyNumber")
+        private String ocrInsuredIdentifyNumber;
+        @JsonProperty(value = "ocrInsuredAddress")
+        @JSONField(name = "ocrInsuredAddress")
+        private String ocrInsuredAddress;
+        @JsonProperty(value = "ocrInsuredIDValidStartDate")
+        @JSONField(name = "ocrInsuredIDValidStartDate")
+        private String ocrInsuredIDValidStartDate;
+        @JsonProperty(value = "ocrInsuredIDValidDate")
+        @JSONField(name = "ocrInsuredIDValidDate")
+        private String ocrInsuredIDValidDate;
+        @JsonProperty(value = "ocrAppliName")
+        @JSONField(name = "ocrAppliName")
+        private String ocrAppliName;
+        @JsonProperty(value = "ocrAppliIdentifyNumber")
+        @JSONField(name = "ocrAppliIdentifyNumber")
+        private String ocrAppliIdentifyNumber;
+        @JsonProperty(value = "ocrAppliAddress")
+        @JSONField(name = "ocrAppliAddress")
+        private String ocrAppliAddress;
+        @JsonProperty(value = "ocrAppliIDValidStartDate")
+        @JSONField(name = "ocrAppliIDValidStartDate")
+        private String ocrAppliIDValidStartDate;
+        @JsonProperty(value = "ocrAppliIDValidDate")
+        @JSONField(name = "ocrAppliIDValidDate")
+        private String ocrAppliIDValidDate;
+        @JsonProperty(value = "ocrOwnerAddress")
+        @JSONField(name = "ocrOwnerAddress")
+        private String ocrOwnerAddress;
+        @JsonProperty(value = "ocrVinNo")
+        @JSONField(name = "ocrVinNo")
+        private String ocrVinNo;
+        @JsonProperty(value = "ocrEngineNo")
+        @JSONField(name = "ocrEngineNo")
+        private String ocrEngineNo;
+        @JsonProperty(value = "ocrEnrolLDate")
+        @JSONField(name = "ocrEnrolLDate")
+        private String ocrEnrolLDate;
+        @JsonProperty(value = "ocrChgOwnerDate")
+        @JSONField(name = "ocrChgOwnerDate")
+        private String ocrChgOwnerDate;
+        @JsonProperty(value = "ocrModelName")
+        @JSONField(name = "ocrModelName")
+        private String ocrModelName;
+        @JsonProperty(value = "ocrUseYears")
+        @JSONField(name = "ocrUseYears")
+        private String ocrUseYears;
+        @JsonProperty(value = "ocrUseNatureCode")
+        @JSONField(name = "ocrUseNatureCode")
+        private String ocrUseNatureCode;
+        @JsonProperty(value = "ocrMaincarKindCode")
+        @JSONField(name = "ocrMaincarKindCode")
+        private String ocrMaincarKindCode;
+        @JsonProperty(value = "ocrCarKindCode")
+        @JSONField(name = "ocrCarKindCode")
+        private String ocrCarKindCode;
+        @JsonProperty(value = "ocrLicenseCategory")
+        @JSONField(name = "ocrLicenseCategory")
+        private String ocrLicenseCategory;
+        @JsonProperty(value = "ocrLicenseKindCode")
+        @JSONField(name = "ocrLicenseKindCode")
+        private String ocrLicenseKindCode;
+
+
+        public OcrOrderDTO(BaseQuoteInfoVo yaQuoteInfoVo) {
+            // 车主
+            CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
+            // 被保人
+            CustomerInfoVo insuredPersonInfo = yaQuoteInfoVo.getInsuredPersonInfo();
+            // 投保人信息
+            CustomerInfoVo policyHolderInfo = yaQuoteInfoVo.getPolicyHolderInfo();
+            // 车辆信息
+            CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
+
+            this.ocrCarOwner = ownerInfo.getName();
+            this.ocrCarOwnerIdentifyNumber = ownerInfo.getIdentifyNumber();
+            this.ocrCarAddress = ownerInfo.getAddr();
+            this.ocrIdvalidStartDate = ownerInfo.getIdentifyValidDate();
+            this.ocrIdvalidDate = ownerInfo.getIdentifyValidEndDate();
+
+            this.ocrInsuredName = insuredPersonInfo.getName();
+            this.ocrInsuredIdentifyNumber = insuredPersonInfo.getIdentifyNumber();
+            this.ocrInsuredAddress = insuredPersonInfo.getAddr();
+            this.ocrInsuredIDValidStartDate = insuredPersonInfo.getIdentifyValidDate();
+            this.ocrInsuredIDValidDate = insuredPersonInfo.getIdentifyValidEndDate();
+
+            this.ocrAppliName = policyHolderInfo.getName();
+            this.ocrAppliIdentifyNumber = policyHolderInfo.getIdentifyNumber();
+            this.ocrAppliAddress = policyHolderInfo.getAddr();
+            this.ocrAppliIDValidStartDate = policyHolderInfo.getIdentifyValidDate();
+            this.ocrAppliIDValidDate = policyHolderInfo.getIdentifyValidEndDate();
+
+            this.ocrVinNo = carInfo.getFrameNo();
+            this.ocrEngineNo = carInfo.getEngineNo();
+            this.ocrEnrolLDate = carInfo.getRegisterDate();
+            this.ocrChgOwnerDate = carInfo.getIssueDate();
+
+        }
+    }
+
 }

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

@@ -77,7 +77,7 @@
     <resultMap id="InsAreaCompanyQueryDto" type="com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto"
                extends="BaseResultMap">
         <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
-        <result property="fileStatus" column="file_status" jdbcType="VARCHAR"/>
+        <result property="fileStatus" column="fileStatus" jdbcType="VARCHAR"/>
     </resultMap>
 
     <sql id="Base_Column_List">