|
@@ -1084,6 +1084,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
if (agreementProductCostsVo.getCostsStartDate() != null) {
|
|
if (agreementProductCostsVo.getCostsStartDate() != null) {
|
|
|
ptlAgreementProductCostsNew.setCostsStartDate(agreementProductCostsVo.getCostsStartDate());
|
|
ptlAgreementProductCostsNew.setCostsStartDate(agreementProductCostsVo.getCostsStartDate());
|
|
|
}
|
|
}
|
|
|
|
|
+ ptlAgreementProductCostsNew.setIsAudit(0);
|
|
|
String desc = "修改费用因子";
|
|
String desc = "修改费用因子";
|
|
|
//添加费用因子轨迹
|
|
//添加费用因子轨迹
|
|
|
ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(), desc, BaseController.getUser().getId());
|
|
ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(), desc, BaseController.getUser().getId());
|
|
@@ -1136,8 +1137,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
validateItems(costsItem, exportItem);
|
|
validateItems(costsItem, exportItem);
|
|
|
|
|
|
|
|
// 更新费用总比例、1-5级比例
|
|
// 更新费用总比例、1-5级比例
|
|
|
- updateCostsItem(agreementProductCostsVo, costsItem);
|
|
|
|
|
- updateExportItem(agreementProductCostsVo, exportItem);
|
|
|
|
|
|
|
+ updateCostsItem(agreementProductCostsVo, costsItem, exportItem);
|
|
|
|
|
+ updateExportItem(agreementProductCostsVo, exportItem, costsItem);
|
|
|
|
|
+ costsItem.setIsAudit(0);
|
|
|
|
|
|
|
|
//添加费用轨迹 费用历史记录
|
|
//添加费用轨迹 费用历史记录
|
|
|
addCostsTrajectory(costsItem);
|
|
addCostsTrajectory(costsItem);
|
|
@@ -1155,10 +1157,10 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void updateCostsItem(AgreementProductCostsVo vo, PtlAgreementProductCostsNew item) {
|
|
|
|
|
- updateProportion(item, vo.getJqCostsProportion(), item::getJqCostsProportion, item::setJqCostsProportion, "交强险总费用");
|
|
|
|
|
- updateProportion(item, vo.getSyCostsProportion(), item::getSyCostsProportion, item::setSyCostsProportion, "商业险总费用");
|
|
|
|
|
- updateProportion(item, vo.getNoCostsProportion(), item::getNoCostsProportion, item::setNoCostsProportion, "非车险总费用");
|
|
|
|
|
|
|
+ private void updateCostsItem(AgreementProductCostsVo vo, PtlAgreementProductCostsNew item, PtlAgreementProductCostsExport export) {
|
|
|
|
|
+ updateProportion(item, vo.getJqCostsProportion(), item::getJqCostsProportion, item::setJqCostsProportion, "交强险总费用", export);
|
|
|
|
|
+ updateProportion(item, vo.getSyCostsProportion(), item::getSyCostsProportion, item::setSyCostsProportion, "商业险总费用", export);
|
|
|
|
|
+ updateProportion(item, vo.getNoCostsProportion(), item::getNoCostsProportion, item::setNoCostsProportion, "非车险总费用", export);
|
|
|
//更新其他费用比例
|
|
//更新其他费用比例
|
|
|
updateOtherCostsProportion(item, vo.getJqCostsProportion(), item::getJqCarOtherCostsProportion, item::setJqCarOtherCostsProportion, "交强险其他费用");
|
|
updateOtherCostsProportion(item, vo.getJqCostsProportion(), item::getJqCarOtherCostsProportion, item::setJqCarOtherCostsProportion, "交强险其他费用");
|
|
|
updateOtherCostsProportion(item, vo.getSyCostsProportion(), item::getSyCarOtherCostsProportion, item::setSyCarOtherCostsProportion, "商业险其他费用");
|
|
updateOtherCostsProportion(item, vo.getSyCostsProportion(), item::getSyCarOtherCostsProportion, item::setSyCarOtherCostsProportion, "商业险其他费用");
|
|
@@ -1166,7 +1168,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//更新总比费用
|
|
//更新总比费用
|
|
|
- private void updateProportion(PtlAgreementProductCostsNew item, String proportionToAdd, Supplier<String> getter, Consumer<String> setter, String desc) {
|
|
|
|
|
|
|
+ private void updateProportion(PtlAgreementProductCostsNew item, String proportionToAdd, Supplier<String> getter, Consumer<String> setter, String desc, PtlAgreementProductCostsExport export) {
|
|
|
if (proportionToAdd != null) {
|
|
if (proportionToAdd != null) {
|
|
|
try {
|
|
try {
|
|
|
BigDecimal current = new BigDecimal(getter.get());
|
|
BigDecimal current = new BigDecimal(getter.get());
|
|
@@ -1176,6 +1178,38 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
|
|
if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
|
|
throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
|
|
|
}
|
|
}
|
|
|
|
|
+ switch(desc) {
|
|
|
|
|
+ case "交强险总费用":
|
|
|
|
|
+ BigDecimal totalJqExportRadio = export.getJqExportRadioLevel1()
|
|
|
|
|
+ .add(export.getJqExportRadioLevel2())
|
|
|
|
|
+ .add(export.getJqExportRadioLevel3())
|
|
|
|
|
+ .add(export.getJqExportRadioLevel4())
|
|
|
|
|
+ .add(export.getJqExportRadioLevel5());
|
|
|
|
|
+ if (updatedValue.compareTo(totalJqExportRadio) < 0) {
|
|
|
|
|
+ throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于交强险管理比例1-5级的总和");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "商业险总费用":
|
|
|
|
|
+ BigDecimal totalSyExportRadio = export.getSyExportRadioLevel1()
|
|
|
|
|
+ .add(export.getSyExportRadioLevel2())
|
|
|
|
|
+ .add(export.getSyExportRadioLevel3())
|
|
|
|
|
+ .add(export.getSyExportRadioLevel4())
|
|
|
|
|
+ .add(export.getSyExportRadioLevel5());
|
|
|
|
|
+ if (updatedValue.compareTo(totalSyExportRadio) < 0) {
|
|
|
|
|
+ throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于商业险管理比例1-5级的总和");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "非车险总费用":
|
|
|
|
|
+ BigDecimal totalNoCarExportRadio = export.getNoCarExportRadioLevel1()
|
|
|
|
|
+ .add(export.getNoCarExportRadioLevel2())
|
|
|
|
|
+ .add(export.getNoCarExportRadioLevel3())
|
|
|
|
|
+ .add(export.getNoCarExportRadioLevel4())
|
|
|
|
|
+ .add(export.getNoCarExportRadioLevel5());
|
|
|
|
|
+ if (updatedValue.compareTo(totalNoCarExportRadio) < 0) {
|
|
|
|
|
+ throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于非车险管理比例1-5级的总和");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
setter.accept(updatedValue.toString());
|
|
setter.accept(updatedValue.toString());
|
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
|
throw new SystemException("比例值格式错误");
|
|
throw new SystemException("比例值格式错误");
|
|
@@ -1183,54 +1217,255 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //更新其他费用比例
|
|
|
|
|
|
|
+ // 更新其他费用比例
|
|
|
private void updateOtherCostsProportion(PtlAgreementProductCostsNew item, String otherProportionToAdd, Supplier<String> getter, Consumer<String> setter, String desc) {
|
|
private void updateOtherCostsProportion(PtlAgreementProductCostsNew item, String otherProportionToAdd, Supplier<String> getter, Consumer<String> setter, String desc) {
|
|
|
if (otherProportionToAdd != null) {
|
|
if (otherProportionToAdd != null) {
|
|
|
try {
|
|
try {
|
|
|
BigDecimal currentOther = new BigDecimal(getter.get());
|
|
BigDecimal currentOther = new BigDecimal(getter.get());
|
|
|
BigDecimal addOther = new BigDecimal(otherProportionToAdd);
|
|
BigDecimal addOther = new BigDecimal(otherProportionToAdd);
|
|
|
- BigDecimal updatedValue = currentOther.add(addOther);
|
|
|
|
|
-
|
|
|
|
|
- // 检查更新后的值是否小于零
|
|
|
|
|
|
|
+ BigDecimal updatedValue = currentOther.add(addOther); // 保持加法不变
|
|
|
|
|
+ // 如果更新后的值小于零,则设置其他费用比例为0,并调整总费用比例
|
|
|
if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
|
|
if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
- throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
|
|
|
|
|
|
|
+ updatedValue = BigDecimal.ZERO;
|
|
|
|
|
+ setter.accept(updatedValue.toString()); // 设置其他费用比例为0
|
|
|
|
|
+ // 计算费用比例需要减少的值
|
|
|
|
|
+ BigDecimal subtractValue = addOther.abs().subtract(currentOther); // 取绝对值,因为是负数
|
|
|
|
|
+ // 根据描述符更新对应的总费用比例
|
|
|
|
|
+ switch(desc) {
|
|
|
|
|
+ case "交强险其他费用":
|
|
|
|
|
+ // 获得现在费用比例的值
|
|
|
|
|
+ BigDecimal jqCarCostsProportion = new BigDecimal(item.getJqCarCostsProportion());
|
|
|
|
|
+ BigDecimal currentJqCarCostsProportion = jqCarCostsProportion.subtract(subtractValue);
|
|
|
|
|
+ if (currentJqCarCostsProportion.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
+ throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
|
|
|
|
|
+ }
|
|
|
|
|
+ item.setJqCarCostsProportion(currentJqCarCostsProportion.toString());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "商业险其他费用":
|
|
|
|
|
+ BigDecimal syCarCostsProportion = new BigDecimal(item.getSyCarCostsProportion());
|
|
|
|
|
+ BigDecimal currentSyCarCostsProportion = syCarCostsProportion.subtract(subtractValue);
|
|
|
|
|
+ if (currentSyCarCostsProportion.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
+ throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
|
|
|
|
|
+ }
|
|
|
|
|
+ item.setSyCostsProportion(currentSyCarCostsProportion.toString());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "非车险其他费用":
|
|
|
|
|
+ BigDecimal noCarCostsProportion = new BigDecimal(item.getNoCarCostsProportion());
|
|
|
|
|
+ BigDecimal currentNoCarCostsProportion = noCarCostsProportion.subtract(subtractValue);
|
|
|
|
|
+ if (currentNoCarCostsProportion.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
+ throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
|
|
|
|
|
+ }
|
|
|
|
|
+ item.setNoCarCostsProportion(currentNoCarCostsProportion.toString());
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ throw new IllegalArgumentException("未知的费用类型: " + desc);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 如果更新后的值大于等于零,则正常更新
|
|
|
|
|
+ setter.accept(updatedValue.toString());
|
|
|
}
|
|
}
|
|
|
- setter.accept(updatedValue.toString());
|
|
|
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
|
throw new SystemException("其他费用比例值格式错误");
|
|
throw new SystemException("其他费用比例值格式错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //更新其他费用比例
|
|
|
|
|
+// private void updateOtherCostsProportion(PtlAgreementProductCostsNew item, String otherProportionToAdd, Supplier<String> getter, Consumer<String> setter, String desc) {
|
|
|
|
|
+// if (otherProportionToAdd != null) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// BigDecimal currentOther = new BigDecimal(getter.get());
|
|
|
|
|
+// BigDecimal addOther = new BigDecimal(otherProportionToAdd);
|
|
|
|
|
+// BigDecimal updatedValue = currentOther.add(addOther);
|
|
|
|
|
+//
|
|
|
|
|
+// // 检查更新后的值是否小于零
|
|
|
|
|
+// if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
|
+// throw new SystemException("id为"+ item.getId() + desc + "比例值不能小于零");
|
|
|
|
|
+// }
|
|
|
|
|
+// setter.accept(updatedValue.toString());
|
|
|
|
|
+// } catch (NumberFormatException e) {
|
|
|
|
|
+// throw new SystemException("其他费用比例值格式错误");
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
//更新1-5级比例
|
|
//更新1-5级比例
|
|
|
- private void updateExportItem(AgreementProductCostsVo vo, PtlAgreementProductCostsExport item) {
|
|
|
|
|
- updateExportRadios(item, vo.getJqExportRadioLevel1(), item::getJqExportRadioLevel1, item::setJqExportRadioLevel1, "交强险一级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getJqExportRadioLevel2(), item::getJqExportRadioLevel2, item::setJqExportRadioLevel2, "交强险二级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getJqExportRadioLevel3(), item::getJqExportRadioLevel3, item::setJqExportRadioLevel3, "交强险三级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getJqExportRadioLevel4(), item::getJqExportRadioLevel4, item::setJqExportRadioLevel4, "交强险四级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getJqExportRadioLevel5(), item::getJqExportRadioLevel5, item::setJqExportRadioLevel5, "交强险五级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getSyExportRadioLevel1(), item::getSyExportRadioLevel1, item::setSyExportRadioLevel1, "商业险一级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getSyExportRadioLevel2(), item::getSyExportRadioLevel2, item::setSyExportRadioLevel2, "商业险二级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getSyExportRadioLevel3(), item::getSyExportRadioLevel3, item::setSyExportRadioLevel3, "商业险三级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getSyExportRadioLevel4(), item::getSyExportRadioLevel4, item::setSyExportRadioLevel4, "商业险四级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getSyExportRadioLevel5(), item::getSyExportRadioLevel5, item::setSyExportRadioLevel5, "商业险五级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getNoCarExportRadioLevel1(), item::getNoCarExportRadioLevel1, item::setNoCarExportRadioLevel1, "非车险一级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getNoCarExportRadioLevel2(), item::getNoCarExportRadioLevel2, item::setNoCarExportRadioLevel2, "非车险二级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getNoCarExportRadioLevel3(), item::getNoCarExportRadioLevel3, item::setNoCarExportRadioLevel3, "非车险三级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getNoCarExportRadioLevel4(), item::getNoCarExportRadioLevel4, item::setNoCarExportRadioLevel4, "非车险四级比例");
|
|
|
|
|
- updateExportRadios(item, vo.getNoCarExportRadioLevel5(), item::getNoCarExportRadioLevel5, item::setNoCarExportRadioLevel5, "非车险五级比例");
|
|
|
|
|
|
|
+ private void updateExportItem(AgreementProductCostsVo vo, PtlAgreementProductCostsExport item,PtlAgreementProductCostsNew costsItem) {
|
|
|
|
|
+ updateExportRadios(item, vo.getJqExportRadioLevel1(), item::getJqExportRadioLevel1, item::setJqExportRadioLevel1, "交强险一级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getJqExportRadioLevel2(), item::getJqExportRadioLevel2, item::setJqExportRadioLevel2, "交强险二级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getJqExportRadioLevel3(), item::getJqExportRadioLevel3, item::setJqExportRadioLevel3, "交强险三级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getJqExportRadioLevel4(), item::getJqExportRadioLevel4, item::setJqExportRadioLevel4, "交强险四级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getJqExportRadioLevel5(), item::getJqExportRadioLevel5, item::setJqExportRadioLevel5, "交强险五级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getSyExportRadioLevel1(), item::getSyExportRadioLevel1, item::setSyExportRadioLevel1, "商业险一级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getSyExportRadioLevel2(), item::getSyExportRadioLevel2, item::setSyExportRadioLevel2, "商业险二级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getSyExportRadioLevel3(), item::getSyExportRadioLevel3, item::setSyExportRadioLevel3, "商业险三级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getSyExportRadioLevel4(), item::getSyExportRadioLevel4, item::setSyExportRadioLevel4, "商业险四级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getSyExportRadioLevel5(), item::getSyExportRadioLevel5, item::setSyExportRadioLevel5, "商业险五级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getNoCarExportRadioLevel1(), item::getNoCarExportRadioLevel1, item::setNoCarExportRadioLevel1, "非车险一级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getNoCarExportRadioLevel2(), item::getNoCarExportRadioLevel2, item::setNoCarExportRadioLevel2, "非车险二级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getNoCarExportRadioLevel3(), item::getNoCarExportRadioLevel3, item::setNoCarExportRadioLevel3, "非车险三级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getNoCarExportRadioLevel4(), item::getNoCarExportRadioLevel4, item::setNoCarExportRadioLevel4, "非车险四级比例", costsItem);
|
|
|
|
|
+ updateExportRadios(item, vo.getNoCarExportRadioLevel5(), item::getNoCarExportRadioLevel5, item::setNoCarExportRadioLevel5, "非车险五级比例", costsItem);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//更新1-5级比例
|
|
//更新1-5级比例
|
|
|
- private void updateExportRadios(PtlAgreementProductCostsExport item, BigDecimal valueToAdd, Supplier<BigDecimal> getter, Consumer<BigDecimal> setter,String desc) {
|
|
|
|
|
|
|
+ private void updateExportRadios(PtlAgreementProductCostsExport item, BigDecimal valueToAdd, Supplier<BigDecimal> getter, Consumer<BigDecimal> setter,String desc,PtlAgreementProductCostsNew costsItem) {
|
|
|
if (valueToAdd != null) {
|
|
if (valueToAdd != null) {
|
|
|
BigDecimal currentValue = getter.get();
|
|
BigDecimal currentValue = getter.get();
|
|
|
BigDecimal updatedValue = currentValue.add(valueToAdd);
|
|
BigDecimal updatedValue = currentValue.add(valueToAdd);
|
|
|
-
|
|
|
|
|
|
|
+ BigDecimal jqCostsProportion = BigDecimal.ZERO;
|
|
|
|
|
+ BigDecimal syCostsProportion = BigDecimal.ZERO;
|
|
|
|
|
+ BigDecimal noCarCostsProportion = BigDecimal.ZERO;
|
|
|
|
|
+ if (costsItem.getJqCostsProportion() != null && !costsItem.getJqCostsProportion().equals("")) {
|
|
|
|
|
+ jqCostsProportion = new BigDecimal(costsItem.getJqCostsProportion());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (costsItem.getSyCostsProportion() != null && !costsItem.getSyCostsProportion().equals("")) {
|
|
|
|
|
+ syCostsProportion = new BigDecimal(costsItem.getSyCostsProportion());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (costsItem.getNoCostsProportion() != null && !costsItem.getNoCostsProportion().equals("")) {
|
|
|
|
|
+ noCarCostsProportion = new BigDecimal(costsItem.getNoCostsProportion());
|
|
|
|
|
+ }
|
|
|
// 检查更新后的值是否小于零
|
|
// 检查更新后的值是否小于零
|
|
|
if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
|
|
if (updatedValue.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
throw new SystemException("id为"+ item.getCostsId() + desc + "比例值不能小于零");
|
|
throw new SystemException("id为"+ item.getCostsId() + desc + "比例值不能小于零");
|
|
|
}
|
|
}
|
|
|
|
|
+ switch(desc) {
|
|
|
|
|
+ case "交强险一级比例":
|
|
|
|
|
+ BigDecimal totalJqCostsExportRadio1 = updatedValue.add(item.getJqExportRadioLevel2())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel3())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel4())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel5());
|
|
|
|
|
+
|
|
|
|
|
+ if (totalJqCostsExportRadio1.compareTo(jqCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("交强险一级比例与二级、三级、四级、五级之和不能大于交强险总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "交强险二级比例":
|
|
|
|
|
+ BigDecimal totalJqCostsExportRadio2 = updatedValue.add(item.getJqExportRadioLevel1())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel3())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel4())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel5());
|
|
|
|
|
+ if (totalJqCostsExportRadio2.compareTo(jqCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("交强险一级比例与二级、三级、四级、五级之和不能大于交强险总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "交强险三级比例":
|
|
|
|
|
+ BigDecimal totalJqCostsExportRadio3 = updatedValue.add(item.getJqExportRadioLevel1())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel2())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel4())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel5());
|
|
|
|
|
+ if (totalJqCostsExportRadio3.compareTo(jqCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("交强险一级比例与二级、三级、四级、五级之和不能大于交强险总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "交强险四级比例":
|
|
|
|
|
+ BigDecimal totalJqCostsExportRadio4 = updatedValue.add(item.getJqExportRadioLevel1())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel2())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel3())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel5());
|
|
|
|
|
+ if (totalJqCostsExportRadio4.compareTo(jqCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("交强险一级比例与二级、三级、四级、五级之和不能大于交强险总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "交强险五级比例":
|
|
|
|
|
+ BigDecimal totalJqCostsExportRadio5 = updatedValue.add(item.getJqExportRadioLevel1())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel2())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel3())
|
|
|
|
|
+ .add(item.getJqExportRadioLevel4());
|
|
|
|
|
+ if (totalJqCostsExportRadio5.compareTo(jqCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("交强险一级比例与二级、三级、四级、五级之和不能大于交强险总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "商业险一级比例":
|
|
|
|
|
+ BigDecimal totalSyCostsExportRadio1 = updatedValue.add(item.getSyExportRadioLevel2())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel3())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel4())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel5());
|
|
|
|
|
+ if (totalSyCostsExportRadio1.compareTo(syCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("商业险一级比例与二级、三级、四级、五级之和不能大于商业总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "商业险二级比例":
|
|
|
|
|
+ BigDecimal totalSyCostsExportRadio2 = updatedValue.add(item.getSyExportRadioLevel1())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel3())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel4())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel5());
|
|
|
|
|
+ if (totalSyCostsExportRadio2.compareTo(syCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("商业险一级比例与二级、三级、四级、五级之和不能大于商业总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "商业险三级比例":
|
|
|
|
|
+ BigDecimal totalSyCostsExportRadio3 = updatedValue.add(item.getSyExportRadioLevel1())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel2())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel4())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel5());
|
|
|
|
|
+ if (totalSyCostsExportRadio3.compareTo(syCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("商业险一级比例与二级、三级、四级、五级之和不能大于商业总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "商业险四级比例":
|
|
|
|
|
+ BigDecimal totalSyCostsExportRadio4 = updatedValue.add(item.getSyExportRadioLevel1())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel2())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel3())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel5());
|
|
|
|
|
+ if (totalSyCostsExportRadio4.compareTo(syCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("商业险一级比例与二级、三级、四级、五级之和不能大于商业总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "商业险五级比例":
|
|
|
|
|
+ BigDecimal totalSyCostsExportRadio5 = updatedValue.add(item.getSyExportRadioLevel1())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel2())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel3())
|
|
|
|
|
+ .add(item.getSyExportRadioLevel4());
|
|
|
|
|
+ if (totalSyCostsExportRadio5.compareTo(syCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("商业险一级比例与二级、三级、四级、五级之和不能大于商业总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "非车险一级比例":
|
|
|
|
|
+ BigDecimal totalNoCarCostsExportRadio1 = updatedValue.add(item.getNoCarExportRadioLevel2())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel3())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel4())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel5());
|
|
|
|
|
+ if (totalNoCarCostsExportRadio1.compareTo(noCarCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("非车险一级比例与二级、三级、四级、五级之和不能大于非车总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "非车险二级比例":
|
|
|
|
|
+ BigDecimal totalNoCarCostsExportRadio2 = updatedValue.add(item.getNoCarExportRadioLevel1())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel3())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel4())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel5());
|
|
|
|
|
+ if (totalNoCarCostsExportRadio2.compareTo(noCarCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("非车险一级比例与二级、三级、四级、五级之和不能大于非车总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "非车险三级比例":
|
|
|
|
|
+ BigDecimal totalNoCarCostsExportRadio3 = updatedValue.add(item.getNoCarExportRadioLevel1())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel2())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel4())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel5());
|
|
|
|
|
+ if (totalNoCarCostsExportRadio3.compareTo(noCarCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("非车险一级比例与二级、三级、四级、五级之和不能大于非车总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "非车险四级比例":
|
|
|
|
|
+ BigDecimal totalNoCarCostsExportRadio4 = updatedValue.add(item.getNoCarExportRadioLevel1())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel2())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel3())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel5());
|
|
|
|
|
+ if (totalNoCarCostsExportRadio4.compareTo(noCarCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("非车险一级比例与二级、三级、四级、五级之和不能大于非车总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "非车险五级比例":
|
|
|
|
|
+ BigDecimal totalNoCarCostsExportRadio5 = updatedValue.add(item.getNoCarExportRadioLevel1())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel2())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel3())
|
|
|
|
|
+ .add(item.getNoCarExportRadioLevel4());
|
|
|
|
|
+ if (totalNoCarCostsExportRadio5.compareTo(noCarCostsProportion) > 0) {
|
|
|
|
|
+ throw new SystemException("非车险一级比例与二级、三级、四级、五级之和不能大于非车总比例");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
setter.accept(updatedValue);
|
|
setter.accept(updatedValue);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|