Browse Source

中煤驾意险出单页面关联产品配置协议配置调整

li.pengfei 2 years ago
parent
commit
9b9dd52f42

+ 17 - 0
src/main/java/com/ydtech/modules/ins/model/vo/GeneralNonCarProductReqVo.java

@@ -0,0 +1,17 @@
+package com.ydtech.modules.ins.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 通用非车产品出单选择返回大对象(适用页面非车产品配置,协议配置费用后的产品)
+ */
+@Data
+@ApiModel("通用非车产品出单选择请求大对象(适用页面非车产品配置,协议配置费用后的产品)")
+public class GeneralNonCarProductReqVo {
+    @ApiModelProperty("协议代码")
+    private String agreementId;
+    @ApiModelProperty("座位数")
+    private String seatNum;
+}

+ 23 - 0
src/main/java/com/ydtech/modules/ins/model/vo/GeneralNonCarProductResVo.java

@@ -0,0 +1,23 @@
+package com.ydtech.modules.ins.model.vo;
+
+import com.ydtech.modules.protocol.entity.vo.PtlNonCarProductSchemeVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 通用非车产品出单选择返回大对象(适用页面非车产品配置,协议配置费用后的产品)
+ */
+@Data
+@ApiModel("通用非车产品出单选择返回大对象(适用页面非车产品配置,协议配置费用后的产品)")
+public class GeneralNonCarProductResVo {
+    @ApiModelProperty("产品代码")
+    private String productCode;
+    @ApiModelProperty("产品名称")
+    private String productName;
+    @ApiModelProperty("产品下方案明细")
+    private List<PtlNonCarProductSchemeVo> schemeList;
+
+}

+ 8 - 0
src/main/java/com/ydtech/modules/order/controller/ZhongMeiOrderApiController.java

@@ -4,6 +4,8 @@ package com.ydtech.modules.order.controller;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.config.properties.ZmApiConfigurationProperties;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.vo.GeneralNonCarProductReqVo;
+import com.ydtech.modules.ins.model.vo.GeneralNonCarProductResVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.order.aop.QuoteVerification;
@@ -99,4 +101,10 @@ public class ZhongMeiOrderApiController {
     public HttpResult<Object> auditStatusQuery(@RequestSingleParam(value = "companyId") String companyId) {
         return this.zhongMeiOrderApiService.auditStatusQuery(companyId);
     }
+
+    @PostMapping("/getDrivingInsurance")
+    @ApiOperation(value = "查询“车+意”中意外险方案信息")
+    public HttpResult<List<GeneralNonCarProductResVo>> getDrivingInsurance(@RequestBody GeneralNonCarProductReqVo reqVo) {
+        return this.zhongMeiOrderApiService.getDrivingInsurance(reqVo);
+    }
 }

+ 9 - 0
src/main/java/com/ydtech/modules/order/service/ZhongMeiOrderApiService.java

@@ -1,6 +1,8 @@
 package com.ydtech.modules.order.service;
 
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.vo.GeneralNonCarProductReqVo;
+import com.ydtech.modules.ins.model.vo.GeneralNonCarProductResVo;
 import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.order.entity.api.zhongmei.request.ApprovedRequest;
 import com.ydtech.modules.order.entity.api.zhongmei.request.CoverageRequest;
@@ -64,4 +66,11 @@ public interface ZhongMeiOrderApiService extends BaseOrderService<AccidentalDriv
      * @return
      */
     HttpResult<Object> auditStatusQuery(String companyId);
+
+    /**
+     * 查询非车险随车产品信息
+     * @param reqVo
+     * @return
+     */
+    HttpResult<List<GeneralNonCarProductResVo>> getDrivingInsurance(GeneralNonCarProductReqVo reqVo);
 }

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

@@ -37,7 +37,12 @@ import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
 import com.ydtech.modules.order.service.*;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementNonCarProductCosts;
+import com.ydtech.modules.protocol.entity.vo.PtlNonCarProductSchemeDetailVo;
+import com.ydtech.modules.protocol.entity.vo.PtlNonCarProductSchemeVo;
 import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
+import com.ydtech.modules.protocol.service.PtlAgreementNonCarProductCostsService;
+import com.ydtech.modules.protocol.service.PtlNonCarProductSchemeService;
 import com.ydtech.utils.CalculateUtils;
 import com.ydtech.utils.baidu.FileUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -75,6 +80,10 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
     private final ZhongmeiRepeatInsuranceComponents zhongmeiRepeatInsuranceComponents;
 
