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

海报管理接口修改 大家财险接口修改

785834757 2 éve
szülő
commit
d2fc467b7e

+ 2 - 3
src/main/java/com/ydtech/modules/admin/controller/SysPosterController.java

@@ -21,13 +21,12 @@ public class SysPosterController {
     @Autowired
     private SysPosterService sysPosterService;
 
-    @GetMapping(value = "/posterList")
+    @PostMapping(value = "/posterList")
     @ApiOperation(value = "海报列表")
     public HttpResult<Object> queryList(@RequestBody SysPosterQueryVo sysPoster){
         return HttpResult.ok(sysPosterService.posterList(sysPoster));
     }
 
-
     @GetMapping(value = "/posterListApp")
     @ApiOperation(value = "App海报列表")
     public HttpResult<Object> queryListApp(@RequestBody SysPosterQueryVo sysPoster){
@@ -39,7 +38,7 @@ public class SysPosterController {
     @PostMapping(value = "/addPoster")
     @ApiOperation(value = "添加海报")
     public HttpResult<Object> addPoster(@RequestBody SysPosterParamsVo sysPosterParamsVo){
-        return sysPosterService.save(sysPosterParamsVo.getType(),sysPosterParamsVo.getIds())?HttpResult.ok("添加成功"):HttpResult.error("添加失败");
+        return sysPosterService.save(sysPosterParamsVo.getType(),sysPosterParamsVo.getFileId())?HttpResult.ok("添加成功"):HttpResult.error("添加失败");
     }
 
     @PostMapping(value = "/delPoster")

+ 3 - 3
src/main/java/com/ydtech/modules/admin/model/vo/SysPosterParamsVo.java

@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
-public class SysPosterParamsVo extends PageRequest{
+public class SysPosterParamsVo{
     /**
      * 海报类型
      */
@@ -15,6 +15,6 @@ public class SysPosterParamsVo extends PageRequest{
     /**
      * 海报文件id
      */
-    @ApiModelProperty("海报文件id数组")
-    private String[] ids;
+    @ApiModelProperty("海报文件id")
+    private String fileId;
 }

+ 8 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysPosterQueryVo.java

@@ -1,22 +1,30 @@
 package com.ydtech.modules.admin.model.vo;
 
 import com.ydtech.core.page.PageRequest;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
 public class SysPosterQueryVo extends PageRequest {
+    @ApiModelProperty("id")
     private Long id;
 
+    @ApiModelProperty("海报类型")
     private String type;
 
+    @ApiModelProperty("海报名称")
     private String title;
 
+    @ApiModelProperty("文件id")
     private String fileId;
 
+    @ApiModelProperty("文件url")
     private String url;
 
+    @ApiModelProperty("修改时间")
     private String updateTime;
 
+    @ApiModelProperty("用户")
     private String username;
 }

+ 1 - 1
src/main/java/com/ydtech/modules/admin/service/SysPosterService.java

@@ -15,7 +15,7 @@ public interface SysPosterService extends IService<SysPoster> {
 
     List<SysPoster> posterList(SysPosterQueryVo sysPoster);
 
-    boolean save(String type,String[] ids);
+    boolean save(String type,String fileId);
 
 }
 

+ 12 - 16
src/main/java/com/ydtech/modules/admin/service/impl/SysPosterServiceImpl.java

@@ -48,27 +48,23 @@ public class SysPosterServiceImpl extends ServiceImpl<SysPosterMapper, SysPoster
 
     /**
      * 保存海报信息
-     * @param ids
+     * @param fileId
      * @return
      */
     @Override
-    @Transactional
-    public boolean save(String type,String[] ids) {
+    public boolean save(String type,String fileId) {
         try {
-            List<SysPoster> list = new ArrayList<>();
-            for (String id : ids) {
-                SysPoster sysPoster = new SysPoster();
-                sysPoster.setId(Long.parseLong(IdGenerate.nextId()));
-                sysPoster.setType(type);
-                sysPoster.setFileId(id);
-                InsUploadFiles byId = insUploadFilesService.getById(id);
-                if (Objects.isNull(byId)) {
-                    throw new RuntimeException("上传的图片文件不存在");
-                }
-                sysPoster.setTitle(byId.getFileName());
-                list.add(sysPoster);
+
+            SysPoster sysPoster = new SysPoster();
+            sysPoster.setId(Long.parseLong(IdGenerate.nextId()));
+            sysPoster.setType(type);
+            sysPoster.setFileId(fileId);
+            InsUploadFiles byId = insUploadFilesService.getById(fileId);
+            if (Objects.isNull(byId)) {
+                throw new RuntimeException("上传的图片文件不存在");
             }
-            this.saveBatch(list);
+            sysPoster.setTitle(byId.getFileName());
+            this.save(sysPoster);
             return true;
         }catch(Exception e){
             return false;

+ 10 - 2
src/main/java/com/ydtech/modules/order/controller/DaJiaOrderController.java

@@ -10,6 +10,8 @@ import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
 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.dajia.AccidentalInsuranceQueryVo;
+import com.ydtech.modules.order.entity.vo.guoren.NonAutoInsuranceQueryVo;
 import com.ydtech.modules.order.service.DaJiaOrderService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -70,7 +72,13 @@ public class DaJiaOrderController {
 
     @PostMapping(value = "/accidentalDrivingList")
     @ApiOperation(value = "驾意险列表")
-    public HttpResult<Object> accidentalDrivingList() {
-        return this.daJiaOrderService.accidentalDrivingList();
+    public HttpResult<Object> accidentalDrivingList(@RequestBody AccidentalInsuranceQueryVo queryVo) {
+        return this.daJiaOrderService.accidentalDrivingList(queryVo);
+    }
+
+    @PostMapping(value = "/accidentalDrivingInfo")
+    @ApiOperation(value = "驾意险详情")
+    public HttpResult<Object> accidentalDrivingInfo(String accidentalId) {
+        return this.daJiaOrderService.accidentalDrivingInfo(accidentalId);
     }
 }

+ 4 - 4
src/main/java/com/ydtech/modules/order/entity/api/dajia/constants/CCvrgNo.java

@@ -27,10 +27,10 @@ public enum CCvrgNo {
     NO035606("035606","","附加车轮单独损失险"),
     NO035607("035607","","附加发动机进水损坏除外特约条款"),
     NO035608("035608","","附加医保外医疗费用责任险(第三者责任保险)"),
-    NO035609("035609","","道路救援服务特约条款"),
-    NO035610("035610","","车辆安全检测特约条款"),
-    NO035611("035611","","代为驾驶服务特约条款"),
-    NO035612("035612","","代为送检服务特约条款"),
+    NO035609("035609","TY1","道路救援服务特约条款"),
+    NO035610("035610","TY2","车辆安全检测特约条款"),
+    NO035611("035611","TY3","代为驾驶服务特约条款"),
+    NO035612("035612","TY4","代为送检服务特约条款"),
     NO035613("035613","SY_FJ_YBW3","附加医保外医疗费用责任险(车上人员责任保险(司机))"),
     NO035614("035614","SY_FJ_YBW2","附加医保外医疗费用责任险(车上人员责任保险(乘客))"),
     NO035615("035615","","附加精神损害抚慰金责任险(车上人员责任保险(司机))"),

+ 19 - 0
src/main/java/com/ydtech/modules/order/entity/api/dajia/constants/CServiceTimes.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.order.entity.api.dajia.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 服务次数
+ */
+@AllArgsConstructor
+@Getter
+public enum CServiceTimes {
+    ST2(2,"2次"),
+    ST5(5,"5次"),
+    ST10(10,"10次"),
+    ST15(15,"15次"),
+    ST20(20,"20次");
+    public final Integer code;
+    public final String desc;
+}

+ 25 - 1
src/main/java/com/ydtech/modules/order/entity/api/dajia/request/ODR1009Request.java

@@ -296,6 +296,30 @@ public class ODR1009Request extends DaJiaBaseRequest {
                 coverageListDTO.setPassengerNLiabDaysLmt(seatCount - 1 + "");
                 coverageListDTO.setPassengerMoralDamageAmt(kindInfoVo.getUnitAmount());
                 coverageListDTOS.add(coverageListDTO);
+            }else if(kindInfoVo.getKindCode().equals(CCvrgNo.NO035609.getInsurCode())){
+                //道路救援服务特约条款
+                BodyDTO.coverageListDTO coverageListDTO = new BodyDTO.coverageListDTO();
+                coverageListDTO.setCvrgNo(CCvrgNo.NO035609.getCode());
+                coverageListDTO.setRoadRescueServices(String.valueOf(kindInfoVo.getServiceTimes()));
+                coverageListDTOS.add(coverageListDTO);
+            }else if(kindInfoVo.getKindCode().equals(CCvrgNo.NO035610.getInsurCode())) {
+                //车辆安全检测特约条款
+                BodyDTO.coverageListDTO coverageListDTO = new BodyDTO.coverageListDTO();
+                coverageListDTO.setCvrgNo(CCvrgNo.NO035610.getCode());
+                coverageListDTO.setVehicleSafetyInspectionServices(String.valueOf(kindInfoVo.getServiceTimes()));
+                coverageListDTOS.add(coverageListDTO);
+            }else if(kindInfoVo.getKindCode().equals(CCvrgNo.NO035611.getInsurCode())) {
+                //代为驾驶服务特约条款
+                BodyDTO.coverageListDTO coverageListDTO = new BodyDTO.coverageListDTO();
+                coverageListDTO.setCvrgNo(CCvrgNo.NO035611.getCode());
+                coverageListDTO.setDrivingServiceTimes(String.valueOf(kindInfoVo.getServiceTimes()));
+                coverageListDTOS.add(coverageListDTO);
+            }else if(kindInfoVo.getKindCode().equals(CCvrgNo.NO035612.getInsurCode())) {
+                //代为送检服务特约条款
+                BodyDTO.coverageListDTO coverageListDTO = new BodyDTO.coverageListDTO();
+                coverageListDTO.setCvrgNo(CCvrgNo.NO035612.getCode());
+                coverageListDTO.setInspectionServiceTimes(String.valueOf(kindInfoVo.getServiceTimes()));
+                coverageListDTOS.add(coverageListDTO);
             }
         });
         this.body.setCoverageList(coverageListDTOS);
@@ -340,7 +364,7 @@ public class ODR1009Request extends DaJiaBaseRequest {
             nvhPolicyListDTO.setNvhlPrm(insAccidentalDrivingDajia.getPrice().toString());
             //险别代码
             nvhPolicyListDTO.setNvDutyRiskCode(item.getCvrgCde());
-            nvhPolicyListDTO.setNvhlSumPrm(insAccidentalDrivingDajia.getPrice() * insAccidentalDrivingDajia.getQuantity() + "");
+            nvhPolicyListDTO.setNvhlSumPrm(insAccidentalDrivingDajia.getPrice() + "");
             nvhPolicyListDTOS.add(nvhPolicyListDTO);
         });
         return nvhPolicyListDTOS;

+ 20 - 0
src/main/java/com/ydtech/modules/order/entity/vo/dajia/AccidentalInsuranceQueryVo.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.order.entity.vo.dajia;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ApiModel("大家非车险查询VO")
+public class AccidentalInsuranceQueryVo implements Serializable {
+
+    private static final long serialVersionUID = 8016628984516940499L;
+
+    @ApiModelProperty("协议id")
+    private String agreementId;
+
+
+}

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/vo/dajia/InsAccidentalDrivingDajia.java

@@ -18,6 +18,9 @@ public class InsAccidentalDrivingDajia implements Serializable {
     @ApiModelProperty(value = "id")
     private Long id;
 
+    @ApiModelProperty(value = "协议id")
+    private Long agreementId;
+
     @ApiModelProperty(value = "渠道code")
     private String channelCode;
 

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/vo/dajia/InsAccidentalDrivingSubDajia.java

@@ -24,6 +24,9 @@ public class InsAccidentalDrivingSubDajia implements Serializable {
     @ApiModelProperty(value = "险种类型")
     private String cvrgType;
 
+    @ApiModelProperty(value = "险种名称")
+    private String cvrgName;
+
     @ApiModelProperty(value = "责任代码")
     private String responsisCde;
 

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

@@ -3,6 +3,7 @@ package com.ydtech.modules.order.service;
 
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.dajia.AccidentalInsuranceQueryVo;
 
 public interface DaJiaOrderService extends BaseOrderService<Object>{
 
@@ -32,7 +33,13 @@ public interface DaJiaOrderService extends BaseOrderService<Object>{
      * 获取驾意险列表
      * @return
      */
-    HttpResult<Object> accidentalDrivingList();
+    HttpResult<Object> accidentalDrivingList(AccidentalInsuranceQueryVo queryVo);
+
+    /**
+     * 获取驾意险详情
+     * @return
+     */
+    HttpResult<Object> accidentalDrivingInfo(String accidentalId);
 
 
 }

+ 24 - 12
src/main/java/com/ydtech/modules/order/service/impl/DaJiaOrderServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
@@ -34,6 +35,7 @@ import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
 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.dajia.AccidentalInsuranceQueryVo;
 import com.ydtech.modules.order.entity.vo.dajia.InsAccidentalDrivingDajia;
 import com.ydtech.modules.order.entity.vo.dajia.InsAccidentalDrivingSubDajia;
 import com.ydtech.modules.order.service.*;
@@ -46,6 +48,7 @@ import com.ydtech.utils.idgen.IdGenerate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.math.BigDecimal;
 import java.util.*;
@@ -221,19 +224,21 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
                     accidentalDriving, listByAccId, daJiaConfigureParameters, isEnergy);
             ODR1009Response odr1009Response = daJiaRequestApiComponents.newPremiumXnyCalculation(odr1009Request);
             NVHLODR1001Response nvhlodr1001Response = null;
-            if (!Objects.isNull(accidentalDrivingVo) && !accidentalDrivingVo.isEmpty()) {
-                //6.驾意险报价
-                NVHLODR1001Request nvhlodr1001Request = new NVHLODR1001Request(daJiaConfigureParameters, odr1009Response,
-                        quoteInfoVo, accidentalDriving, accidentalDrivingVo.getString("quantity"), policyHolderPersonArea,
-                        insuredPersonArea);
-                nvhlodr1001Response = daJiaRequestApiComponents.accidentPremiumCalculation(nvhlodr1001Request);
-                if (!"2000".equals(nvhlodr1001Response.getStatus())) {
-                    return HttpResult.error("驾意险报价失败");
-                }
-            }
+
 
             if (Message.M0000.getCode().equals(odr1009Response.getStatus())) {
 
+                if (!Objects.isNull(accidentalDrivingVo) && !accidentalDrivingVo.isEmpty()) {
+                    //6.驾意险报价
+                    NVHLODR1001Request nvhlodr1001Request = new NVHLODR1001Request(daJiaConfigureParameters, odr1009Response,
+                            quoteInfoVo, accidentalDriving, accidentalDrivingVo.getString("quantity"), policyHolderPersonArea,
+                            insuredPersonArea);
+                    nvhlodr1001Response = daJiaRequestApiComponents.accidentPremiumCalculation(nvhlodr1001Request);
+                    if (!"2000".equals(nvhlodr1001Response.getStatus())) {
+                        return HttpResult.error("驾意险报价失败");
+                    }
+                }
+
                 //保费计算接口返回
                 QuoteRespVo quoteRespVo = getQuoteRespVo(odr1009Response, quoteInfoVo, nvhlodr1001Response);
                 //添加调用费用匹配功能
@@ -767,11 +772,18 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
      * @return
      */
     @Override
-    public HttpResult<Object> accidentalDrivingList() {
-        List<InsAccidentalDrivingDajia> list = insAccidentalDrivingDaJiaService.list();
+    public HttpResult<Object> accidentalDrivingList(AccidentalInsuranceQueryVo queryVo) {
+        List<InsAccidentalDrivingDajia> list = insAccidentalDrivingDaJiaService.list(new LambdaQueryWrapper<InsAccidentalDrivingDajia>().eq(InsAccidentalDrivingDajia::getAgreementId, queryVo.getAgreementId()));
         return HttpResult.ok("获取驾意险列表成功", list);
     }
 
+    @Override
+    public HttpResult<Object> accidentalDrivingInfo(String accidentalId) {
+        List<InsAccidentalDrivingSubDajia> list = insAccidentalDrivingSubDaJiaService.list(new LambdaQueryWrapper<InsAccidentalDrivingSubDajia>().eq(InsAccidentalDrivingSubDajia::getAccId, accidentalId));
+        return HttpResult.ok("获取驾意险详情成功", list);
+    }
+
+
     private String gainCarInsPolicy(String url, String fileName, String licensePlate) {
         String dir = "carInsPolicy/" + licensePlate + "/";
         url = url.replaceAll("http://","https://");