|
@@ -41,15 +41,16 @@ import com.ydtech.modules.ins.model.yc.ruote.Vhlowner;
|
|
|
import com.ydtech.modules.ins.service.InsApiLogService;
|
|
import com.ydtech.modules.ins.service.InsApiLogService;
|
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
|
|
|
+import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
|
|
|
import com.ydtech.modules.order.dao.InsTaskImagesMapper;
|
|
import com.ydtech.modules.order.dao.InsTaskImagesMapper;
|
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.guoren.constants.PlatformInterfaceCode;
|
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
|
import com.ydtech.modules.order.entity.vo.*;
|
|
import com.ydtech.modules.order.entity.vo.*;
|
|
|
import com.ydtech.modules.order.service.GuorenOrderApiService;
|
|
import com.ydtech.modules.order.service.GuorenOrderApiService;
|
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
-import com.ydtech.modules.order.service.YongchengOrderApiService;
|
|
|
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
import com.ydtech.utils.*;
|
|
import com.ydtech.utils.*;
|
|
|
import com.ydtech.utils.baidu.FileUtil;
|
|
import com.ydtech.utils.baidu.FileUtil;
|
|
@@ -57,12 +58,14 @@ import lombok.Data;
|
|
|
import org.apache.commons.httpclient.methods.multipart.FilePart;
|
|
import org.apache.commons.httpclient.methods.multipart.FilePart;
|
|
|
import org.apache.commons.httpclient.methods.multipart.Part;
|
|
import org.apache.commons.httpclient.methods.multipart.Part;
|
|
|
import org.apache.commons.httpclient.methods.multipart.StringPart;
|
|
import org.apache.commons.httpclient.methods.multipart.StringPart;
|
|
|
|
|
+import org.apache.poi.hssf.record.SSTRecord;
|
|
|
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.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -125,6 +128,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
InsTaskImagesMapper insTaskImagesMapper;
|
|
InsTaskImagesMapper insTaskImagesMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private GuorenRequestApiComponent guorenRequestApiComponent;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private static ChannelInfoDto channelInfo = null;
|
|
private static ChannelInfoDto channelInfo = null;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -142,16 +149,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
public HttpResult gainChannelInfo(String thirdCode) {
|
|
public HttpResult gainChannelInfo(String thirdCode) {
|
|
|
Map m = new HashMap();
|
|
Map m = new HashMap();
|
|
|
m.put("thirdCode", thirdCode);
|
|
m.put("thirdCode", thirdCode);
|
|
|
|
|
+// String bodyStr = RequestDto.builRequestDto(m, "IIRBT00018");
|
|
|
|
|
+ ChannelInfoResp request = guorenRequestApiComponent.request(m, PlatformInterfaceCode.API_IIRBT00018);
|
|
|
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(m, "IIRBT00018");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- ChannelInfoResp resp = ResponseDto.buildBody(rest, ChannelInfoResp.class);
|
|
|
|
|
-// channelInfo = resp.getData().get(0);
|
|
|
|
|
-
|
|
|
|
|
- return HttpResult.ok(resp);
|
|
|
|
|
|
|
+ return HttpResult.ok(request);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -160,15 +161,9 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult modelsQueryApi(CarInfoVo carInfo) {
|
|
public HttpResult modelsQueryApi(CarInfoVo carInfo) {
|
|
|
-
|
|
|
|
|
CarModelReq carModelReq = CarModelReq.buildCarModelParam(carInfo);
|
|
CarModelReq carModelReq = CarModelReq.buildCarModelParam(carInfo);
|
|
|
-
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(carModelReq, "IIRBT00002");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
|
|
|
|
|
-
|
|
|
|
|
- CarModelResp rest = JsonUtils.toObject(result, CarModelResp.class);
|
|
|
|
|
-
|
|
|
|
|
- return HttpResult.ok(rest);
|
|
|
|
|
|
|
+ CarModelResp request = guorenRequestApiComponent.request(carModelReq, PlatformInterfaceCode.API_IIRBT00002);
|
|
|
|
|
+ return HttpResult.ok(request);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -345,7 +340,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取保险公司订单信息
|
|
* 获取保险公司订单信息
|
|
|
- *
|
|
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
@@ -473,25 +467,22 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
|
|
InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
|
|
|
- if (null == channelInfo) return HttpResult.error("请先配置保险公司渠道信息");
|
|
|
|
|
this.channelInfo = channelInfo;
|
|
this.channelInfo = channelInfo;
|
|
|
|
|
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
-
|
|
|
|
|
BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(order.getOrderno());
|
|
BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(order.getOrderno());
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 4、投保单保存
|
|
* 4、投保单保存
|
|
|
*/
|
|
*/
|
|
|
InsuranceSlipResp insuranceSlip = insuranceSlip(yaQuoteInfoVo, iac.getInsOrderNo());
|
|
InsuranceSlipResp insuranceSlip = insuranceSlip(yaQuoteInfoVo, iac.getInsOrderNo());
|
|
|
- if (insuranceSlip.getResultCode() == 1) return HttpResult.error(insuranceSlip.getResultMsg());
|
|
|
|
|
|
|
+ if (insuranceSlip.getResultCode() == 1) {
|
|
|
|
|
+ return HttpResult.error(insuranceSlip.getResultMsg());
|
|
|
|
|
+ }
|
|
|
iac.setJqapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoCI());
|
|
iac.setJqapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoCI());
|
|
|
iac.setSyapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoBI());
|
|
iac.setSyapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoBI());
|
|
|
-
|
|
|
|
|
//影像上传
|
|
//影像上传
|
|
|
imageUpdate(iac, channelInfo);
|
|
imageUpdate(iac, channelInfo);
|
|
|
insAreaCompanyService.updateById(iac);
|
|
insAreaCompanyService.updateById(iac);
|
|
|
-
|
|
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -511,24 +502,17 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
List<InsUploadImagesDto> insUploadImagesDtos = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(iac.getOrderno());
|
|
List<InsUploadImagesDto> insUploadImagesDtos = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(iac.getOrderno());
|
|
|
insUploadImagesDtos.stream().forEach(a -> {
|
|
insUploadImagesDtos.stream().forEach(a -> {
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
-
|
|
|
|
|
// FilePart file1 = new FilePart(fileName, new File("https://img0.baidu.com/it/u=3021883569,1259262591&fm=253&fmt=auto&app=120&f=JPEG?w=1140&h=641"));
|
|
// FilePart file1 = new FilePart(fileName, new File("https://img0.baidu.com/it/u=3021883569,1259262591&fm=253&fmt=auto&app=120&f=JPEG?w=1140&h=641"));
|
|
|
FilePart file1 = new FilePart("file", new File(a.getFilePath()));
|
|
FilePart file1 = new FilePart("file", new File(a.getFilePath()));
|
|
|
|
|
|
|
|
|
|
|
|
|
- Part[] parts = {file1
|
|
|
|
|
- , new StringPart("businessNo", formMap.get("businessNo").toString())
|
|
|
|
|
- , new StringPart("operatorCode", formMap.get("operatorCode").toString())
|
|
|
|
|
- , new StringPart("comCode", formMap.get("comCode").toString())
|
|
|
|
|
- , new StringPart("fileGroup", formMap.get("fileGroup").toString())
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Part[] parts = {file1, new StringPart("businessNo", formMap.get("businessNo").toString()), new StringPart("operatorCode", formMap.get("operatorCode").toString()), new StringPart("comCode", formMap.get("comCode").toString()), new StringPart("fileGroup", formMap.get("fileGroup").toString())};
|
|
|
|
|
|
|
|
String result = HttpUtil.sendPostFromFile(parts, properties.getUploadUrl());
|
|
String result = HttpUtil.sendPostFromFile(parts, properties.getUploadUrl());
|
|
|
if (StringUtils.isEmpty(result)) throw new SystemException("国任,影像上传失败");
|
|
if (StringUtils.isEmpty(result)) throw new SystemException("国任,影像上传失败");
|
|
|
|
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(result);
|
|
|
if (StringUtils.toInt(jsonObject.get("resultCode")) == 0) return;
|
|
if (StringUtils.toInt(jsonObject.get("resultCode")) == 0) return;
|
|
|
throw new SystemException("国任,影像上传失败,类型:" + a.getImageType());
|
|
throw new SystemException("国任,影像上传失败,类型:" + a.getImageType());
|
|
|
|
|
|
|
@@ -548,15 +532,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
public PayResp.DataDTO pay(InsAreaCompany iac) {
|
|
public PayResp.DataDTO pay(InsAreaCompany iac) {
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
PayReq req = PayReq.buildParam(iac, properties.getRedirectUrl(), channelInfo);
|
|
PayReq req = PayReq.buildParam(iac, properties.getRedirectUrl(), channelInfo);
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00008");
|
|
|
|
|
-
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取支付链接,订单号:" + iac.getId());
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- PayResp resp = ResponseDto.buildBody(rest, PayResp.class);
|
|
|
|
|
-
|
|
|
|
|
- if (null != rest) return resp.getData();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ PayResp payResp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00008);
|
|
|
|
|
+ if (null != payResp) {
|
|
|
|
|
+ return payResp.getData();
|
|
|
|
|
+ }
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -565,16 +544,9 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
*/
|
|
*/
|
|
|
public SignatureResp.DataDTO signature(InsAreaCompany iac) {
|
|
public SignatureResp.DataDTO signature(InsAreaCompany iac) {
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
- Map req = new HashMap();
|
|
|
|
|
|
|
+ Map<String, String> req = new HashMap<>();
|
|
|
req.put("proposalNo", StringUtils.isEmpty(iac.getJqapplyno()) ? iac.getSyapplyno() : iac.getJqapplyno());
|
|
req.put("proposalNo", StringUtils.isEmpty(iac.getJqapplyno()) ? iac.getSyapplyno() : iac.getJqapplyno());
|
|
|
-
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00046");
|
|
|
|
|
-
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取签名链接,订单号:" + iac.getId());
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- SignatureResp resp = ResponseDto.buildBody(rest, SignatureResp.class);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ SignatureResp resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00046);
|
|
|
return resp.getData();
|
|
return resp.getData();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -583,18 +555,12 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
* 电子保单
|
|
* 电子保单
|
|
|
*/
|
|
*/
|
|
|
public PolicyResp policyPrint(String policyNo) {
|
|
public PolicyResp policyPrint(String policyNo) {
|
|
|
-
|
|
|
|
|
- Map m = new HashMap();
|
|
|
|
|
|
|
+ Map<String, String> m = new HashMap<>();
|
|
|
m.put("policyNo", policyNo);
|
|
m.put("policyNo", policyNo);
|
|
|
-
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(m, "IIRBT00027");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- PolicyResp resp = ResponseDto.buildBody(rest, PolicyResp.class);
|
|
|
|
|
-
|
|
|
|
|
- if (null != resp && resp.getResultCode() == 0) return resp;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ PolicyResp resp = guorenRequestApiComponent.request(m, PlatformInterfaceCode.API_IIRBT00027);
|
|
|
|
|
+ if (null != resp && resp.getResultCode() == 0) {
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1203,16 +1169,14 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
* 构造 车价查询uid编号
|
|
* 构造 车价查询uid编号
|
|
|
*/
|
|
*/
|
|
|
private String buildCarPriceQueryUidNum(String orderNo) {
|
|
private String buildCarPriceQueryUidNum(String orderNo) {
|
|
|
- String redisNum = orderNo + "-guoRen" + "-CarPriceQuery-uid";
|
|
|
|
|
- return redisNum;
|
|
|
|
|
|
|
+ return orderNo + "-guoRen" + "-CarPriceQuery-uid";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 构造 投保单的redis key
|
|
* 构造 投保单的redis key
|
|
|
*/
|
|
*/
|
|
|
private String buildInsuranceSlipNum(String orderNo) {
|
|
private String buildInsuranceSlipNum(String orderNo) {
|
|
|
- String redisNum = orderNo + "-guoRen" + "-InsuranceSlipNum";
|
|
|
|
|
- return redisNum;
|
|
|
|
|
|
|
+ return orderNo + "-guoRen" + "-InsuranceSlipNum";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1223,11 +1187,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
* @date: 2023年09月13日 0013
|
|
* @date: 2023年09月13日 0013
|
|
|
*/
|
|
*/
|
|
|
private InsuranceSlipResp gainInsuranceSlip(String orderNo) {
|
|
private InsuranceSlipResp gainInsuranceSlip(String orderNo) {
|
|
|
-
|
|
|
|
|
String s = RedisUtils.get(buildInsuranceSlipNum(orderNo));
|
|
String s = RedisUtils.get(buildInsuranceSlipNum(orderNo));
|
|
|
-
|
|
|
|
|
InsuranceSlipResp insuranceSlip = JSON.parseObject(s, InsuranceSlipResp.class);
|
|
InsuranceSlipResp insuranceSlip = JSON.parseObject(s, InsuranceSlipResp.class);
|
|
|
-
|
|
|
|
|
return insuranceSlip;
|
|
return insuranceSlip;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1241,22 +1202,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
*/
|
|
*/
|
|
|
public VinQueryResp.DataDTO vinQuery(VinQueryReq vinQueryReq) {
|
|
public VinQueryResp.DataDTO vinQuery(VinQueryReq vinQueryReq) {
|
|
|
VinQueryReq req = VinQueryReq.buildParam2(vinQueryReq, channelInfo);
|
|
VinQueryReq req = VinQueryReq.buildParam2(vinQueryReq, channelInfo);
|
|
|
-
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00009");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "vin码查询车辆,车牌号:" + vinQueryReq.getLicenseNo());
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
-
|
|
|
|
|
- if (rest.getPlatformCode().equals("T0000000")) {
|
|
|
|
|
- VinQueryResp resp = ResponseDto.buildBody(rest, VinQueryResp.class);
|
|
|
|
|
- if (resp.getResultCode() == 1) {
|
|
|
|
|
- throw new SystemException(resp.getResultMsg() == null ? "未找到车辆信息" : resp.getResultMsg());
|
|
|
|
|
- }
|
|
|
|
|
- return resp.getData().get(0);
|
|
|
|
|
|
|
+ VinQueryResp resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00009);
|
|
|
|
|
+ if (resp.getResultCode() == 1) {
|
|
|
|
|
+ throw new SystemException(resp.getResultMsg() == null ? "未找到车辆信息" : resp.getResultMsg());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ return resp.getData().get(0);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1268,19 +1218,17 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
CarPriceReq req = CarPriceReq.buildCarPriceParam(yaQuoteInfoVo, vinQ, channelInfo);
|
|
CarPriceReq req = CarPriceReq.buildCarPriceParam(yaQuoteInfoVo, vinQ, channelInfo);
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00003");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "车价查询,车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
|
|
+ JSONObject request = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00003);
|
|
|
|
|
+ Object cars = request.get("cars");
|
|
|
|
|
|
|
|
- if (rest.getPlatformCode().equals("T0000000")) {
|
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(cars)) {
|
|
|
|
|
|
|
|
//多条
|
|
//多条
|
|
|
- CarPriceMuchResp respMuch = ResponseDto.buildBody(rest, CarPriceMuchResp.class);
|
|
|
|
|
|
|
+ CarPriceMuchResp respMuch = request.toJavaObject(CarPriceMuchResp.class);
|
|
|
|
|
|
|
|
//单条
|
|
//单条
|
|
|
if (CollUtil.isEmpty(respMuch.getData().getCars())) {
|
|
if (CollUtil.isEmpty(respMuch.getData().getCars())) {
|
|
|
- CarPriceResp resp = ResponseDto.buildBody(rest, CarPriceResp.class);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ CarPriceResp resp = request.toJavaObject(CarPriceResp.class);
|
|
|
if (resp.getResultCode() == 1) {
|
|
if (resp.getResultCode() == 1) {
|
|
|
throw new SystemException(resp.getResultMsg() == null ? "未获取到车价信息,请联系管理员" : resp.getResultMsg());
|
|
throw new SystemException(resp.getResultMsg() == null ? "未获取到车价信息,请联系管理员" : resp.getResultMsg());
|
|
|
}
|
|
}
|
|
@@ -1304,9 +1252,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
} else {
|
|
} else {
|
|
|
//匹配的车辆信息数据里 未匹配成功 默认选择第一条
|
|
//匹配的车辆信息数据里 未匹配成功 默认选择第一条
|
|
|
//排序 年款降序 金额升序
|
|
//排序 年款降序 金额升序
|
|
|
- vehicleInfoList = vehicleInfoList.stream().sorted(Comparator.comparing(CarPriceMuchResp.DataDTO.CarsDTO::getCarYear)
|
|
|
|
|
- .thenComparing((o1, o2) -> Integer.compare(StringUtils.toInt(o2.getCarYear()), StringUtils.toInt(o1.getCarYear()))).reversed())
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ vehicleInfoList = vehicleInfoList.stream().sorted(Comparator.comparing(CarPriceMuchResp.DataDTO.CarsDTO::getCarYear).thenComparing((o1, o2) -> Integer.compare(StringUtils.toInt(o2.getCarYear()), StringUtils.toInt(o1.getCarYear()))).reversed()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
confirmCarMuch = vehicleInfoList.get(0);
|
|
confirmCarMuch = vehicleInfoList.get(0);
|
|
|
}
|
|
}
|
|
@@ -1327,24 +1273,14 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
* (多条)车价查询
|
|
* (多条)车价查询
|
|
|
*/
|
|
*/
|
|
|
public CarPriceResp.DataDTO carPriceQueryMuch(String uuid, CarPriceMuchResp.DataDTO.CarsDTO carsDTO, String licenseNo) {
|
|
public CarPriceResp.DataDTO carPriceQueryMuch(String uuid, CarPriceMuchResp.DataDTO.CarsDTO carsDTO, String licenseNo) {
|
|
|
-
|
|
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
CarPriceMuchReq req = new CarPriceMuchReq();
|
|
CarPriceMuchReq req = new CarPriceMuchReq();
|
|
|
req.setUuid(uuid);
|
|
req.setUuid(uuid);
|
|
|
req.setCarPriceMuchResp(carsDTO);
|
|
req.setCarPriceMuchResp(carsDTO);
|
|
|
-
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00017");
|
|
|
|
|
-
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "再次车价查询,车牌:" + licenseNo);
|
|
|
|
|
-// String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ ResponseDto rest = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00017);
|
|
|
|
|
|
|
|
if (rest.getPlatformCode().equals("T0000000")) {
|
|
if (rest.getPlatformCode().equals("T0000000")) {
|
|
|
-
|
|
|
|
|
CarPriceResp resp = ResponseDto.buildBody(rest, CarPriceResp.class);
|
|
CarPriceResp resp = ResponseDto.buildBody(rest, CarPriceResp.class);
|
|
|
-
|
|
|
|
|
if (resp.getResultCode() == 1) {
|
|
if (resp.getResultCode() == 1) {
|
|
|
throw new SystemException(resp.getResultMsg() == null ? "未获取到车价信息,请联系管理员" : resp.getResultMsg());
|
|
throw new SystemException(resp.getResultMsg() == null ? "未获取到车价信息,请联系管理员" : resp.getResultMsg());
|
|
|
}
|
|
}
|
|
@@ -1372,29 +1308,23 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
StringBuffer flag = new StringBuffer();
|
|
StringBuffer flag = new StringBuffer();
|
|
|
|
|
|
|
|
while (boo) {
|
|
while (boo) {
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00004");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "保费计算 |" + flag + ",车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- resp = ResponseDto.buildBody(rest, PremiumResp.class);
|
|
|
|
|
- if (rest.getPlatformCode().equals("T0000000")) {
|
|
|
|
|
|
|
|
|
|
|
|
+ resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00004);
|
|
|
// //警告
|
|
// //警告
|
|
|
// if (resp.getResultCode() == 0) throw new SystemException(resp.getResultMsg());
|
|
// if (resp.getResultCode() == 0) throw new SystemException(resp.getResultMsg());
|
|
|
|
|
|
|
|
- //1、 交强险重复投保 替换时间
|
|
|
|
|
- boo = buildCiRepeatParam(boo, resp, requestInfoList, req);
|
|
|
|
|
- if (boo) {
|
|
|
|
|
- flag.append("重复投保处理 |");
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //2、 转保
|
|
|
|
|
- boo = buildCheckCodeParam(resp, requestInfoList, req);
|
|
|
|
|
- if (boo) {
|
|
|
|
|
- flag.append("转保处理 |");
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //1、 交强险重复投保 替换时间
|
|
|
|
|
+ boo = buildCiRepeatParam(boo, resp, requestInfoList, req);
|
|
|
|
|
+ if (boo) {
|
|
|
|
|
+ flag.append("重复投保处理 |");
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ //2、 转保
|
|
|
|
|
+ boo = buildCheckCodeParam(resp, requestInfoList, req);
|
|
|
|
|
+ if (boo) {
|
|
|
|
|
+ flag.append("转保处理 |");
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1405,8 +1335,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
resp.getData().setBiStartDate(req.getBi().getPrpTmain().getStartDate());
|
|
resp.getData().setBiStartDate(req.getBi().getPrpTmain().getStartDate());
|
|
|
resp.getData().setBiEndDate(req.getBi().getPrpTmain().getEndDate());
|
|
resp.getData().setBiEndDate(req.getBi().getPrpTmain().getEndDate());
|
|
|
|
|
|
|
|
- if (null != resp && resp.getResultCode() == 1)
|
|
|
|
|
|
|
+ if (null != resp && resp.getResultCode() == 1) {
|
|
|
throw new SystemException(resp.getResultMsg() == null ? "保费计算失败,请联系管理员" : resp.getResultMsg());
|
|
throw new SystemException(resp.getResultMsg() == null ? "保费计算失败,请联系管理员" : resp.getResultMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (null != resp) return resp.getData();
|
|
if (null != resp) return resp.getData();
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1422,17 +1354,9 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
* @date: 2023年08月18日 0018
|
|
* @date: 2023年08月18日 0018
|
|
|
*/
|
|
*/
|
|
|
public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum) {
|
|
public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum) {
|
|
|
-
|
|
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum);
|
|
InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum);
|
|
|
-
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00006");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "投保单保存,车牌号:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- InsuranceSlipResp resp = ResponseDto.buildBody(rest, InsuranceSlipResp.class);
|
|
|
|
|
-
|
|
|
|
|
- return resp;
|
|
|
|
|
|
|
+ return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00006);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1445,14 +1369,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
public SubmitAuditResp submitAudit(InsAreaCompany iac) {
|
|
public SubmitAuditResp submitAudit(InsAreaCompany iac) {
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
SubmitAuditReq req = SubmitAuditReq.buildParam(iac, channelInfo);
|
|
SubmitAuditReq req = SubmitAuditReq.buildParam(iac, channelInfo);
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIRBT00007");
|
|
|
|
|
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "核保提交");
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
|
|
|
|
|
-
|
|
|
|
|
- return resp;
|
|
|
|
|
|
|
+ return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00007);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1462,9 +1380,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
* @date: 2023-09-26
|
|
* @date: 2023-09-26
|
|
|
*/
|
|
*/
|
|
|
public InsOrderStatusResp insOrderStatus(InsAreaCompany iac) {
|
|
public InsOrderStatusResp insOrderStatus(InsAreaCompany iac) {
|
|
|
-// //构造请求参数
|
|
|
|
|
-// SubmitAuditReq req = SubmitAuditReq.buildParam(insuranceSlip, channelInfo);
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
List<String> proposalNos = new ArrayList<>();
|
|
List<String> proposalNos = new ArrayList<>();
|
|
|
String jqNo = iac.getJqapplyno();
|
|
String jqNo = iac.getJqapplyno();
|
|
@@ -1475,19 +1390,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
if (StringUtils.isNotEmpty(syNo)) {
|
|
if (StringUtils.isNotEmpty(syNo)) {
|
|
|
proposalNos.add(syNo);
|
|
proposalNos.add(syNo);
|
|
|
}
|
|
}
|
|
|
- Map paramMap = new HashMap();
|
|
|
|
|
|
|
+ Map<String, List<String>> paramMap = new HashMap<>();
|
|
|
paramMap.put("proposalNos", proposalNos);
|
|
paramMap.put("proposalNos", proposalNos);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//投保单状态查询
|
|
//投保单状态查询
|
|
|
- String bodyStr = RequestDto.builRequestDto(paramMap, "IIRBT00010");
|
|
|
|
|
-
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "投保单状态查询");
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- InsOrderStatusResp resp = ResponseDto.buildBody(rest, InsOrderStatusResp.class);
|
|
|
|
|
-
|
|
|
|
|
- return resp;
|
|
|
|
|
|
|
+ return guorenRequestApiComponent.request(paramMap, PlatformInterfaceCode.API_IIRBT00010);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1500,28 +1407,18 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
@Override
|
|
@Override
|
|
|
public NonAutoInsResp.DataDTO gainNonAutoInsList(String goodsCode) {
|
|
public NonAutoInsResp.DataDTO gainNonAutoInsList(String goodsCode) {
|
|
|
|
|
|
|
|
|
|
+ Map<String, Object> bodyMap = new HashMap<>();
|
|
|
|
|
|
|
|
- Map bodyMap = new HashMap();
|
|
|
|
|
- Map bodyParamsMap = new HashMap();
|
|
|
|
|
|
|
+ Map<String, Object> bodyParamsMap = new HashMap<>();
|
|
|
bodyParamsMap.put("goodsCode", goodsCode);
|
|
bodyParamsMap.put("goodsCode", goodsCode);
|
|
|
bodyMap.put("data", bodyParamsMap);
|
|
bodyMap.put("data", bodyParamsMap);
|
|
|
-
|
|
|
|
|
bodyMap.put("systemCode", "TQDL");
|
|
bodyMap.put("systemCode", "TQDL");
|
|
|
bodyMap.put("requestTime", Instant.now().getEpochSecond() * 1000);
|
|
bodyMap.put("requestTime", Instant.now().getEpochSecond() * 1000);
|
|
|
|
|
|
|
|
-// String params = JSON.toJSONString(bodyMap);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- String bodyStr = RequestDto.builRequestDto(bodyMap, "IIIRBT00053");
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取非车列表,产品号:" + goodsCode);
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- NonAutoInsResp resp = ResponseDto.buildBody(rest, NonAutoInsResp.class);
|
|
|
|
|
-
|
|
|
|
|
-// ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
-// SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
|
|
|
|
|
- if (null != resp.getData()) return resp.getData();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ NonAutoInsResp resp = guorenRequestApiComponent.request(bodyMap, PlatformInterfaceCode.API_IIIRBT00053);
|
|
|
|
|
+ if (null != resp.getData()) {
|
|
|
|
|
+ return resp.getData();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -1539,14 +1436,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
VinQueryResp.DataDTO vinQ = new VinQueryResp.DataDTO();
|
|
VinQueryResp.DataDTO vinQ = new VinQueryResp.DataDTO();
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
NonAutoInsOrderReq req = NonAutoInsOrderReq.buildParam(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid);
|
|
NonAutoInsOrderReq req = NonAutoInsOrderReq.buildParam(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid);
|
|
|
- String bodyStr = RequestDto.builRequestDto(req, "IIIRBT00054");
|
|
|
|
|
-
|
|
|
|
|
- String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "创建非车订单");
|
|
|
|
|
-
|
|
|
|
|
- ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
|
|
|
|
|
- SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
|
|
|
|
|
|
|
|
|
|
- return resp;
|
|
|
|
|
|
|
+ return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIIRBT00054);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1572,7 +1463,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
String newEndDate = "";
|
|
String newEndDate = "";
|
|
|
|
|
|
|
|
//及时起保
|
|
//及时起保
|
|
|
- if (start.getHour() > 0 && start.getHour() < 59) {
|
|
|
|
|
|
|
+ if (start.getHour() > 0) {
|
|
|
LocalDateTime end = start.plusYears(1L);
|
|
LocalDateTime end = start.plusYears(1L);
|
|
|
newStartDate = DateTimeUtil.format(start, DateTimeUtil.DATETIME_PATTERN);
|
|
newStartDate = DateTimeUtil.format(start, DateTimeUtil.DATETIME_PATTERN);
|
|
|
newEndDate = DateTimeUtil.format(end, DateTimeUtil.DATETIME_PATTERN);
|
|
newEndDate = DateTimeUtil.format(end, DateTimeUtil.DATETIME_PATTERN);
|