|
|
@@ -616,50 +616,101 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
invSource.setId(IdGenerate.nextId());
|
|
|
invSource.builder();
|
|
|
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));
|
|
|
-
|
|
|
+ /**
|
|
|
+ * jqPremiumTax 交强险保费
|
|
|
+ * syPremiumTax 商业险保费
|
|
|
+ * nonCarPremiumTax 非车保费
|
|
|
+ * jqReceivableRatio 交强应收比例
|
|
|
+ * syReceivableRatio 商业应收比列
|
|
|
+ * nonCarReceivableRatio 非车应收比列
|
|
|
+ * jqPremium 交强险保费(不含税)
|
|
|
+ * syPremium 商业险保费(不含税)
|
|
|
+ * nonCarPremium 非车保费(不含税)
|
|
|
+ * jqPremiumRatio 交强手续费比例
|
|
|
+ * syPremiumRatio 商业手续费比例
|
|
|
+ * nonCarPremiumRatio 非车手续费比例
|
|
|
+ * jqNonCopyingRatio 交强非跟单比例
|
|
|
+ * syNonCopyingRatio 商业非跟单比例
|
|
|
+ * nonCarNonCopyingRatio 非车非跟单比例
|
|
|
+ */
|
|
|
//处理非跟单比例
|
|
|
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()));
|
|
|
+ }
|
|
|
+
|
|
|
boolean save = invSourceMapper.insert(invSource) > 0 ? true : false;
|
|
|
return save;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean addSettlement(InvSettlementSource invSettlementSource) {
|
|
|
+ invSettlementSource.setId(IdGenerate.nextId());
|
|
|
+ invSettlementSource.builder();
|
|
|
+ //处理补贴金额
|
|
|
+ invSettlementSource.setSubsidyAmount(
|
|
|
+ invSettlementSource.getJqPremiumTax().multiply(invSettlementSource.getSubsidyRatio())
|
|
|
+ .add(invSettlementSource.getSyPremiumTax().multiply(invSettlementSource.getSubsidyRatio()))
|
|
|
+ .add(invSettlementSource.getNonCarPremiumTax().multiply(invSettlementSource.getSubsidyRatio())));
|
|
|
+ // 处理结算金额
|
|
|
+ invSettlementSource.setSettlementAmount(
|
|
|
+ invSettlementSource.getJqPremiumTax().multiply(invSettlementSource.getCompulsoryExportRatio())
|
|
|
+ .add(invSettlementSource.getSyPremiumTax().multiply(invSettlementSource.getCommercialExportRatio())
|
|
|
+ .add(invSettlementSource.getNonCarPremiumTax().multiply(invSettlementSource.getNonVehicleExportRatio())))
|
|
|
+ );
|
|
|
+ DateTime dateTime = new DateTime();
|
|
|
+ invSettlementSource.setRevenueTime(dateTime.toString());
|
|
|
+ boolean save = invSettlementSourceMapper.insert(invSettlementSource) > 0 ? true : false;
|
|
|
+ return save;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<String> dataMatching() {
|
|
|
List<String> data = invSourceMapper.dataMatching();
|