Procházet zdrojové kódy

Merge branch 'test' into test-dj

dongxin před 1 rokem
rodič
revize
cb9030fb06
23 změnil soubory, kde provedl 401 přidání a 28 odebrání
  1. 175 0
      src/main/java/com/ydtech/modules/admin/model/po/CustVehiclePolicyInfo.java
  2. 4 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysPremiumDetailsVo.java
  3. 4 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java
  4. 12 0
      src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java
  5. 4 2
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java
  6. 1 1
      src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java
  7. 6 1
      src/main/java/com/ydtech/modules/order/components/zijin/ZijinRequestApiComponents.java
  8. 31 0
      src/main/java/com/ydtech/modules/order/controller/ExternalOrderController.java
  9. 8 0
      src/main/java/com/ydtech/modules/order/dao/InsOrdersMapper.java
  10. 6 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyExternalFee.java
  11. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/UnderwritingResponse.java
  12. 5 1
      src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangGetNonVehicleProductsRequest.java
  13. 12 0
      src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java
  14. 5 1
      src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java
  15. 8 0
      src/main/java/com/ydtech/modules/order/entity/vo/ExternalOrderFeeVo.java
  16. 17 2
      src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java
  17. 33 7
      src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java
  18. 5 3
      src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java
  19. 20 0
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  20. 30 2
      src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java
  21. 8 3
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  22. 4 1
      src/main/resources/mapper/modules/admin/CustVehiclePolicyInfoMapper.xml
  23. 2 2
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

+ 175 - 0
src/main/java/com/ydtech/modules/admin/model/po/CustVehiclePolicyInfo.java

