|
|
@@ -416,46 +416,57 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
@Override
|
|
|
public Boolean updateRecivable(InvSource invSource) {
|
|
|
BigDecimal tax = BigDecimal.valueOf(1.06);
|
|
|
- //处理交强不含税
|
|
|
- invSource.setJqPremium(invSource.getJqPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
- //处理商业不含税
|
|
|
- invSource.setSyPremium(invSource.getSyPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
- //处理非车不含税
|
|
|
- invSource.setNonCarPremium(invSource.getNonCarPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
-
|
|
|
//处理非跟单比例
|
|
|
invSource.setJqNonCopyingRatio(invSource.getJqReceivableRatio().subtract(invSource.getJqPremiumRatio()));
|
|
|
invSource.setSyNonCopyingRatio(invSource.getSyReceivableRatio().subtract(invSource.getSyPremiumRatio()));
|
|
|
invSource.setNonCarNonCopyingRatio(invSource.getNonCarReceivableRatio().subtract(invSource.getNonCarPremiumRatio()));
|
|
|
|
|
|
- //处理手续费金额
|
|
|
- invSource.setPremium(
|
|
|
- invSource.getJqPremium().multiply(invSource.getJqPremiumRatio())
|
|
|
- .add(invSource.getSyPremium().multiply(invSource.getSyPremiumRatio()))
|
|
|
- .add(invSource.getNonCarPremium().multiply(invSource.getNonCarPremiumRatio())));
|
|
|
- //处理非跟单金额
|
|
|
- invSource.setNonCopying(
|
|
|
- invSource.getJqPremium().multiply(invSource.getJqNonCopyingRatio())
|
|
|
- .add(invSource.getSyPremium().multiply(invSource.getSyNonCopyingRatio()))
|
|
|
- .add(invSource.getNonCarPremium().multiply(invSource.getNonCarNonCopyingRatio())));
|
|
|
- //处理保司应收金额
|
|
|
- invSource.setReceivable(
|
|
|
- invSource.getJqPremium().multiply(invSource.getJqReceivableRatio())
|
|
|
- .add(invSource.getSyPremium().multiply(invSource.getSyReceivableRatio()))
|
|
|
- .add(invSource.getNonCarPremium().multiply(invSource.getNonCarReceivableRatio())));
|
|
|
//处理补贴金额
|
|
|
invSource.setSubsidyAmount(
|
|
|
invSource.getJqPremiumTax().multiply(invSource.getSubsidyRatio())
|
|
|
.add(invSource.getSyPremiumTax().multiply(invSource.getSubsidyRatio()))
|
|
|
.add(invSource.getNonCarPremiumTax().multiply(invSource.getSubsidyRatio())));
|
|
|
- //处理应收总金额
|
|
|
- invSource.setTotalReceivableAmount(
|
|
|
- invSource.getReceivable().add(invSource.getSubsidyAmount()));
|
|
|
//处理最大应付金额
|
|
|
invSource.setMaxReceivable(
|
|
|
invSource.getJqPremiumTax().multiply(invSource.getMaxJqReceivableRatio())
|
|
|
.add(invSource.getSyPremiumTax().multiply(invSource.getMaxSyReceivableRatio()))
|
|
|
.add(invSource.getNonCarPremiumTax().multiply(invSource.getMaxNonCarReceivableRatio())));
|
|
|
+ //处理不含税保费
|
|
|
+ invSource.setJqPremium(invSource.getJqPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
+ invSource.setSyPremium(invSource.getSyPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
+ invSource.setNonCarPremium(invSource.getNonCarPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
+
|
|
|
+ //手续费金额 premium
|
|
|
+ invSource.setPremium(invSource.getJqPremium().multiply(invSource.getJqPremiumRatio())
|
|
|
+ .add(invSource.getSyPremium().multiply(invSource.getSyPremiumRatio())
|
|
|
+ .add(invSource.getNonCarPremium().multiply(invSource.getNonCarPremiumRatio()))));
|
|
|
+
|
|
|
+ //非跟单金额 nonCopying 不含税保费 * 非跟单比例
|
|
|
+ invSource.setNonCopying(invSource.getJqPremium().multiply(invSource.getJqNonCopyingRatio())
|
|
|
+ .add(invSource.getSyPremium().multiply(invSource.getSyNonCopyingRatio())
|
|
|
+ .add(invSource.getNonCarPremium().multiply(invSource.getNonCarNonCopyingRatio()))));
|
|
|
+
|
|
|
+
|
|
|
+ //选择类型为含税类型时 应收金额 = 含税保费 * 应收比例
|
|
|
+ if (invSource.getInvSourceType().equals("platform")) {
|
|
|
+ //处理应收金额
|
|
|
+ invSource.setReceivable(invSource.getJqPremiumTax().multiply(invSource.getJqReceivableRatio())
|
|
|
+ .add(invSource.getSyPremiumTax().multiply(invSource.getSyReceivableRatio())
|
|
|
+ .add(invSource.getNonCarPremiumTax().multiply(invSource.getNonCarReceivableRatio()))));
|
|
|
+ //处理应收总金额
|
|
|
+ invSource.setTotalReceivableAmount(
|
|
|
+ invSource.getReceivable().add(invSource.getSubsidyAmount()));
|
|
|
+ }
|
|
|
+
|
|
|
+ //选择类型为不含税类型时 应收金额 = (不含税保费 * 手续费)+(不含税保费 * 非跟单比例)
|
|
|
+ if (invSource.getInvSourceType().equals("privately")) {
|
|
|
+ //应收金额
|
|
|
+ invSource.setReceivable(invSource.getPremium().add(invSource.getNonCopying()));
|
|
|
+
|
|
|
+ //处理应收总金额
|
|
|
+ invSource.setTotalReceivableAmount(
|
|
|
+ invSource.getReceivable().add(invSource.getSubsidyAmount()));
|
|
|
+ }
|
|
|
invSource.setClearingState("未结算".equals(invSource.getClearingState()) ? "0" :
|
|
|
"已结算".equals(invSource.getClearingState()) ? "1" : invSource.getClearingState());
|
|
|
invSource.setInsuranceClearingState("未结算".equals(invSource.getInsuranceClearingState()) ? "0" :
|
|
|
@@ -690,7 +701,7 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
invSource.getReceivable().add(invSource.getSubsidyAmount()));
|
|
|
}
|
|
|
|
|
|
- //选择类型为不含税类型时 应收金额 = (不含税保费 * 手续费)+ (不含税保费 * 非跟单比例)
|
|
|
+ //选择类型为不含税类型时 应收金额 = (不含税保费 * 手续费)+(不含税保费 * 非跟单比例)
|
|
|
if (invSource.getInvSourceType().equals("privately")) {
|
|
|
//应收金额
|
|
|
invSource.setReceivable(invSource.getPremium().add(invSource.getNonCopying()));
|