|
|
@@ -13,6 +13,7 @@ import com.ydtech.modules.fee.dto.FeeFactorInfoDto;
|
|
|
import com.ydtech.modules.fee.dto.FeeSchemeReqDto;
|
|
|
import com.ydtech.modules.fee.dto.FeeSchemeResDto;
|
|
|
import com.ydtech.modules.fee.service.FeeRuleSchemeService;
|
|
|
+import com.ydtech.modules.ins.model.vo.AccidentResponseVo;
|
|
|
import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.KindInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.QuoteRespVo;
|
|
|
@@ -27,9 +28,13 @@ import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
import com.ydtech.modules.order.service.InsFeeOrderService;
|
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreement;
|
|
|
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
|
|
|
+import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
|
|
|
+import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementProductCostsService;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementService;
|
|
|
+import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -64,7 +69,10 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
|
|
|
private InsAreaCompanyService insAreaCompanyService;
|
|
|
@Resource
|
|
|
private PtlAgreementService ptlAgreementService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService;
|
|
|
+ @Resource
|
|
|
+ private PtlAgreementAttributionService ptlAgreementAttributionService;
|
|
|
|
|
|
/**
|
|
|
* 根据跟单信息,以及配置的费用因子,获取合适的跟单费用
|
|
|
@@ -921,6 +929,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
|
|
|
//----------------------------------------------分割线
|
|
|
|
|
|
public FeeSchemeReqDto getFeeSchemeInfo(BaseQuoteInfoVo quoteInfoVo, QuoteRespVo quoteRespVo, String agreementId, String productId){
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
|
|
|
CarInfoVo carInfoVo = quoteInfoVo.getCarInfo();
|
|
|
List<KindInfoVo> kindList = quoteInfoVo.getKindList();
|
|
|
String thirdPartyInsurance = "";
|
|
|
@@ -974,14 +983,29 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
|
|
|
feeSchemeReqDto.setIsTransfer(isTransfer);//是否过户 1是 0否"
|
|
|
|
|
|
//新旧车判断逻辑,初登日期小于当前日期加9个月
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
if(StringUtils.isNotEmpty(carInfoVo.getRegisterDate())){
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
LocalDate registerDate = LocalDate.parse(carInfoVo.getRegisterDate(), formatter).plusMonths(9);
|
|
|
- LocalDate currentDate = LocalDate.now();
|
|
|
if(currentDate.isBefore(registerDate)){
|
|
|
isNewCar = "1";
|
|
|
}
|
|
|
}
|
|
|
+ List<PtlNewCarJudgeRules> ptlNewCarJudgeRulesList = ptlNewCarJudgeRulesService.getByCompanyId(ptlAgreementAttribution.getInsCompanyId());
|
|
|
+ if(ptlNewCarJudgeRulesList!=null &&ptlNewCarJudgeRulesList.size()>0){
|
|
|
+ PtlNewCarJudgeRules ptlNewCarJudgeRules = ptlNewCarJudgeRulesList.get(0);
|
|
|
+ if("月".equals(ptlNewCarJudgeRules.getUnitTypeCode())){
|
|
|
+ LocalDate registerDate = LocalDate.parse(carInfoVo.getRegisterDate(), formatter).plusMonths(Integer.parseInt(ptlNewCarJudgeRules.getUnitTypeValue()));
|
|
|
+ if(currentDate.isBefore(registerDate)){
|
|
|
+ isNewCar = "1";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ LocalDate registerDate = LocalDate.parse(carInfoVo.getRegisterDate(), formatter).plusDays(Integer.parseInt(ptlNewCarJudgeRules.getUnitTypeValue()));
|
|
|
+ if(currentDate.isBefore(registerDate)){
|
|
|
+ isNewCar = "1";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
feeSchemeReqDto.setIsNewCar(isNewCar);//是否新车 1是 0否
|
|
|
if("1".equals(carInfoVo.getPowertype())||"2".equals(carInfoVo.getPowertype())||"3".equals(carInfoVo.getPowertype())){
|
|
|
isNewEnergy = "1";
|
|
|
@@ -1029,6 +1053,11 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
|
|
|
BigDecimal jqNoTaxPremium = new BigDecimal(0);
|
|
|
BigDecimal syNoTaxPremium = new BigDecimal(0);
|
|
|
InsOrders insOrders = insOrdersService.getById(quoteRespVo.getOrderno());
|
|
|
+ List<AccidentResponseVo> accidentList = quoteRespVo.getAccident();
|
|
|
+ /*BigDecimal accidentActualPremium = new BigDecimal(0);
|
|
|
+ for(AccidentResponseVo accidentResponseVo: accidentList){
|
|
|
+ accidentActualPremium = new BigDecimal(accidentResponseVo.getActualPremium());
|
|
|
+ }*/
|
|
|
FeeSchemeReqDto feeSchemeReqDto = this.getFeeSchemeInfo(quoteInfoVo,quoteRespVo,agreementId,insOrders.getProductid());
|
|
|
FeeSchemeResDto feeSchemeResDto = this.matchTheAppropriateFees(feeSchemeReqDto);
|
|
|
InsFeeOrder insFeeOrder = new InsFeeOrder(feeSchemeReqDto,feeSchemeResDto,businessNo);
|