|
|
@@ -263,20 +263,22 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
}
|
|
|
|
|
|
if(switchConfigService.ctDiscountSwitches()){ //是否自动计算折扣
|
|
|
- String EntireInitialDiscountStr = biContract.getDiscountInfo().getEntireInitialDiscount();
|
|
|
- String hopeDiscountStr = biContract.getContractMain().getHopeDiscount();
|
|
|
+ if(biContract != null) {
|
|
|
+ String EntireInitialDiscountStr = biContract.getDiscountInfo().getEntireInitialDiscount();
|
|
|
+ String hopeDiscountStr = biContract.getContractMain().getHopeDiscount();
|
|
|
// String hopeCoefficientStr = biContract.getContractMain().getHopeCoefficient();
|
|
|
- if(StringUtils.isNotBlank(hopeDiscountStr) && StringUtils.isNotBlank(EntireInitialDiscountStr)){
|
|
|
- // 获取商业险的初始建议折扣 和 期望折扣
|
|
|
- Double entireInitialDiscount = Double.parseDouble(EntireInitialDiscountStr); //初始建议折扣
|
|
|
- Double hopeDiscount = Double.parseDouble(hopeDiscountStr); // 期望折扣
|
|
|
- if(entireInitialDiscount > hopeDiscount){
|
|
|
- biDiscountBoo = true;
|
|
|
- }
|
|
|
- if(biDiscountBoo){
|
|
|
- entireInitialDiscount = entireInitialDiscount + 0.01;
|
|
|
- this.replaceDiscount(insurePremiumRequest,entireInitialDiscount);
|
|
|
- insurePremiumResponse = chengTaiRequestApiComponents.quoteApi(insurePremiumRequest,httpHeaders);
|
|
|
+ if (StringUtils.isNotBlank(hopeDiscountStr) && StringUtils.isNotBlank(EntireInitialDiscountStr)) {
|
|
|
+ // 获取商业险的初始建议折扣 和 期望折扣
|
|
|
+ Double entireInitialDiscount = Double.parseDouble(EntireInitialDiscountStr); //初始建议折扣
|
|
|
+ Double hopeDiscount = Double.parseDouble(hopeDiscountStr); // 期望折扣
|
|
|
+ if (entireInitialDiscount > hopeDiscount) {
|
|
|
+ biDiscountBoo = true;
|
|
|
+ }
|
|
|
+ if (biDiscountBoo) {
|
|
|
+ entireInitialDiscount = entireInitialDiscount + 0.01;
|
|
|
+ this.replaceDiscount(insurePremiumRequest, entireInitialDiscount);
|
|
|
+ insurePremiumResponse = chengTaiRequestApiComponents.quoteApi(insurePremiumRequest, httpHeaders);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|