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

Merge remote-tracking branch 'origin/test' into test

Qchen 1 год назад
Родитель
Сommit
020be7f0f0

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

@@ -16,6 +16,7 @@ import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.base.model.dto.PageDto;
 import com.ydtech.modules.base.model.dto.PageDto;
 import com.ydtech.modules.base.model.vo.PageVo;
 import com.ydtech.modules.base.model.vo.PageVo;
+import org.springframework.util.ObjectUtils;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -390,6 +391,9 @@ public interface SysUserService extends BaseIService<SysUser> {
      */
      */
     default SysUser judgmentIncumbency(String id) {
     default SysUser judgmentIncumbency(String id) {
         SysUser user = getById(id);
         SysUser user = getById(id);
+        if(ObjectUtils.isEmpty(user)){
+            throw new SystemException("用户或密码错误!!");
+        }
         if (!UserWorkStatus.UWS_1.getCode().equals(user.getStatus())) {
         if (!UserWorkStatus.UWS_1.getCode().equals(user.getStatus())) {
             throw new SystemException("审核未通过、请联系管理员");
             throw new SystemException("审核未通过、请联系管理员");
         }
         }

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

@@ -121,6 +121,10 @@ public class RuleAttrMappingVo {
 
 
         //发证日期
         //发证日期
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("DateofIssuance", carInfo.getIssueDate()));
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("DateofIssuance", carInfo.getIssueDate()));
+
+        // 初登日期是否与发证日期一致
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("SameDate", carInfo.getRegisterDate().equals(carInfo.getIssueDate()) ? "1" : "0"));
+
         //车长
         //车长
 //        ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleLength", carInfo.getCarLength()));
 //        ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleLength", carInfo.getCarLength()));
         //转续保 交强
         //转续保 交强

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

@@ -3223,6 +3223,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         equalsMap.add("JqCharacterBasedRating");
         equalsMap.add("JqCharacterBasedRating");
         //商业字符型评分
         //商业字符型评分
         equalsMap.add("SyCharacterBasedRating");
         equalsMap.add("SyCharacterBasedRating");
+        // 阳光红黄蓝车系
+        equalsMap.add("SeriesTypeActualName");
 
 
 
 
 
 
@@ -3258,6 +3260,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         equalsMap.add("JqCharacterBasedRating");
         equalsMap.add("JqCharacterBasedRating");
         //商业字符型评分
         //商业字符型评分
         equalsMap.add("SyCharacterBasedRating");
         equalsMap.add("SyCharacterBasedRating");
+        // 阳光红黄蓝车系
+        equalsMap.add("SeriesTypeActualName");
 
 
 
 
 
 

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

@@ -238,6 +238,9 @@ public class QuoteRespVo {
     @ApiModelProperty("永安商业费用浮动")
     @ApiModelProperty("永安商业费用浮动")
     private String bifeeFloat;
     private String bifeeFloat;
 
 
+    @ApiModelProperty("永安商业折扣")
+    private String yaBusinessDiscount;
+
     @ApiModelProperty("人保商业折扣")
     @ApiModelProperty("人保商业折扣")
     private String preDiscount;
     private String preDiscount;
 
 

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

@@ -187,7 +187,7 @@ public class InsCrawlerOrderController extends BaseController {
     @ApiOperation(value = "统一发送登录验证码")
     @ApiOperation(value = "统一发送登录验证码")
     public HttpResult sendLoginSmsCode(@RequestBody PtlAgreementAttributionDto agreementAttributionDto) {
     public HttpResult sendLoginSmsCode(@RequestBody PtlAgreementAttributionDto agreementAttributionDto) {
         JSONObject response = insuranceCrawlerOrderService.sendLoginSmsCode(agreementAttributionDto);
         JSONObject response = insuranceCrawlerOrderService.sendLoginSmsCode(agreementAttributionDto);
-        if (response.getInteger("code") == 200){
+        if (response.getInteger("code") == 400){
             return HttpResult.ok(response.getString("message"),response.getString("secretKey"));
             return HttpResult.ok(response.getString("message"),response.getString("secretKey"));
         }else{
         }else{
             return HttpResult.error("验证码发送失败");
             return HttpResult.error("验证码发送失败");

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

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.aop.AuditVerification;
 import com.ydtech.modules.order.aop.QuoteVerification;
 import com.ydtech.modules.order.aop.QuoteVerification;
 import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.entity.api.yangguang.response.YangGuangGetNonVehicleProductsResponse;
 import com.ydtech.modules.order.entity.api.yangguang.response.YangGuangGetNonVehicleProductsResponse;
@@ -54,7 +55,7 @@ public class YangGuangOrderApiController {
         return this.yangGuangOrderApiService.upload(companyId);
         return this.yangGuangOrderApiService.upload(companyId);
     }
     }
 
 
-
+    @AuditVerification("核保")
     @PostMapping("/submit")
     @PostMapping("/submit")
     @ApiOperation("投保单提交")
     @ApiOperation("投保单提交")
     public HttpResult<Object> submit(@RequestSingleParam(value = "companyId") String companyId) throws Exception {
     public HttpResult<Object> submit(@RequestSingleParam(value = "companyId") String companyId) throws Exception {

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

@@ -76,6 +76,11 @@ public class CrawlerQuoteRequest extends BaseQuoteInfoVo {
      */
      */
     private String carChecker;
     private String carChecker;
 
 
+    /**
+     * 永安商业折扣
+     */
+    private String yaBusinessDiscount;
+
     /**
     /**
      * 人保赔付优化申请
      * 人保赔付优化申请
      */
      */

+ 53 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CtCrawlerLoginRequest.java

@@ -0,0 +1,53 @@
+package com.ydtech.modules.order.entity.crawler.request;
+
+import cn.hutool.core.collection.CollUtil;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
+import com.ydtech.utils.StringUtils;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+
+@Data
+@NoArgsConstructor
+public class CtCrawlerLoginRequest implements Serializable {
+
+    private static final long serialVersionUID = 01404102263425770704305L;
+
+    /**
+     * 账号
+     */
+    @JsonProperty(value = "username")
+    private String username;
+
+    /**
+     * 密码
+     */
+    @JsonProperty(value = "pwd")
+    private String pwd;
+
+    /**
+     * 归属信息
+     */
+    @JsonProperty(value = "other")
+    private LinkedHashMap<String, String> other;
+
+    @JsonProperty(value = "check")
+    private String check;
+
+    public CtCrawlerLoginRequest(PtlAgreementAttributionDto attribution) {
+        this.username = attribution.getUsername();
+        this.pwd = attribution.getPassword();
+
+    }
+
+    public CtCrawlerLoginRequest(PtlAgreementAttributionDto attribution, String sendcode, CtCrawlerLoginRequest request) {
+        this.username = attribution.getUsername();
+        this.pwd = attribution.getPassword();
+        if(CollUtil.isNotEmpty(attribution.getFields())){
+            this.other = attribution.getFields().stream().collect(LinkedHashMap::new, (m, v) -> m.put(v.getField(), v.getValue()), LinkedHashMap::putAll);
+        }
+    }
+}

+ 27 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CtCrawlerBaseResponse.java

@@ -0,0 +1,27 @@
+package com.ydtech.modules.order.entity.crawler.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CtCrawlerBaseResponse implements Serializable {
+
+    private static final long serialVersionUID = 0436050477325473777054L;
+
+    /**
+     * 状态码
+     */
+    @JsonProperty("code")
+    private Integer code;
+    /**
+     * 返回信息
+     */
+    @JsonProperty("message")
+    private String message;
+
+    @JsonProperty("data")
+    private Object data;
+
+}

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

@@ -155,6 +155,8 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         crawlerQuoteRequest.setDiscount(t.getDiscount());
         crawlerQuoteRequest.setDiscount(t.getDiscount());
         // 是否需要验车
         // 是否需要验车
         crawlerQuoteRequest.setIsInspect(t.getIsInspect());
         crawlerQuoteRequest.setIsInspect(t.getIsInspect());
+        // 永安商业折扣
+        crawlerQuoteRequest.setYaBusinessDiscount(t.getDiscount());
         // 上次订单
         // 上次订单
         if (StringUtils.isNotEmpty(t.getLastCompanyId())) {
         if (StringUtils.isNotEmpty(t.getLastCompanyId())) {
             InsAreaCompany insAreaCompany = insAreaCompanyService.getById(t.getLastCompanyId());
             InsAreaCompany insAreaCompany = insAreaCompanyService.getById(t.getLastCompanyId());
@@ -578,6 +580,8 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         quoteRespVo.setCifeeFloat(other.getCifeeFloat());
         quoteRespVo.setCifeeFloat(other.getCifeeFloat());
         // 商业费用浮动
         // 商业费用浮动
         quoteRespVo.setBifeeFloat(other.getBifeeFloat());
         quoteRespVo.setBifeeFloat(other.getBifeeFloat());
+        // 永安商业折扣
+        quoteRespVo.setYaBusinessDiscount(other.getSyDiscount());
 
 
         quoteRespVo.setTotalAdjustRate(StringUtils.toDouble(other.getDiscount()));
         quoteRespVo.setTotalAdjustRate(StringUtils.toDouble(other.getDiscount()));
         quoteRespVo.setJqAdjustRate(other.getJqDiscount());
         quoteRespVo.setJqAdjustRate(other.getJqDiscount());
@@ -1041,7 +1045,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
     public JSONObject sendLoginSmsCode(PtlAgreementAttributionDto agreementAttributionDto) {
     public JSONObject sendLoginSmsCode(PtlAgreementAttributionDto agreementAttributionDto) {
 //        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
 //        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
         PtlAgreementAttribution attribution = ptlAgreementAttributionService.getOne(new LambdaQueryWrapper<PtlAgreementAttribution>()
         PtlAgreementAttribution attribution = ptlAgreementAttributionService.getOne(new LambdaQueryWrapper<PtlAgreementAttribution>()
-                .eq(PtlAgreementAttribution::getTemplateId,agreementAttributionDto.getTemplateId()));
+                .eq(PtlAgreementAttribution::getId,agreementAttributionDto.getId()));
 
 
         PtlAgreementAttributionDto attributionDto = new PtlAgreementAttributionDto();
         PtlAgreementAttributionDto attributionDto = new PtlAgreementAttributionDto();
         BeanUtils.copyProperties(attribution, attributionDto);
         BeanUtils.copyProperties(attribution, attributionDto);
@@ -1064,6 +1068,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         // 泰山发送验证码
         // 泰山发送验证码
         if (attribution.getInsCompanyId().equals("TSBX1000000")){
         if (attribution.getInsCompanyId().equals("TSBX1000000")){
             TsCrawlerLoginRequest crawlerLoginRequest = new TsCrawlerLoginRequest(attributionDto);
             TsCrawlerLoginRequest crawlerLoginRequest = new TsCrawlerLoginRequest(attributionDto);
+
             TsCrawlerBaseResponse tsResponse = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.TSBX.getCode(), "获取验证码",
             TsCrawlerBaseResponse tsResponse = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.TSBX.getCode(), "获取验证码",
                     crawlerLoginRequest, TsCrawlerBaseResponse.class);
                     crawlerLoginRequest, TsCrawlerBaseResponse.class);
             if (!tsResponse.getCode().equals(200)) {
             if (!tsResponse.getCode().equals(200)) {
@@ -1073,7 +1078,22 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             redisTemplate.opsForValue().set(InsuranceEnum.TSBX.getCode()+OrderCacheConstant.BS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(tsResponse.getData()), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
             redisTemplate.opsForValue().set(InsuranceEnum.TSBX.getCode()+OrderCacheConstant.BS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(tsResponse.getData()), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
                     TimeUnit.SECONDS);
                     TimeUnit.SECONDS);
         }
         }
-//        if (attribution.getInsCompanyId().equals(""))
+        // 诚泰发送验证码
+        if (attribution.getInsCompanyId().equals("CHAC1000000")){
+            CtCrawlerLoginRequest crawlerLoginRequest = new CtCrawlerLoginRequest(attributionDto);
+            LinkedHashMap<String,String> other = new LinkedHashMap<>();
+            other.put("phone",agreementAttributionDto.getPhone());
+            crawlerLoginRequest.setOther(other);
+            crawlerLoginRequest.setCheck("zs");
+            response = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.CHAC.getCode(), "获取验证码",
+                    crawlerLoginRequest, JSONObject.class);
+            if (!response.getInteger("code").equals(400)) {
+                throw new SystemException(response.getString("message"));
+            }
+            // 将返回参数放入redis
+            redisTemplate.opsForValue().set(InsuranceEnum.CHAC.getCode()+OrderCacheConstant.BS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(response.getString("data")), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
+                    TimeUnit.SECONDS);
+        }
         return response;
         return response;
     }
     }
 
 
@@ -1123,6 +1143,26 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
                 throw new SystemException("验证码已失效!请重新发送!");
                 throw new SystemException("验证码已失效!请重新发送!");
             }
             }
         }
         }
+        else if(companyCode.equals(InsuranceEnum.CHAC.getCode())){
+            CtCrawlerLoginRequest ctCrawlerLoginRequest = new CtCrawlerLoginRequest();
+            ctCrawlerLoginRequest.setUsername(agreement.getAttribution().getUsername());
+            ctCrawlerLoginRequest.setPwd(agreement.getAttribution().getPassword());
+            ctCrawlerLoginRequest.setOther(new LinkedHashMap<>());
+            ctCrawlerLoginRequest.getOther().put("phone",agreement.getAttribution().getPhone());
+            ctCrawlerLoginRequest.getOther().put("mescoed",agreement.getAgreement().getSmsCode());
+            ctCrawlerLoginRequest.setCheck("zs");
+            // 组装 Other 信息
+            Map<String,String> otherMap = new HashMap<>();
+            agreement.getAttribution().getFields().forEach(item->{
+                otherMap.put(item.getField(),item.getValue());
+            });
+            JSONObject response = insCrawlerOrderComponents.request(apiUrl, agreement.getAgreement().getPartnerCompaniesId(), "登录",
+                    ctCrawlerLoginRequest, JSONObject.class);
+            if (response.getInteger("code") != 200) {
+                throw new SystemException("登录失败:" + response.getString("token"));
+            }
+
+        }
         else{
         else{
             // 正常登录流程
             // 正常登录流程
         }
         }

+ 5 - 0
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementAttributionDto.java

@@ -18,6 +18,8 @@ public class PtlAgreementAttributionDto implements Serializable {
 
 
     private static final long serialVersionUID = 5438498729372152816L;
     private static final long serialVersionUID = 5438498729372152816L;
 
 
+    private String id;
+
     /**
     /**
      * 模板id
      * 模板id
      */
      */
@@ -48,6 +50,9 @@ public class PtlAgreementAttributionDto implements Serializable {
     @ApiModelProperty("保险公司密码")
     @ApiModelProperty("保险公司密码")
     private String password;
     private String password;
 
 
+    @ApiModelProperty("手机号 用于验证码登录")
+    private String phone;
+
     @ApiModelProperty("环境?")
     @ApiModelProperty("环境?")
     private String check;
     private String check;
 }
 }