|
|
@@ -128,6 +128,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
private static final String JY_INVOICING_COMMISSION_LOCK = "JY_INVOICING_COMMISSION_LOCK:";
|
|
|
// 驾意险跟单费结算所
|
|
|
private static final String JY_INVOICING_OTHER_LOCK = "JY_INVOICING_OTHER_LOCK:";
|
|
|
+ // 驾意险跟单费结算所
|
|
|
+ private static final String PT_INVOICING_COMMISSION_LOCK = "PT_INVOICING_COMMISSION_LOCK:";
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
@@ -501,6 +503,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
case "2" -> CAR_INVOICING_OTHER_LOCK;
|
|
|
case "3" -> JY_INVOICING_COMMISSION_LOCK;
|
|
|
case "4" -> JY_INVOICING_OTHER_LOCK;
|
|
|
+ case "5" -> PT_INVOICING_COMMISSION_LOCK;
|
|
|
default -> throw new SystemException("不支持的开票类型");
|
|
|
};
|
|
|
|
|
|
@@ -617,9 +620,11 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
invoice.setId(IdGenerate.nextId());
|
|
|
invoice.setCompanyId(invoicingVo.getCompanyId());
|
|
|
invoice.setInvoiceType(invoicingVo.getInvoiceType());
|
|
|
- // 开票类型 1 手续费 2 跟单费 3 驾意险手续费 4 驾意险跟单费
|
|
|
+ // 开票类型 1、手续费 2、跟单费 3、驾意险手续费 4、驾意险跟单费 5、平台应收
|
|
|
if("1".equals(invoicingVo.getInvoiceType()) || "2".equals(invoicingVo.getInvoiceType())){
|
|
|
invoice.setInvoiceRiskType("10");
|
|
|
+ }else if("5".equals(invoicingVo.getInvoiceType())){
|
|
|
+ invoice.setInvoiceRiskType("30");
|
|
|
}else{
|
|
|
invoice.setInvoiceRiskType("20");
|
|
|
}
|
|
|
@@ -706,14 +711,14 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
InsPlyIncomeInvoice insPlyIncomeInvoice = insPlyIncomeInvoiceMapper.selectById(settlementVo.getInvoicingId());
|
|
|
AssertionUtils.isFail(Objects.isNull(insPlyIncomeInvoice), "发票数据不存在");
|
|
|
// 实际已经收的了金额
|
|
|
- BigDecimal ctualReceivedAmount = this.getInvoicingAmount(settlementVo.getInvoicingId());
|
|
|
+ BigDecimal actualReceivedAmount = this.getInvoicingAmount(settlementVo.getInvoicingId());
|
|
|
|
|
|
// 所有需要结算的金额
|
|
|
BigDecimal allToSettlement = insPlyIncomeInvoice.getReceivableSupervisePremium().add(insPlyIncomeInvoice.getOverinflatedAmount());
|
|
|
// 剩余的金额
|
|
|
- BigDecimal surplusPremium = allToSettlement.subtract(ctualReceivedAmount);
|
|
|
+ BigDecimal surplusPremium = allToSettlement.subtract(actualReceivedAmount);
|
|
|
log.info("invoiceId=[{}],一共需要结算的金额[{}],实际已经结算的金额[{}],本次计划结算的金额[{}]",
|
|
|
- settlementVo.getInvoicingId(), allToSettlement,ctualReceivedAmount,settlementVo.getActualReceivedAmount());
|
|
|
+ settlementVo.getInvoicingId(), allToSettlement,actualReceivedAmount,settlementVo.getActualReceivedAmount());
|
|
|
// 校验是否超出了剩余的金额
|
|
|
AssertionUtils.isFail(surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) < 0, "已超出应收金额,请核对!");
|
|
|
|