|
|
@@ -8,6 +8,8 @@ import com.ydtech.constants.enums.InsOrderStatus;
|
|
|
import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
+import com.ydtech.modules.fee.dto.FeeSchemeReqDto;
|
|
|
+import com.ydtech.modules.fee.service.FeeRuleSchemeService;
|
|
|
import com.ydtech.modules.ins.model.request.Response;
|
|
|
import com.ydtech.modules.ins.model.vo.*;
|
|
|
import com.ydtech.modules.ins.model.ya.CarModelDTO;
|
|
|
@@ -41,6 +43,7 @@ import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.utils.CalculateUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.core.ParameterizedTypeReference;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
@@ -67,7 +70,9 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
|
|
|
private final ConfigureParametersComponents configureParametersComponents;
|
|
|
|
|
|
- public ZhongMeiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService, ZhongmeiRequestApiComponents zhongmeiRequestApiComponents, ZhongmeiRequestComponents zhongmeiRequestComponents, ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService) {
|
|
|
+ private final FeeRuleSchemeService feeRuleSchemeService;
|
|
|
+
|
|
|
+ public ZhongMeiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService, ZhongmeiRequestApiComponents zhongmeiRequestApiComponents, ZhongmeiRequestComponents zhongmeiRequestComponents, ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService,FeeRuleSchemeService feeRuleSchemeService) {
|
|
|
this.insOrdersService = insOrdersService;
|
|
|
this.insAreaCompanyService = insAreaCompanyService;
|
|
|
this.insTaskImagesService = insTaskImagesService;
|
|
|
@@ -75,6 +80,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
this.zhongmeiRequestComponents = zhongmeiRequestComponents;
|
|
|
this.configureParametersComponents = configureParametersComponents;
|
|
|
this.ptlAgreementAttributionService = ptlAgreementAttributionService;
|
|
|
+ this.feeRuleSchemeService = feeRuleSchemeService;
|
|
|
}
|
|
|
|
|
|
private void modelInquiry(String modelName, List<ModelsQueryResponse.SimpleStadarCarDTO> simpleStadarCarDTOS) {
|
|
|
@@ -142,6 +148,11 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
QuotedPriceResponse quotedPriceResponse = zhongmeiRequestApiComponents.quotedPrice(quotedPriceRequest, QuotedPriceResponse.class);
|
|
|
QuoteRespVo quoteRespVo = getQuoteRespVo(quotedPriceResponse, quoteInfo);
|
|
|
|
|
|
+ //这里调用费用匹配功能
|
|
|
+ InsOrders insOrders = insOrdersService.getById(quoteRespVo.getOrderno());
|
|
|
+ List<KindInfoVo> kindInfoVoList = quoteInfo.getKindList();
|
|
|
+ FeeSchemeReqDto feeSchemeReqDto = getFeeSchemeInfo(quotedPriceRequest,quotedPriceResponse,quoteRespVo,ptlAgreementAttribution.getId(),insOrders.getProductid(),kindInfoVoList);
|
|
|
+ feeRuleSchemeService.matchTheAppropriateFees(feeSchemeReqDto);
|
|
|
return responseOrder(quotedPriceResponse, quoteRespVo, ptlAgreementAttribution);
|
|
|
}
|
|
|
|
|
|
@@ -395,6 +406,60 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
quoteRespVo.setTaxArrears(taxArrearsList);
|
|
|
return HttpResult.ok(quotedPriceResponse.getHead().getReturnMessage(), quoteRespVo);
|
|
|
}
|
|
|
+ private FeeSchemeReqDto getFeeSchemeInfo(QuotedPriceRequest quotedPriceRequest,QuotedPriceResponse quotedPriceResponse, QuoteRespVo quoteRespVo,String agreementId,String productId,List<KindInfoVo> kindInfoVoList){
|
|
|
+ QuotedPriceRequest.BusinessDataDTO.InsuredObjectDTO.PolicyCarDTO policyCarDTO = quotedPriceRequest.getBusinessData().getInsuredObject().getPolicyCar();
|
|
|
+ ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO = quotedPriceRequest.getBusinessData().getInsuredObject().getSimpleStadarCar();
|
|
|
+ List<QuoteKindRespVo> kindList = quoteRespVo.getKindList();
|
|
|
+ String thirdPartyInsurance = "";
|
|
|
+ if(kindList!=null && kindList.size()>0){
|
|
|
+ for(QuoteKindRespVo quoteKindRespVo:kindList){
|
|
|
+ if("B".equals(quoteKindRespVo.getKindCode())){
|
|
|
+ thirdPartyInsurance = String.valueOf(quoteKindRespVo.getAmount());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ FeeSchemeReqDto feeSchemeReqDto = new FeeSchemeReqDto();
|
|
|
+ String isTransfer = "0";
|
|
|
+ String isNewCar = "0";
|
|
|
+ String isRenewal = "0";
|
|
|
+ String useNature = "";
|
|
|
+ feeSchemeReqDto.setBusType(productId);//"业务类型:单交0330、单商034001、单三034002、交三0330034002、交商0330034001"
|
|
|
+ feeSchemeReqDto.setAgreementId(agreementId);//协议ID
|
|
|
+ if(StringUtils.isNotEmpty(policyCarDTO.getChgOwnerFlag())&& "01".equals(policyCarDTO.getChgOwnerFlag())){
|
|
|
+ isTransfer = "1";
|
|
|
+ }
|
|
|
+ feeSchemeReqDto.setIsTransfer(isTransfer);//是否过户 1是 0否"
|
|
|
+ if(policyCarDTO.getNewCarSign()){
|
|
|
+ isNewCar = "1";
|
|
|
+ }
|
|
|
+ feeSchemeReqDto.setIsNewCar(isNewCar);//是否新车 1是 0否
|
|
|
+ feeSchemeReqDto.setIsNewEnergy("");//是否新能源 1是 0否
|
|
|
+ if(quotedPriceResponse.getBizPremium().getIsRenewal()){
|
|
|
+ isRenewal = "1";
|
|
|
+ }
|
|
|
+ feeSchemeReqDto.setIsRenewal(isRenewal);//是否续保 1是 0否
|
|
|
+ //页面要素及中煤交互请求返参没有,先默认写死
|
|
|
+ feeSchemeReqDto.setVehicleCategory("客车");//车辆大类: 客车、货车、特种车、挂车、摩托车、拖拉机
|
|
|
+ if("01".equals(policyCarDTO.getCarUseType())){
|
|
|
+ useNature = "家庭自用";
|
|
|
+ }
|
|
|
+ feeSchemeReqDto.setUseNature(useNature);//使用性质: 营业出租、营业租赁、营业公交、营业客运、营业货运、营业旅游、家庭自用、非营业机关事业、非营业企业、非营业个人
|
|
|
+ feeSchemeReqDto.setSeatNum(String.valueOf(simpleStadarCarDTO.getApprovedPassengersCapacity()));//座位数
|
|
|
+ feeSchemeReqDto.setPurchasePrice(simpleStadarCarDTO.getPurchasePrice());//新车购置价
|
|
|
+ feeSchemeReqDto.setApprovedLoadCapacity(String.valueOf(simpleStadarCarDTO.getApprovedLoad()));//核定载质量
|
|
|
+ feeSchemeReqDto.setJqPremium(String.valueOf(quoteRespVo.getJqPremium()));//交强保费
|
|
|
+ feeSchemeReqDto.setSyPremium(String.valueOf(quoteRespVo.getSyPremium()));//商业保费
|
|
|
+ feeSchemeReqDto.setSumPayTax(String.valueOf(quoteRespVo.getTaxAmount()));//车船税金额
|
|
|
+ feeSchemeReqDto.setThirdPartyInsurance(thirdPartyInsurance);//三者险保额
|
|
|
+ feeSchemeReqDto.setNoCarPremium("");//随车产品保费
|
|
|
+ feeSchemeReqDto.setSyDiscount("");//商业险折扣
|
|
|
+ feeSchemeReqDto.setJqDiscount("");//交强险折扣
|
|
|
+ feeSchemeReqDto.setInsuranceScore(quotedPriceResponse.getPlatMain().getZmScore());//保司评分 这里直接取中煤分
|
|
|
+ feeSchemeReqDto.setExpectedLossRate("");//预期赔付率
|
|
|
+ feeSchemeReqDto.setLicenseNo(policyCarDTO.getPlateNo());//车牌号
|
|
|
+
|
|
|
+ return feeSchemeReqDto;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public HttpResult<Object> auditStatusQuery(String companyId) {
|