|
|
@@ -1,8 +1,11 @@
|
|
|
package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.ydtech.config.properties.PingAnApiConfigurationProperties;
|
|
|
+import com.ydtech.constants.enums.InsurKind;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
@@ -34,7 +37,6 @@ import com.ydtech.modules.order.entity.config.PingAnConfigureParameters;
|
|
|
import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
|
import com.ydtech.modules.order.entity.po.InsTaskImages;
|
|
|
-import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
|
|
|
import com.ydtech.modules.order.entity.po.InsUploadFiles;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
|
|
|
@@ -45,6 +47,7 @@ import com.ydtech.modules.order.entity.vo.pingan.PingAnQuoteVo;
|
|
|
import com.ydtech.modules.order.entity.vo.pingan.RenewalConfirmVo;
|
|
|
import com.ydtech.modules.order.entity.vo.pingan.StorefrontQueryVo;
|
|
|
import com.ydtech.modules.order.service.*;
|
|
|
+import com.ydtech.modules.order.utils.MD5Util;
|
|
|
import com.ydtech.modules.order.utils.PingAnUpLoadUtils;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
@@ -198,8 +201,10 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
* @Exception
|
|
|
*/
|
|
|
@Override
|
|
|
- public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfo, PingAnQuoteVo<InsDrivingIntentionInsuranceSonVo> quoteVo) throws Exception {
|
|
|
+ public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfo, PingAnQuoteVo<Map<String,Object>> quoteVo) throws Exception {
|
|
|
|
|
|
+ //验证参数
|
|
|
+ checkData(quoteVo);
|
|
|
// 车型查询
|
|
|
CarInfoVo carInfo = quoteInfo.getCarInfo();
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(quoteVo.getOrderNo(),null,quoteVo.getAgreementId());
|
|
|
@@ -208,8 +213,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
// 通过 协议id获取配置实体
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
-
|
|
|
-
|
|
|
try {
|
|
|
// 1. 标的信息
|
|
|
IndexRequest indexRequest = new IndexRequest(parameters, carInfo);
|
|
|
@@ -249,15 +252,15 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
}
|
|
|
//4.报价 使用车辆确认返回的流程id
|
|
|
pinganApiLog.setId(null);
|
|
|
- QuoteRequest quoteRequest = new QuoteRequest(parameters, quoteInfo, model, carConfirmResponse.getFlowid(), quoteVo.getAccommodationFlag(), quoteVo.getApplyUnAuto(), quoteVo.getApplyXiaoWei(), quoteVo.getUnAutoListInfo(), quoteVo.getXiaoWeiListInfo(), quoteVo.getAmount22XNYChargingPostList(), quoteVo.getAmount23XNYChargingPostList());
|
|
|
+ QuoteRequest quoteRequest = new QuoteRequest(parameters, quoteInfo,carConfirmResponse.getFlowid(), quoteVo.getAccommodationFlag(), quoteVo.getAmount22XNYChargingPostList(), quoteVo.getAmount23XNYChargingPostList(),quoteVo.getAccidentalDrivingVo());
|
|
|
//能源车 判断 赋值能源参数
|
|
|
if("1,2,3,".contains(carInfo.getEnergyType())){
|
|
|
+ //新能源参数传递
|
|
|
quoteRequest = quoteRequest.transferPingAnRequestMsgNY(quoteInfo.getKindList(), quoteRequest,carConfirmResponse.getBizQuoteConfig());
|
|
|
}else{
|
|
|
+ //客车、货车传递
|
|
|
quoteRequest = quoteRequest.transferPingAnRequestMsg(quoteInfo.getKindList(), quoteRequest,carConfirmResponse.getBizQuoteConfig());
|
|
|
}
|
|
|
-
|
|
|
- quoteRequest = quoteRequest.transYJPingAnRequestMsg(quoteVo.getAccidentalDrivingVo(), quoteRequest,"1");
|
|
|
QuoteResponse quoteResponse = null;
|
|
|
try {
|
|
|
quoteResponse = pinganRequestApiComponents.quote(quoteRequest,pinganApiLog);
|
|
|
@@ -266,7 +269,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
}
|
|
|
if (quoteResponse != null && "0".equals(quoteResponse.getResultCode())) {
|
|
|
//5.组装返回的报价信息
|
|
|
- return getQuoteRespVo(quoteResponse, quoteInfo, ptlAgreementAttribution, model,parameters.getUserId(),pinganApiLog,carConfirmResponse);
|
|
|
+ return getQuoteRespVo(quoteResponse, quoteInfo, ptlAgreementAttribution, model,parameters.getUserId(),pinganApiLog,carConfirmResponse,quoteVo);
|
|
|
}else{
|
|
|
throw new SystemException(quoteResponse.getResultMessage());
|
|
|
}
|
|
|
@@ -274,13 +277,42 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/6 16:21
|
|
|
+ * @Description: 验证参数是否正确
|
|
|
+ */
|
|
|
+ private static void checkData(PingAnQuoteVo<Map<String, Object>> quoteVo) {
|
|
|
+ String agreementId = quoteVo.getAgreementId();
|
|
|
+ if(StringUtils.isBlank(agreementId)){
|
|
|
+ throw new SystemException("未选择协议不能报价");
|
|
|
+ }
|
|
|
+ Map<String, Object> map = quoteVo.getAccidentalDrivingVo();
|
|
|
+ if(map!=null && map.get("2")!=null ){
|
|
|
+ LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("2");
|
|
|
+ int count =0;
|
|
|
+ if(linkedMap!=null && linkedMap.size()>0){
|
|
|
+ List<InsDrivingIntentionInsuranceSonVo> zhlist = (List<InsDrivingIntentionInsuranceSonVo>)linkedMap.get("2");
|
|
|
+ for(InsDrivingIntentionInsuranceSonVo zhVo : zhlist ){
|
|
|
+ if("01".equals(zhVo.getCombineProductType())){
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(count==1){
|
|
|
+ throw new SystemException("组合险不能只选择不可单独销售的产品");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public HttpResult<QuoteRespVo> getQuoteRespVo(QuoteResponse response,
|
|
|
BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
PtlAgreementAttribution ptlAgreementAttribution,
|
|
|
SearchPAVehicleListResponse.ModelsDto modelsDto,String userId,
|
|
|
PinganApiLog pinganApiLog,
|
|
|
- CarConfirmResponse carConfirmResponse
|
|
|
+ CarConfirmResponse carConfirmResponse,
|
|
|
+ PingAnQuoteVo<Map<String,Object>> quoteVo
|
|
|
) {
|
|
|
|
|
|
PingAnQuoteRespVo quoteRespVo = new PingAnQuoteRespVo();
|
|
|
@@ -320,8 +352,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
syPremium = Double.parseDouble(bizQuoteResult.getPremiumTotal() == null ? "0" : bizQuoteResult.getPremiumTotal());
|
|
|
//商业险保费
|
|
|
quoteRespVo.setSyPremium(syPremium);
|
|
|
- //商业险保单号
|
|
|
- quoteRespVo.setSyApplyNo(bizQuoteResult.getQueryRequestCode());
|
|
|
QuoteResponse.QuoteDTO bizQuote = response.getBizQuote();
|
|
|
// 交强
|
|
|
quoteRespVo.setStartDateJq(forceQuote.getBeginDate());
|
|
|
@@ -330,19 +360,20 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
quoteRespVo.setStartDateSy(bizQuote.getBeginDate());
|
|
|
quoteRespVo.setEndDateSy(bizQuote.getEndDate());
|
|
|
// 商业险险种
|
|
|
- List<QuoteResponse.ClauseCaseListDTO> clauseCaseList = bizQuoteResult.getClauseCaseList();
|
|
|
+ List<KindInfoVo> kindList = yaQuoteInfoVo.getKindList();
|
|
|
QuoteKindRespVo kind;
|
|
|
- if(clauseCaseList!=null && clauseCaseList.size()>0){
|
|
|
- for (QuoteResponse.ClauseCaseListDTO clauseCaseListDTO : clauseCaseList) {
|
|
|
+ if(kindList!=null && kindList.size()>0){
|
|
|
+ for (KindInfoVo kindInfoVo : kindList) {
|
|
|
kind = new QuoteKindRespVo();
|
|
|
- kind.setKindCode(clauseCaseListDTO.getProductCode());
|
|
|
- kind.setKindName(clauseCaseListDTO.getProductName());
|
|
|
- double amount = Double.parseDouble(clauseCaseListDTO.getAmount() == null ? "0" : clauseCaseListDTO.getAmount());
|
|
|
- kind.setAmount(amount);
|
|
|
- double count = Double.parseDouble(clauseCaseListDTO.getCount() == null ? "0" : clauseCaseListDTO.getCount());
|
|
|
- kind.setUnitAmount(count);
|
|
|
- //保费
|
|
|
- kind.setCoveragePremium(amount * count);
|
|
|
+ kind.setKindCode(kindInfoVo.getKindCode());
|
|
|
+ kind.setKindName(kindInfoVo.getKindName());
|
|
|
+ kind.setAmount(kindInfoVo.getAmount());
|
|
|
+ kind.setCoveragePremium(getPremium(bizQuoteResult,xnyFlag,kindInfoVo.getKindCode()));
|
|
|
+ kind.setUnitAmount(kindInfoVo.getUnitAmount());
|
|
|
+ kind.setServiceTimes(String.valueOf(kindInfoVo.getServiceTimes()));
|
|
|
+ if (!ObjectUtils.isEmpty(kindInfoVo.getDeductibleRate())) {
|
|
|
+ kind.setDeductibleRate(Double.parseDouble(kindInfoVo.getDeductibleRate()));
|
|
|
+ }
|
|
|
kindList1.add(kind);
|
|
|
}
|
|
|
}
|
|
|
@@ -352,6 +383,15 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
QuoteResponse.AhsUpcActualPremiumDTO ahsUpcActualPremium = response.getAhsUpcActualPremium();
|
|
|
// 小微险保费
|
|
|
QuoteResponse.XwActualPremiumDTO xwActualPremium = response.getXwActualPremium();
|
|
|
+ double zhAmount=0;
|
|
|
+ //组合险保费
|
|
|
+ QuoteResponse.CombinationPremiumDTO combinationPremium = response.getCombinationPremium();
|
|
|
+ if(combinationPremium!=null && combinationPremium.getPremiumList()!=null && combinationPremium.getPremiumList().size()>0){
|
|
|
+ List<QuoteResponse.CombinationPremiumDetaillDTO> premiumList = combinationPremium.getPremiumList();
|
|
|
+ for(QuoteResponse.CombinationPremiumDetaillDTO vo :premiumList){
|
|
|
+ zhAmount+=StringUtils.isBlank(vo.getPremium())?0:Double.parseDouble(vo.getPremium());
|
|
|
+ }
|
|
|
+ }
|
|
|
//小微险保费
|
|
|
quoteRespVo.setAhsUpcActualPremium(ahsUpcActualPremium);
|
|
|
quoteRespVo.setXwActualPremium(xwActualPremium);
|
|
|
@@ -362,11 +402,15 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
// 财意险总保费
|
|
|
double ahsUpcTotalPremium = Double.parseDouble(ahsUpcActualPremium.getAhsUpcTotalPremium() == null ? "0" : ahsUpcActualPremium.getAhsUpcTotalPremium());;
|
|
|
jyPremium += ahsUpcTotalPremium;
|
|
|
+ quoteRespVo.setCyPremium(ahsUpcTotalPremium);
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(xwActualPremium)) {
|
|
|
double xwPremium = Double.parseDouble(xwActualPremium.getXwPremium() == null ? "0" : xwActualPremium.getXwPremium());
|
|
|
jyPremium += xwPremium;
|
|
|
+ quoteRespVo.setXwPremium(xwPremium);
|
|
|
}
|
|
|
+ jyPremium += zhAmount;
|
|
|
+ quoteRespVo.setZhPremium(zhAmount);
|
|
|
// 报价险种放入保费
|
|
|
List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
|
|
|
|
|
|
@@ -384,16 +428,182 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
quoteRespVo.setOrderno(yaQuoteInfoVo.getOrderNo());
|
|
|
quoteRespVo.setCoreModels(modelsDto.toCoreModelsVo());
|
|
|
String orderId = yaQuoteInfoVo.getOrderNo();
|
|
|
- return responseOrder(response, quoteRespVo, ptlAgreementAttribution, orderId,userId,pinganApiLog,carConfirmResponse);
|
|
|
+ return responseOrder(response, quoteRespVo, ptlAgreementAttribution, orderId,userId,pinganApiLog,carConfirmResponse,quoteVo);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/6 17:46
|
|
|
+ * @Description: 赋值新能源、非新能源的商业险信息
|
|
|
+ */
|
|
|
+ private double getPremium(QuoteResponse.BizQuoteResultDTO bizQuoteResult, Boolean xnyFlag,String code) {
|
|
|
+ double val=0;
|
|
|
+ //机动车损失保险保费
|
|
|
+ if (InsurKind.A.getCode().equalsIgnoreCase(code)) {
|
|
|
+ //能源车
|
|
|
+ if(xnyFlag){
|
|
|
+ //premium01XNY C 新能源汽车损失保险保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium01XNY())?0:Double.parseDouble(bizQuoteResult.getPremium01XNY());
|
|
|
+ }else{
|
|
|
+ // premium01 C 机动车损失保险保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium01())?0:Double.parseDouble(bizQuoteResult.getPremium01());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //三者险
|
|
|
+ if (InsurKind.B.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ //premium02XNY C 新能源汽车第三者责任保险保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium02XNY())?0:Double.parseDouble(bizQuoteResult.getPremium02XNY());
|
|
|
+ }else{
|
|
|
+ // premium02 C 机动车第三者责任保险保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium02())?0:Double.parseDouble(bizQuoteResult.getPremium02());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //乘客责任险
|
|
|
+ if (InsurKind.D4.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ //premium03XNY C 新能源汽车车上人员责任保险(司机)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium03XNY())?0:Double.parseDouble(bizQuoteResult.getPremium03XNY());
|
|
|
+ }else{
|
|
|
+ //premium04 C 机动车车上人员责任保险(司机)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium04())?0:Double.parseDouble(bizQuoteResult.getPremium04());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //司机责任险
|
|
|
+ if (InsurKind.D3.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // premium04XNY C单座保费*乘客座位数 新能源汽车车上人员责任保险(乘客)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium04XNY())?0:Double.parseDouble(bizQuoteResult.getPremium04XNY());
|
|
|
+ }else{
|
|
|
+ //premium05 C单座保费*乘客座位数 机动车车上人员责任保险(乘客)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium05())?0:Double.parseDouble(bizQuoteResult.getPremium05());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 客车 premium06 C * 附加车上货物责任险保费 能源无
|
|
|
+ // 附加医保外用药责任险(第三者责任保险)
|
|
|
+ if (InsurKind.SY_FJ_YBW1.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // premium18XNY C 附加医保外用药责任险保额(三者)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium18XNY())?0:Double.parseDouble(bizQuoteResult.getPremium18XNY());
|
|
|
+ }else{
|
|
|
+ // premium07 C 附加医保外用药责任险保费(三者)
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium07())?0:Double.parseDouble(bizQuoteResult.getPremium07());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 附加医保外用药责任险(车上人员责任保险(乘客))
|
|
|
+ if (InsurKind.SY_FJ_YBW2.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // premium19XNY C 附加医保外用药责任险保额(司机)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium19XNY())?0:Double.parseDouble(bizQuoteResult.getPremium19XNY());
|
|
|
+ }else{
|
|
|
+ // premium08 C 附加医保外用药责任险保费(司机)
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium08())?0:Double.parseDouble(bizQuoteResult.getPremium08());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 附加医保外用药责任险(车上人员责任保险(司机))
|
|
|
+ if (InsurKind.SY_FJ_YBW3.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // premium20XNY C 附加医保外用药责任险保额(乘客)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium20XNY())?0:Double.parseDouble(bizQuoteResult.getPremium20XNY());
|
|
|
+ }else{
|
|
|
+ // premium09 C 附加医保外用药责任险保费(乘客)
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium09())?0:Double.parseDouble(bizQuoteResult.getPremium09());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 附加绝对免赔率特约条款(车损)
|
|
|
+ if (InsurKind.MJ1.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // premium05XNY C * 附加绝对免赔率特约险(车损)保费 能源车
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium05XNY())?0:Double.parseDouble(bizQuoteResult.getPremium05XNY());
|
|
|
+ }else{
|
|
|
+ //premium53 C 附加绝对免赔率特约险(车损)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium53())?0:Double.parseDouble(bizQuoteResult.getPremium53());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 附加绝对免赔率特约条款(机动车第三者责任保险)
|
|
|
+ if (InsurKind.MJ2.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // premium06XNY C 附加绝对免赔率特约险(三者)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium06XNY())?0:Double.parseDouble(bizQuoteResult.getPremium06XNY());
|
|
|
+ }else{
|
|
|
+ // premium54 C 附加绝对免赔率特约险(三者)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium54())?0:Double.parseDouble(bizQuoteResult.getPremium54());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 附加绝对免赔率特约条款(机动车车上人员责任保险(司机))
|
|
|
+ if (InsurKind.MJ3.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // //premium07XNY C 附加绝对免赔率特约险(车上人员司机)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium07XNY())?0:Double.parseDouble(bizQuoteResult.getPremium07XNY());
|
|
|
+ }else{
|
|
|
+ //premium55 C 附加绝对免赔率特约险(车上人员司机)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium55())?0:Double.parseDouble(bizQuoteResult.getPremium55());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 附加绝对免赔率特约条款(机动车车上人员责任保险(乘客))
|
|
|
+ if (InsurKind.MJ4.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // premium08XNY C 附加绝对免赔率特约险(车上人员乘客)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium08XNY())?0:Double.parseDouble(bizQuoteResult.getPremium08XNY());
|
|
|
+ }else{
|
|
|
+ // * premium56 C 附加绝对免赔率特约险(车上人员乘客)保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium56())?0:Double.parseDouble(bizQuoteResult.getPremium56());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //附加修理期间费用补偿险 premium10 C 附加修理期间费用补偿险保费 非能源 无
|
|
|
+ // premium09XNY C 附加车轮单独损失险保费 能源车 无
|
|
|
+ // premium10XNY C 附加新增加设备损失险保费 能源车 无
|
|
|
+ // premium11 C 附加新增加设备损失险保费 非能源 无
|
|
|
+ // 附加新增加设备损失险 暂时没有
|
|
|
+ //附加车身划痕损失险
|
|
|
+ if (InsurKind.L.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ //premium11XNY C 附加车身划痕损失险保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium11XNY())?0:Double.parseDouble(bizQuoteResult.getPremium11XNY());
|
|
|
+ }else{
|
|
|
+ //premium17 C 附加车身划痕损失险保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium17())?0:Double.parseDouble(bizQuoteResult.getPremium17());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //附加法定节假日限额翻倍险
|
|
|
+ if (InsurKind.BD.getCode().equalsIgnoreCase(code)) {
|
|
|
+ if(xnyFlag){
|
|
|
+ // * premium17XNY C 附加法定节假日限额翻倍险保费
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium17XNY())?0:Double.parseDouble(bizQuoteResult.getPremium17XNY());
|
|
|
+ }else{
|
|
|
+ //premium74 C 附加法定节假日限额翻倍险保费 能源无
|
|
|
+ val = StringUtils.isBlank(bizQuoteResult.getPremium74())?0:Double.parseDouble(bizQuoteResult.getPremium74());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //premium32 C 附加精神损害抚慰金责任险(三者)保费 能源无
|
|
|
+ //premium30 C 附加精神损害抚慰金责任险(司机)保费 能源无
|
|
|
+ // * premium31 C 附加精神损害抚慰金责任险(乘客)保费 能源无
|
|
|
+ // * premium52 C 附加车轮单独损失险保费 能源无
|
|
|
+ // * premium73 C 机动车钥匙丢失或损坏费用补偿险保费 能源无
|
|
|
+ // *
|
|
|
+ // * premium75 C 附加发动机损坏除外特约条款保费 能源无
|
|
|
+ // premium12XNY C 附加修理期间费用补偿险保费 新能源 无
|
|
|
+ //premium13XNY C 附加车上货物责任险保费
|
|
|
+ // * premium14XNY C 附加精神损害抚慰金责任险(三者保费
|
|
|
+ // * premium15XNY C 附加精神损害抚慰金责任险(司机保费
|
|
|
+ //* premium16XNY C 附加精神损害抚慰金责任险(乘客保费
|
|
|
+ //* premium21XNY C 附加外部电网故障损失险保费
|
|
|
+ // * premium22XNY C 附加自用充电桩损失保险保费
|
|
|
+ // * premium23XNY C 附加自用充电桩责任保险保费
|
|
|
+ return val;
|
|
|
}
|
|
|
|
|
|
public HttpResult<QuoteRespVo> responseOrder(QuoteResponse response,
|
|
|
- QuoteRespVo quoteRespVo,
|
|
|
+ PingAnQuoteRespVo quoteRespVo,
|
|
|
PtlAgreementAttribution ptlAgreementAttribution,
|
|
|
String orderId,
|
|
|
String userId,
|
|
|
PinganApiLog pinganApiLog,
|
|
|
- CarConfirmResponse carConfirmResponse
|
|
|
+ CarConfirmResponse carConfirmResponse,
|
|
|
+ PingAnQuoteVo<Map<String,Object>> quoteVo
|
|
|
+
|
|
|
) {
|
|
|
// 保存订单信息
|
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
|
@@ -402,14 +612,68 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(response)));
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
insAreaCompany.setInsOrderNo(flowid);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- QuoteResponse.AhsUpcActualPremiumDTO ahsUpcActualPremium = response.getAhsUpcActualPremium();
|
|
|
- // 小微险保费
|
|
|
- QuoteResponse.XwActualPremiumDTO xwActualPremium = response.getXwActualPremium();
|
|
|
- map.put("xwActualPremium", xwActualPremium);
|
|
|
- map.put("ahsUpcActualPremium", ahsUpcActualPremium);
|
|
|
+
|
|
|
+ Map<String, Object> map = quoteVo.getAccidentalDrivingVo();
|
|
|
+ List<QuoteRequest.UnAutoListInfoDTO> unAutoListInfoList=new ArrayList<>();
|
|
|
+ List<QuoteRequest.UnAutoListInfoDTO> xiaoWeiListInfoList=new ArrayList<>();
|
|
|
+ List<QuoteRequest.CombinationInfoDTO> combinationInfoList=new ArrayList<>();
|
|
|
+ if(map!=null && map.get("0")!=null ){
|
|
|
+ LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("0");
|
|
|
+ if(linkedMap!=null && linkedMap.size()>0){
|
|
|
+ InsDrivingIntentionInsuranceSonVo vo = BeanUtil.mapToBean(linkedMap, InsDrivingIntentionInsuranceSonVo.class, true);
|
|
|
+ QuoteRequest.UnAutoListInfoDTO unAutoListInfoDTO =new QuoteRequest.UnAutoListInfoDTO(vo.getProductCode(),vo.getCode(),vo.getQuantity());
|
|
|
+ unAutoListInfoList.add(unAutoListInfoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(map!=null && map.get("1")!=null ){
|
|
|
+ LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("1");
|
|
|
+ if(linkedMap!=null && linkedMap.size()>0){
|
|
|
+ InsDrivingIntentionInsuranceSonVo vo = BeanUtil.mapToBean(linkedMap, InsDrivingIntentionInsuranceSonVo.class, true);
|
|
|
+ QuoteRequest.UnAutoListInfoDTO unAutoListInfoDTO =new QuoteRequest.UnAutoListInfoDTO(vo.getProductCode(),vo.getCode(),vo.getQuantity());
|
|
|
+ unAutoListInfoList.add(unAutoListInfoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(map!=null && map.get("2")!=null ){
|
|
|
+ LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("2");
|
|
|
+ if(linkedMap!=null && linkedMap.size()>0){
|
|
|
+ List<InsDrivingIntentionInsuranceSonVo> zhlist = (List<InsDrivingIntentionInsuranceSonVo>)linkedMap.get("2");
|
|
|
+ for(InsDrivingIntentionInsuranceSonVo zhVo : zhlist ){
|
|
|
+ QuoteRequest.CombinationInfoDTO combinationInfo =new QuoteRequest.CombinationInfoDTO(zhVo.getProductCode(),zhVo.getCode(),zhVo.getQuantity(),zhVo.getCombineProductType());
|
|
|
+ combinationInfoList.add(combinationInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//赋值驾意险信息
|
|
|
- //insAreaCompany.setPingAnAccidentInfo(JSON.parseObject(JSON.toJSONString(map)));
|
|
|
+ Map<String,Object> jyMap=new HashMap<>();
|
|
|
+ Map<String,Object> xwMap=new HashMap<>();
|
|
|
+ Map<String,Object> zhMap=new HashMap<>();
|
|
|
+ if(unAutoListInfoList!=null && unAutoListInfoList.size()>0){
|
|
|
+ jyMap.put("sumAmount",quoteRespVo.getCyPremium());
|
|
|
+ jyMap.put("list",unAutoListInfoList);
|
|
|
+ }
|
|
|
+ if(xiaoWeiListInfoList!=null && xiaoWeiListInfoList.size()>0){
|
|
|
+ xwMap.put("sumAmount",quoteRespVo.getXwPremium());
|
|
|
+ xwMap.put("list",xiaoWeiListInfoList);
|
|
|
+ }
|
|
|
+ if(combinationInfoList!=null && combinationInfoList.size()>0){
|
|
|
+ zhMap.put("sumAmount",quoteRespVo.getZhPremium());
|
|
|
+ zhMap.put("list",combinationInfoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
|
|
|
+ if(jyMap!=null && jyMap.size()>0){
|
|
|
+ list.add(jyMap);
|
|
|
+ }
|
|
|
+ if(xwMap!=null && xwMap.size()>0){
|
|
|
+ list.add(xwMap);
|
|
|
+ }
|
|
|
+ if(zhMap!=null && zhMap.size()>0){
|
|
|
+ list.add(zhMap);
|
|
|
+ }
|
|
|
+ if(list!=null && list.size()>0){
|
|
|
+ insAreaCompany.setAccidentInfo(JSON.parseArray(JSON.toJSONString(list)));
|
|
|
+ }
|
|
|
// 车船税
|
|
|
QuoteResponse.ForceQuoteResultDTO.TaxDTO tax = response.getForceQuoteResult().getTax();
|
|
|
TaxArrears taxArrears = new TaxArrears("往年欠税", Double.parseDouble(tax.getLastYearPay()),
|
|
|
@@ -456,8 +720,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//图片
|
|
|
List<InsUploadImagesDto> imgList = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(insAreaCompany.getOrderno());
|
|
|
|
|
|
- // List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insOrders.getOrderno(),
|
|
|
- // insAreaCompany.getId(), true);
|
|
|
+ // List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insOrders.getOrderno(),
|
|
|
+ // insAreaCompany.getId(), true);
|
|
|
if (imgList.isEmpty()) {
|
|
|
return HttpResult.error("影像集合为空");
|
|
|
} else {
|
|
|
@@ -483,7 +747,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String documentFormat = fileName.split("\\.")[1];
|
|
|
boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
|
|
|
if(!upLoadFileFlag){
|
|
|
- throw new SystemException("上传影像文件失败");
|
|
|
+ // throw new SystemException("上传影像文件失败");
|
|
|
}
|
|
|
UploadFilesRequest.DocListDTO docListDTO = new UploadFilesRequest.DocListDTO(key, documentClass, documentType, documentName,documentFormat ,
|
|
|
null, insAreaCompany.getJqapplyno(),null, parameters.getUserId(), "openApi");
|
|
|
@@ -750,8 +1014,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
List<String> list=new ArrayList<>();
|
|
|
- String bizApplyNo = insAreaCompany.getJqpolicyno();
|
|
|
- String forceApplyNo = insAreaCompany.getSypolicyno();
|
|
|
+ String bizApplyNo = insAreaCompany.getSyapplyno();
|
|
|
+ String forceApplyNo = insAreaCompany.getJqapplyno();
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
list.add(bizApplyNo);
|
|
|
}
|
|
|
@@ -1082,16 +1346,18 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
} else if (("单商".equals(insAreaCompany.getProduct()) || "单三".equals(insAreaCompany.getProduct())) && sqflag) {
|
|
|
insAreaCompany.setSypolicyno(sypolicyno);
|
|
|
}
|
|
|
- if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status)){
|
|
|
+ String orderstatus = insAreaCompany.getOrderstatus();
|
|
|
+ if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) && ("0".equals(orderstatus) || "1".equals(orderstatus)) ){
|
|
|
//已核保待缴费
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
- }else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status)){
|
|
|
+ }else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status) && ("0".equals(orderstatus) || "1".equals(orderstatus) || "2".equals(orderstatus)) ){
|
|
|
//说明核保成功,更新大订单和小订单的状态为3 更新为已承保
|
|
|
if(StringUtils.isNotBlank(noticeNo)){
|
|
|
insAreaCompany.setNoticeNo(noticeNo);
|
|
|
}
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
}
|
|
|
+
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("更新状态成功");
|
|
|
|
|
|
@@ -1270,7 +1536,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
} catch (Exception e) {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
- if (recoverApplyVerifyCodeResponse != null && "0".equals(recoverApplyVerifyCodeResponse.getResultCode())) {
|
|
|
+ if (recoverApplyVerifyCodeResponse != null && "0".equals(recoverApplyVerifyCodeResponse.getResultCode()) || (recoverApplyVerifyCodeResponse != null && recoverApplyVerifyCodeResponse.getResultMessage().contains("已成功采集验证码"))) {
|
|
|
return createNotice(companyId);
|
|
|
}else{
|
|
|
throw new SystemException(recoverApplyVerifyCodeResponse.getResultMessage());
|
|
|
@@ -1290,51 +1556,74 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
// 通过 协议id获取配置实体
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
- String forceApplyNo= insAreaCompany.getJqapplyno();
|
|
|
- String bizApplyNo = insAreaCompany.getSyapplyno();
|
|
|
//生成通知单号
|
|
|
ArrayList<String> noticelist =new ArrayList<String>();
|
|
|
+ String bizApplyNo = insAreaCompany.getSyapplyno();
|
|
|
+ String forceApplyNo = insAreaCompany.getJqapplyno();
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
noticelist.add(bizApplyNo);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(forceApplyNo)) {
|
|
|
noticelist.add(forceApplyNo);
|
|
|
}
|
|
|
- //生成通知单号
|
|
|
- NoticeDoRequest noticeDoRequest = new NoticeDoRequest(parameters.getUserId(), noticelist);
|
|
|
- NoticeDoResponse noticeDoResponse = null;
|
|
|
+ String noticeNo="";
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
|
|
|
- try {
|
|
|
- noticeDoResponse = pinganRequestApiComponents.createNoticeNo(noticeDoRequest,pinganApiLog);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new SystemException(e.getMessage());
|
|
|
- }
|
|
|
- String noticeNo = noticeDoResponse.getNoticeNo();
|
|
|
- ScanCodeURLRequest.DocumentDTO noticeNoeDto=new ScanCodeURLRequest.DocumentDTO(noticeNo,"07");
|
|
|
- ArrayList<ScanCodeURLRequest.DocumentDTO> scancodelist =new ArrayList<ScanCodeURLRequest.DocumentDTO>();
|
|
|
- if (StringUtils.isNotBlank(noticeNo)) {
|
|
|
- scancodelist.add(noticeNoeDto);
|
|
|
+ if(StringUtils.isNotBlank(insAreaCompany.getNoticeNo())){
|
|
|
+ noticeNo = insAreaCompany.getNoticeNo();
|
|
|
+ }else{
|
|
|
+ //生成通知单号
|
|
|
+ NoticeDoRequest noticeDoRequest = new NoticeDoRequest(parameters.getUserId(), noticelist);
|
|
|
+ NoticeDoResponse noticeDoResponse = null;
|
|
|
+ try {
|
|
|
+ noticeDoResponse = pinganRequestApiComponents.createNoticeNo(noticeDoRequest,pinganApiLog);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ noticeNo = noticeDoResponse.getNoticeNo();
|
|
|
}
|
|
|
+
|
|
|
// 获取支付的链接 只支持通知单号类型07 单证类型(01投保单02保单03批改申请单04批单05赔案号06报案号07通知单号)
|
|
|
pinganApiLog.setId(null);
|
|
|
- ScanCodeURLRequest scanCodeURLRequest = new ScanCodeURLRequest(scancodelist, "68",parameters.getUserId());
|
|
|
- ScanCodeURLResponse scanCodeURLResponse = null;
|
|
|
+ ChexianStandardPrePaymentResponse chexianStandardPrePaymentResponse = null;
|
|
|
+ long currentTimeMillis = System.currentTimeMillis();
|
|
|
+ // 转换为秒,并去掉前10位(即 Tue Aug 20 18:26:39 GMT+08:00 2019 对应的秒数)
|
|
|
+ long seconds = currentTimeMillis / 1000L;
|
|
|
+ // 保留后13位
|
|
|
+ long l = seconds % 1000000000000L;
|
|
|
+ String tradeNo=properties.getClientId()+l ;
|
|
|
+ String clientId=properties.getClientId();
|
|
|
+ String mingwen=clientId +noticeNo+"CNY" +insAreaCompany.getSumpremium();
|
|
|
+ String signMsg = MD5Util.sha256Hex(mingwen);
|
|
|
+
|
|
|
+ ChexianStandardPrePaymentRequest chexianStandardPrePaymentRequest =new ChexianStandardPrePaymentRequest(insAreaCompany.getSumpremium().toString(),null,null,noticeNo,null,null,tradeNo,signMsg,clientId,"CNY", properties.getClientId()+"车险保费",null);
|
|
|
try {
|
|
|
- scanCodeURLResponse = pinganRequestApiComponents.getScanCodeURL(scanCodeURLRequest,pinganApiLog);
|
|
|
+ chexianStandardPrePaymentResponse = pinganRequestApiComponents.chexianStandardPrePayment(chexianStandardPrePaymentRequest,pinganApiLog);
|
|
|
} catch (Exception e) {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
- String payUrl = "";
|
|
|
- //成功将支付的url链接赋值
|
|
|
- if (scanCodeURLResponse != null && ScanCodeURLResponseCodeEnum.SCAN_CODE_URL_CODE_MSG_Y.getCode().equals(scanCodeURLResponse.getResultCode())) {
|
|
|
- payUrl = scanCodeURLResponse.getScanCodeURLList().get(0).getScanCodeURL();
|
|
|
- } else {
|
|
|
- return HttpResult.error("二维码支付接口报错");
|
|
|
- }
|
|
|
- insAreaCompany.setPaymentLink(payUrl);
|
|
|
- return HttpResult.ok(payUrl);
|
|
|
+ return HttpResult.ok(chexianStandardPrePaymentResponse.getPayUrl());
|
|
|
}
|
|
|
/**
|
|
|
+ *
|
|
|
+ * ScanCodeURLRequest scanCodeURLRequest = new ScanCodeURLRequest(scancodelist, "68",parameters.getUserId());
|
|
|
+ * ScanCodeURLResponse scanCodeURLResponse = null;
|
|
|
+ * try {
|
|
|
+ * scanCodeURLResponse = pinganRequestApiComponents.getScanCodeURL(scanCodeURLRequest,pinganApiLog);
|
|
|
+ * } catch (Exception e) {
|
|
|
+ * throw new SystemException(e.getMessage());
|
|
|
+ * }
|
|
|
+ * String payUrl = "";
|
|
|
+ * //成功将支付的url链接赋值
|
|
|
+ * if (scanCodeURLResponse != null && ScanCodeURLResponseCodeEnum.SCAN_CODE_URL_CODE_MSG_Y.getCode().equals(scanCodeURLResponse.getResultCode())) {
|
|
|
+ * payUrl = scanCodeURLResponse.getScanCodeURLList().get(0).getScanCodeURL();
|
|
|
+ * } else {
|
|
|
+ * return HttpResult.error("二维码支付接口报错");
|
|
|
+ * }
|
|
|
+ * insAreaCompany.setPaymentLink(payUrl);
|
|
|
+ *
|
|
|
+ * /
|
|
|
+
|
|
|
+ /**
|
|
|
* @version
|
|
|
* @author: hxl
|
|
|
* @Date: 2024/7/22 18:57
|
|
|
@@ -1349,10 +1638,10 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
|
|
|
- String bizApplyNo = insAreaCompany.getJqpolicyno();
|
|
|
- String forceApplyNo = insAreaCompany.getSypolicyno();
|
|
|
//生成通知单号
|
|
|
ArrayList<String> noticelist =new ArrayList<String>();
|
|
|
+ String bizApplyNo = insAreaCompany.getSyapplyno();
|
|
|
+ String forceApplyNo = insAreaCompany.getJqapplyno();
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
noticelist.add(bizApplyNo);
|
|
|
}
|
|
|
@@ -1564,8 +1853,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
pinganApiLog.setId(null);
|
|
|
pinganApiLog.setRequestUrl("/payReturn");
|
|
|
pinganApiLog.setRequestType("支付回调");
|
|
|
- pinganApiLog.setRequestParam(payReturnRequest.toString());
|
|
|
- pinganApiLog.setResponseBody(null);
|
|
|
+ pinganApiLog.setRequestParam(new Gson().toJson(payReturnRequest));
|
|
|
+ pinganApiLog.setResponseBody(payReturnRequest.getResultMsg()+"-"+payReturnRequest.getErrorMsg());
|
|
|
pinganApiLogService.save(pinganApiLog);
|
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
@@ -1573,8 +1862,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
List<String> list = new ArrayList<>();
|
|
|
- String bizApplyNo = insAreaCompany.getJqpolicyno();
|
|
|
- String forceApplyNo = insAreaCompany.getSypolicyno();
|
|
|
+ String bizApplyNo = insAreaCompany.getSyapplyno();
|
|
|
+ String forceApplyNo = insAreaCompany.getJqapplyno();
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
list.add(bizApplyNo);
|
|
|
}
|
|
|
@@ -1595,22 +1884,29 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String status = "";
|
|
|
if (documentList != null && documentList.size() > 0) {
|
|
|
Boolean flag = false;
|
|
|
- //B2 为 未缴费
|
|
|
for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
status = dto.getStatus();
|
|
|
- if (!OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(dto.getStatus())) {
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(dto.getStatus())) {
|
|
|
flag = false;
|
|
|
}
|
|
|
}
|
|
|
//已承保更新承保状态
|
|
|
- if (!flag && OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status)) {
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status)) {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- return HttpResult.ok("承保成功");
|
|
|
+ return HttpResult.ok("支付成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ PinganApiLog pinganApiLog = new PinganApiLog(null,null,null);
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ pinganApiLog.setRequestUrl("/payReturn");
|
|
|
+ pinganApiLog.setRequestType("支付回调");
|
|
|
+ pinganApiLog.setRequestParam(new Gson().toJson(payReturnRequest));
|
|
|
+ pinganApiLog.setResponseBody(payReturnRequest.getResultMsg()+"-"+payReturnRequest.getErrorMsg());
|
|
|
+ pinganApiLogService.save(pinganApiLog);
|
|
|
}
|
|
|
return HttpResult.error("支付失败");
|
|
|
}
|