|
|
@@ -893,6 +893,11 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
return HttpResult.ok();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public InsPlyIncome getEntityById(String id) {
|
|
|
+ return baseMapper.getEntityById(id);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void updateByEntity(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
@@ -901,7 +906,6 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
BeanUtils.copyProperties(insPlyIncomeVo, insPlyIncome);
|
|
|
this.amountCalculate(insPlyIncomeVo,insPlyIncome);
|
|
|
baseMapper.updateById(insPlyIncome);
|
|
|
-
|
|
|
insPlyIncomeVo.setCrudStatus("2");
|
|
|
this.saveLog(insPlyIncomeVo);
|
|
|
|
|
|
@@ -916,53 +920,82 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
* 计算逻辑 交强不含税保费* 交强跟单比例 = 交强跟单金额
|
|
|
*/
|
|
|
private void amountCalculate(InsPlyIncomeVo insPlyIncomeVo,InsPlyIncome insPlyIncome) {
|
|
|
- BigDecimal jqNoTaxPremium = insPlyIncomeVo.getJqNoTaxPremium();// 交强手续费 按照思路 交强不含税保费* 交强手续费比例 =交强手续费
|
|
|
- BigDecimal syNoTaxPremium = insPlyIncomeVo.getSyNoTaxPremium();// 商业手续费 按照思路 商业不含税保费* 商业手续费比例 =商业手续费
|
|
|
- BigDecimal noNoTaxPremium = insPlyIncomeVo.getNoNoTaxPremium();// 非车手续费 按照思路 非车不含税保费* 非车手续费比例 =非车手续费
|
|
|
- if(insPlyIncomeVo.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
- BigDecimal jqhandingFee = jqNoTaxPremium.multiply(insPlyIncomeVo.getJqSuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
- insPlyIncome.setJqSuperviseCostsPremiums(jqhandingFee);
|
|
|
- }
|
|
|
+ if("1".equals(insPlyIncomeVo.getAgreementType())){ //平台
|
|
|
+// 平台 手续费 +跟单费 = 应收 手续费 = 手续费比例*保费 应收比例=手续费比例 + 跟单比例
|
|
|
+ BigDecimal jqSuperviseCostsProportion = initializationBigdecimal(insPlyIncomeVo.getJqSuperviseCostsProportion());//交强手续费比例
|
|
|
+ BigDecimal sySuperviseCostsProportion = initializationBigdecimal(insPlyIncomeVo.getSySuperviseCostsProportion()); //商业手续费比例
|
|
|
+ BigDecimal noSuperviseCostsProportion = initializationBigdecimal(insPlyIncomeVo.getNoSuperviseCostsProportion()); //非车手续费比例
|
|
|
+ BigDecimal jqOtherCostsProportion = initializationBigdecimal(insPlyIncomeVo.getJqOtherCostsProportion()); //交强跟单比例
|
|
|
+ BigDecimal syOtherCostsProportion = initializationBigdecimal(insPlyIncomeVo.getSyOtherCostsProportion()); //商业跟单比例
|
|
|
+ BigDecimal noOtherCostsProportion = initializationBigdecimal(insPlyIncomeVo.getNoOtherCostsProportion()); //非车跟单比例
|
|
|
+ BigDecimal jqPremium = initializationBigdecimal(insPlyIncomeVo.getJqPremium()); //交强保费
|
|
|
+ BigDecimal syPremium = initializationBigdecimal(insPlyIncomeVo.getSyPremium()); //商业保费
|
|
|
+ BigDecimal noPremium = initializationBigdecimal(insPlyIncomeVo.getNoPremium()); //非车保费
|
|
|
+ //手续费比例
|
|
|
+ insPlyIncome.setCommissionFeerate(this.calculateTotal(jqSuperviseCostsProportion,sySuperviseCostsProportion,noSuperviseCostsProportion)); //手续费比例 = 商业手续费比例 + 交强手续费比例 + 非车手续费比例
|
|
|
+ if(jqSuperviseCostsProportion !=null && jqPremium!=null ){
|
|
|
+ insPlyIncome.setJqSuperviseCostsPremiums(this.algorithmAmount(jqPremium,jqSuperviseCostsProportion)); //交强手续费
|
|
|
+ }
|
|
|
+ if(sySuperviseCostsProportion !=null && syPremium !=null){
|
|
|
+ insPlyIncome.setSySuperviseCostsPremiums(this.algorithmAmount(syPremium,sySuperviseCostsProportion)); //商业手续费
|
|
|
+ }
|
|
|
+ if(noSuperviseCostsProportion !=null && noPremium!=null){
|
|
|
+ insPlyIncome.setNoSuperviseCostsPremiums(this.algorithmAmount(noPremium,noSuperviseCostsProportion)); //非车手续费
|
|
|
+ }
|
|
|
+ if(jqOtherCostsProportion !=null && jqPremium!=null ){
|
|
|
+ insPlyIncome.setJqOtherCostsPremium(this.algorithmAmount(jqPremium,jqOtherCostsProportion)); //交强跟单费
|
|
|
+ }
|
|
|
+ if(syOtherCostsProportion !=null && syPremium !=null ){
|
|
|
+ insPlyIncome.setSyOtherCostsPremium(this.algorithmAmount(syPremium,syOtherCostsProportion)); //商业跟单费
|
|
|
+ }
|
|
|
+ if(noOtherCostsProportion !=null && noPremium !=null){
|
|
|
+ insPlyIncome.setNoOtherCostsPremium(this.algorithmAmount(noPremium,noOtherCostsProportion)); //非车跟单费
|
|
|
+ }
|
|
|
+ insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getJqSuperviseCostsPremiums(),insPlyIncome.getSySuperviseCostsPremiums(),insPlyIncome.getNoSuperviseCostsPremiums())); //手续费
|
|
|
+ insPlyIncome.setCommissionFeerate(this.calculateTotal(jqSuperviseCostsProportion,sySuperviseCostsProportion,noSuperviseCostsProportion)); //手续费比例
|
|
|
+ insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getJqOtherCostsPremium(),insPlyIncome.getSyOtherCostsPremium(),insPlyIncome.getNoOtherCostsPremium())); //跟单费金额
|
|
|
+ insPlyIncome.setOtherFeerate(this.calculateTotal(jqOtherCostsProportion,syOtherCostsProportion,noOtherCostsProportion)); //跟单费比例
|
|
|
+ insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),insPlyIncome.getOtherFeevalue(),null)); // 总费用 = 手续费+跟单费
|
|
|
+ //应收比例 交强应收比例=交强手续费比例+交强非跟单比例
|
|
|
+ insPlyIncome.setJqReceivableProportion(this.calculateTotal(jqSuperviseCostsProportion,jqOtherCostsProportion,null)); //交强应收
|
|
|
+ insPlyIncome.setSyReceivableProportion(this.calculateTotal(sySuperviseCostsProportion,syOtherCostsProportion,null)); //商业应收
|
|
|
+ insPlyIncome.setNoReceivableProportion(this.calculateTotal(noSuperviseCostsProportion,noOtherCostsProportion,null)); //非车应收
|
|
|
|
|
|
- if(insPlyIncomeVo.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
- BigDecimal syhandingFee = syNoTaxPremium.multiply(insPlyIncomeVo.getSySuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
- insPlyIncome.setSySuperviseCostsPremiums(syhandingFee);
|
|
|
- }
|
|
|
+ }else {
|
|
|
+ BigDecimal jqNoTaxPremium = insPlyIncomeVo.getJqNoTaxPremium();// 交强手续费 按照思路 交强不含税保费* 交强手续费比例 =交强手续费
|
|
|
+ BigDecimal syNoTaxPremium = insPlyIncomeVo.getSyNoTaxPremium();// 商业手续费 按照思路 商业不含税保费* 商业手续费比例 =商业手续费
|
|
|
+ BigDecimal noNoTaxPremium = insPlyIncomeVo.getNoNoTaxPremium();// 非车手续费 按照思路 非车不含税保费* 非车手续费比例 =非车手续费
|
|
|
+ if(insPlyIncomeVo.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
+ BigDecimal jqhandingFee = jqNoTaxPremium.multiply(insPlyIncomeVo.getJqSuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
+ insPlyIncome.setJqSuperviseCostsPremiums(jqhandingFee);
|
|
|
+ }
|
|
|
|
|
|
- if(insPlyIncomeVo.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
- BigDecimal nohandingFee = noNoTaxPremium.multiply(insPlyIncomeVo.getNoSuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
- insPlyIncome.setNoSuperviseCostsPremiums(nohandingFee);
|
|
|
- }
|
|
|
+ if(insPlyIncomeVo.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
+ BigDecimal syhandingFee = syNoTaxPremium.multiply(insPlyIncomeVo.getSySuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
+ insPlyIncome.setSySuperviseCostsPremiums(syhandingFee);
|
|
|
+ }
|
|
|
|
|
|
- if(insPlyIncomeVo.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
- BigDecimal jqother = jqNoTaxPremium.multiply(insPlyIncomeVo.getJqOtherCostsProportion().divide(new BigDecimal(100)));//交强跟单费 按照思路 交强不含税保费* 交强跟单比例 = 交强跟单金额
|
|
|
- insPlyIncome.setJqOtherCostsPremium(jqother);
|
|
|
- }
|
|
|
+ if(insPlyIncomeVo.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
+ BigDecimal nohandingFee = noNoTaxPremium.multiply(insPlyIncomeVo.getNoSuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
+ insPlyIncome.setNoSuperviseCostsPremiums(nohandingFee);
|
|
|
+ }
|
|
|
|
|
|
- if(insPlyIncomeVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
- BigDecimal syother = syNoTaxPremium.multiply(insPlyIncomeVo.getSyOtherCostsProportion().divide(new BigDecimal(100)));//交强跟单费 按照思路 交强不含税保费* 交强跟单比例 = 交强跟单金额
|
|
|
- insPlyIncome.setSyOtherCostsPremium(syother);
|
|
|
- }
|
|
|
+ if(insPlyIncomeVo.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
+ BigDecimal jqother = jqNoTaxPremium.multiply(insPlyIncomeVo.getJqOtherCostsProportion().divide(new BigDecimal(100)));//交强跟单费 按照思路 交强不含税保费* 交强跟单比例 = 交强跟单金额
|
|
|
+ insPlyIncome.setJqOtherCostsPremium(jqother);
|
|
|
+ }
|
|
|
|
|
|
- if(insPlyIncomeVo.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
- BigDecimal syother = syNoTaxPremium.multiply(insPlyIncomeVo.getNoOtherCostsProportion().divide(new BigDecimal(100)));//非车跟单费 按照思路 非车不含税保费* 非车跟单比例 = 非车跟单金额
|
|
|
- insPlyIncome.setNoOtherCostsPremium(syother);
|
|
|
- }
|
|
|
- /**
|
|
|
- 判断是否是平台 如果是平台则 手续费= 交强手续费+ 商业手续费+非车手续费 费单非= 交强跟单费+ 商业跟单费 +非车跟单费费
|
|
|
- * 如果是保险 保险手续费= 交强手续费+商业跟单费 跟单费为null
|
|
|
- * 保险跟单 手续费为null 跟单费= 交强跟单费+商业跟单费
|
|
|
- * 非车手续费 =非车手续费
|
|
|
- * 非车跟单 = 非车跟单费
|
|
|
- */
|
|
|
- if("1".equals(insPlyIncomeVo.getAgreementType())){//保险手续费
|
|
|
- insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncome.getJqSuperviseCostsProportion(),insPlyIncome.getSySuperviseCostsProportion(),insPlyIncome.getNoSuperviseCostsProportion())); //手续费比例
|
|
|
- insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getJqSuperviseCostsPremiums(),insPlyIncome.getSySuperviseCostsPremiums(),insPlyIncome.getNoSuperviseCostsPremiums())); //手续费金额
|
|
|
- insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getJqOtherCostsProportion(),insPlyIncome.getSyOtherCostsProportion(),insPlyIncome.getNoOtherCostsProportion())); //跟单比例
|
|
|
- insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getJqOtherCostsPremium(),insPlyIncome.getSyOtherCostsPremium(),insPlyIncome.getNoOtherCostsPremium()));//跟单费金额
|
|
|
- insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),insPlyIncome.getOtherFeevalue(),null)); // 总费用 = 手续费+跟单费
|
|
|
- }else {
|
|
|
- if("0".equals(insPlyIncomeVo.getIsNotDocumentary()) && "0".equals(insPlyIncomeVo.getIsNotCar())){ //保险手续费
|
|
|
+ if(insPlyIncomeVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
+ BigDecimal syother = syNoTaxPremium.multiply(insPlyIncomeVo.getSyOtherCostsProportion().divide(new BigDecimal(100)));//交强跟单费 按照思路 交强不含税保费* 交强跟单比例 = 交强跟单金额
|
|
|
+ insPlyIncome.setSyOtherCostsPremium(syother);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(insPlyIncomeVo.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
+ BigDecimal syother = syNoTaxPremium.multiply(insPlyIncomeVo.getNoOtherCostsProportion().divide(new BigDecimal(100)));//非车跟单费 按照思路 非车不含税保费* 非车跟单比例 = 非车跟单金额
|
|
|
+ insPlyIncome.setNoOtherCostsPremium(syother);
|
|
|
+ }
|
|
|
+
|
|
|
+ if("0".equals(insPlyIncomeVo.getIsNotDocumentary()) && "0".equals(insPlyIncomeVo.getIsNotCar())){ //保险 手续费 =不含税保费* 手续费比例
|
|
|
insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getJqSuperviseCostsPremiums(),insPlyIncome.getSySuperviseCostsPremiums(),null)); // 手续费
|
|
|
insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncome.getJqSuperviseCostsProportion(),insPlyIncome.getSySuperviseCostsProportion(),null));//手续费比例
|
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),null,null));//总金额
|
|
|
@@ -970,7 +1003,6 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getJqOtherCostsPremium(),insPlyIncome.getSyOtherCostsPremium(),null));
|
|
|
insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getJqOtherCostsProportion(),insPlyIncome.getSyOtherCostsProportion(),null));
|
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getOtherFeevalue(),null,null));//总金额
|
|
|
-
|
|
|
}
|
|
|
if("0".equals(insPlyIncomeVo.getIsNotDocumentary()) && "1".equals(insPlyIncomeVo.getIsNotCar())){// 非车
|
|
|
insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getNoSuperviseCostsPremiums(),null,null)); // 非车手续费
|
|
|
@@ -981,9 +1013,24 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getNoOtherCostsProportion(),null,null)); // 非车跟单比例
|
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getOtherFeevalue(),null,null));//总金额
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param value1 保费
|
|
|
+ * @param value2 比例
|
|
|
+ * @return 费用
|
|
|
+ */
|
|
|
+ private BigDecimal algorithmAmount(BigDecimal value1, BigDecimal value2) {
|
|
|
+
|
|
|
+ return value1.multiply(value2.divide(new BigDecimal(100)));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private BigDecimal initializationBigdecimal(BigDecimal value) {
|
|
|
+ return value != null ? value : BigDecimal.ZERO;
|
|
|
|
|
|
}
|
|
|
|