|
@@ -52,10 +52,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.Collections;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -160,7 +157,7 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
|
|
|
// 设置核心报价车型
|
|
// 设置核心报价车型
|
|
|
quoteRespVo.setCoreModels(vehicleModelInfosDTO.toCoreModelsVo());
|
|
quoteRespVo.setCoreModels(vehicleModelInfosDTO.toCoreModelsVo());
|
|
|
return responseOrder(calculatePremiumResponse, quoteRespVo, ptlAgreementAttribution, calculatePremiumRequest.getOrderId(),
|
|
return responseOrder(calculatePremiumResponse, quoteRespVo, ptlAgreementAttribution, calculatePremiumRequest.getOrderId(),
|
|
|
- calculatePremiumRequest.getOrderNo(),quoteVo.getAccidentalDrivingVo());
|
|
|
|
|
|
|
+ calculatePremiumRequest.getOrderNo(), quoteVo.getAccidentalDrivingVo());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -392,11 +389,12 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
|
|
|
|
|
|
|
|
return HttpResult.ok("撤单成功");
|
|
return HttpResult.ok("撤单成功");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
- * @version
|
|
|
|
|
- * @author: hxl
|
|
|
|
|
- * @Date: 2024/3/28 16:03
|
|
|
|
|
- * @Description:
|
|
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/3/28 16:03
|
|
|
|
|
+ * @Description:
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> paymentCallbacks(PaymentCallbacksRequest paymentCallbacksRequest) {
|
|
public HttpResult<Object> paymentCallbacks(PaymentCallbacksRequest paymentCallbacksRequest) {
|
|
@@ -500,6 +498,31 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
|
|
|
quoteRespVo.setAccidentInfoStr(priceInfoListDTO.getClaimTimes());
|
|
quoteRespVo.setAccidentInfoStr(priceInfoListDTO.getClaimTimes());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 车辆信息
|
|
|
|
|
+ for (CalculatePremiumResponse.PriceInfoListDTO priceInfoListDTO : priceInfoList) {
|
|
|
|
|
+
|
|
|
|
|
+ // 鼎然分
|
|
|
|
|
+ String score = Optional.ofNullable(priceInfoListDTO.getUbiPredictedInfo())
|
|
|
|
|
+ .map(CalculatePremiumResponse.PriceInfoListDTO.UbiPredictedInfoDTO::getScore)
|
|
|
|
|
+ .orElse(null);
|
|
|
|
|
+ quoteRespVo.setUbiPredictedInfoScore(score);
|
|
|
|
|
+
|
|
|
|
|
+ switch (priceInfoListDTO.getRiskCode()) {
|
|
|
|
|
+ case RiskCodeEnum.TRAFFIC_CODE:
|
|
|
|
|
+ quoteRespVo.setJqScore(priceInfoListDTO.getRevPredScore());
|
|
|
|
|
+ quoteRespVo.setJqLossRation(StringUtils.toDouble(priceInfoListDTO.getLrRecom()));
|
|
|
|
|
+ quoteRespVo.setJqClaims(priceInfoListDTO.getClaimTimes());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case RiskCodeEnum.BUSINESS_CODE:
|
|
|
|
|
+ quoteRespVo.setSyScore(priceInfoListDTO.getRevPredScore());
|
|
|
|
|
+ quoteRespVo.setSyLossRation(StringUtils.toDouble(priceInfoListDTO.getLrRecom()));
|
|
|
|
|
+ quoteRespVo.setSyClaims(priceInfoListDTO.getClaimTimes());
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
List<QuoteKindRespVo> kindList1 = new ArrayList<>();
|
|
List<QuoteKindRespVo> kindList1 = new ArrayList<>();
|
|
|
List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
|
|
List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
|
|
|
// 报价险种放入保费
|
|
// 报价险种放入保费
|
|
@@ -576,16 +599,8 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
|
|
|
Double.parseDouble(carShipTax.getLateFee()));
|
|
Double.parseDouble(carShipTax.getLateFee()));
|
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
|
insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
|
|
insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
|
|
|
- //add by hxl 2024-04-08 添加紫荆能源车的鼎然-车辆风险评分 返回前台
|
|
|
|
|
- List<CalculatePremiumResponse.PriceInfoListDTO> priceInfoList = calculatePremiumResponse.getPriceInfoList();
|
|
|
|
|
- if(priceInfoList!=null && !priceInfoList.isEmpty()){
|
|
|
|
|
- CalculatePremiumResponse.PriceInfoListDTO priceInfoListDTO = priceInfoList.get(0);
|
|
|
|
|
- if(priceInfoListDTO.getUbiPredictedInfo()!=null && priceInfoListDTO.getUbiPredictedInfo().getScore()!=null && !"".equals(priceInfoListDTO.getUbiPredictedInfo().getScore())){
|
|
|
|
|
- String score = priceInfoListDTO.getUbiPredictedInfo().getScore();
|
|
|
|
|
- quoteRespVo.setUbiPredictedInfoScore(score);
|
|
|
|
|
- insAreaCompany.setUbiPredictedInfoScore(score);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ insAreaCompany.setUbiPredictedInfoScore(quoteRespVo.getUbiPredictedInfoScore());
|
|
|
|
|
+
|
|
|
List<InsAreaCompanyAccidentalDriving> insAreaCompanyAccidentalDrivings = new ArrayList<>();
|
|
List<InsAreaCompanyAccidentalDriving> insAreaCompanyAccidentalDrivings = new ArrayList<>();
|
|
|
accidentalDrivingVo.forEach(accidentalDriving -> {
|
|
accidentalDrivingVo.forEach(accidentalDriving -> {
|
|
|
InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = new InsAreaCompanyAccidentalDriving();
|
|
InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = new InsAreaCompanyAccidentalDriving();
|
|
@@ -595,22 +610,23 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
|
|
|
insAreaCompanyAccidentalDrivings.add(insAreaCompanyAccidentalDriving);
|
|
insAreaCompanyAccidentalDrivings.add(insAreaCompanyAccidentalDriving);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- insAreaCompany.setIsDjq(calculatePremiumResponse.getBasePart().getIsDjq().equals("")?"0":calculatePremiumResponse.getBasePart().getIsDjq());
|
|
|
|
|
- insAreaCompanyService.insertCompanyAndOrders(insAreaCompany,insAreaCompanyAccidentalDrivings);
|
|
|
|
|
|
|
+ insAreaCompany.setIsDjq(calculatePremiumResponse.getBasePart().getIsDjq().equals("") ? "0" :
|
|
|
|
|
+ calculatePremiumResponse.getBasePart().getIsDjq());
|
|
|
|
|
+ insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDrivings);
|
|
|
quoteRespVo.setCompanyId(orderNo);
|
|
quoteRespVo.setCompanyId(orderNo);
|
|
|
//添加调用费用匹配功能
|
|
//添加调用费用匹配功能
|
|
|
// feeRuleSchemeService.dealFeeOrderInfo(quoteInfoVo, quoteRespVo, ptlAgreementAttribution.getId(), insAreaCompany.getId());
|
|
// feeRuleSchemeService.dealFeeOrderInfo(quoteInfoVo, quoteRespVo, ptlAgreementAttribution.getId(), insAreaCompany.getId());
|
|
|
return HttpResult.ok("报价成功", quoteRespVo);
|
|
return HttpResult.ok("报价成功", quoteRespVo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
- * @Description 更新订单状态和支付时间
|
|
|
|
|
- * @Author xingming
|
|
|
|
|
- * @Date 2024/3/28 17:17
|
|
|
|
|
- * @Param
|
|
|
|
|
- * @Return
|
|
|
|
|
- * @Exception
|
|
|
|
|
- *
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * @Description 更新订单状态和支付时间
|
|
|
|
|
+ * @Author xingming
|
|
|
|
|
+ * @Date 2024/3/28 17:17
|
|
|
|
|
+ * @Param
|
|
|
|
|
+ * @Return
|
|
|
|
|
+ * @Exception
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
public void getOrderDetailNew(String companyId) {
|
|
public void getOrderDetailNew(String companyId) {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
@@ -629,17 +645,17 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
|
|
|
if (OrderStatusEnum.O_4.getCode().equals(orderStatus)) {
|
|
if (OrderStatusEnum.O_4.getCode().equals(orderStatus)) {
|
|
|
// 3.1 非车险订单存入数据
|
|
// 3.1 非车险订单存入数据
|
|
|
String payTime = resultObj.getPayTime();
|
|
String payTime = resultObj.getPayTime();
|
|
|
|
|
+
|
|
|
//更新支付时间
|
|
//更新支付时间
|
|
|
- if (StringUtils.isNotEmpty(payTime)) {
|
|
|
|
|
- insAreaCompany.setPayDate(LocalDateTime.parse(payTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //设置支付时间
|
|
|
|
|
+ LocalDateTime localDateTime = Optional.ofNullable(payTime)
|
|
|
|
|
+ .map(x -> LocalDateTime.parse(x, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
|
|
|
|
|
+ .orElse(LocalDateTime.now());
|
|
|
|
|
+ insAreaCompany.setPayDate(localDateTime);
|
|
|
|
|
+
|
|
|
List<DrivingInsuranceDto> drivingInsuranceDto = queryOrderDetailResponse.getDrivingInsuranceDto();
|
|
List<DrivingInsuranceDto> drivingInsuranceDto = queryOrderDetailResponse.getDrivingInsuranceDto();
|
|
|
insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDto)));
|
|
insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDto)));
|
|
|
//更新承保状态
|
|
//更新承保状态
|
|
|
- //设置支付时间
|
|
|
|
|
- if(insAreaCompany.getPayDate()==null){
|
|
|
|
|
- insAreaCompany.setPayDate(LocalDateTime.now());
|
|
|
|
|
- }
|
|
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrdersNew(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrdersNew(insAreaCompany);
|
|
|
}
|
|
}
|