@@ -250,6 +250,141 @@ public class CustVehiclePolicyInfo implements Serializable {
      */
     private Integer delFlag;
 
+    //企业车新增
+    /**
+     *   固定电话
+     */
+    private String applyTel;
+
+    /**
+     *  省
+     */
+    private String applyProvince;
+
+    /**
+     *  市
+     */
+    private String applyCity;
+
+    /**
+     *  县
+     */
+    private String  applyCounty;
+
+    /***
+     * 车主类型(0:法人 1:个人(中国籍) 2: 个人(非中国籍))
+     */
+    private String applyProperty;
+
+    /***
+     * 注册资本金
+     */
+    private String applyRegisteredCapital;
+
+    /***
+     * 经营范围
+     */
+    private String applyScope;
+    /***
+     * 联系人
+     */
+    private String applyLegalPerson;
+
+    /***
+     * 组织机构代码
+     */
+    private String applyOrganizationCode;
+
+
+    /**
+     *   固定电话
+     */
+    private String insureTel;
+
+    /**
+     *  省
+     */
+    private String insureProvince;
+
+    /**
+     *  市
+     */
+    private String insureCity;
+
+    /**
+     *  县
+     */
+    private String  insureCounty;
+
+    /***
+     * 车主类型(0:法人 1:个人(中国籍) 2: 个人(非中国籍))
+     */
+    private String insureProperty;
+
+    /***
+     * 注册资本金
+     */
+    private String insureRegisteredCapital;
+
+    /***
+     * 经营范围
+     */
+    private String insureScope;
+    /***
+     * 联系人
+     */
+    private String insureLegalPerson;
+
+    /***
+     * 组织机构代码
+     */
+    private String insureOrganizationCode;
+
+
+    /**
+     *   固定电话
+     */
+    private String ownerTel;
+
+    /**
+     *  省
+     */
+    private String ownerProvince;
+
+    /**
+     *  市
+     */
+    private String ownerCity;
+
+    /**
+     *  县
+     */
+    private String  ownerCounty;
+
+    /***
+     * 车主类型(0:法人 1:个人(中国籍) 2: 个人(非中国籍))
+     */
+    private String ownerProperty;
+
+    /***
+     * 注册资本金
+     */
+    private String ownerRegisteredCapital;
+
+    /***
+     * 经营范围
+     */
+    private String ownerScope;
+    /***
+     * 联系人
+     */
+    private String ownerLegalPerson;
+
+    /***
+     * 组织机构代码
+     */
+    private String ownerOrganizationCode;
+
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 
@@ -291,6 +426,16 @@ public class CustVehiclePolicyInfo implements Serializable {
             customerInfoVo.setOwner(custVehiclePolicyInfo.getOwnerOwnerFlag() != null && custVehiclePolicyInfo.getOwnerOwnerFlag());
             //同投保人
             customerInfoVo.setInsuranceHolder(custVehiclePolicyInfo.getOwnerInsuranceHolderFlag() != null && custVehiclePolicyInfo.getOwnerInsuranceHolderFlag());
+            //车主相关信息   add  hxl   2024-12-20
+            customerInfoVo.setTel(custVehiclePolicyInfo.getOwnerTel());
+            customerInfoVo.setOrganizationCode(custVehiclePolicyInfo.getOwnerOrganizationCode());
+            customerInfoVo.setProvince(custVehiclePolicyInfo.getOwnerProvince());
+            customerInfoVo.setCity(custVehiclePolicyInfo.getOwnerCity());
+            customerInfoVo.setCounty(custVehiclePolicyInfo.getOwnerCounty());
+            customerInfoVo.setProperty(custVehiclePolicyInfo.getOwnerProperty());
+            customerInfoVo.setRegisteredCapital(custVehiclePolicyInfo.getOwnerRegisteredCapital());
+            customerInfoVo.setScope(custVehiclePolicyInfo.getOwnerScope());
+            customerInfoVo.setLegalPerson(custVehiclePolicyInfo.getOwnerLegalPerson());
 
         }else if(type ==2){
             //姓名
@@ -328,6 +473,16 @@ public class CustVehiclePolicyInfo implements Serializable {
             customerInfoVo.setOwner(custVehiclePolicyInfo.getInsureOwnerFlag() != null && custVehiclePolicyInfo.getInsureOwnerFlag());
             //同投保人
             customerInfoVo.setInsuranceHolder(custVehiclePolicyInfo.getInsureInsuranceHolderFlag() != null && custVehiclePolicyInfo.getInsureInsuranceHolderFlag());
+            //车主相关信息   add  hxl   2024-12-20
+            customerInfoVo.setTel(custVehiclePolicyInfo.getInsureTel());
+            customerInfoVo.setOrganizationCode(custVehiclePolicyInfo.getInsureOrganizationCode());
+            customerInfoVo.setProvince(custVehiclePolicyInfo.getInsureProvince());
+            customerInfoVo.setCity(custVehiclePolicyInfo.getInsureCity());
+            customerInfoVo.setCounty(custVehiclePolicyInfo.getInsureCounty());
+            customerInfoVo.setProperty(custVehiclePolicyInfo.getInsureProperty());
+            customerInfoVo.setRegisteredCapital(custVehiclePolicyInfo.getInsureRegisteredCapital());
+            customerInfoVo.setScope(custVehiclePolicyInfo.getInsureScope());
+            customerInfoVo.setLegalPerson(custVehiclePolicyInfo.getInsureLegalPerson());
 
         }else if(type ==3){
             //姓名
@@ -365,6 +520,26 @@ public class CustVehiclePolicyInfo implements Serializable {
             customerInfoVo.setOwner(custVehiclePolicyInfo.getApplyOwnerFlag() != null && custVehiclePolicyInfo.getApplyOwnerFlag());
             //同投保人
             customerInfoVo.setInsuranceHolder(custVehiclePolicyInfo.getApplyInsuranceHolderFlag() != null && custVehiclePolicyInfo.getApplyInsuranceHolderFlag());
+            //车主相关信息   add  hxl   2024-12-20
+            customerInfoVo.setTel(custVehiclePolicyInfo.getOwnerTel());
+            customerInfoVo.setOrganizationCode(custVehiclePolicyInfo.getOwnerOrganizationCode());
+            customerInfoVo.setProvince(custVehiclePolicyInfo.getOwnerProvince());
+            customerInfoVo.setCity(custVehiclePolicyInfo.getOwnerCity());
+            customerInfoVo.setCounty(custVehiclePolicyInfo.getOwnerCounty());
+            customerInfoVo.setProperty(custVehiclePolicyInfo.getOwnerProperty());
+            customerInfoVo.setRegisteredCapital(custVehiclePolicyInfo.getOwnerRegisteredCapital());
+            customerInfoVo.setScope(custVehiclePolicyInfo.getOwnerScope());
+
+            //车主相关信息   add  hxl   2024-12-20
+            customerInfoVo.setTel(custVehiclePolicyInfo.getOwnerTel());
+            customerInfoVo.setOrganizationCode(custVehiclePolicyInfo.getOwnerOrganizationCode());
+            customerInfoVo.setProvince(custVehiclePolicyInfo.getOwnerProvince());
+            customerInfoVo.setCity(custVehiclePolicyInfo.getOwnerCity());
+            customerInfoVo.setCounty(custVehiclePolicyInfo.getOwnerCounty());
+            customerInfoVo.setProperty(custVehiclePolicyInfo.getOwnerProperty());
+            customerInfoVo.setRegisteredCapital(custVehiclePolicyInfo.getOwnerRegisteredCapital());
+            customerInfoVo.setScope(custVehiclePolicyInfo.getOwnerScope());
+            customerInfoVo.setLegalPerson(custVehiclePolicyInfo.getOwnerLegalPerson());
         }
         return customerInfoVo;
     }

+ 4 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysPremiumDetailsVo.java

@@ -69,6 +69,10 @@ public class SysPremiumDetailsVo {
     @ApiModelProperty(value = "贡献合伙人名称")
     private String profferName;
 
+    @ApiModelProperty(value = "贡献人名称")
+    private String workName;
+
+
     /**
      * 存放贡献费用每集合伙人的等级和比例
      */

+ 4 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java

@@ -1448,6 +1448,9 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                 sysPremiumDetailsVo.setProfferLevel(sysPartner.getType());
                 SysUser sysUser = sysUserMapper.selectById(sysPartner.getUserId());
                 sysPremiumDetailsVo.setProfferName(sysUser.getName());
+                //直接工作室产生费用,显示工作室名称
+                SysDept sysDept1 = sysDeptMapper.selectById(sysAgencyLeader.getDeptId());
+                sysPremiumDetailsVo.setWorkName(sysDept1.getName());
             }
             sysPremiumDetailsVo.setSumpremium(sysPremiumDetails1.getSumpremium());
             SysUser sysUser = sysUserMapper.selectById(sysPremiumDetails1.getIssuerId());
@@ -1866,7 +1869,7 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
     @Override
     public List<SysPartnerVo> getRelationInfo(String userId) {
         List<SysPartnerVo> sysPartners = new ArrayList<>();
-        //登陆人的上级合伙人信息
+        //登陆人的上级合伙人信息
         SysPartner sysPartner = sysPartnerMapper.selectOne(new LambdaQueryWrapper<SysPartner>()
                 .eq(SysPartner::getUserId, userId).eq(SysPartner::getDelFlag, 1));
         SysPartnerVo sysPartnerVo = BeanUtil.copyProperties(sysPartner, SysPartnerVo.class);

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

@@ -594,6 +594,18 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
      **/
     @Override
     public List<TaskStatisticsDto> getDistribution(TaskStatisticsVo taskStatisticsVo) {
+        if(StringUtils.isNotEmpty(taskStatisticsVo.getDays())){
+            if("7".equals(taskStatisticsVo.getDays())){
+                taskStatisticsVo.setDateType("2");
+            } else if ("30".equals(taskStatisticsVo.getDays())) {
+                taskStatisticsVo.setDateType("3");
+            } else if ("1".equals(taskStatisticsVo.getDays())){
+                taskStatisticsVo.setDateType("1");
+            }
+        }
+        HashMap<String, String> dateMapByType = getDateMapByTypeNew(taskStatisticsVo.getDateType(), taskStatisticsVo.getCreatetimeStart(), taskStatisticsVo.getCreatetimeEnd());
+        taskStatisticsVo.setCreatetimeStart(dateMapByType.get("startDate"));
+        taskStatisticsVo.setCreatetimeEnd(dateMapByType.get("endDate"));
         List<TaskStatisticsDto> result = new ArrayList<>();
          //0 报价中 1 待核保  2 已核保代缴费  3 已承保  4  核保退回
         for (int i = 0; i < 5; i++) {

+ 4 - 2
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -2,7 +2,6 @@ package com.ydtech.modules.fee.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ydtech.constants.enums.dict.insurance.EnergyType;
-import com.ydtech.constants.enums.dict.insurance.NatureOfVehicleUse;
 import com.ydtech.constants.enums.dict.insurance.VehicleType;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysUser;
@@ -47,7 +46,6 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -1623,6 +1621,10 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         //默认分销比例设置
         RetailProportion retailProportion = new RetailProportion();
         if (!Objects.isNull(esmRetailList) && !esmRetailList.isEmpty()) {
+            //处理数据空指针异常   add by hxl  2024-12-19
+            if(esmRetailList.get(0).getRetailtype()==null){
+                esmRetailList.get(0).setRetailtype("0");
+            }
             retailLevel = Integer.parseInt(esmRetailList.get(0).getRetailtype());
             //赋值默认的分销比例
             retailProportion.setProportion(esmRetailList.get(0).getDisrate1(), esmRetailList.get(0).getDisrate2(), esmRetailList.get(0).getDisrate3());

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

@@ -225,7 +225,7 @@ public class QuoteRespVo {
     }
 
     public void setSyClaims(String syClaims) {
-        this.syClaims = StringUtils.isEmpty(jqClaims) ? null : syClaims;
+        this.syClaims = StringUtils.isEmpty(syClaims) ? null : syClaims;
     }
 
     public List<AccidentResponseVo> getAccidentInfo() {

+ 6 - 1
src/main/java/com/ydtech/modules/order/components/zijin/ZijinRequestApiComponents.java

@@ -83,7 +83,7 @@ public class ZijinRequestApiComponents {
                                                           HttpHeaders httpHeaders) {
         String url = zijinApiConfigurationProperties.getUrl() + requestUrl.getUri();
         B b = insCrawlerOrderComponents.request(url, InsuranceEnum.ZKIC, requestUrl.getDesc(), requestBody, responseType, httpHeaders);
-        ResultEnum.verifyQuotation(b.getRtnCode(), b.getRtnMsg());
+//        ResultEnum.verifyQuotation(b.getRtnCode(), b.getRtnMsg());
         return b;
     }
 
@@ -137,6 +137,11 @@ public class ZijinRequestApiComponents {
         if (!ObjectUtils.isEmpty(entries)) {
             String authorization = (String) entries.get(AUTHORIZATION);
             String zKIApiAuthorization = (String) entries.get(ZKI_API_AUTHORIZATION);
+
+            System.out.printf("---------------\n--------------\n---------------\n--------------\n---------------\n--------------\n---------------\n--------------\n---------------\n--------------\n");
+            System.out.printf("authorization:" + authorization);
+            System.out.printf("zKIApiAuthorization:" + zKIApiAuthorization);
+            System.out.printf("---------------\n--------------\n---------------\n--------------\n---------------\n--------------\n---------------\n--------------\n---------------\n--------------\n");
             httpHeaders.set(AUTHORIZATION, authorization);
             httpHeaders.set(ZKI_API_AUTHORIZATION, zKIApiAuthorization);
             return httpHeaders;

+ 31 - 0
src/main/java/com/ydtech/modules/order/controller/ExternalOrderController.java

@@ -20,6 +20,7 @@ import com.ydtech.modules.order.service.InsTaskImagesService;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
+import com.ydtech.modules.protocols.entity.vo.InquiryNowFeeQueryVo;
 import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -28,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Objects;
 
 import static com.ydtech.modules.base.model.vo.PageVo.buildPageRequest;
@@ -205,6 +207,8 @@ public class ExternalOrderController {
         externalOrderFeeVo.blank();
         ExternalOrderFeeVo resultExternalOrderFeeVo = feeRuleSchemeNewService.calcCostsExternalExportData(ptlAgreement, noInquiryNowFee, externalOrderFeeVo);
 
+        resultExternalOrderFeeVo.setCostId(noInquiryNowFee!=null?noInquiryNowFee.getId():"");
+
         return HttpResult.ok(resultExternalOrderFeeVo);
     }
 
@@ -214,4 +218,31 @@ public class ExternalOrderController {
 
         return insOrdersService.delExternalOrder(insOrdersEditingVo)? HttpResult.ok("删除成功") : HttpResult.error("删除失败");
     }
+
+    /**
+     * 外部订单非现询费用
+     */
+    @PostMapping("/externalInquiryNowFeeOrderFee")
+    @ApiOperation("外部订单非现询费用")
+    public HttpResult<Object> externalInquiryNowFeeOrderFee(@RequestBody ExternalOrderFeeVo externalOrderFeeVo){
+        PtlAgreement ptlAgreement = ptlAgreementService.getById(externalOrderFeeVo.getAgreementId());
+        ProductsType productsType = InsuranceRisk.determineInsuranceInformation(externalOrderFeeVo.getKinds(), externalOrderFeeVo.getRisks());
+        externalOrderFeeVo.setProductCode(productsType.getCode());
+        InquiryNowFeeQueryVo inquiryNowFeeQueryVo =new InquiryNowFeeQueryVo();
+        inquiryNowFeeQueryVo.setAgreementId(externalOrderFeeVo.getAgreementId());
+        inquiryNowFeeQueryVo.setProductId(productsType.getCode());
+        List<PtlAgreementProductCostsNew> inquiryNowFeeList = ptlAgreementProductCostsNewService.getInquiryNowFee(inquiryNowFeeQueryVo);
+        PtlAgreementProductCostsNew noInquiryNowFee =  new PtlAgreementProductCostsNew();
+        if(inquiryNowFeeList == null || inquiryNowFeeList.size()==0){
+            throw new SystemException("不存在非现询费用");
+        }else{
+            noInquiryNowFee = inquiryNowFeeList.get(0);
+        }
+        externalOrderFeeVo.blank();
+        ExternalOrderFeeVo resultExternalOrderFeeVo = feeRuleSchemeNewService.calcCostsExternalExportData(ptlAgreement, noInquiryNowFee, externalOrderFeeVo);
+
+        resultExternalOrderFeeVo.setCostId(noInquiryNowFee!=null?noInquiryNowFee.getId():"");
+
+        return HttpResult.ok(resultExternalOrderFeeVo);
+    }
 }

+ 8 - 0
src/main/java/com/ydtech/modules/order/dao/InsOrdersMapper.java

@@ -183,4 +183,12 @@ public interface InsOrdersMapper extends BaseMapper<InsOrders> {
             @Param("type") Integer code,
             @Param("flag") Boolean flag
     );
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/16 10:34
+     *  @Description: 更新空值
+     */
+    boolean updateWithNull(InsOrders insOrders);
 }

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

@@ -49,6 +49,12 @@ public class InsAreaCompanyExternalFee implements Serializable {
     @TableField(value = "no_other_costs_proportion")
     private BigDecimal noOtherCostsProportion;
 
+    @TableField(value = "cost_id")
+    private String  costId;
+
+    @TableField(value = "cost_flag")
+    private String  costFlag;
+
 
     public BigDecimal getJqSuperviseCostsProportion() {
         return jqSuperviseCostsProportion == null ? BigDecimal.ZERO : jqSuperviseCostsProportion;

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/response/UnderwritingResponse.java

@@ -186,7 +186,7 @@ public class UnderwritingResponse extends BoHaiBaseResponse {
             private static final String MESSAGES = "核保成功";
 
             public DrivingInsuranceDto toDrivingInsuranceDto() {
-                if (!MESSAGES.equals(this.getResultMsg())) {
+                if (StringUtils.isEmpty(this.getApplicationNo())) {
                     throw new SystemException(this.getResultMsg());
                 }
 

+ 5 - 1
src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangGetNonVehicleProductsRequest.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.order.entity.api.yangguang.request;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.annotation.JSONField;
 import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.api.yangguang.constants.YangGuangCarType;
 import com.ydtech.modules.order.entity.api.yangguang.constants.YgUseNatureCodeMapping;
 import com.ydtech.modules.order.entity.config.YangGuangConfigureParameters;
 import lombok.Data;
@@ -105,7 +106,10 @@ public class YangGuangGetNonVehicleProductsRequest extends YangGuangBaseRequest
         if (useNatureCode != null) {
             this.UseNatureCode = YgUseNatureCodeMapping.getYgUseNatureCode(useNatureCode);
         }
-        this.VehicleType = jsonObject.getString("cimodelclass");
+        String cartype = jsonObject.getString("cartype");
+        //车辆种类
+        YangGuangCarType yangGuangCarType = Enum.valueOf(YangGuangCarType.class,cartype);
+        this.VehicleType = yangGuangCarType.getCode();
         this.LicenseCategory = jsonObject.getString("cartype");
         this.Toncount = jsonObject.getString("seatCount");
     }

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

@@ -142,6 +142,18 @@ public class CrawlerQuoteResponse extends CrawlerBaseResponse {
         @JsonProperty("price")
         private String price;
 
+        /**
+         * 非车险起保时间
+         */
+        @JsonProperty("fcx_startDate")
+        private String divingInsurancesStartDate;
+
+        /**
+         * 非车险终保时间
+         */
+        @JsonProperty("fcx_endDate")
+        private String divingInsurancesEndDate;
+
         public static List<AccidentResponseVo> toAccidentResponseVoList(List<DivingInsurancesDto> drivingInsurances) {
             return drivingInsurances.stream().map(DivingInsurancesDto::toAccidentResponseVo).collect(Collectors.toList());
         }

+ 5 - 1
src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java

@@ -1,6 +1,5 @@
 package com.ydtech.modules.order.entity.vo;
 
-import com.alibaba.fastjson.JSONArray;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
@@ -176,4 +175,9 @@ public class BaseQuoteVo<T> {
 
     @ApiModelProperty("报价比例")
     private BigDecimal quoteRatio;
+
+    // add by hxl
+    @ApiModelProperty("是否现询 1.是 2.否")
+    private String costFlag;
+
 }

+ 8 - 0
src/main/java/com/ydtech/modules/order/entity/vo/ExternalOrderFeeVo.java

@@ -91,6 +91,14 @@ public class ExternalOrderFeeVo {
     @ApiModelProperty(value = "计算的非车入口比例")
     private BigDecimal NoCostsProportion;
 
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/16 12:07
+     *  @Description: 费用id
+     */
+    private String  costId;
+
 
     public void blank(){
         if(Objects.isNull(this.jqPremium)){

+ 17 - 2
src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java

@@ -13,15 +13,14 @@ import com.ydtech.modules.order.entity.InsBusinessInsurance;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.TaxArrears;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
-import com.ydtech.utils.BigDecimalUtils;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto;
+import com.ydtech.utils.BigDecimalUtils;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.ObjectUtils;
 
-import javax.persistence.NamedQueries;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
@@ -93,6 +92,22 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
     @ApiModelProperty("现询费用id")
     private String nowCostsId;
 
+    // add  by  2024-12-16
+    @ApiModelProperty("是否现询 1.是 2.否")
+    private String costFlag;
+
+    // add  by  2024-12-17
+    @ApiModelProperty("交强出口比例")
+    private String  jqExportFee;
+
+    // add  by  2024-12-17
+    @ApiModelProperty("商业出口比例")
+    private String  syExportFee;
+
+    // add  by  2024-12-17
+    @ApiModelProperty("非车出口比例")
+    private String  noExportFee;
+
     @Data
     @AllArgsConstructor
     @NoArgsConstructor

+ 33 - 7
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -558,10 +558,20 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         if (quoteVo.getStageFlag() == null) {
             throw new SystemException("暂存标志为空");
         }
-
         validQuoteVo(quoteVo);
-
-
+        if (StringUtils.isBlank(quoteVo.getAgreementId())) {
+            throw new SystemException("请选择协议!!");
+        }
+        if (StringUtils.isBlank(quoteVo.getCostFlag())) {
+            throw new SystemException("是否现询不能为空!");
+        }
+        if(StringUtils.isBlank(quoteVo.getNowCostsId())){
+            throw new SystemException("费用不能为空!!");
+        }
+        String nowCostsId = quoteVo.getNowCostsId();
+        if("1".equals(quoteVo.getCostFlag())){
+            nowCostsId =null;
+        }
 //        LambdaQueryWrapper<InsAreaCompany> queryWrapper = new LambdaQueryWrapper<>();
 //        queryWrapper.eq(InsAreaCompany::getJqpolicyno, quoteVo.getJqpolicyno())
 //                .or()
@@ -601,7 +611,7 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         agreementProductQueryVo.setProductCode(productId);
         agreementProductQueryVo.setIsAudit("1");
         agreementProductQueryVo.setAgreementId(ptlAgreement.getId());
-        agreementProductQueryVo.setNowCostsId(quoteVo.getNowCostsId());
+        agreementProductQueryVo.setNowCostsId(nowCostsId);
 
         List<PtlAgreementProductCostsNew> costsNews = ptlAgreementProductCostsNewService.getByAgreementId(agreementProductQueryVo);
 
@@ -723,6 +733,8 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         insAreaCompanyExternalFee.setNoSuperviseCostsProportion(quoteVo.getNoSuperviseCostsProportion() != null ? quoteVo.getNoSuperviseCostsProportion() : new BigDecimal(0));
         insAreaCompanyExternalFee.setNoOtherCostsProportion(quoteVo.getNoOtherCostsProportion() != null ? quoteVo.getNoOtherCostsProportion() : new BigDecimal(0));
 
+        insAreaCompanyExternalFee.setCostId(ptlAgreementProductCostsNew.getId());
+        insAreaCompanyExternalFee.setCostFlag(quoteVo.getCostFlag());
         this.insAreaCompanyExternalFeeService.save(insAreaCompanyExternalFee);
 
 
@@ -818,6 +830,16 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         if (StringUtils.isBlank(insOrdersEditingVo.getAgreementId())) {
             throw new SystemException("请选择协议!!");
         }
+        if (StringUtils.isBlank(insOrdersEditingVo.getCostFlag())) {
+            throw new SystemException("是否现询不能为空!");
+        }
+        if(StringUtils.isBlank(insOrdersEditingVo.getNowCostsId())){
+            throw new SystemException("费用不能为空!!");
+        }
+        String nowCostsId = insOrdersEditingVo.getNowCostsId();
+        if("1".equals(insOrdersEditingVo.getCostFlag())){
+            nowCostsId =null;
+        }
         //通过协议id 查询费用
         PtlAgreement ptlAgreement = ptlAgreementService.getById(insOrdersEditingVo.getAgreementId());
         InsOrders insOrders = new InsOrders();
@@ -848,7 +870,8 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
             insOrders.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
             insOrders.setInsureTime(insOrdersEditingVo.getSignDate());
         }
-        insOrdersService.updateById(insOrders);
+        //更新空值
+        insOrdersMapper.updateWithNull(insOrders);
         String subOrderNo = insOrdersEditingVo.getInsAreaCompanyList().get(0).getId();
         //处理保单
         InsAreaCompanyExternalPolicy externalPolicy = new InsAreaCompanyExternalPolicy();
@@ -880,11 +903,11 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         //查找协议的费用
         AgreementProductQueryVo agreementProductQueryVo = new AgreementProductQueryVo();
         List<String> productId = new ArrayList<>();
-        productId.add(insOrders.getProductid());
+        productId.add(insAreaCompany.getProductid());
         agreementProductQueryVo.setProductCode(productId);
         agreementProductQueryVo.setIsAudit("1");
         agreementProductQueryVo.setAgreementId(ptlAgreement.getId());
-        agreementProductQueryVo.setNowCostsId(insOrdersEditingVo.getNowCostsId());
+        agreementProductQueryVo.setNowCostsId(nowCostsId);
 
         List<PtlAgreementProductCostsNew> costsNews = ptlAgreementProductCostsNewService.getByAgreementId(agreementProductQueryVo);
 
@@ -898,6 +921,9 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
 
         InsAreaCompanyExternalFee insAreaCompanyExternalFee = new InsAreaCompanyExternalFee();
         insAreaCompanyExternalFee.setSubOrderNo(subOrderNo);
+        // add by hxl 2024-12-16    添加费用id 和是否现询
+        insAreaCompanyExternalFee.setCostId(insOrdersEditingVo.getNowCostsId());
+        insAreaCompanyExternalFee.setCostFlag(insOrdersEditingVo.getCostFlag());
         if (insOrdersEditingVo.getJqCostsProportion() != null) {
             if (jqSuperviseCostsProportion.compareTo(insOrdersEditingVo.getJqCostsProportion()) > 0) {
                 //总比例等于手续费比例

+ 5 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -168,9 +168,11 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
                 sysQuoteRecords.forEach(item -> {
                     item.setSubOrderNo(subOrderNo);
                 });
-                sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
-                //刷新redis中的报价次数
-                sysQuoteRedisService.refreshQuoteNum(t.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
+                if(sysQuoteRecords.size() > 0) {
+                    sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
+                    //刷新redis中的报价次数
+                    sysQuoteRedisService.refreshQuoteNum(t.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
+                }
             }
             throw new SystemException(response.getMessage());
         }

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

@@ -1130,6 +1130,19 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             }
             insOrdersEditingVo.setJypolicyno(application);
 
+            InsFeeAudit feeAuditByInsOrderNo = insFeeAuditService.getFeeAuditByInsOrderNo(insAreaCompanyList.get(0).getId());
+            int status=0;
+            if(feeAuditByInsOrderNo !=null){
+                String auditstatus = feeAuditByInsOrderNo.getAuditstatus();
+                if("2".equals(auditstatus)){
+                    status=1;
+                }else{
+                    status=2;
+                }
+            }
+            //添加订单状态   add by hxl  2024-12-17
+            insOrdersEditingVo.setOrderExternalStatus(status);
+
             InsAreaCompanyExternalPolicy policyByCompanyId = insAreaCompanyExternalPolicyService.getPolicyByCompanyId(insAreaCompanyList.get(0).getId());
 //            insOrdersEditingVo.setExternalPolicy(policyByCompanyId);
 
@@ -1209,6 +1222,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                     insFeeOrderNews.get(0).getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
                 insOrdersEditingVo.setNoCostsProportion(insAreaCompanyExternalFee.getNoSuperviseCostsProportion().add(insAreaCompanyExternalFee.getNoOtherCostsProportion()));
             }
+            // add by hxl 2024-12-16    添加费用id 和是否现询
+            insOrdersEditingVo.setNowCostsId(insAreaCompanyExternalFee.getCostId());
+            insOrdersEditingVo.setCostFlag(insAreaCompanyExternalFee.getCostFlag());
+            insOrdersEditingVo.setJqExportFee(insAreaCompanyExternalFee.getCostFlag());
+            insOrdersEditingVo.setSyExportFee(insAreaCompanyExternalFee.getCostFlag());
+            insOrdersEditingVo.setNoExportFee(insAreaCompanyExternalFee.getCostFlag());
+
         }
 
         //计算费用

+ 30 - 2
src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java

@@ -15,7 +15,9 @@ import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.InsImagesUploadCacheComponents;
 import com.ydtech.modules.order.components.zijin.ZijinRequestApiComponents;
 import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
+import com.ydtech.modules.order.constants.QuoteNumberConstant;
 import com.ydtech.modules.order.constants.UnderwritingStatus;
+import com.ydtech.modules.order.dao.SysQuoteRecordMapper;
 import com.ydtech.modules.order.entity.*;
 import com.ydtech.modules.order.entity.api.zijin.constants.enums.*;
 import com.ydtech.modules.order.entity.api.zijin.request.*;
@@ -25,6 +27,7 @@ import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
 import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
 import com.ydtech.modules.order.entity.filter.CarModelsFilterUtils;
 import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
+import com.ydtech.modules.order.entity.po.SysQuoteRecord;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
@@ -71,6 +74,10 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
 
     private final InsImagesUploadCacheComponents insImagesUploadCacheComponents;
 
+    private final SysQuoteRecordMapper sysQuoteRecordMapper;
+
+    private final SysQuoteRedisService sysQuoteRedisService;
+
     // 重复投保次数
     private static final int REPEAT_NUMBER = 3;
 
@@ -107,6 +114,9 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
 
     @Override
     public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<ZjQuoteAccidentVo>> quoteVo) {
+        Integer maxQuoteNum = quoteVo.getMaxQuoteNum();
+        List<SysQuoteRecord> sysQuoteRecords = new ArrayList<>();
+
         // 1. 协议id获取配置实体
         String agreementId = quoteVo.getAgreementId();
         // 1.1 账号信息
@@ -160,7 +170,15 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
                 insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
             }
             String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, calculatePremiumResponse.getRtnMsg(), insOrderStatusEnum);
-
+            SysQuoteRecord deplSysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
+                    QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
+            sysQuoteRecords.add(deplSysQuoteRecord);
+            sysQuoteRecords.forEach(item->{
+                item.setSubOrderNo(subOrderNo);
+            });
+            sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
+            //刷新redis中的报价次数
+            sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
             throw new SystemException(calculatePremiumResponse.getRtnMsg());
         }
 
@@ -174,8 +192,18 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
 
         // 设置核心报价车型
         quoteRespVo.setCoreModels(vehicleModelInfosDTO.toCoreModelsVo());
-        return responseOrder(calculatePremiumResponse, quoteRespVo, ptlAgreementAttribution, calculatePremiumRequest.getOrderId(),
+        HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(calculatePremiumResponse, quoteRespVo, ptlAgreementAttribution, calculatePremiumRequest.getOrderId(),
                 calculatePremiumRequest.getOrderNo(), quoteVo.getAccidentalDrivingVo());
+        SysQuoteRecord deplSysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
+                QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
+        sysQuoteRecords.add(deplSysQuoteRecord);
+        sysQuoteRecords.forEach(item->{
+            item.setSubOrderNo(quoteRespVoHttpResult.getData().getCompanyId());
+        });
+        sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
+        //刷新redis中的报价次数
+        sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
+        return quoteRespVoHttpResult;
     }
 
     @Override

+ 8 - 3
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -42,6 +42,7 @@ import com.ydtech.modules.protocols.entity.po.*;
 import com.ydtech.modules.protocols.entity.vo.*;
 import com.ydtech.modules.protocols.service.*;
 import com.ydtech.utils.idgen.IdGenerate;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -2400,21 +2401,23 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         queryWrapper.gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
 
         queryWrapper.eq(PtlAgreementProductCostsNew::getIsAudit, "1");
+        //费用审核
+        queryWrapper.eq(PtlAgreementProductCostsNew::getValidStatus, 1);
         queryWrapper.eq(PtlAgreementProductCostsNew::getIsInquiryNow, "0");
         List<PtlAgreementProductCostsNew> ptlAgreementProductCostsNews = baseMapper.selectList(queryWrapper);
 
         ptlAgreementProductCostsNews.forEach(item -> {
             if (item.getProductId().equals(ProductsType.PT_0330.getCode())) {
-                if (item.getSyCostsProportion().equals("0")) {
+                if (StringUtils.isBlank(item.getSyCostsProportion()) || item.getSyCostsProportion().equals("0")) {
                     item.setSyCostsProportion(null);
                 }
 
             } else if (item.getProductId().equals(ProductsType.PT_034002.getCode()) || item.getProductId().equals(ProductsType.PT_034001.getCode())) {
-                if (item.getJqCostsProportion().equals("0")) {
+                if (StringUtils.isBlank(item.getJqCostsProportion()) || item.getJqCostsProportion().equals("0")) {
                     item.setJqCostsProportion(null);
                 }
             }
-            if (item.getNoCarCostsProportion().equals("0")) {
+            if (StringUtils.isBlank(item.getNoCarCostsProportion()) || item.getNoCarCostsProportion().equals("0")) {
                 item.setNoCostsProportion(null);
             }
         });
@@ -2435,6 +2438,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         queryWrapper.gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
 
         queryWrapper.eq(PtlAgreementProductCostsNew::getIsAudit, "1");
+        //费用审核
+        queryWrapper.eq(PtlAgreementProductCostsNew::getValidStatus, 1);
         queryWrapper.eq(PtlAgreementProductCostsNew::getIsInquiryNow, "1");
 
         queryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId, agreementId);

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

@@ -19,7 +19,10 @@
         owner_identify_valid_end_date,create_by,create_time,
         update_by,update_time,del_flag,
         insure_owner_flag,insure_insurance_holder_flag,owner_owner_flag,
-        owner_insurance_holder_flag,apply_owner_flag,apply_insurance_holder_flag
+        owner_insurance_holder_flag,apply_owner_flag,apply_insurance_holder_flag,
+        apply_tel,apply_province,apply_city,apply_county,apply_property,apply_registered_capital,apply_scope,apply_legal_person,apply_organization_code,
+        insure_tel,insure_province,insure_city,	insure_county,insure_property,insure_registered_capital,insure_scope,insure_legal_person,insure_organization_code,
+        owner_tel,owner_province,owner_city,owner_county,owner_property,owner_registered_capital,owner_scope,owner_legal_person,owner_organization_code
     </sql>
     <select id="findCustomerInfo" resultType="com.ydtech.modules.admin.model.po.CustVehiclePolicyInfo">
         select

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

@@ -2250,8 +2250,8 @@
             a.partnerCompaniesName as "partnerCompaniesName",
             sum(a.totalPremium) as  "totalPremium",
             sum(a.qutationInsureCount) as  "qutationInsureCount",
-            sum(a.totalPremium) / sum(a.qutationInsureCount)  AS "averagePremium",
-            sum(a.totalPremium)  /   sum(a.userNumber)   as "perCapitaAmount",
+            ROUND(sum(a.totalPremium) / sum(a.qutationInsureCount), 2)   AS "averagePremium",
+            ROUND(sum(a.totalPremium) / sum(a.userNumber),2)  as "perCapitaAmount",
             sum(a.userNumber) as "userNumber"
         from  (
         select