|
@@ -418,9 +418,68 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
return quoteVo;
|
|
return quoteVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void validQuoteVo(BaseQuoteVo<AccidentalDrivingVo> quoteVo){
|
|
|
|
|
+ if(quoteVo.getJqpremium() != null && quoteVo.getJqpremium().compareTo(new BigDecimal(0)) <= 0){
|
|
|
|
|
+ throw new SystemException("交强险保费填写错误请重新填写");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getJqpolicyno() != null || quoteVo.getJqPolicy() != null || quoteVo.getJqpremium() != null || quoteVo.getJqCostsProportion() != null){
|
|
|
|
|
+ if(quoteVo.getJqpolicyno() == null){
|
|
|
|
|
+ throw new SystemException("交强险保单号不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getJqPolicy() == null){
|
|
|
|
|
+ throw new SystemException("交强险保单不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getJqpremium() == null){
|
|
|
|
|
+ throw new SystemException("交强险保费不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getJqCostsProportion() == null){
|
|
|
|
|
+ throw new SystemException("交强险总比例不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(quoteVo.getSypremium() != null && quoteVo.getSypremium().compareTo(new BigDecimal(0)) <= 0){
|
|
|
|
|
+ throw new SystemException("商业险保费填写错误请重新填写");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getSypolicyno() != null || quoteVo.getSyPolicy() != null || quoteVo.getSypremium() != null || quoteVo.getSyCostsProportion() != null){
|
|
|
|
|
+ if(quoteVo.getSypolicyno() == null){
|
|
|
|
|
+ throw new SystemException("商业险保单号不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getSyPolicy() == null){
|
|
|
|
|
+ throw new SystemException("商业险保单不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getSypremium() == null){
|
|
|
|
|
+ throw new SystemException("商业险保费不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getSyCostsProportion() == null){
|
|
|
|
|
+ throw new SystemException("商业险总比例不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(quoteVo.getJypremium() != null && quoteVo.getJypremium().compareTo(new BigDecimal(0)) <= 0){
|
|
|
|
|
+ throw new SystemException("非车险保费填写错误请重新填写");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getJypolicyno() != null || quoteVo.getJypremium() != null || quoteVo.getNoPolicy() != null || quoteVo.getNoCostsProportion() != null){
|
|
|
|
|
+ if(quoteVo.getJypolicyno() == null){
|
|
|
|
|
+ throw new SystemException("非车险保单号不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getNoPolicy() == null){
|
|
|
|
|
+ throw new SystemException("非车险保单不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getJypremium() == null){
|
|
|
|
|
+ throw new SystemException("非车险保费不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(quoteVo.getNoCostsProportion() == null){
|
|
|
|
|
+ throw new SystemException("非车险总比例不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public boolean saveSubOrder(BaseQuoteInfoVo quoteInfo, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
|
|
public boolean saveSubOrder(BaseQuoteInfoVo quoteInfo, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
|
|
|
|
|
+
|
|
|
|
|
+ validQuoteVo(quoteVo);
|
|
|
|
|
+
|
|
|
InsOrders insOrders = insOrdersService.getById(quoteInfo.getOrderNo());
|
|
InsOrders insOrders = insOrdersService.getById(quoteInfo.getOrderNo());
|
|
|
PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(quoteVo.getAgreementId());
|
|
PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(quoteVo.getAgreementId());
|
|
|
quoteVo = checkQuoteVo(quoteVo);
|
|
quoteVo = checkQuoteVo(quoteVo);
|
|
@@ -497,32 +556,45 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
//保存费用比例
|
|
//保存费用比例
|
|
|
InsAreaCompanyExternalFee insAreaCompanyExternalFee = new InsAreaCompanyExternalFee();
|
|
InsAreaCompanyExternalFee insAreaCompanyExternalFee = new InsAreaCompanyExternalFee();
|
|
|
insAreaCompanyExternalFee.setSubOrderNo(subOrderNo);
|
|
insAreaCompanyExternalFee.setSubOrderNo(subOrderNo);
|
|
|
- if(quoteVo.getJqSuperviseCostsProportion().compareTo(quoteVo.getJqCostsProportion()) > 0){
|
|
|
|
|
- //总比例等于手续费比例
|
|
|
|
|
- quoteVo.setJqSuperviseCostsProportion(quoteVo.getJqCostsProportion());
|
|
|
|
|
- quoteVo.setJqOtherCostsProportion(new BigDecimal(0));
|
|
|
|
|
- }else{
|
|
|
|
|
- //总比例减去手续费比例 = 跟单比例
|
|
|
|
|
- quoteVo.setJqOtherCostsProportion(quoteVo.getJqCostsProportion().subtract(quoteVo.getJqSuperviseCostsProportion()));
|
|
|
|
|
|
|
+ if(quoteVo.getJqCostsProportion() != null) {
|
|
|
|
|
+ if (quoteVo.getJqSuperviseCostsProportion().compareTo(quoteVo.getJqCostsProportion()) > 0) {
|
|
|
|
|
+ //总比例等于手续费比例
|
|
|
|
|
+ quoteVo.setJqSuperviseCostsProportion(quoteVo.getJqCostsProportion());
|
|
|
|
|
+ quoteVo.setJqOtherCostsProportion(new BigDecimal(0));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //总比例减去手续费比例 = 跟单比例
|
|
|
|
|
+ quoteVo.setJqOtherCostsProportion(quoteVo.getJqCostsProportion().subtract(quoteVo.getJqSuperviseCostsProportion()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(quoteVo.getSySuperviseCostsProportion().compareTo(quoteVo.getSyCostsProportion()) >= 0){
|
|
|
|
|
- //总比例等于手续费比例
|
|
|
|
|
- quoteVo.setSySuperviseCostsProportion(quoteVo.getSyCostsProportion());
|
|
|
|
|
- quoteVo.setSyOtherCostsProportion(new BigDecimal(0));
|
|
|
|
|
- }else{
|
|
|
|
|
- //总比例减去手续费比例 = 跟单比例
|
|
|
|
|
- quoteVo.setSyOtherCostsProportion(quoteVo.getSyCostsProportion().subtract(quoteVo.getSySuperviseCostsProportion()));
|
|
|
|
|
|
|
+ if(quoteVo.getSyCostsProportion() != null) {
|
|
|
|
|
+ if (quoteVo.getSySuperviseCostsProportion().compareTo(quoteVo.getSyCostsProportion()) >= 0) {
|
|
|
|
|
+ //总比例等于手续费比例
|
|
|
|
|
+ quoteVo.setSySuperviseCostsProportion(quoteVo.getSyCostsProportion());
|
|
|
|
|
+ quoteVo.setSyOtherCostsProportion(new BigDecimal(0));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //总比例减去手续费比例 = 跟单比例
|
|
|
|
|
+ quoteVo.setSyOtherCostsProportion(quoteVo.getSyCostsProportion().subtract(quoteVo.getSySuperviseCostsProportion()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(quoteVo.getNoSuperviseCostsProportion().compareTo(quoteVo.getNoCostsProportion()) >= 0){
|
|
|
|
|
- //总比例等于手续费比例
|
|
|
|
|
- quoteVo.setNoSuperviseCostsProportion(quoteVo.getNoCostsProportion());
|
|
|
|
|
- quoteVo.setNoOtherCostsProportion(new BigDecimal(0));
|
|
|
|
|
- }else{
|
|
|
|
|
- //总比例减去手续费比例 = 跟单比例
|
|
|
|
|
- quoteVo.setNoOtherCostsProportion(quoteVo.getNoCostsProportion().subtract(quoteVo.getNoSuperviseCostsProportion()));
|
|
|
|
|
|
|
+ if(quoteVo.getNoCostsProportion() != null) {
|
|
|
|
|
+ if (quoteVo.getNoSuperviseCostsProportion().compareTo(quoteVo.getNoCostsProportion()) >= 0) {
|
|
|
|
|
+ //总比例等于手续费比例
|
|
|
|
|
+ quoteVo.setNoSuperviseCostsProportion(quoteVo.getNoCostsProportion());
|
|
|
|
|
+ quoteVo.setNoOtherCostsProportion(new BigDecimal(0));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //总比例减去手续费比例 = 跟单比例
|
|
|
|
|
+ quoteVo.setNoOtherCostsProportion(quoteVo.getNoCostsProportion().subtract(quoteVo.getNoSuperviseCostsProportion()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ insAreaCompanyExternalFee.setJqSuperviseCostsProportion(quoteVo.getJqSuperviseCostsProportion()!=null ? quoteVo.getJqSuperviseCostsProportion() : new BigDecimal(0));
|
|
|
|
|
+ insAreaCompanyExternalFee.setJqOtherCostsProportion(quoteVo.getJqOtherCostsProportion()!=null ? quoteVo.getJqOtherCostsProportion() : new BigDecimal(0));
|
|
|
|
|
+ insAreaCompanyExternalFee.setSySuperviseCostsProportion(quoteVo.getSySuperviseCostsProportion()!=null ? quoteVo.getSySuperviseCostsProportion() : new BigDecimal(0));
|
|
|
|
|
+ insAreaCompanyExternalFee.setSyOtherCostsProportion(quoteVo.getSyOtherCostsProportion()!=null ? quoteVo.getSyOtherCostsProportion() : new BigDecimal(0));
|
|
|
|
|
+ insAreaCompanyExternalFee.setNoSuperviseCostsProportion(quoteVo.getNoSuperviseCostsProportion()!=null ? quoteVo.getNoSuperviseCostsProportion() : new BigDecimal(0));
|
|
|
|
|
+ insAreaCompanyExternalFee.setNoOtherCostsProportion(quoteVo.getNoOtherCostsProportion()!=null ? quoteVo.getNoOtherCostsProportion() : new BigDecimal(0));
|
|
|
|
|
+
|
|
|
this.insAreaCompanyExternalFeeService.save(insAreaCompanyExternalFee);
|
|
this.insAreaCompanyExternalFeeService.save(insAreaCompanyExternalFee);
|
|
|
|
|
|
|
|
|
|
|