|
|
@@ -212,7 +212,7 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
|
|
|
}
|
|
|
|
|
|
// 设置非车险(驾意险)保费
|
|
|
- if (quotationResponse.getCarPolicySubInfoList() != null && !quotationResponse.getCarPolicySubInfoList().isEmpty()) {
|
|
|
+ if (CollectionUtils.isNotEmpty(quotationResponse.getCarPolicySubInfoList())) {
|
|
|
ZiJinCrawlerQuotationResponse.CarPolicySubInfoList carPolicySubInfoList = quotationResponse.getCarPolicySubInfoList().get(0);
|
|
|
if (carPolicySubInfoList != null && carPolicySubInfoList.getActualPremium() != null) {
|
|
|
quoteResultsVo.getCosts().setNiPremium(carPolicySubInfoList.getActualPremium());
|
|
|
@@ -229,41 +229,12 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
|
|
|
* @param quoteResultsVo
|
|
|
*/
|
|
|
private static void calculateSumPremium(QuoteResultsVo quoteResultsVo) {
|
|
|
- double sumPremium = 0.0;
|
|
|
-
|
|
|
- if (quoteResultsVo.getCosts().getCiPremium() != null) {
|
|
|
- try {
|
|
|
- sumPremium += Double.parseDouble(quoteResultsVo.getCosts().getCiPremium());
|
|
|
- } catch (NumberFormatException e) {
|
|
|
- log.warn("交强险保费解析失败: {}", quoteResultsVo.getCosts().getCiPremium());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (quoteResultsVo.getCosts().getBiPremium() != null) {
|
|
|
- try {
|
|
|
- sumPremium += Double.parseDouble(quoteResultsVo.getCosts().getBiPremium());
|
|
|
- } catch (NumberFormatException e) {
|
|
|
- log.warn("商业险保费解析失败: {}", quoteResultsVo.getCosts().getBiPremium());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (quoteResultsVo.getCosts().getVvTax() != null) {
|
|
|
- try {
|
|
|
- sumPremium += Double.parseDouble(quoteResultsVo.getCosts().getVvTax());
|
|
|
- } catch (NumberFormatException e) {
|
|
|
- log.warn("车船税解析失败: {}", quoteResultsVo.getCosts().getVvTax());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (quoteResultsVo.getCosts().getNiPremium() != null) {
|
|
|
- try {
|
|
|
- sumPremium += Double.parseDouble(quoteResultsVo.getCosts().getNiPremium());
|
|
|
- } catch (NumberFormatException e) {
|
|
|
- log.warn("非车险保费解析失败: {}", quoteResultsVo.getCosts().getNiPremium());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- quoteResultsVo.getCosts().setSumPremium(String.valueOf(sumPremium));
|
|
|
+ BigDecimal ci = quoteResultsVo.getCosts().getCiPremium() == null ? BigDecimal.ZERO : new BigDecimal(quoteResultsVo.getCosts().getCiPremium());
|
|
|
+ BigDecimal bi = quoteResultsVo.getCosts().getBiPremium() == null ? BigDecimal.ZERO : new BigDecimal(quoteResultsVo.getCosts().getBiPremium());
|
|
|
+ BigDecimal vv = quoteResultsVo.getCosts().getVvTax() == null ? BigDecimal.ZERO : new BigDecimal(quoteResultsVo.getCosts().getVvTax());
|
|
|
+ BigDecimal jyx = quoteResultsVo.getCosts().getNiPremium() == null ? BigDecimal.ZERO : new BigDecimal(quoteResultsVo.getCosts().getNiPremium());
|
|
|
+ BigDecimal total = ci.add(bi).add(vv).add(jyx);
|
|
|
+ quoteResultsVo.getCosts().setSumPremium(total.toPlainString());
|
|
|
}
|
|
|
|
|
|
/**
|