+    private final PtlAgreementNonCarProductCostsService ptlAgreementNonCarProductCostsService;
+
+    private final PtlNonCarProductSchemeService ptlNonCarProductSchemeService;
+
     @Value("${upload.file.path}")
     private String uploadFilePath;
 
@@ -87,7 +96,8 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
     public ZhongMeiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService,
                                        ZhongmeiRequestApiComponents zhongmeiRequestApiComponents, ZhongmeiRequestComponents zhongmeiRequestComponents,
                                        ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService,
-                                       FeeRuleSchemeService feeRuleSchemeService, InsFeeOrderService insFeeOrderService,ZhongmeiRepeatInsuranceComponents zhongmeiRepeatInsuranceComponents) {
+                                       FeeRuleSchemeService feeRuleSchemeService, InsFeeOrderService insFeeOrderService,ZhongmeiRepeatInsuranceComponents zhongmeiRepeatInsuranceComponents,
+                                       PtlAgreementNonCarProductCostsService ptlAgreementNonCarProductCostsService,PtlNonCarProductSchemeService ptlNonCarProductSchemeService) {
         this.insOrdersService = insOrdersService;
         this.insAreaCompanyService = insAreaCompanyService;
         this.insTaskImagesService = insTaskImagesService;
@@ -98,6 +108,8 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         this.feeRuleSchemeService = feeRuleSchemeService;
         this.insFeeOrderService = insFeeOrderService;
         this.zhongmeiRepeatInsuranceComponents = zhongmeiRepeatInsuranceComponents;
+        this.ptlAgreementNonCarProductCostsService=ptlAgreementNonCarProductCostsService;
+        this.ptlNonCarProductSchemeService=ptlNonCarProductSchemeService;
     }
 
     private void modelInquiry(String modelName, List<ModelsQueryResponse.SimpleStadarCarDTO> simpleStadarCarDTOS) {
@@ -521,6 +533,43 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         }
     }
 
+    /**
+     * 根据协议代码获取可选非车险产品方案信息
+     * @param reqVo
+     * @return
+     */
+    public HttpResult<List<GeneralNonCarProductResVo>> getDrivingInsurance(GeneralNonCarProductReqVo reqVo){
+        List<GeneralNonCarProductResVo> resultList=new ArrayList<>();
+        if(StringUtils.isNotEmpty(reqVo.getAgreementId())&&StringUtils.isNotEmpty(reqVo.getSeatNum())){
+            List<PtlAgreementNonCarProductCosts> productList= ptlAgreementNonCarProductCostsService.getByAgreementId(reqVo.getAgreementId());
+            if(productList!=null&&productList.size()>0){
+                for(PtlAgreementNonCarProductCosts tempProductDto:productList){
+                    GeneralNonCarProductResVo tempGeneralNonCarProductVo=new GeneralNonCarProductResVo();
+                    tempGeneralNonCarProductVo.setProductCode(tempProductDto.getProductId());
+                    tempGeneralNonCarProductVo.setProductName(tempProductDto.getProductName());
+                    List<PtlNonCarProductSchemeVo> schemeList=ptlNonCarProductSchemeService.findAllProductSchemeInfo(tempProductDto.getProductId());
+                    //处理保额信息
+                    for(PtlNonCarProductSchemeVo schemeVo:schemeList){
+                        double sumAmount=0.0;
+                        List<PtlNonCarProductSchemeDetailVo> specialInfoList=schemeVo.getSpecialInfo();
+                        for(PtlNonCarProductSchemeDetailVo detailVo:specialInfoList){
+                            if("1".equals(detailVo.getCountType())){
+                                sumAmount=sumAmount+Double.parseDouble(detailVo.getUnitAmount());
+                            }else if("2".equals(detailVo.getCountType())){
+                                sumAmount=sumAmount+(Double.parseDouble(detailVo.getUnitAmount())*Double.parseDouble(reqVo.getSeatNum()));
+                            }
+                        }
+                        schemeVo.setUnitAmount(String.valueOf(sumAmount));
+                        //默认带出时,投保份数默认1份
+                        schemeVo.setQuantity("1");
+                    }
+                    tempGeneralNonCarProductVo.setSchemeList(schemeList);
+                    resultList.add(tempGeneralNonCarProductVo);
+                }
+            }
+        }
+        return HttpResult.ok(resultList);
+    }
 }
 
 

+ 10 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlNonCarProductSchemeVo.java

@@ -32,6 +32,16 @@ public class PtlNonCarProductSchemeVo {
      */
     private String insuredNumLimit;
 
+    /**
+     * 单位保额
+     */
+    private String unitAmount;
+
+    /**
+     * 默认投保份数
+     */
+    private String quantity;
+
     /**
      * 保障明细
      */