|
|
@@ -513,7 +513,8 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
.add(invSource.getNonCarPremiumTax().multiply(invSource.getMaxNonCarReceivableRatio())));
|
|
|
invSource.setClearingState("未结算".equals(invSource.getClearingState()) ? "0" :
|
|
|
"已结算".equals(invSource.getClearingState()) ? "1" : invSource.getClearingState());
|
|
|
-
|
|
|
+ invSource.setInsuranceClearingState("未结算".equals(invSource.getClearingState()) ? "0" :
|
|
|
+ "已结算".equals(invSource.getClearingState()) ? "1" : invSource.getClearingState());
|
|
|
return invSourceMapper.updateById(invSource) > 0 ? true : false;
|
|
|
}
|
|
|
|
|
|
@@ -666,6 +667,47 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean addReceivable(InvSource invSource) {
|
|
|
+ BigDecimal tax = new BigDecimal(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.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())));
|
|
|
+ boolean save = invSourceService.save(invSource);
|
|
|
+ return save;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|