wks 2 éve
szülő
commit
1c06a49b41
30 módosított fájl, 810 hozzáadás és 23 törlés
  1. 4 0
      src/main/java/com/ydtech/config/properties/BohaiApiConfigurationProperties.java
  2. 1 1
      src/main/java/com/ydtech/constants/InsuranceEnum.java
  3. 26 0
      src/main/java/com/ydtech/constants/enums/dict/insurance/Property.java
  4. 4 0
      src/main/java/com/ydtech/modules/ins/model/vo/CarInfoVo.java
  5. 86 0
      src/main/java/com/ydtech/modules/order/components/bohai/BoHaiRequestApiComponent.java
  6. 105 0
      src/main/java/com/ydtech/modules/order/controller/BoHaiOrderApiController.java
  7. 47 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/BoHaiEncrypted.java
  8. 24 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleAffNature.java
  9. 26 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleKind.java
  10. 23 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleUsage.java
  11. 24 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleUsageDetail.java
  12. 4 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/BoHaiBaseRequest.java
  13. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/ElectronicPolicyRequest.java
  14. 46 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/GenerateOrderNoRequest.java
  15. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/ImageUploadRequest.java
  16. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/QuotationRequest.java
  17. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/UnderwritingRequest.java
  18. 154 8
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleConfirmationReqeust.java
  19. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleTypeQueryRequest.java
  20. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/BoHaiBaseResponse.java
  21. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/ElectronicPolicyResponse.java
  22. 26 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/GenerateOrderNoResponse.java
  23. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/ImageUploadResponse.java
  24. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/QuotationResponse.java
  25. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/UnderwritingResponse.java
  26. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/VehicleConfirmationResponse.java
  27. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/VehicleTypeQueryResponse.java
  28. 92 0
      src/main/java/com/ydtech/modules/order/service/BoHaiOrderApiService.java
  29. 1 1
      src/main/java/com/ydtech/modules/order/service/ZijinOrderApiService.java
  30. 105 0
      src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java

+ 4 - 0
src/main/java/com/ydtech/config/properties/BohaiApiConfigurationProperties.java

@@ -22,6 +22,10 @@ public class BohaiApiConfigurationProperties {
     // 渤海方公钥
     private String boHaiPublicKey;
 
+    // 合作方代码,由渤海分配
+    private String insurerCode;
+
     // 配置code
     private String sysSourceCode;
+
 }

+ 1 - 1
src/main/java/com/ydtech/constants/InsuranceEnum.java

