|
@@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.ydtech.constants.enums.dict.insurance.EnergyType;
|
|
import com.ydtech.constants.enums.dict.insurance.EnergyType;
|
|
|
import com.ydtech.exception.SystemException;
|
|
import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
|
|
|
+import com.ydtech.modules.admin.service.SysSwitchConfigService;
|
|
|
import com.ydtech.modules.admin.service.SysUserAccountService;
|
|
import com.ydtech.modules.admin.service.SysUserAccountService;
|
|
|
import com.ydtech.modules.admin.service.SysUserService;
|
|
import com.ydtech.modules.admin.service.SysUserService;
|
|
|
import com.ydtech.modules.esm.model.EsmRetail;
|
|
import com.ydtech.modules.esm.model.EsmRetail;
|
|
|
import com.ydtech.modules.esm.model.EsmUserReferrer;
|
|
import com.ydtech.modules.esm.model.EsmUserReferrer;
|
|
|
import com.ydtech.modules.esm.service.EsmRetailService;
|
|
import com.ydtech.modules.esm.service.EsmRetailService;
|
|
|
import com.ydtech.modules.esm.service.EsmUserReferrerService;
|
|
import com.ydtech.modules.esm.service.EsmUserReferrerService;
|
|
|
|
|
+import com.ydtech.modules.fee.constants.CostAllocation;
|
|
|
import com.ydtech.modules.fee.dto.po.InsFeeOrderConfig;
|
|
import com.ydtech.modules.fee.dto.po.InsFeeOrderConfig;
|
|
|
import com.ydtech.modules.fee.dto.vo.ReCalcuLateProportion;
|
|
import com.ydtech.modules.fee.dto.vo.ReCalcuLateProportion;
|
|
|
import com.ydtech.modules.fee.dto.vo.RetailProportion;
|
|
import com.ydtech.modules.fee.dto.vo.RetailProportion;
|
|
@@ -96,6 +98,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InsFeeOrderConfigService insFeeOrderConfigService;
|
|
private InsFeeOrderConfigService insFeeOrderConfigService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SysSwitchConfigService sysSwitchConfigService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public QueryOrderFeeVo queryFeeOrderInfo(String companyId) {
|
|
public QueryOrderFeeVo queryFeeOrderInfo(String companyId) {
|
|
@@ -156,55 +160,70 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//BigDecimal取两位
|
|
//BigDecimal取两位
|
|
|
- private BigDecimal twoPeople(BigDecimal number){
|
|
|
|
|
|
|
+ private BigDecimal twoPeople(BigDecimal number) {
|
|
|
return number.setScale(2, BigDecimal.ROUND_DOWN);
|
|
return number.setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 重新计算分销和机构比例
|
|
* 重新计算分销和机构比例
|
|
|
- * @param sumCostsProportion 总入口费用比例
|
|
|
|
|
- * @param deptProportion 机构管理总比例
|
|
|
|
|
- * @param retailProportion 默认分销总比例
|
|
|
|
|
- * @param retailLevel 分销级别
|
|
|
|
|
- * @return 如果不够减则 返回新的分销比例
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param sumCostsProportion 总入口费用比例
|
|
|
|
|
+ * @param deptProportion 机构管理总比例
|
|
|
|
|
+ * @param retailProportion 默认分销总比例
|
|
|
|
|
+ * @param retailLevel 分销级别
|
|
|
|
|
+ * @return 如果不够减则 返回新的分销比例
|
|
|
*/
|
|
*/
|
|
|
public ReCalcuLateProportion recalculateProportion(BigDecimal sumCostsProportion,
|
|
public ReCalcuLateProportion recalculateProportion(BigDecimal sumCostsProportion,
|
|
|
- BigDecimal deptProportion,
|
|
|
|
|
- BigDecimal retailProportion,
|
|
|
|
|
- BigDecimal taxRadio,
|
|
|
|
|
- Integer retailLevel,
|
|
|
|
|
- PtlAgreementProductCostsExport ptlAgreementProductCostsExport,
|
|
|
|
|
- RetailProportion originalRetailProportion,
|
|
|
|
|
- String type){
|
|
|
|
|
|
|
+ BigDecimal deptProportion,
|
|
|
|
|
+ BigDecimal retailProportion,
|
|
|
|
|
+ BigDecimal taxRadio,
|
|
|
|
|
+ Integer retailLevel,
|
|
|
|
|
+ PtlAgreementProductCostsExport ptlAgreementProductCostsExport,
|
|
|
|
|
+ RetailProportion originalRetailProportion,
|
|
|
|
|
+ String type,
|
|
|
|
|
+ BigDecimal enterProportion) {
|
|
|
ReCalcuLateProportion reCalcuLateProportion = new ReCalcuLateProportion();
|
|
ReCalcuLateProportion reCalcuLateProportion = new ReCalcuLateProportion();
|
|
|
BigDecimal costsProportion = sumCostsProportion.divide(taxRadio, 2, BigDecimal.ROUND_DOWN);
|
|
BigDecimal costsProportion = sumCostsProportion.divide(taxRadio, 2, BigDecimal.ROUND_DOWN);
|
|
|
List<InsFeeOrderConfig> list = insFeeOrderConfigService.list();
|
|
List<InsFeeOrderConfig> list = insFeeOrderConfigService.list();
|
|
|
//总比例 / 比例 / 分销等级
|
|
//总比例 / 比例 / 分销等级
|
|
|
|
|
+ // 不够减扣除比例
|
|
|
|
|
+ Map<String, BigDecimal> notEnoughReduce = list.stream().collect(Collectors.toMap(InsFeeOrderConfig::getKeyword, InsFeeOrderConfig::getVal));
|
|
|
//分销配置的比例
|
|
//分销配置的比例
|
|
|
- BigDecimal retailProportionConfig = list.stream().filter(x -> x.getKeyword().equals("retailProportion")).findFirst().get().getVal();
|
|
|
|
|
|
|
+ BigDecimal retailProportionConfig = notEnoughReduce.get(CostAllocation.CA_01.getCode());
|
|
|
|
|
+
|
|
|
BigDecimal retailSettingProportion = new BigDecimal(retailProportionConfig.toString());
|
|
BigDecimal retailSettingProportion = new BigDecimal(retailProportionConfig.toString());
|
|
|
|
|
+ // 机构配置的比例
|
|
|
|
|
+ BigDecimal deptProportionConfig = notEnoughReduce.get(CostAllocation.CA_02.getCode());
|
|
|
|
|
+ // 代课录单比例
|
|
|
|
|
+ BigDecimal proxyProportionConfig = notEnoughReduce.get(CostAllocation.CA_03.getCode());
|
|
|
|
|
|
|
|
- //分销比例均分
|
|
|
|
|
- BigDecimal jqAverageRetail = new BigDecimal(0);
|
|
|
|
|
- if(retailLevel != 0) {
|
|
|
|
|
- jqAverageRetail = twoPeople(twoPeople(costsProportion.multiply(retailSettingProportion)).divide(new BigDecimal(retailLevel), 2, RoundingMode.DOWN));
|
|
|
|
|
- }
|
|
|
|
|
- //机构配置的比例
|
|
|
|
|
- BigDecimal deptProportionConfig = list.stream().filter(x -> x.getKeyword().equals("deptProportion")).findFirst().get().getVal();
|
|
|
|
|
BigDecimal deptSettingProportion = new BigDecimal(deptProportionConfig.toString());
|
|
BigDecimal deptSettingProportion = new BigDecimal(deptProportionConfig.toString());
|
|
|
//机构比例均分
|
|
//机构比例均分
|
|
|
BigDecimal jqAverageDept = twoPeople(twoPeople(costsProportion.multiply(deptSettingProportion)).divide(new BigDecimal(5)));
|
|
BigDecimal jqAverageDept = twoPeople(twoPeople(costsProportion.multiply(deptSettingProportion)).divide(new BigDecimal(5)));
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//如果不够减的话
|
|
//如果不够减的话
|
|
|
- if(deptProportion.add(retailProportion).compareTo(costsProportion) > 0){
|
|
|
|
|
- if(retailLevel >= 3){
|
|
|
|
|
|
|
+ if (deptProportion.add(retailProportion).add(enterProportion).compareTo(costsProportion) > 0) {
|
|
|
|
|
+ //分销比例均分
|
|
|
|
|
+ BigDecimal jqAverageRetail = new BigDecimal(0);
|
|
|
|
|
+ if (retailLevel != 0) {
|
|
|
|
|
+ jqAverageRetail = twoPeople(twoPeople(costsProportion.multiply(retailSettingProportion)).divide(new BigDecimal(retailLevel), 2, RoundingMode.DOWN));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (enterProportion.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
|
+ reCalcuLateProportion.setProxyProportion(BigDecimal.ZERO);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 代客比例
|
|
|
|
|
+ BigDecimal proxyProportion = costsProportion.multiply(proxyProportionConfig);
|
|
|
|
|
+ reCalcuLateProportion.setProxyProportion(twoPeople(proxyProportion));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (retailLevel >= 3) {
|
|
|
reCalcuLateProportion.setRetail_level_3_proportion(jqAverageRetail);
|
|
reCalcuLateProportion.setRetail_level_3_proportion(jqAverageRetail);
|
|
|
}
|
|
}
|
|
|
- if(retailLevel >= 2){
|
|
|
|
|
|
|
+ if (retailLevel >= 2) {
|
|
|
reCalcuLateProportion.setRetail_level_2_proportion(jqAverageRetail);
|
|
reCalcuLateProportion.setRetail_level_2_proportion(jqAverageRetail);
|
|
|
}
|
|
}
|
|
|
- if(retailLevel >= 1){
|
|
|
|
|
|
|
+ if (retailLevel >= 1) {
|
|
|
reCalcuLateProportion.setRetail_level_1_proportion(jqAverageRetail);
|
|
reCalcuLateProportion.setRetail_level_1_proportion(jqAverageRetail);
|
|
|
}
|
|
}
|
|
|
reCalcuLateProportion.setDept_level_1_proportion(jqAverageDept);
|
|
reCalcuLateProportion.setDept_level_1_proportion(jqAverageDept);
|
|
@@ -212,8 +231,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
reCalcuLateProportion.setDept_level_3_proportion(jqAverageDept);
|
|
reCalcuLateProportion.setDept_level_3_proportion(jqAverageDept);
|
|
|
reCalcuLateProportion.setDept_level_4_proportion(jqAverageDept);
|
|
reCalcuLateProportion.setDept_level_4_proportion(jqAverageDept);
|
|
|
reCalcuLateProportion.setDept_level_5_proportion(jqAverageDept);
|
|
reCalcuLateProportion.setDept_level_5_proportion(jqAverageDept);
|
|
|
- }else{
|
|
|
|
|
- if(type.equals("jq")) {
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (type.equals("jq")) {
|
|
|
reCalcuLateProportion.setDept_level_1_proportion(ptlAgreementProductCostsExport.getJqExportRadioLevel1());
|
|
reCalcuLateProportion.setDept_level_1_proportion(ptlAgreementProductCostsExport.getJqExportRadioLevel1());
|
|
|
reCalcuLateProportion.setDept_level_2_proportion(ptlAgreementProductCostsExport.getJqExportRadioLevel2());
|
|
reCalcuLateProportion.setDept_level_2_proportion(ptlAgreementProductCostsExport.getJqExportRadioLevel2());
|
|
|
reCalcuLateProportion.setDept_level_3_proportion(ptlAgreementProductCostsExport.getJqExportRadioLevel3());
|
|
reCalcuLateProportion.setDept_level_3_proportion(ptlAgreementProductCostsExport.getJqExportRadioLevel3());
|
|
@@ -223,8 +242,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
reCalcuLateProportion.setRetail_level_1_proportion(originalRetailProportion.getJqRetailLevel1Proportion());
|
|
reCalcuLateProportion.setRetail_level_1_proportion(originalRetailProportion.getJqRetailLevel1Proportion());
|
|
|
reCalcuLateProportion.setRetail_level_2_proportion(originalRetailProportion.getJqRetailLevel2Proportion());
|
|
reCalcuLateProportion.setRetail_level_2_proportion(originalRetailProportion.getJqRetailLevel2Proportion());
|
|
|
reCalcuLateProportion.setRetail_level_3_proportion(originalRetailProportion.getJqRetailLevel3Proportion());
|
|
reCalcuLateProportion.setRetail_level_3_proportion(originalRetailProportion.getJqRetailLevel3Proportion());
|
|
|
- }else if(type.equals("sy"))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ } else if (type.equals("sy")) {
|
|
|
reCalcuLateProportion.setDept_level_1_proportion(ptlAgreementProductCostsExport.getSyExportRadioLevel1());
|
|
reCalcuLateProportion.setDept_level_1_proportion(ptlAgreementProductCostsExport.getSyExportRadioLevel1());
|
|
|
reCalcuLateProportion.setDept_level_2_proportion(ptlAgreementProductCostsExport.getSyExportRadioLevel2());
|
|
reCalcuLateProportion.setDept_level_2_proportion(ptlAgreementProductCostsExport.getSyExportRadioLevel2());
|
|
|
reCalcuLateProportion.setDept_level_3_proportion(ptlAgreementProductCostsExport.getSyExportRadioLevel3());
|
|
reCalcuLateProportion.setDept_level_3_proportion(ptlAgreementProductCostsExport.getSyExportRadioLevel3());
|
|
@@ -233,7 +251,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
reCalcuLateProportion.setRetail_level_1_proportion(originalRetailProportion.getSyRetailLevel1Proportion());
|
|
reCalcuLateProportion.setRetail_level_1_proportion(originalRetailProportion.getSyRetailLevel1Proportion());
|
|
|
reCalcuLateProportion.setRetail_level_2_proportion(originalRetailProportion.getSyRetailLevel2Proportion());
|
|
reCalcuLateProportion.setRetail_level_2_proportion(originalRetailProportion.getSyRetailLevel2Proportion());
|
|
|
reCalcuLateProportion.setRetail_level_3_proportion(originalRetailProportion.getSyRetailLevel3Proportion());
|
|
reCalcuLateProportion.setRetail_level_3_proportion(originalRetailProportion.getSyRetailLevel3Proportion());
|
|
|
- }else if(type.equals("no")){
|
|
|
|
|
|
|
+ } else if (type.equals("no")) {
|
|
|
reCalcuLateProportion.setDept_level_1_proportion(ptlAgreementProductCostsExport.getNoCarExportRadioLevel1());
|
|
reCalcuLateProportion.setDept_level_1_proportion(ptlAgreementProductCostsExport.getNoCarExportRadioLevel1());
|
|
|
reCalcuLateProportion.setDept_level_2_proportion(ptlAgreementProductCostsExport.getNoCarExportRadioLevel2());
|
|
reCalcuLateProportion.setDept_level_2_proportion(ptlAgreementProductCostsExport.getNoCarExportRadioLevel2());
|
|
|
reCalcuLateProportion.setDept_level_3_proportion(ptlAgreementProductCostsExport.getNoCarExportRadioLevel3());
|
|
reCalcuLateProportion.setDept_level_3_proportion(ptlAgreementProductCostsExport.getNoCarExportRadioLevel3());
|
|
@@ -243,6 +261,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
reCalcuLateProportion.setRetail_level_2_proportion(originalRetailProportion.getNoRetailLevel2Proportion());
|
|
reCalcuLateProportion.setRetail_level_2_proportion(originalRetailProportion.getNoRetailLevel2Proportion());
|
|
|
reCalcuLateProportion.setRetail_level_3_proportion(originalRetailProportion.getNoRetailLevel3Proportion());
|
|
reCalcuLateProportion.setRetail_level_3_proportion(originalRetailProportion.getNoRetailLevel3Proportion());
|
|
|
}
|
|
}
|
|
|
|
|
+ // 代课比例
|
|
|
|
|
+ reCalcuLateProportion.setProxyProportion(enterProportion);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
return reCalcuLateProportion;
|
|
return reCalcuLateProportion;
|
|
|
}
|
|
}
|
|
@@ -279,7 +300,6 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
insFeeOrderNew.setAgreementId(insAreaCompany.getAgreementId());
|
|
insFeeOrderNew.setAgreementId(insAreaCompany.getAgreementId());
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//存储部门id与用户id
|
|
//存储部门id与用户id
|
|
|
InsOrders order = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
InsOrders order = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
InsFeeOrderNew insFeeOrderNewByCompanyId = insFeeOrderNewService.getInsFeeOrderNewByCompanyId(insAreaCompany.getId());
|
|
InsFeeOrderNew insFeeOrderNewByCompanyId = insFeeOrderNewService.getInsFeeOrderNewByCompanyId(insAreaCompany.getId());
|
|
@@ -347,11 +367,10 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
//默认分销比例设置
|
|
//默认分销比例设置
|
|
|
RetailProportion retailProportion = new RetailProportion();
|
|
RetailProportion retailProportion = new RetailProportion();
|
|
|
- if(!Objects.isNull(esmRetailList) && !esmRetailList.isEmpty())
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (!Objects.isNull(esmRetailList) && !esmRetailList.isEmpty()) {
|
|
|
retailLevel = Integer.parseInt(esmRetailList.get(0).getRetailtype());
|
|
retailLevel = Integer.parseInt(esmRetailList.get(0).getRetailtype());
|
|
|
//赋值默认的分销比例
|
|
//赋值默认的分销比例
|
|
|
- retailProportion.setProportion(esmRetailList.get(0).getDisrate1(),esmRetailList.get(0).getDisrate2(),esmRetailList.get(0).getDisrate3());
|
|
|
|
|
|
|
+ retailProportion.setProportion(esmRetailList.get(0).getDisrate1(), esmRetailList.get(0).getDisrate2(), esmRetailList.get(0).getDisrate3());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -389,6 +408,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
.add(retailProportion.getNoRetailLevel2Proportion())
|
|
.add(retailProportion.getNoRetailLevel2Proportion())
|
|
|
.add(retailProportion.getNoRetailLevel3Proportion());
|
|
.add(retailProportion.getNoRetailLevel3Proportion());
|
|
|
|
|
|
|
|
|
|
+ // 外部订单比例
|
|
|
|
|
+ BigDecimal enterProportion = sysSwitchConfigService.getEnterProportion(insOrders.getDeptid(), insOrders.getEntryStatus());
|
|
|
|
|
+
|
|
|
//重新计算比例 入口是否超出支付的比例
|
|
//重新计算比例 入口是否超出支付的比例
|
|
|
ReCalcuLateProportion jqReCalcuLateProportion = recalculateProportion(
|
|
ReCalcuLateProportion jqReCalcuLateProportion = recalculateProportion(
|
|
|
new BigDecimal(ptlAgreementProductCostsNew.getJqCostsProportion()),
|
|
new BigDecimal(ptlAgreementProductCostsNew.getJqCostsProportion()),
|
|
@@ -398,7 +420,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
retailLevel,
|
|
retailLevel,
|
|
|
ptlAgreementProductCostsExport,
|
|
ptlAgreementProductCostsExport,
|
|
|
retailProportion,
|
|
retailProportion,
|
|
|
- "jq");
|
|
|
|
|
|
|
+ "jq",
|
|
|
|
|
+ enterProportion
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
ReCalcuLateProportion syReCalcuLateProportion = recalculateProportion(
|
|
ReCalcuLateProportion syReCalcuLateProportion = recalculateProportion(
|
|
|
new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()),
|
|
new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()),
|
|
@@ -408,7 +432,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
retailLevel,
|
|
retailLevel,
|
|
|
ptlAgreementProductCostsExport,
|
|
ptlAgreementProductCostsExport,
|
|
|
retailProportion,
|
|
retailProportion,
|
|
|
- "sy");
|
|
|
|
|
|
|
+ "sy",
|
|
|
|
|
+ enterProportion
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
ReCalcuLateProportion noReCalcuLateProportion = recalculateProportion(
|
|
ReCalcuLateProportion noReCalcuLateProportion = recalculateProportion(
|
|
|
new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()),
|
|
new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()),
|
|
@@ -418,9 +444,11 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
retailLevel,
|
|
retailLevel,
|
|
|
ptlAgreementProductCostsExport,
|
|
ptlAgreementProductCostsExport,
|
|
|
retailProportion,
|
|
retailProportion,
|
|
|
- "no");
|
|
|
|
|
|
|
+ "no",
|
|
|
|
|
+ enterProportion
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
- retailProportion.setProportion(jqReCalcuLateProportion,syReCalcuLateProportion,noReCalcuLateProportion);
|
|
|
|
|
|
|
+ retailProportion.setProportion(jqReCalcuLateProportion, syReCalcuLateProportion, noReCalcuLateProportion);
|
|
|
// ptlAgreementProductCostsExportService.updateById(ptlAgreementProductCostsExport);
|
|
// ptlAgreementProductCostsExportService.updateById(ptlAgreementProductCostsExport);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -464,7 +492,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
if (parents != null && parents.size() > 2) {
|
|
if (parents != null && parents.size() > 2) {
|
|
|
insFeeOrderNew.setThreeLevelUserId(parents.get(2).getId());
|
|
insFeeOrderNew.setThreeLevelUserId(parents.get(2).getId());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 2) {
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 2) {
|
|
@@ -484,7 +512,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
if (parents != null && parents.size() > 1) {
|
|
if (parents != null && parents.size() > 1) {
|
|
|
insFeeOrderNew.setTwoLevelUserId(parents.get(1).getId());
|
|
insFeeOrderNew.setTwoLevelUserId(parents.get(1).getId());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 1) {
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 1) {
|
|
@@ -501,36 +529,36 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
insFeeOrderNew.setFirstDetailPremiums(retailFeeLevel1.getTotalRetailPremiums());
|
|
insFeeOrderNew.setFirstDetailPremiums(retailFeeLevel1.getTotalRetailPremiums());
|
|
|
|
|
|
|
|
- if (parents != null && parents.size() > 0) {
|
|
|
|
|
|
|
+ if (parents != null && !parents.isEmpty()) {
|
|
|
insFeeOrderNew.setFirstLevelUserId(parents.get(0).getId());
|
|
insFeeOrderNew.setFirstLevelUserId(parents.get(0).getId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setFirstDetailPremiums(new BigDecimal(0));
|
|
insFeeOrderNew.setFirstDetailPremiums(new BigDecimal(0));
|
|
|
insFeeOrderNew.setSecondDetailPremiums(new BigDecimal(0));
|
|
insFeeOrderNew.setSecondDetailPremiums(new BigDecimal(0));
|
|
|
insFeeOrderNew.setThirdDetailPremiums(new BigDecimal(0));
|
|
insFeeOrderNew.setThirdDetailPremiums(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
jqRetailRadio = jqRetailRadio.add(retailFeeLevel1.getJqRetailProportion())
|
|
jqRetailRadio = jqRetailRadio.add(retailFeeLevel1.getJqRetailProportion())
|
|
|
- .add(retailFeeLevel2.getJqRetailProportion())
|
|
|
|
|
- .add(retailFeeLevel3.getJqRetailProportion());
|
|
|
|
|
|
|
+ .add(retailFeeLevel2.getJqRetailProportion())
|
|
|
|
|
+ .add(retailFeeLevel3.getJqRetailProportion());
|
|
|
|
|
|
|
|
syRetailRadio = syRetailRadio.add(retailFeeLevel1.getSyRetailProportion())
|
|
syRetailRadio = syRetailRadio.add(retailFeeLevel1.getSyRetailProportion())
|
|
|
- .add(retailFeeLevel2.getSyRetailProportion())
|
|
|
|
|
- .add(retailFeeLevel3.getSyRetailProportion());
|
|
|
|
|
|
|
+ .add(retailFeeLevel2.getSyRetailProportion())
|
|
|
|
|
+ .add(retailFeeLevel3.getSyRetailProportion());
|
|
|
|
|
|
|
|
noRetailRadio = noRetailRadio.add(retailFeeLevel1.getNoRetailProportion())
|
|
noRetailRadio = noRetailRadio.add(retailFeeLevel1.getNoRetailProportion())
|
|
|
- .add(retailFeeLevel2.getNoRetailProportion())
|
|
|
|
|
- .add(retailFeeLevel3.getNoRetailProportion());
|
|
|
|
|
|
|
+ .add(retailFeeLevel2.getNoRetailProportion())
|
|
|
|
|
+ .add(retailFeeLevel3.getNoRetailProportion());
|
|
|
|
|
|
|
|
- insFeeOrderNew.assignRetail(retailFeeLevel1,retailFeeLevel2,retailFeeLevel3);
|
|
|
|
|
|
|
+ insFeeOrderNew.assignRetail(retailFeeLevel1, retailFeeLevel2, retailFeeLevel3);
|
|
|
|
|
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
@@ -582,7 +610,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
noReCalcuLateProportion.getDept_level_4_proportion(),
|
|
noReCalcuLateProportion.getDept_level_4_proportion(),
|
|
|
noReCalcuLateProportion.getDept_level_5_proportion());
|
|
noReCalcuLateProportion.getDept_level_5_proportion());
|
|
|
|
|
|
|
|
- insFeeOrderNew.assignDept(jqDeptManagerFee,syDeptManagerFee,noDeptManagerFee);
|
|
|
|
|
|
|
+ insFeeOrderNew.assignDept(jqDeptManagerFee, syDeptManagerFee, noDeptManagerFee);
|
|
|
|
|
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
@@ -595,7 +623,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
insFeeOrderNew.getJqCostsProportion(),
|
|
insFeeOrderNew.getJqCostsProportion(),
|
|
|
jqDeptRadio,
|
|
jqDeptRadio,
|
|
|
jqRetailRadio,
|
|
jqRetailRadio,
|
|
|
- taxRadio);
|
|
|
|
|
|
|
+ taxRadio,
|
|
|
|
|
+ jqReCalcuLateProportion.getProxyProportion()
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
//商业出口手续费比例
|
|
//商业出口手续费比例
|
|
|
FeeOrderNewVo.ExportFee syExportFee = feeRuleSchemeService.calcExportFee(
|
|
FeeOrderNewVo.ExportFee syExportFee = feeRuleSchemeService.calcExportFee(
|
|
@@ -604,7 +634,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
insFeeOrderNew.getSyCostsProportion(),
|
|
insFeeOrderNew.getSyCostsProportion(),
|
|
|
syDeptRadio,
|
|
syDeptRadio,
|
|
|
syRetailRadio,
|
|
syRetailRadio,
|
|
|
- taxRadio);
|
|
|
|
|
|
|
+ taxRadio,
|
|
|
|
|
+ syReCalcuLateProportion.getProxyProportion()
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
//非车出口手续费比例
|
|
//非车出口手续费比例
|
|
|
FeeOrderNewVo.ExportFee noExportFee = feeRuleSchemeService.calcExportFee(
|
|
FeeOrderNewVo.ExportFee noExportFee = feeRuleSchemeService.calcExportFee(
|
|
@@ -613,7 +645,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
insFeeOrderNew.getNoCostsProportion(),
|
|
insFeeOrderNew.getNoCostsProportion(),
|
|
|
noDeptRadio,
|
|
noDeptRadio,
|
|
|
noRetailRadio,
|
|
noRetailRadio,
|
|
|
- taxRadio);
|
|
|
|
|
|
|
+ taxRadio,
|
|
|
|
|
+ noReCalcuLateProportion.getProxyProportion()
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
//出口手续费用
|
|
//出口手续费用
|
|
|
insFeeOrderNew.setJqExportSuperviseCostsPremiums(twoPeople(jqExportFee.getSuperviseCostsPremiums()));
|
|
insFeeOrderNew.setJqExportSuperviseCostsPremiums(twoPeople(jqExportFee.getSuperviseCostsPremiums()));
|
|
@@ -635,6 +669,16 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
insFeeOrderNew.setSyCostsExportProportion(twoPeople(syExportFee.getSuperviseCosts()));
|
|
insFeeOrderNew.setSyCostsExportProportion(twoPeople(syExportFee.getSuperviseCosts()));
|
|
|
insFeeOrderNew.setNoCostsExportProportion(twoPeople(noExportFee.getSuperviseCosts()));
|
|
insFeeOrderNew.setNoCostsExportProportion(twoPeople(noExportFee.getSuperviseCosts()));
|
|
|
|
|
|
|
|
|
|
+ // 外部费用
|
|
|
|
|
+ insFeeOrderNew.setJqExternalProportion(jqExportFee.getExternalProportion());
|
|
|
|
|
+ insFeeOrderNew.setJqExternalPremiums(jqExportFee.getExternalPremiums());
|
|
|
|
|
+
|
|
|
|
|
+ insFeeOrderNew.setSyExternalProportion(syExportFee.getExternalProportion());
|
|
|
|
|
+ insFeeOrderNew.setSyExternalPremiums(syExportFee.getExternalPremiums());
|
|
|
|
|
+
|
|
|
|
|
+ insFeeOrderNew.setNoExternalProportion(noExportFee.getExternalProportion());
|
|
|
|
|
+ insFeeOrderNew.setNoExternalPremiums(noExportFee.getExternalPremiums());
|
|
|
|
|
+
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 计算利润差值
|
|
//region 计算利润差值
|
|
@@ -642,59 +686,65 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
//分销交强费用
|
|
//分销交强费用
|
|
|
//分开算 1 2 3 级
|
|
//分开算 1 2 3 级
|
|
|
- BigDecimal jqFirst = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal jqSecond = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal jqThird = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
|
+ BigDecimal jqFirst = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal jqSecond = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal jqThird = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
BigDecimal jqFenXiao = jqFirst.add(jqSecond).add(jqThird);
|
|
BigDecimal jqFenXiao = jqFirst.add(jqSecond).add(jqThird);
|
|
|
//分销商业费用
|
|
//分销商业费用
|
|
|
- BigDecimal syFirst = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal sySecond = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal syThird = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
|
+ BigDecimal syFirst = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal sySecond = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal syThird = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
BigDecimal syFenXiao = syFirst.add(sySecond).add(syThird);
|
|
BigDecimal syFenXiao = syFirst.add(sySecond).add(syThird);
|
|
|
//分销非车费用
|
|
//分销非车费用
|
|
|
- BigDecimal noFirst = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal noSecond = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal noThird = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
|
+ BigDecimal noFirst = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal noSecond = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal noThird = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
BigDecimal noFenXiao = noFirst.add(noSecond).add(noThird);
|
|
BigDecimal noFenXiao = noFirst.add(noSecond).add(noThird);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- BigDecimal jqDifference = jqEntranceFee.getTotalAmount().subtract(
|
|
|
|
|
|
|
+ BigDecimal jqDifference = jqEntranceFee.getTotalAmount()
|
|
|
|
|
+ .subtract(jqExportFee.getExternalPremiums())
|
|
|
|
|
+ .subtract(
|
|
|
(jqExportFee.getSuperviseCostsPremiums().add(jqExportFee.getOtherCostsPremiums())))
|
|
(jqExportFee.getSuperviseCostsPremiums().add(jqExportFee.getOtherCostsPremiums())))
|
|
|
.subtract(
|
|
.subtract(
|
|
|
(jqDeptManagerFee.getDeptPremiumsLevelOne().add(jqDeptManagerFee.getDeptPremiumsLevelTwo().add(jqDeptManagerFee.getDeptPremiumsLevelThree()).add(jqDeptManagerFee.getDeptPremiumsLevelFoure()).add(jqDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
(jqDeptManagerFee.getDeptPremiumsLevelOne().add(jqDeptManagerFee.getDeptPremiumsLevelTwo().add(jqDeptManagerFee.getDeptPremiumsLevelThree()).add(jqDeptManagerFee.getDeptPremiumsLevelFoure()).add(jqDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
|
)
|
|
)
|
|
|
- .subtract(jqFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
|
|
|
|
+ .subtract(jqFenXiao)
|
|
|
|
|
+ .setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
insFeeOrderNew.setJqProfitMarginPremiums(jqDifference);
|
|
insFeeOrderNew.setJqProfitMarginPremiums(jqDifference);
|
|
|
|
|
|
|
|
- BigDecimal syDifference = syEntranceFee.getTotalAmount().subtract(
|
|
|
|
|
|
|
+ BigDecimal syDifference = syEntranceFee.getTotalAmount()
|
|
|
|
|
+ .subtract(syExportFee.getExternalPremiums())
|
|
|
|
|
+ .subtract(
|
|
|
(syExportFee.getSuperviseCostsPremiums().add(syExportFee.getOtherCostsPremiums())))
|
|
(syExportFee.getSuperviseCostsPremiums().add(syExportFee.getOtherCostsPremiums())))
|
|
|
.subtract(
|
|
.subtract(
|
|
|
(syDeptManagerFee.getDeptPremiumsLevelOne().add(syDeptManagerFee.getDeptPremiumsLevelTwo().add(syDeptManagerFee.getDeptPremiumsLevelThree()).add(syDeptManagerFee.getDeptPremiumsLevelFoure()).add(syDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
(syDeptManagerFee.getDeptPremiumsLevelOne().add(syDeptManagerFee.getDeptPremiumsLevelTwo().add(syDeptManagerFee.getDeptPremiumsLevelThree()).add(syDeptManagerFee.getDeptPremiumsLevelFoure()).add(syDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
|
)
|
|
)
|
|
|
- .subtract(syFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
|
|
|
|
+ .subtract(syFenXiao)
|
|
|
|
|
+ .setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
insFeeOrderNew.setSyProfitMarginPremiums(syDifference);
|
|
insFeeOrderNew.setSyProfitMarginPremiums(syDifference);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- BigDecimal noDifference = noEntranceFee.getTotalAmount().subtract(
|
|
|
|
|
|
|
+ BigDecimal noDifference = noEntranceFee.getTotalAmount()
|
|
|
|
|
+ .subtract(noExportFee.getExternalPremiums())
|
|
|
|
|
+ .subtract(
|
|
|
(noExportFee.getSuperviseCostsPremiums().add(noExportFee.getOtherCostsPremiums())))
|
|
(noExportFee.getSuperviseCostsPremiums().add(noExportFee.getOtherCostsPremiums())))
|
|
|
.subtract(
|
|
.subtract(
|
|
|
(noDeptManagerFee.getDeptPremiumsLevelOne().add(noDeptManagerFee.getDeptPremiumsLevelTwo().add(noDeptManagerFee.getDeptPremiumsLevelThree()).add(noDeptManagerFee.getDeptPremiumsLevelFoure()).add(noDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
(noDeptManagerFee.getDeptPremiumsLevelOne().add(noDeptManagerFee.getDeptPremiumsLevelTwo().add(noDeptManagerFee.getDeptPremiumsLevelThree()).add(noDeptManagerFee.getDeptPremiumsLevelFoure()).add(noDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
|
)
|
|
)
|
|
|
- .subtract(noFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ .subtract(noFenXiao)
|
|
|
|
|
+ .setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
insFeeOrderNew.setNoProfitMarginPremiums(noDifference);
|
|
insFeeOrderNew.setNoProfitMarginPremiums(noDifference);
|
|
|
|
|
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 比例逆推是否等于0
|
|
//region 比例逆推是否等于0
|
|
|
|
|
|
|
|
- if(!feeRuleSchemeService.calculateProportion(jqEntranceFee,jqDeptManagerFee,jqExportFee,jqRetailRadio,taxRadio,insFeeOrderNew.getJqPremium()))
|
|
|
|
|
|
|
+ if (!feeRuleSchemeService.calculateProportion(jqEntranceFee, jqDeptManagerFee, jqExportFee, jqRetailRadio, taxRadio, insFeeOrderNew.getJqPremium()))
|
|
|
throw new SystemException("交强比例异常");
|
|
throw new SystemException("交强比例异常");
|
|
|
|
|
|
|
|
- if(!feeRuleSchemeService.calculateProportion(syEntranceFee,syDeptManagerFee,syExportFee,syRetailRadio,taxRadio,insFeeOrderNew.getSyPremium()))
|
|
|
|
|
|
|
+ if (!feeRuleSchemeService.calculateProportion(syEntranceFee, syDeptManagerFee, syExportFee, syRetailRadio, taxRadio, insFeeOrderNew.getSyPremium()))
|
|
|
throw new SystemException("商业比例异常");
|
|
throw new SystemException("商业比例异常");
|
|
|
|
|
|
|
|
- if(!feeRuleSchemeService.calculateProportion(noEntranceFee,noDeptManagerFee,noExportFee,noRetailRadio,taxRadio,insFeeOrderNew.getNoPremium()))
|
|
|
|
|
|
|
+ if (!feeRuleSchemeService.calculateProportion(noEntranceFee, noDeptManagerFee, noExportFee, noRetailRadio, taxRadio, insFeeOrderNew.getNoPremium()))
|
|
|
throw new SystemException("非车比例异常");
|
|
throw new SystemException("非车比例异常");
|
|
|
|
|
|
|
|
//endregion
|
|
//endregion
|
|
@@ -705,6 +755,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 计算费用测试方法 没有数据库保存操作 只带入值进行计算核对
|
|
* 计算费用测试方法 没有数据库保存操作 只带入值进行计算核对
|
|
|
|
|
+ *
|
|
|
* @param costsId
|
|
* @param costsId
|
|
|
* @param insAreaCompany
|
|
* @param insAreaCompany
|
|
|
*/
|
|
*/
|
|
@@ -1028,9 +1079,11 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
@Override
|
|
@Override
|
|
|
public void calcCostsExternal(PtlAgreementProductCostsNew ptlAgreementProductCostsNew, InsAreaCompany insAreaCompany) {
|
|
public void calcCostsExternal(PtlAgreementProductCostsNew ptlAgreementProductCostsNew, InsAreaCompany insAreaCompany) {
|
|
|
//获取协议信息
|
|
//获取协议信息
|
|
|
|
|
+ // 外部订单比例
|
|
|
PtlAgreement ptlAgreement = ptlAgreementService.getById(insAreaCompany.getAgreementId());
|
|
PtlAgreement ptlAgreement = ptlAgreementService.getById(insAreaCompany.getAgreementId());
|
|
|
InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
SysUser sysUser = sysUserService.findByUserId(insOrders.getUserid());
|
|
SysUser sysUser = sysUserService.findByUserId(insOrders.getUserid());
|
|
|
|
|
+ BigDecimal enterProportion = sysSwitchConfigService.getEnterProportion(insOrders.getDeptid(), insAreaCompany.getEntryStatus());
|
|
|
|
|
|
|
|
BigDecimal taxRadio = new BigDecimal("1.00");
|
|
BigDecimal taxRadio = new BigDecimal("1.00");
|
|
|
//如果是外部订单则 不含税
|
|
//如果是外部订单则 不含税
|
|
@@ -1112,11 +1165,10 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
//默认分销比例设置
|
|
//默认分销比例设置
|
|
|
RetailProportion retailProportion = new RetailProportion();
|
|
RetailProportion retailProportion = new RetailProportion();
|
|
|
- if(!Objects.isNull(esmRetailList) && !esmRetailList.isEmpty())
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (!Objects.isNull(esmRetailList) && !esmRetailList.isEmpty()) {
|
|
|
retailLevel = Integer.parseInt(esmRetailList.get(0).getRetailtype());
|
|
retailLevel = Integer.parseInt(esmRetailList.get(0).getRetailtype());
|
|
|
//赋值默认的分销比例
|
|
//赋值默认的分销比例
|
|
|
- retailProportion.setProportion(esmRetailList.get(0).getDisrate1(),esmRetailList.get(0).getDisrate2(),esmRetailList.get(0).getDisrate3());
|
|
|
|
|
|
|
+ retailProportion.setProportion(esmRetailList.get(0).getDisrate1(), esmRetailList.get(0).getDisrate2(), esmRetailList.get(0).getDisrate3());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1163,7 +1215,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
retailLevel,
|
|
retailLevel,
|
|
|
ptlAgreementProductCostsExport,
|
|
ptlAgreementProductCostsExport,
|
|
|
retailProportion,
|
|
retailProportion,
|
|
|
- "jq");
|
|
|
|
|
|
|
+ "jq",
|
|
|
|
|
+ enterProportion
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
ReCalcuLateProportion syReCalcuLateProportion = recalculateProportion(
|
|
ReCalcuLateProportion syReCalcuLateProportion = recalculateProportion(
|
|
|
new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()),
|
|
new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()),
|
|
@@ -1173,7 +1227,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
retailLevel,
|
|
retailLevel,
|
|
|
ptlAgreementProductCostsExport,
|
|
ptlAgreementProductCostsExport,
|
|
|
retailProportion,
|
|
retailProportion,
|
|
|
- "sy");
|
|
|
|
|
|
|
+ "sy",
|
|
|
|
|
+ enterProportion
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
ReCalcuLateProportion noReCalcuLateProportion = recalculateProportion(
|
|
ReCalcuLateProportion noReCalcuLateProportion = recalculateProportion(
|
|
|
new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()),
|
|
new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()),
|
|
@@ -1183,9 +1239,11 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
retailLevel,
|
|
retailLevel,
|
|
|
ptlAgreementProductCostsExport,
|
|
ptlAgreementProductCostsExport,
|
|
|
retailProportion,
|
|
retailProportion,
|
|
|
- "no");
|
|
|
|
|
|
|
+ "no",
|
|
|
|
|
+ enterProportion
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
- retailProportion.setProportion(jqReCalcuLateProportion,syReCalcuLateProportion,noReCalcuLateProportion);
|
|
|
|
|
|
|
+ retailProportion.setProportion(jqReCalcuLateProportion, syReCalcuLateProportion, noReCalcuLateProportion);
|
|
|
// ptlAgreementProductCostsExportService.updateById(ptlAgreementProductCostsExport);
|
|
// ptlAgreementProductCostsExportService.updateById(ptlAgreementProductCostsExport);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1232,7 +1290,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
if (parents != null && parents.size() > 2) {
|
|
if (parents != null && parents.size() > 2) {
|
|
|
insFeeOrderNew.setThreeLevelUserId(parents.get(2).getId());
|
|
insFeeOrderNew.setThreeLevelUserId(parents.get(2).getId());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 2) {
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 2) {
|
|
@@ -1251,7 +1309,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
if (parents != null && parents.size() > 1) {
|
|
if (parents != null && parents.size() > 1) {
|
|
|
insFeeOrderNew.setTwoLevelUserId(parents.get(1).getId());
|
|
insFeeOrderNew.setTwoLevelUserId(parents.get(1).getId());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 1) {
|
|
if (Integer.parseInt(esmRetail.getRetailtype()) >= 1) {
|
|
@@ -1267,23 +1325,23 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
retailProportion.getSyRetailLevel1Proportion(),
|
|
retailProportion.getSyRetailLevel1Proportion(),
|
|
|
retailProportion.getNoRetailLevel1Proportion());
|
|
retailProportion.getNoRetailLevel1Proportion());
|
|
|
insFeeOrderNew.setFirstDetailPremiums(retailFeeLevel1.getTotalRetailPremiums());
|
|
insFeeOrderNew.setFirstDetailPremiums(retailFeeLevel1.getTotalRetailPremiums());
|
|
|
- if (parents != null && parents.size() > 0) {
|
|
|
|
|
|
|
+ if (parents != null && !parents.isEmpty()) {
|
|
|
insFeeOrderNew.setFirstLevelUserId(parents.get(0).getId());
|
|
insFeeOrderNew.setFirstLevelUserId(parents.get(0).getId());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setFirstDetailPremiums(new BigDecimal(0));
|
|
insFeeOrderNew.setFirstDetailPremiums(new BigDecimal(0));
|
|
|
insFeeOrderNew.setSecondDetailPremiums(new BigDecimal(0));
|
|
insFeeOrderNew.setSecondDetailPremiums(new BigDecimal(0));
|
|
|
insFeeOrderNew.setThirdDetailPremiums(new BigDecimal(0));
|
|
insFeeOrderNew.setThirdDetailPremiums(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
|
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
|
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
|
|
|
}
|
|
}
|
|
|
- insFeeOrderNew.assignRetail(retailFeeLevel1,retailFeeLevel2,retailFeeLevel3);
|
|
|
|
|
|
|
+ insFeeOrderNew.assignRetail(retailFeeLevel1, retailFeeLevel2, retailFeeLevel3);
|
|
|
|
|
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
@@ -1347,15 +1405,15 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
//交强出口手续费比例
|
|
//交强出口手续费比例
|
|
|
FeeOrderNewVo.ExportFee jqExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getJqPremium(), new BigDecimal(ptlAgreementProductCostsNew.getJqCostsExportProportion()),
|
|
FeeOrderNewVo.ExportFee jqExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getJqPremium(), new BigDecimal(ptlAgreementProductCostsNew.getJqCostsExportProportion()),
|
|
|
- insFeeOrderNew.getJqCostsProportion(), jqDeptRadio, retailRadio, taxRadio);
|
|
|
|
|
|
|
+ insFeeOrderNew.getJqCostsProportion(), jqDeptRadio, retailRadio, taxRadio, jqReCalcuLateProportion.getProxyProportion());
|
|
|
|
|
|
|
|
//商业出口手续费比例
|
|
//商业出口手续费比例
|
|
|
FeeOrderNewVo.ExportFee syExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getSyPremium(), new BigDecimal(ptlAgreementProductCostsNew.getSyCostsExportProportion()),
|
|
FeeOrderNewVo.ExportFee syExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getSyPremium(), new BigDecimal(ptlAgreementProductCostsNew.getSyCostsExportProportion()),
|
|
|
- insFeeOrderNew.getSyCostsProportion(), syDeptRadio, retailRadio, taxRadio);
|
|
|
|
|
|
|
+ insFeeOrderNew.getSyCostsProportion(), syDeptRadio, retailRadio, taxRadio, syReCalcuLateProportion.getProxyProportion());
|
|
|
|
|
|
|
|
//非车出口手续费比例
|
|
//非车出口手续费比例
|
|
|
FeeOrderNewVo.ExportFee noExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getNoPremium(), new BigDecimal(ptlAgreementProductCostsNew.getNoCostsExportProportion()),
|
|
FeeOrderNewVo.ExportFee noExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getNoPremium(), new BigDecimal(ptlAgreementProductCostsNew.getNoCostsExportProportion()),
|
|
|
- insFeeOrderNew.getNoCostsProportion(), noDeptRadio, retailRadio, taxRadio);
|
|
|
|
|
|
|
+ insFeeOrderNew.getNoCostsProportion(), noDeptRadio, retailRadio, taxRadio, noReCalcuLateProportion.getProxyProportion());
|
|
|
|
|
|
|
|
//出口手续费用
|
|
//出口手续费用
|
|
|
insFeeOrderNew.setJqExportSuperviseCostsPremiums(twoPeople(jqExportFee.getSuperviseCostsPremiums()));
|
|
insFeeOrderNew.setJqExportSuperviseCostsPremiums(twoPeople(jqExportFee.getSuperviseCostsPremiums()));
|
|
@@ -1377,6 +1435,16 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
insFeeOrderNew.setSyCostsExportProportion(twoPeople(syExportFee.getSuperviseCosts()));
|
|
insFeeOrderNew.setSyCostsExportProportion(twoPeople(syExportFee.getSuperviseCosts()));
|
|
|
insFeeOrderNew.setNoCostsExportProportion(twoPeople(noExportFee.getSuperviseCosts()));
|
|
insFeeOrderNew.setNoCostsExportProportion(twoPeople(noExportFee.getSuperviseCosts()));
|
|
|
|
|
|
|
|
|
|
+ // 外部订单费用
|
|
|
|
|
+ insFeeOrderNew.setJqExternalProportion(jqExportFee.getExternalProportion());
|
|
|
|
|
+ insFeeOrderNew.setJqExternalPremiums(jqExportFee.getExternalPremiums());
|
|
|
|
|
+
|
|
|
|
|
+ insFeeOrderNew.setSyExternalProportion(syExportFee.getExternalProportion());
|
|
|
|
|
+ insFeeOrderNew.setSyExternalPremiums(syExportFee.getExternalPremiums());
|
|
|
|
|
+
|
|
|
|
|
+ insFeeOrderNew.setNoExternalProportion(noExportFee.getExternalProportion());
|
|
|
|
|
+ insFeeOrderNew.setNoExternalPremiums(noExportFee.getExternalPremiums());
|
|
|
|
|
+
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 计算利润差值
|
|
//region 计算利润差值
|
|
@@ -1384,23 +1452,24 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
//分销交强费用
|
|
//分销交强费用
|
|
|
//分开算 1 2 3 级
|
|
//分开算 1 2 3 级
|
|
|
- BigDecimal jqFirst = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getFirstDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal jqSecond = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getSecondDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal jqThird = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getThirdDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
|
+ BigDecimal jqFirst = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getFirstDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal jqSecond = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getSecondDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal jqThird = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getThirdDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
BigDecimal jqFenXiao = jqFirst.add(jqSecond).add(jqThird);
|
|
BigDecimal jqFenXiao = jqFirst.add(jqSecond).add(jqThird);
|
|
|
//分销商业费用
|
|
//分销商业费用
|
|
|
- BigDecimal syFirst = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getFirstDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal sySecond = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSecondDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal syThird = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getThirdDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
|
+ BigDecimal syFirst = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getFirstDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal sySecond = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSecondDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal syThird = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getThirdDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
BigDecimal syFenXiao = syFirst.add(sySecond).add(syThird);
|
|
BigDecimal syFenXiao = syFirst.add(sySecond).add(syThird);
|
|
|
//分销非车费用
|
|
//分销非车费用
|
|
|
- BigDecimal noFirst = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getFirstDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal noSecond = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getSecondDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
- BigDecimal noThird = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getThirdDetailProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
|
+ BigDecimal noFirst = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getFirstDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal noSecond = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getSecondDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
+ BigDecimal noThird = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getThirdDetailProportion().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
BigDecimal noFenXiao = noFirst.add(noSecond).add(noThird);
|
|
BigDecimal noFenXiao = noFirst.add(noSecond).add(noThird);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- BigDecimal jqDifference = jqEntranceFee.getTotalAmount().subtract(
|
|
|
|
|
|
|
+ BigDecimal jqDifference = jqEntranceFee.getTotalAmount()
|
|
|
|
|
+ .subtract(jqExportFee.getExternalPremiums())
|
|
|
|
|
+ .subtract(
|
|
|
(jqExportFee.getSuperviseCostsPremiums().add(jqExportFee.getOtherCostsPremiums())))
|
|
(jqExportFee.getSuperviseCostsPremiums().add(jqExportFee.getOtherCostsPremiums())))
|
|
|
.subtract(
|
|
.subtract(
|
|
|
(jqDeptManagerFee.getDeptPremiumsLevelOne().add(jqDeptManagerFee.getDeptPremiumsLevelTwo().add(jqDeptManagerFee.getDeptPremiumsLevelThree()).add(jqDeptManagerFee.getDeptPremiumsLevelFoure()).add(jqDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
(jqDeptManagerFee.getDeptPremiumsLevelOne().add(jqDeptManagerFee.getDeptPremiumsLevelTwo().add(jqDeptManagerFee.getDeptPremiumsLevelThree()).add(jqDeptManagerFee.getDeptPremiumsLevelFoure()).add(jqDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
@@ -1408,7 +1477,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
.subtract(jqFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
.subtract(jqFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
insFeeOrderNew.setJqProfitMarginPremiums(jqDifference);
|
|
insFeeOrderNew.setJqProfitMarginPremiums(jqDifference);
|
|
|
|
|
|
|
|
- BigDecimal syDifference = syEntranceFee.getTotalAmount().subtract(
|
|
|
|
|
|
|
+ BigDecimal syDifference = syEntranceFee.getTotalAmount()
|
|
|
|
|
+ .subtract(syExportFee.getExternalPremiums())
|
|
|
|
|
+ .subtract(
|
|
|
(syExportFee.getSuperviseCostsPremiums().add(syExportFee.getOtherCostsPremiums())))
|
|
(syExportFee.getSuperviseCostsPremiums().add(syExportFee.getOtherCostsPremiums())))
|
|
|
.subtract(
|
|
.subtract(
|
|
|
(syDeptManagerFee.getDeptPremiumsLevelOne().add(syDeptManagerFee.getDeptPremiumsLevelTwo().add(syDeptManagerFee.getDeptPremiumsLevelThree()).add(syDeptManagerFee.getDeptPremiumsLevelFoure()).add(syDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
(syDeptManagerFee.getDeptPremiumsLevelOne().add(syDeptManagerFee.getDeptPremiumsLevelTwo().add(syDeptManagerFee.getDeptPremiumsLevelThree()).add(syDeptManagerFee.getDeptPremiumsLevelFoure()).add(syDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
@@ -1416,8 +1487,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
.subtract(syFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
.subtract(syFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
|
|
|
insFeeOrderNew.setSyProfitMarginPremiums(syDifference);
|
|
insFeeOrderNew.setSyProfitMarginPremiums(syDifference);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- BigDecimal noDifference = noEntranceFee.getTotalAmount().subtract(
|
|
|
|
|
|
|
+ BigDecimal noDifference = noEntranceFee.getTotalAmount()
|
|
|
|
|
+ .subtract(noExportFee.getExternalPremiums())
|
|
|
|
|
+ .subtract(
|
|
|
(noExportFee.getSuperviseCostsPremiums().add(noExportFee.getOtherCostsPremiums())))
|
|
(noExportFee.getSuperviseCostsPremiums().add(noExportFee.getOtherCostsPremiums())))
|
|
|
.subtract(
|
|
.subtract(
|
|
|
(noDeptManagerFee.getDeptPremiumsLevelOne().add(noDeptManagerFee.getDeptPremiumsLevelTwo().add(noDeptManagerFee.getDeptPremiumsLevelThree()).add(noDeptManagerFee.getDeptPremiumsLevelFoure()).add(noDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
(noDeptManagerFee.getDeptPremiumsLevelOne().add(noDeptManagerFee.getDeptPremiumsLevelTwo().add(noDeptManagerFee.getDeptPremiumsLevelThree()).add(noDeptManagerFee.getDeptPremiumsLevelFoure()).add(noDeptManagerFee.getDeptPremiumsLevelFive())))
|
|
@@ -1430,13 +1502,13 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
|
|
//region 比例逆推是否等于0
|
|
//region 比例逆推是否等于0
|
|
|
|
|
|
|
|
- if(!feeRuleSchemeService.calculateProportion(jqEntranceFee,jqDeptManagerFee,jqExportFee,retailRadio,taxRadio,insFeeOrderNew.getJqPremium()))
|
|
|
|
|
|
|
+ if (!feeRuleSchemeService.calculateProportion(jqEntranceFee, jqDeptManagerFee, jqExportFee, retailRadio, taxRadio, insFeeOrderNew.getJqPremium()))
|
|
|
throw new SystemException("交强比例异常");
|
|
throw new SystemException("交强比例异常");
|
|
|
|
|
|
|
|
- if(!feeRuleSchemeService.calculateProportion(syEntranceFee,syDeptManagerFee,syExportFee,retailRadio,taxRadio,insFeeOrderNew.getSyPremium()))
|
|
|
|
|
|
|
+ if (!feeRuleSchemeService.calculateProportion(syEntranceFee, syDeptManagerFee, syExportFee, retailRadio, taxRadio, insFeeOrderNew.getSyPremium()))
|
|
|
throw new SystemException("商业比例异常");
|
|
throw new SystemException("商业比例异常");
|
|
|
|
|
|
|
|
- if(!feeRuleSchemeService.calculateProportion(noEntranceFee,noDeptManagerFee,noExportFee,retailRadio,taxRadio,insFeeOrderNew.getNoPremium()))
|
|
|
|
|
|
|
+ if (!feeRuleSchemeService.calculateProportion(noEntranceFee, noDeptManagerFee, noExportFee, retailRadio, taxRadio, insFeeOrderNew.getNoPremium()))
|
|
|
throw new SystemException("非车比例异常");
|
|
throw new SystemException("非车比例异常");
|
|
|
|
|
|
|
|
//endregion
|
|
//endregion
|
|
@@ -1765,9 +1837,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
*/
|
|
*/
|
|
|
private boolean checkBoxEqual(PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink, String value) {
|
|
private boolean checkBoxEqual(PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink, String value) {
|
|
|
String[] split = ptlAgreementProductCostsAttrLink.getMin().split(",");
|
|
String[] split = ptlAgreementProductCostsAttrLink.getMin().split(",");
|
|
|
- for( String sp : split)
|
|
|
|
|
- {
|
|
|
|
|
- if(sp.equals(value)){
|
|
|
|
|
|
|
+ for (String sp : split) {
|
|
|
|
|
+ if (sp.equals(value)) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1867,13 +1938,13 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
//将值进行分割
|
|
//将值进行分割
|
|
|
String[] split = ptlAgreementUndwrtRulesAttrLink.getMin().split(",");
|
|
String[] split = ptlAgreementUndwrtRulesAttrLink.getMin().split(",");
|
|
|
AtomicBoolean returnBool = new AtomicBoolean(true);
|
|
AtomicBoolean returnBool = new AtomicBoolean(true);
|
|
|
- if(ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("NatureOfUse")) {
|
|
|
|
|
|
|
+ if (ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("NatureOfUse")) {
|
|
|
Arrays.stream(split).forEach(x -> {
|
|
Arrays.stream(split).forEach(x -> {
|
|
|
if (!x.equals("") && value.equals(x)) {
|
|
if (!x.equals("") && value.equals(x)) {
|
|
|
returnBool.set(false);
|
|
returnBool.set(false);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
Arrays.stream(split).forEach(x -> {
|
|
Arrays.stream(split).forEach(x -> {
|
|
|
if (!x.equals("") && value.contains(x)) {
|
|
if (!x.equals("") && value.contains(x)) {
|
|
|
returnBool.set(false);
|
|
returnBool.set(false);
|