|
@@ -3,36 +3,28 @@ package com.ydtech.modules.ins.controller;
|
|
|
|
|
|
|
|
import com.ydtech.aop.request.MethodLogAnnotation;
|
|
import com.ydtech.aop.request.MethodLogAnnotation;
|
|
|
import com.ydtech.aop.request.RequestSingleParam;
|
|
import com.ydtech.aop.request.RequestSingleParam;
|
|
|
-import com.ydtech.constants.enums.InsYcAccident;
|
|
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
-import com.ydtech.modules.esm.model.InsTaskImage;
|
|
|
|
|
import com.ydtech.modules.esm.service.InsTaskImageService;
|
|
import com.ydtech.modules.esm.service.InsTaskImageService;
|
|
|
import com.ydtech.modules.ins.model.ya.CarModel_Req;
|
|
import com.ydtech.modules.ins.model.ya.CarModel_Req;
|
|
|
import com.ydtech.modules.ins.model.yc.CallBackRequest;
|
|
import com.ydtech.modules.ins.model.yc.CallBackRequest;
|
|
|
-import com.ydtech.modules.ins.service.InsYongchengApiService;
|
|
|
|
|
|
|
+import com.ydtech.modules.ins.service.InsAlltrustApiService;
|
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
|
import com.ydtech.utils.Base64Utils;
|
|
import com.ydtech.utils.Base64Utils;
|
|
|
-import com.ydtech.utils.RedisUtils;
|
|
|
|
|
import com.ydtech.utils.StringUtils;
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
-import sun.misc.BASE64Decoder;
|
|
|
|
|
-import sun.misc.BASE64Encoder;
|
|
|
|
|
-
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -43,12 +35,12 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
@Api(tags = "永诚API方式对接")
|
|
@Api(tags = "永诚API方式对接")
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/api/yongCheng")
|
|
@RequestMapping("/api/yongCheng")
|
|
|
-public class InsYongChengApiController {
|
|
|
|
|
|
|
+public class InsAlltrustApiController {
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger("alltrust");
|
|
private static final Logger log = LoggerFactory.getLogger("alltrust");
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- InsYongchengApiService insYongchengApiService;
|
|
|
|
|
|
|
+ InsAlltrustApiService insYongchengApiService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
InsOrdersComponents insOrdersComponents;
|
|
InsOrdersComponents insOrdersComponents;
|
|
@@ -66,53 +58,37 @@ public class InsYongChengApiController {
|
|
|
@ApiOperation(value = "永诚API方式 - 报价")
|
|
@ApiOperation(value = "永诚API方式 - 报价")
|
|
|
@PostMapping("/quote")
|
|
@PostMapping("/quote")
|
|
|
@MethodLogAnnotation(title = "永诚API方式 - 报价")
|
|
@MethodLogAnnotation(title = "永诚API方式 - 报价")
|
|
|
- @ApiImplicitParams({
|
|
|
|
|
- @ApiImplicitParam(name = "orderNo", value = "订单号")
|
|
|
|
|
- })
|
|
|
|
|
- public HttpResult quoteApi(String orderNo) {
|
|
|
|
|
- BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(orderNo);
|
|
|
|
|
|
|
+ public HttpResult quoteApi(@RequestBody BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
|
|
|
|
|
+ BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
|
return insYongchengApiService.quoteApi(quoteInfo);
|
|
return insYongchengApiService.quoteApi(quoteInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "永诚API方式 - 核保")
|
|
@ApiOperation(value = "永诚API方式 - 核保")
|
|
|
@PostMapping("/audit")
|
|
@PostMapping("/audit")
|
|
|
@MethodLogAnnotation(title = "永诚API方式 - 核保")
|
|
@MethodLogAnnotation(title = "永诚API方式 - 核保")
|
|
|
- @ApiImplicitParams({
|
|
|
|
|
- @ApiImplicitParam(name = "quoteOrderNo", value = "报价订单号")
|
|
|
|
|
- })
|
|
|
|
|
- public HttpResult auditApi(String quoteOrderNo) {
|
|
|
|
|
- return insYongchengApiService.auditApi(quoteOrderNo);
|
|
|
|
|
|
|
+ public HttpResult auditApi(@RequestSingleParam(value = "companyId") String companyId) {
|
|
|
|
|
+ return insYongchengApiService.auditApi(companyId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "永诚API方式 - 影像上传")
|
|
@ApiOperation(value = "永诚API方式 - 影像上传")
|
|
|
@PostMapping(value = "/UploadImage")
|
|
@PostMapping(value = "/UploadImage")
|
|
|
- @ApiImplicitParams({
|
|
|
|
|
- @ApiImplicitParam(name = "quoteNo", value = "报价号"),
|
|
|
|
|
- @ApiImplicitParam(name = "quoteOrderNo", value = "报价订单号")
|
|
|
|
|
- })
|
|
|
|
|
- public HttpResult UploadImageApi(String quoteNo, String quoteOrderNo) {
|
|
|
|
|
- List<InsTaskImage> insTaskImage = insTaskImageService.selectByTaskId(quoteNo);
|
|
|
|
|
- return insYongchengApiService.UploadImageApi(insTaskImage, quoteOrderNo);
|
|
|
|
|
|
|
+ public HttpResult UploadImageApi(@RequestSingleParam(value = "companyId") String companyId) {
|
|
|
|
|
+
|
|
|
|
|
+ return insYongchengApiService.UploadImageApi(companyId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "永诚API方式 - 获取支付链接")
|
|
@ApiOperation(value = "永诚API方式 - 获取支付链接")
|
|
|
@PostMapping("/getPayUrl")
|
|
@PostMapping("/getPayUrl")
|
|
|
- @ApiImplicitParams({
|
|
|
|
|
- @ApiImplicitParam(name = "quoteOrderNo", value = "报价订单号")
|
|
|
|
|
- })
|
|
|
|
|
- public HttpResult getPayUrl(String quoteOrderNo) {
|
|
|
|
|
- return insYongchengApiService.getPayUrlApi(quoteOrderNo);
|
|
|
|
|
|
|
+ public HttpResult getPayUrl(@RequestSingleParam(value = "companyId") String companyId) {
|
|
|
|
|
+ return insYongchengApiService.getPayUrlApi(companyId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "永诚API方式 - 补传回调及订单信息查询接口")
|
|
@ApiOperation(value = "永诚API方式 - 补传回调及订单信息查询接口")
|
|
|
@PostMapping("/callbackAnOrder")
|
|
@PostMapping("/callbackAnOrder")
|
|
|
- @ApiImplicitParams({
|
|
|
|
|
- @ApiImplicitParam(name = "quoteOrderNo", value = "报价订单号")
|
|
|
|
|
- })
|
|
|
|
|
- public HttpResult callbackAnOrder(String quoteOrderNo) {
|
|
|
|
|
- return insYongchengApiService.callbackAnOrder(quoteOrderNo);
|
|
|
|
|
|
|
+ public HttpResult callbackAnOrder(@RequestSingleParam(value = "companyId") String companyId) {
|
|
|
|
|
+ return insYongchengApiService.callbackAnOrder(companyId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -174,24 +150,12 @@ public class InsYongChengApiController {
|
|
|
@ApiOperation(value = "永诚API方式 -电子保单")
|
|
@ApiOperation(value = "永诚API方式 -电子保单")
|
|
|
@PostMapping("/getPolicyPrint")
|
|
@PostMapping("/getPolicyPrint")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "quoteOrderNo", value = "报价订单号"),
|
|
|
|
|
|
|
+ @ApiImplicitParam(name = "companyId",required = true, value = "报价订单号"),
|
|
|
@ApiImplicitParam(name = "type", value = "类型,1交强,2商业")
|
|
@ApiImplicitParam(name = "type", value = "类型,1交强,2商业")
|
|
|
})
|
|
})
|
|
|
- public HttpResult getPolicyPrintApi(String quoteOrderNo,String type) {
|
|
|
|
|
-// //子订单
|
|
|
|
|
-// InsAreaCompany iac = insAreaCompanyService.getById(companyId);
|
|
|
|
|
-// iac.getPaymentLink()
|
|
|
|
|
- return insYongchengApiService.getPolicyPrintApi(quoteOrderNo,StringUtils.toString(type,"1"));
|
|
|
|
|
|
|
+ public HttpResult getPolicyPrintApi(String companyId,String type) {
|
|
|
|
|
+ return insYongchengApiService.getPolicyPrintApi(companyId,StringUtils.toString(type,"1"));
|
|
|
}
|
|
}
|
|
|
-//
|
|
|
|
|
-// /*
|
|
|
|
|
-// 02-车险电子标志
|
|
|
|
|
-// */
|
|
|
|
|
-// @PostMapping("/getPolicyPrint2")
|
|
|
|
|
-// public HttpResult getPolicyPrint2(@RequestBody InsOrder orderno) {
|
|
|
|
|
-//
|
|
|
|
|
-// return yongAnService.getPolicyPrint(orderno.getOrderno(), orderno.getPolicytype(), "02");
|
|
|
|
|
-// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获得意外险列表
|
|
* 获得意外险列表
|
|
@@ -199,44 +163,27 @@ public class InsYongChengApiController {
|
|
|
@ApiOperation(value = "永诚API方式 -意外险列表")
|
|
@ApiOperation(value = "永诚API方式 -意外险列表")
|
|
|
@PostMapping("/gainAccidentList")
|
|
@PostMapping("/gainAccidentList")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "quoteOrderNo", value = "报价订单号")
|
|
|
|
|
|
|
+ @ApiImplicitParam(name = "companyId",required = true, value = "报价订单号")
|
|
|
})
|
|
})
|
|
|
- public HttpResult gainAccidentList(String quoteOrderNo) {
|
|
|
|
|
- return insYongchengApiService.gainAccidentList(quoteOrderNo);
|
|
|
|
|
|
|
+ public HttpResult gainAccidentList(String companyId) {
|
|
|
|
|
+ return insYongchengApiService.gainAccidentList(companyId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 测试获取redis
|
|
|
|
|
- */
|
|
|
|
|
- @ApiOperation(value = "测试获取redis")
|
|
|
|
|
- @GetMapping("/testRedis")
|
|
|
|
|
- public HttpResult testRedis() {
|
|
|
|
|
- log.info("this is a info log");
|
|
|
|
|
- log.warn("this is a warn log");
|
|
|
|
|
- log.error("this is a error log");
|
|
|
|
|
- log.debug("ddddddddddddddd");
|
|
|
|
|
- return HttpResult.ok(RedisUtils.exists("aaa"));
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 测试获取redis
|
|
|
|
|
+// * @
|
|
|
|
|
+// */
|
|
|
|
|
+// @ApiOperation(value = "测试获取redis")
|
|
|
|
|
+// @GetMapping("/testRedis")
|
|
|
|
|
+// public HttpResult testRedis() {
|
|
|
|
|
+// log.info("this is a info log");
|
|
|
|
|
+// log.warn("this is a warn log");
|
|
|
|
|
+// log.error("this is a error log");
|
|
|
|
|
+// log.debug("ddddddddddddddd");
|
|
|
|
|
+// return HttpResult.ok(RedisUtils.exists("aaa"));
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|
-// @ApiOperation(value = "根据多个字典类型查询字典数据")
|
|
|
|
|
-// @GetMapping("/listAllDataByTypes")
|
|
|
|
|
-// public List<DictionaryManagement> listAllDataByTypes(@RequestParam Set<String> dictTypeList) {
|
|
|
|
|
-// List<DictionaryManagement> dmList = new ArrayList<>();
|
|
|
|
|
-// Map<String, DictionaryManagement> dmMap = DictEnumConfig.getDmMap();
|
|
|
|
|
-// Set<String> dictTypeListRemain = new HashSet<>();
|
|
|
|
|
-// for (String dictType : dictTypeList) {
|
|
|
|
|
-// if (dmMap.containsKey(dictType)){
|
|
|
|
|
-// DictionaryManagement dictionaryManagement = dmMap.get(dictType);
|
|
|
|
|
-// dmList.add(dictionaryManagement);
|
|
|
|
|
-// }else {
|
|
|
|
|
-// dictTypeListRemain.add(dictType);
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-//// List<DictionaryManagement> dictionaryManagements = dictionaryManagementService.listAllDataByTypes(dictTypeListRemain);
|
|
|
|
|
-//// dmList.addAll(dictionaryManagements);
|
|
|
|
|
-// return dmList;
|
|
|
|
|
-// }
|
|
|
|
|
}
|
|
}
|