@@ -24,7 +24,7 @@ public enum InsuranceEnum {
     AZCN("AZCN", "京东安联财产保险有限公司", ""),
     BGIC("BGIC", "北部湾财产保险股份有限公司", ""),
     BOCI("BOCI", "中银保险有限公司", ""),
-    BPIC("BPIC", "渤海财产保险股份有限公司", ""),
+    BPIC("BPIC", "渤海财产保险股份有限公司", "bohai"),
     CAIC("CAIC", "长安责任保险股份有限公司", ""),
     CATH("CATH", "国泰财产保险有限责任公司", ""),
     CCBP("CCBP", "建信财产保险有限公司", ""),

+ 26 - 0
src/main/java/com/ydtech/constants/enums/dict/insurance/Property.java

@@ -0,0 +1,26 @@
+package com.ydtech.constants.enums.dict.insurance;
+
+import com.ydtech.aop.request.DictEnum;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+@DictEnum(key = "property", desc = "(车辆用途)非营业")
+public enum Property {
+
+    P_1("1", "个人", 1, 0),
+    P_2("2", "企业", 2, 0),
+    P_3("3", "机关", 3, 0);
+
+    // 编号
+    private final String code;
+    // 说明
+    private final String desc;
+    // 排序
+    private final Integer sort;
+    // 状态  0 启用  1 不启用
+    private final Integer status;
+
+
+}

+ 4 - 0
src/main/java/com/ydtech/modules/ins/model/vo/CarInfoVo.java

@@ -165,6 +165,10 @@ public class CarInfoVo {
     @ApiModelProperty(value = "车辆用途")
     private String vehicleUse;
 
+    /**
+     * 所属性质
+     * @see com.ydtech.constants.enums.dict.insurance.Property
+     */
     @ApiModelProperty(value = "所属性质(1个人 2企业 3机关)")
     private String property;
 

+ 86 - 0
src/main/java/com/ydtech/modules/order/components/bohai/BoHaiRequestApiComponent.java

@@ -0,0 +1,86 @@
+package com.ydtech.modules.order.components.bohai;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.ydtech.config.properties.BohaiApiConfigurationProperties;
+import com.ydtech.constants.InsuranceEnum;
+import com.ydtech.modules.order.entity.api.bohai.BoHaiEncrypted;
+import com.ydtech.modules.order.entity.api.bohai.request.BoHaiBaseRequest;
+import com.ydtech.modules.order.entity.api.bohai.request.GenerateOrderNoRequest;
+import com.ydtech.modules.order.entity.api.bohai.response.BoHaiBaseResponse;
+import com.ydtech.modules.order.entity.api.bohai.response.GenerateOrderNoResponse;
+import com.ydtech.modules.order.utils.InsuranceLog;
+import com.ydtech.modules.order.utils.SignatureUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+
+/**
+ * @description: 渤海财险
+ * @author: wenks
+ * @date: 2024/3/6 14:45
+ **/
+@Component
+@RequiredArgsConstructor
+public class BoHaiRequestApiComponent {
+
+    private final BohaiApiConfigurationProperties properties;
+
+    private final RestTemplate restTemplate;
+
+
+    /**
+     * 加密请求
+     *
+     * @param q      请求参数
+     * @param url    请求url
+     * @param tClass 响应类型
+     * @param <Q>    Request 请求体
+     * @param <S>    Response 响应体
+     * @return <S>
+     */
+    private <Q extends BoHaiBaseRequest, S extends BoHaiBaseResponse> S post(Q q, String url, Class<S> tClass) throws Exception {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+        String busReqString = JSON.toJSONString(q, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
+        InsuranceLog.infoLog(InsuranceEnum.BPIC.getPinyin(), "\n\t---------> URl: {} \n---------> 请求参数:{}", url, busReqString);
+
+        BoHaiEncrypted boHaiEncrypted = new BoHaiEncrypted(busReqString, properties);
+        String json = JSON.toJSONString(boHaiEncrypted, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
+
+        // 获取请求头
+        Map<String, String> stringStringMap = SignatureUtils.encryptAndSign(properties.getSelfPrivateKey(),
+                properties.getBoHaiPublicKey(), json, true, true);
+        String signature = stringStringMap.get("signature");
+        String content = stringStringMap.get("content");
+        httpHeaders.set("signature", signature);
+        InsuranceLog.infoLog(InsuranceEnum.BPIC.getPinyin(), "\n\t---------> 加密后的参数:{}", content);
+
+        HttpEntity<String> httpEntity = new HttpEntity<>(content, httpHeaders);
+        //----加密endding------------
+        ResponseEntity<String> response = restTemplate.postForEntity(url, httpEntity, String.class);
+        String body = response.getBody();
+        InsuranceLog.infoLog(InsuranceEnum.BPIC.getPinyin(), "\n\t---------> 解密前的参数:{}", body);
+
+        return null;
+    }
+
+
+
+
+    public GenerateOrderNoResponse generateOrderNo(GenerateOrderNoRequest request) throws Exception {
+        return post(request, properties.getUrl(), GenerateOrderNoResponse.class);
+    }
+
+
+
+
+}

+ 105 - 0
src/main/java/com/ydtech/modules/order/controller/BoHaiOrderApiController.java

@@ -0,0 +1,105 @@
+package com.ydtech.modules.order.controller;
+
+
+import com.ydtech.aop.request.RequestSingleParam;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.aop.QuoteVerification;
+import com.ydtech.modules.order.components.InsOrdersComponents;
+import com.ydtech.modules.order.entity.api.zijin.request.PaymentCallbacksRequest;
+import com.ydtech.modules.order.entity.api.zijin.request.SubmitVerifyRequest;
+import com.ydtech.modules.order.entity.api.zijin.response.QueryClauseDataResponse;
+import com.ydtech.modules.order.entity.api.zijin.response.QueryVehicProductsResponse;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
+import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
+import com.ydtech.modules.order.entity.vo.zj.ZjVehicleProductsQueryVo;
+import com.ydtech.modules.order.service.BoHaiOrderApiService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+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 java.util.List;
+
+@Api(tags = "渤海财险 API ")
+@Slf4j
+@RestController
+@RequestMapping("/order/boHaiApi")
+@RequiredArgsConstructor
+public class BoHaiOrderApiController {
+
+    private final BoHaiOrderApiService boHaiOrderApiService;
+
+    private final InsOrdersComponents insOrdersComponents;
+
+    @PostMapping("/queryVehicleProducts")
+    @ApiOperation(value = "查询“车+意”中意外险方案信息")
+    public HttpResult<List<QueryVehicProductsResponse.ProductDtoListDTO>> queryVehicleProducts(@RequestBody ZjVehicleProductsQueryVo zjVehicleProductsVo) {
+        return this.boHaiOrderApiService.queryVehicleProducts(zjVehicleProductsVo);
+    }
+
+    @QuoteVerification("报价授权")
+    @PostMapping("/quote")
+    @ApiOperation("报价")
+    public HttpResult<QuoteRespVo> quote(@RequestBody BaseQuoteVo<List<ZjQuoteAccidentVo>> quoteVo) {
+        BaseQuoteInfoVo quoteInfo = this.insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(), quoteVo.getAgreementId());
+        return this.boHaiOrderApiService.quote(quoteInfo, quoteVo);
+    }
+
+    @PostMapping(value = "/submitImage")
+    @ApiOperation(value = "提交影像信息")
+    public HttpResult<Object> submitImage(@RequestSingleParam(value = "companyId") String companyId) {
+        return this.boHaiOrderApiService.submitImage(companyId);
+    }
+
+    @PostMapping(value = "/queryClauseData")
+    @ApiOperation(value = "特约查询")
+    public HttpResult<List<QueryClauseDataResponse.ClauseInfoDtoListDTO>> queryClauseData(@RequestSingleParam(value = "companyId") String companyId) {
+        return this.boHaiOrderApiService.queryClauseData(companyId);
+    }
+
+    @PostMapping(value = "/audit")
+    @ApiOperation(value = "提交核保")
+    public HttpResult<Object> audit(@RequestBody SpecialAuditVo<SubmitVerifyRequest.EngageListDTO> specialAudit) {
+        return this.boHaiOrderApiService.audit(specialAudit);
+    }
+
+    @PostMapping(value = "/cancel")
+    @ApiOperation(value = "未缴费保单撤单")
+    public HttpResult<Object> cancel(@RequestSingleParam(value = "companyId") String companyId) {
+        return this.boHaiOrderApiService.cancel(companyId);
+    }
+
+    @PostMapping("/paymentCallbacks")
+    @ApiOperation(value = "支付回调")
+    public HttpResult<Object> paymentCallbacks(PaymentCallbacksRequest paymentCallbacksRequest) {
+        return this.boHaiOrderApiService.paymentCallbacks(paymentCallbacksRequest);
+    }
+
+    @PostMapping("/getOrderDetail")
+    @ApiOperation(value = "订单状态查询")
+    public HttpResult<Object> getOrderDetail(@RequestSingleParam(value = "companyId") String companyId) {
+        return this.boHaiOrderApiService.getOrderDetail(companyId);
+    }
+
+    @PostMapping("/getPolicyPrint")
+    @ApiOperation(value = "电子保单")
+    public HttpResult<String> getPolicyPrint(@RequestBody PolicyPrintVo policyPrintVo) {
+        return this.boHaiOrderApiService.getPolicyPrint(policyPrintVo);
+    }
+
+    @PostMapping("/auditStatusQuery")
+    @ApiOperation(value = "核保状态查询")
+    public HttpResult<Object> auditStatusQuery(@RequestSingleParam(value = "companyId") String companyId) {
+        return this.boHaiOrderApiService.auditStatusQuery(companyId);
+    }
+
+
+}

+ 47 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/BoHaiEncrypted.java

@@ -0,0 +1,47 @@
+package com.ydtech.modules.order.entity.api.bohai;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.config.properties.BohaiApiConfigurationProperties;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+
+/**
+ * @description: 国任财险请求加密
+ * @author: wenks
+ * @date: 2024/3/6 14:54
+ **/
+@NoArgsConstructor
+@Data
+public class BoHaiEncrypted implements Serializable {
+
+    private static final long serialVersionUID = -1988710813171274356L;
+
+    /**
+     * 业务数据加密串
+     */
+    @JsonProperty("bizContent")
+    private String bizContent;
+    /**
+     * 合作方代码,由渤海分配
+     */
+    @JsonProperty("insurerCode")
+    private String insurerCode;
+
+    /**
+     * 配置
+     */
+    @JsonProperty("sysSourceCode")
+    private String sysSourceCode;
+
+
+    public BoHaiEncrypted(String bizContent, BohaiApiConfigurationProperties properties) {
+        this.bizContent = bizContent;
+        this.insurerCode = properties.getInsurerCode();
+        this.sysSourceCode = properties.getSysSourceCode();
+    }
+
+
+}

+ 24 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleAffNature.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.order.entity.api.bohai.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @description: 渤海财险 车辆所属性质代码
+ * @author: wenks
+ * @date: 2024/3/6 18:19
+ **/
+@Getter
+@AllArgsConstructor
+public enum VehicleAffNature {
+
+    VAN_1("1", "个人"),
+    VAN_2("2", "机关"),
+    VAN_3("3", "企业");
+
+    private final String code;
+
+    private final String desc;
+
+}

+ 26 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleKind.java

@@ -0,0 +1,26 @@
+package com.ydtech.modules.order.entity.api.bohai.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+/**
+ * @description: 渤海财险 车辆种类
+ * @author: wenks
+ * @date: 2024/3/6 18:19
+ **/
+
+@Getter
+@AllArgsConstructor
+public enum VehicleKind {
+
+    VK_A0("11", "客车"),
+    VK_A1("21", "货车"),
+    VK_A2("25", "货车");
+
+    private final String code;
+
+    private final String desc;
+
+}

+ 23 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleUsage.java

@@ -0,0 +1,23 @@
+package com.ydtech.modules.order.entity.api.bohai.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @description: 渤海财险 车辆使用性质
+ * @author: wenks
+ * @date: 2024/3/6 18:22
+ **/
+@Getter
+@AllArgsConstructor
+public enum VehicleUsage {
+
+    VU_01("100",	"营业"),
+    VU_02("200",	"非营业");
+
+    private final String code;
+
+    private final String desc;
+
+}

+ 24 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/VehicleUsageDetail.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.order.entity.api.bohai.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum VehicleUsageDetail {
+
+    VUD_01("101", "营业出租租赁"),
+    VUD_02("102", "营业城公交"),
+    VUD_03("103", "营业公路客运"),
+    VUD_04("105", "营业货运"),
+    VUD_05("253", "家庭自用"),
+    VUD_06("230", "非营业机关"),
+    VUD_07("220", "非营业企业"),
+    VUD_08("240", "非营业货运");
+
+    // 编号
+    private final String code;
+    // 说明
+    private final String desc;
+}

+ 4 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/BohaiBaseRequest.java → src/main/java/com/ydtech/modules/order/entity/api/bohai/request/BoHaiBaseRequest.java

@@ -8,7 +8,7 @@ import java.io.Serializable;
 
 @NoArgsConstructor
 @Data
-public class BohaiBaseRequest implements Serializable {
+public class BoHaiBaseRequest implements Serializable {
 
     private static final long serialVersionUID = -489340818664271735L;
 
@@ -36,6 +36,9 @@ public class BohaiBaseRequest implements Serializable {
         @JsonProperty("ip")
         private String ip;
 
+        @JsonProperty("insurerBranchCode")
+        private String insurerBranchCode;
+
         @JsonProperty("franchiserInstitutionCode")
         private String franchiserInstitutionCode;
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/ElectronicPolicyRequest.java

@@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class ElectronicPolicyRequest extends BohaiBaseRequest{
+public class ElectronicPolicyRequest extends BoHaiBaseRequest {
 
     private static final long serialVersionUID = 6662090847203132477L;
 

+ 46 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/GenerateOrderNoRequest.java

@@ -0,0 +1,46 @@
+package com.ydtech.modules.order.entity.api.bohai.request;
+
+
+import com.ydtech.modules.order.entity.api.bohai.constants.RequestType;
+import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.UUID;
+
+/**
+ * @description: 渤海财险 生成订单接口
+ * @author: wenks
+ * @date: 2024/3/6 15:50
+ **/
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class GenerateOrderNoRequest extends BoHaiBaseRequest {
+
+    private static final long serialVersionUID = 8713399532011104295L;
+
+    public GenerateOrderNoRequest(BoHaiConfigureParameters parameters) {
+
+
+        this.setBaseParam(new BaseParamDTO());
+        this.getBaseParam().setFranchiserChannel(new BaseParamDTO.FranchiserChannelDTO());
+        this.getBaseParam().getFranchiserChannel().setFranchiserChannelId(parameters.getFranchiserChannelId());
+        this.getBaseParam().setFranchiserInstitutionCode(parameters.getFranchiserInstitutionCode());
+        this.getBaseParam().setInsurerBranchCode(parameters.getInsurerBranchCode());
+        String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
+        this.getBaseParam().setRequestTime(now);
+        this.getBaseParam().setRequestType(RequestType.Z00002.getCode());
+        this.getBaseParam().setIp("118.81.124.183");
+        this.getBaseParam().setRequestNo(UUID.randomUUID().toString().replace("-", ""));
+
+    }
+
+
+
+
+
+}

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/ImageUploadRequest.java

@@ -17,7 +17,7 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class ImageUploadRequest extends BohaiBaseRequest {
+public class ImageUploadRequest extends BoHaiBaseRequest {
 
     private static final long serialVersionUID = -1181756921642403577L;
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/QuotationRequest.java

@@ -14,7 +14,7 @@ import java.util.List;
  **/
 @NoArgsConstructor
 @Data
-public class QuotationRequest extends BohaiBaseRequest {
+public class QuotationRequest extends BoHaiBaseRequest {
 
     private static final long serialVersionUID = -7695992388798928886L;
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/UnderwritingRequest.java

@@ -10,7 +10,7 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class UnderwritingRequest extends BohaiBaseRequest{
+public class UnderwritingRequest extends BoHaiBaseRequest {
     private static final long serialVersionUID = -5144990999677705223L;
 
     @JsonProperty("businessPolicy")

+ 154 - 8
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleConfirmationReqeust.java

@@ -1,6 +1,14 @@
 package com.ydtech.modules.order.entity.api.bohai.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.modules.order.entity.api.bohai.constants.VehicleAffNature;
+import com.ydtech.modules.order.entity.api.bohai.constants.VehicleKind;
+import com.ydtech.modules.order.entity.api.bohai.constants.VehicleUsage;
+import com.ydtech.modules.order.entity.api.bohai.constants.VehicleUsageDetail;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.utils.StringUtils;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -16,7 +24,7 @@ import java.io.Serializable;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class VehicleConfirmationReqeust extends BohaiBaseRequest {
+public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
 
     private static final long serialVersionUID = -3897773355946250398L;
 
@@ -30,74 +38,194 @@ public class VehicleConfirmationReqeust extends BohaiBaseRequest {
     private HolderDTO holder;
 
     @JsonProperty("insureder")
-
     private InsurederDTO insureder;
 
+
+    public VehicleConfirmationReqeust(BaseQuoteInfoVo quoteInfoVo) {
+        // 车辆信息
+        CarInfoVo carInfo = quoteInfoVo.getCarInfo();
+        this.vehicle = new VehicleDTO(carInfo);
+
+        // 车主
+        CustomerInfoVo ownerInfo = quoteInfoVo.getOwnerInfo();
+        this.carOwner = new CarOwnerDTO(ownerInfo);
+
+        // 投保人
+        CustomerInfoVo policyHolderInfo = quoteInfoVo.getPolicyHolderInfo();
+        this.holder = new HolderDTO(policyHolderInfo);
+
+        // 被保人
+        CustomerInfoVo insuredPersonInfo = quoteInfoVo.getInsuredPersonInfo();
+        this.insureder = new InsurederDTO(insuredPersonInfo);
+
+    }
+
     @NoArgsConstructor
     @Data
     public static class VehicleDTO implements Serializable {
 
+        private static final long serialVersionUID = -2343894775576071422L;
+
+        /**
+         * 车辆识别代号/车架号
+         */
         @JsonProperty("carVin")
         private String carVin;
 
+        /**
+         * 车型编码
+         */
         @JsonProperty("vehicleModelCode")
         private String vehicleModelCode;
 
+        /**
+         * 发动机号
+         */
         @JsonProperty("engineNo")
         private String engineNo;
 
+        /**
+         * 号牌号码
+         */
         @JsonProperty("plateNo")
         private String plateNo;
 
+        /**
+         * 初登日期
+         */
         @JsonProperty("registerDate")
         private String registerDate;
 
+        /**
+         * 指导价格
+         */
         @JsonProperty("purchasePrice")
         private String purchasePrice;
 
-        @JsonProperty("specialCarFlag")
-        private String specialCarFlag;
-
+        /**
+         * 是否新车
+         */
         @JsonProperty("newVehicleFlag")
         private String newVehicleFlag;
 
+        /**
+         * 车型名称 (品牌型号)
+         */
         @JsonProperty("moldName")
         private String moldName;
 
+        /**
+         * 座位数
+         */
         @JsonProperty("seatCount")
         private String seatCount;
 
+
         @JsonProperty("purchaseinvoicesDate")
         private String purchaseinvoicesDate;
 
+        /**
+         * 核定载质量(KG)
+         */
         @JsonProperty("tonNumber")
         private String tonNumber;
 
+        /**
+         * 燃料类型
+         */
         @JsonProperty("fuelType")
         private String fuelType;
 
+        /**
+         * 整备质量(KG)
+         */
         @JsonProperty("emptyWeight")
         private String emptyWeight;
 
+        /**
+         * 排气量(L)
+         */
         @JsonProperty("exhaustMeasure")
         private String exhaustMeasure;
 
+        /**
+         * 车辆种类
+         */
         @JsonProperty("vehicleKind")
         private String vehicleKind;
 
+        /**
+         * 车辆所属性质
+         */
         @JsonProperty("vehicleAffNature")
         private String vehicleAffNature;
 
+        /**
+         * 车辆使用性质
+         */
         @JsonProperty("vehicleUsage")
         private String vehicleUsage;
 
+        /**
+         * 车辆使用性质细分
+         */
+        @JsonProperty("vehicleUsageDetail")
+        private String vehicleUsageDetail;
+
+        /**
+         * 是否过户
+         */
         @JsonProperty("isTransfer")
         private String isTransfer;
+
+        /**
+         * 过户日期
+         */
+        @JsonProperty("transferDate")
+        private String transferDate;
+
+        public VehicleDTO(CarInfoVo carInfo) {
+            this.carVin = carInfo.getVinNo();
+            this.vehicleModelCode = vehicleModelCode;
+
+            this.engineNo = carInfo.getEngineNo();
+            this.plateNo = carInfo.getLicenseNo();
+            this.registerDate = carInfo.getRegisterDate();
+
+            this.purchasePrice = purchasePrice;
+
+            // 新车
+            this.newVehicleFlag = StringUtils.isNotEmpty(carInfo.getLicenseNo()) ? "0" : "1";
+
+            this.moldName = moldName;
+
+            this.seatCount = carInfo.getSeatCount();
+            this.tonNumber = carInfo.getLimitLoad();
+
+            this.fuelType = carInfo.getEnergyType();
+            this.emptyWeight = carInfo.getCompleteKerbMass();
+
+            this.exhaustMeasure = exhaustMeasure;
+
+            VehicleKind vehicleKindEnum = VehicleKind.valueOf(carInfo.getCimodelclass());
+            this.vehicleKind = vehicleKindEnum.getCode();
+            this.vehicleAffNature = VehicleAffNature.VAN_1.getCode();
+            VehicleUsage vehicleUsageEnum = VehicleUsage.valueOf(carInfo.getCarnature());
+            this.vehicleUsage = vehicleUsageEnum.getCode();
+            VehicleUsageDetail vehicleUsageDetailEnum = VehicleUsageDetail.valueOf(carInfo.getVehicleUse());
+            this.vehicleUsageDetail = vehicleUsageDetailEnum.getCode();
+            this.isTransfer = carInfo.isTransferFlag() ? "1" : "0";
+            this.transferDate = carInfo.getTransferDate();
+
+        }
     }
 
     @NoArgsConstructor
     @Data
-    public static class CarOwnerDTO {
+    public static class CarOwnerDTO implements Serializable {
+
+        private static final long serialVersionUID = 8709315851618789033L;
+
         @JsonProperty("certType")
         private String certType;
 
@@ -112,11 +240,17 @@ public class VehicleConfirmationReqeust extends BohaiBaseRequest {
 
         @JsonProperty("phoneNumber")
         private String phoneNumber;
+
+        public CarOwnerDTO(CustomerInfoVo ownerInfo) {
+
+        }
     }
 
     @NoArgsConstructor
     @Data
-    public static class HolderDTO {
+    public static class HolderDTO implements Serializable {
+
+        private static final long serialVersionUID = -2088635630636574306L;
 
         @JsonProperty("certType")
         private String certType;
@@ -162,11 +296,18 @@ public class VehicleConfirmationReqeust extends BohaiBaseRequest {
 
         @JsonProperty("elecApplicationFlag")
         private String elecApplicationFlag;
+
+        public HolderDTO(CustomerInfoVo policyHolderInfo) {
+
+        }
     }
 
     @NoArgsConstructor
     @Data
-    public static class InsurederDTO {
+    public static class InsurederDTO implements Serializable {
+
+        private static final long serialVersionUID = 1045840175935280892L;
+
         @JsonProperty("certType")
         private String certType;
 
@@ -193,5 +334,10 @@ public class VehicleConfirmationReqeust extends BohaiBaseRequest {
 
         @JsonProperty("certiType")
         private String certiType;
+
+        public InsurederDTO(CustomerInfoVo insuredPersonInfo) {
+
+
+        }
     }
 }

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleTypeQueryRequest.java

@@ -14,7 +14,7 @@ import lombok.NoArgsConstructor;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class VehicleTypeQueryRequest extends BohaiBaseRequest {
+public class VehicleTypeQueryRequest extends BoHaiBaseRequest {
 
     private static final long serialVersionUID = 895674542981964966L;
 

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

@@ -9,7 +9,7 @@ import java.io.Serializable;
 
 @NoArgsConstructor
 @Data
-public class BohaiBaseResponse implements Serializable {
+public class BoHaiBaseResponse implements Serializable {
 
     private static final long serialVersionUID = -9181769167087164902L;
 

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

@@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class ElectronicPolicyResponse extends BohaiBaseResponse{
+public class ElectronicPolicyResponse extends BoHaiBaseResponse {
 
     private static final long serialVersionUID = -6579348094955612464L;
 

+ 26 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/response/GenerateOrderNoResponse.java

@@ -0,0 +1,26 @@
+package com.ydtech.modules.order.entity.api.bohai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class GenerateOrderNoResponse extends BoHaiBaseResponse{
+
+    private static final long serialVersionUID = -2484273134957187041L;
+
+    @JsonProperty("data")
+    private DataDTO data;
+
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+
+        @JsonProperty("orderNo")
+        private String orderNo;
+    }
+
+}

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

@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class ImageUploadResponse extends BohaiBaseResponse {
+public class ImageUploadResponse extends BoHaiBaseResponse {
 
     private static final long serialVersionUID = -7592136960014445159L;
 

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

@@ -10,7 +10,7 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class QuotationResponse extends BohaiBaseResponse {
+public class QuotationResponse extends BoHaiBaseResponse {
 
     private static final long serialVersionUID = 8400108878099661258L;
 

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

@@ -11,7 +11,7 @@ import java.util.List;
 @NoArgsConstructor
 @EqualsAndHashCode(callSuper = true)
 @Data
-public class UnderwritingResponse extends BohaiBaseResponse  {
+public class UnderwritingResponse extends BoHaiBaseResponse {
 
     private static final long serialVersionUID = -5864520337104413574L;
 

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

@@ -15,7 +15,7 @@ import java.util.List;
  **/
 @NoArgsConstructor
 @Data
-public class VehicleConfirmationResponse extends BohaiBaseResponse {
+public class VehicleConfirmationResponse extends BoHaiBaseResponse {
 
     private static final long serialVersionUID = -6468400287877400921L;
 

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

@@ -16,7 +16,7 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class VehicleTypeQueryResponse extends BohaiBaseResponse {
+public class VehicleTypeQueryResponse extends BoHaiBaseResponse {
 
     private static final long serialVersionUID = -3892555490586746320L;
 

+ 92 - 0
src/main/java/com/ydtech/modules/order/service/BoHaiOrderApiService.java

@@ -0,0 +1,92 @@
+package com.ydtech.modules.order.service;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.entity.api.zijin.request.PaymentCallbacksRequest;
+import com.ydtech.modules.order.entity.api.zijin.request.SubmitVerifyRequest;
+import com.ydtech.modules.order.entity.api.zijin.response.QueryClauseDataResponse;
+import com.ydtech.modules.order.entity.api.zijin.response.QueryVehicProductsResponse;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
+import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
+import com.ydtech.modules.order.entity.vo.zj.ZjVehicleProductsQueryVo;
+
+import java.util.List;
+
+public interface BoHaiOrderApiService {
+
+    /**
+     * 报价
+     *
+     * @param quoteInfoVo 报价实体
+     */
+    HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<ZjQuoteAccidentVo>> t);
+
+    /**
+     * 提交影像信息
+     *
+     * @param subOrderNo 子订单好
+     * @return HttpResult
+     */
+    HttpResult<Object> submitImage(String subOrderNo);
+
+    /**
+     * 特约查询
+     *
+     * @param companyId 子订单号
+     */
+    HttpResult<List<QueryClauseDataResponse.ClauseInfoDtoListDTO>> queryClauseData(String companyId);
+
+    /**
+     * 提交核保
+     *
+     * @param specialAudit 核保特约
+     */
+    HttpResult<Object> audit(SpecialAuditVo<SubmitVerifyRequest.EngageListDTO> specialAudit);
+
+    /**
+     * 获取驾意险
+     *
+     * @return 查询“车+意”中意外险方案信息
+     */
+    HttpResult<List<QueryVehicProductsResponse.ProductDtoListDTO>> queryVehicleProducts(ZjVehicleProductsQueryVo zjVehicleProductsVo);
+
+    /**
+     * 订单状态查询
+     *
+     * @param companyId 子订单号
+     */
+    HttpResult<Object> getOrderDetail(String companyId);
+
+    /**
+     * 未缴费保单撤单
+     *
+     * @param companyId 子订单号
+     */
+    HttpResult<Object> cancel(String companyId);
+
+    /**
+     * 获取电子保单
+     *
+     * @param policyPrintVo 获取保单实体
+     * @return 电子保单链接
+     */
+    HttpResult<String> getPolicyPrint(PolicyPrintVo policyPrintVo);
+
+    /**
+     * 支付回调
+     *
+     * @param paymentCallbacksRequest 支付回调实体
+     */
+    HttpResult<Object> paymentCallbacks(PaymentCallbacksRequest paymentCallbacksRequest);
+
+
+    /**
+     * 核保状态查询
+     * @param companyId 子订单号
+     */
+    HttpResult<Object> auditStatusQuery(String companyId);
+
+}

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

@@ -18,7 +18,7 @@ import java.util.List;
 public interface ZijinOrderApiService {
 
     /**
-     * 报价
+     * 1. 报价
      *
      * @param quoteInfoVo 报价实体
      */

+ 105 - 0
src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java

@@ -0,0 +1,105 @@
+package com.ydtech.modules.order.service.impl;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.components.ConfigureParametersComponents;
+import com.ydtech.modules.order.components.bohai.BoHaiRequestApiComponent;
+import com.ydtech.modules.order.entity.api.bohai.request.GenerateOrderNoRequest;
+import com.ydtech.modules.order.entity.api.bohai.request.VehicleTypeQueryRequest;
+import com.ydtech.modules.order.entity.api.bohai.response.GenerateOrderNoResponse;
+import com.ydtech.modules.order.entity.api.zijin.request.PaymentCallbacksRequest;
+import com.ydtech.modules.order.entity.api.zijin.request.SubmitVerifyRequest;
+import com.ydtech.modules.order.entity.api.zijin.response.QueryClauseDataResponse;
+import com.ydtech.modules.order.entity.api.zijin.response.QueryVehicProductsResponse;
+import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
+import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
+import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
+import com.ydtech.modules.order.entity.vo.zj.ZjVehicleProductsQueryVo;
+import com.ydtech.modules.order.service.BoHaiOrderApiService;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+@RequiredArgsConstructor
+public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
+
+    private final PtlAgreementAttributionService ptlAgreementAttributionService;
+
+    private final ConfigureParametersComponents configureParametersComponents;
+
+    private final BoHaiRequestApiComponent boHaiRequestApiComponent;
+
+    @Override
+    public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<ZjQuoteAccidentVo>> quoteVo) {
+        // 1. 协议id获取配置实体
+        String agreementId = quoteVo.getAgreementId();
+        // 账号信息
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
+        // 通过 协议id获取配置实体
+        BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class, ptlAgreementAttribution);
+        // 1.1 车型查询接口
+        GenerateOrderNoRequest generateOrderNoRequest = new GenerateOrderNoRequest(parameters);
+        try {
+            GenerateOrderNoResponse generateOrderNoResponse = boHaiRequestApiComponent.generateOrderNo(generateOrderNoRequest);
+
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public HttpResult<Object> submitImage(String subOrderNo) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<List<QueryClauseDataResponse.ClauseInfoDtoListDTO>> queryClauseData(String companyId) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<Object> audit(SpecialAuditVo<SubmitVerifyRequest.EngageListDTO> specialAudit) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<List<QueryVehicProductsResponse.ProductDtoListDTO>> queryVehicleProducts(ZjVehicleProductsQueryVo zjVehicleProductsVo) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<Object> getOrderDetail(String companyId) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<Object> cancel(String companyId) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<String> getPolicyPrint(PolicyPrintVo policyPrintVo) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<Object> paymentCallbacks(PaymentCallbacksRequest paymentCallbacksRequest) {
+        return null;
+    }
+
+    @Override
+    public HttpResult<Object> auditStatusQuery(String companyId) {
+        return null;
+    }
+}