本文解答了关于《购买预付卡的账务处理》相关内容,同时关于1、购买预付卡的账务处理,2、购买预付卡的账务处理流程,3、购买预付卡如何做账,4、购买预付卡计入什么科目,5、购买预付款卡怎么做账,的相关问答本篇文章福途教育网小编也整理了进来,希望对您有帮助。
购买预付卡的账务处理
/**
* 购买预付卡的账务处理
* @param acctId
* @param realPayFee
*/
private void processPbocBuyCard(Long acctId,Long realPayFee)throws Exception{
try {
IAccountRelatQry accountQry = null;
IAccount acctBean= null;
//查询账户信息
accountQry = (IAccountRelatQry)BscServiceUtils.getBean("finishAccountRelatQry");
AcctDto acctInfo = accountQry.getAcctInfoByAcctId(acctId);
if(null == acctInfo){
throw new Exception("获取账户信息为空!");
}
int balanceType = 9002;//账本类型
//更新账户信息
AcctChangeDto acctChangeInfo = new AcctChangeDto();
acctChangeInfo.setAcctId(acctId);
acctChangeInfo.setOweFee(realPayFee);
acctChangeInfo.setChangeEvalue(realPayFee);
acctChangeInfo.setOperType(AccountOperType.DEDUCT_PREPAY);
acctChangeInfo.setRollBack(true);
acctChangeInfo.setSOper(AccountChangeOper.ADJUST_PREPAY_CARD_PAY);
acctBean = (IAccount)BscServiceUtils.getBean("finishAccount");
Long balanceFee = acctBean.changeFee(acctChangeInfo);
if(null == balanceFee){
throw new Exception("调用账户模块返回的剩余费用为空!");
}
Long feeId = acctChangeInfo.getFeeId();
if(null == feeId){
throw new Exception("调用账户模块返回的费用流水号为空!");
}
//更新账本信息
IBalanceAcctQry balanceQry = (IBalanceAcctQry)BscServiceUtils.getBean("finishBalanceAcctQry");
Long balanceId = balanceQry.getBookBalanceId(acctId,balanceType);
if(null == balanceId){
throw new Exception("查询余额账本信息为空!");
}
IAccountBalance acctBalanceBean = (IAccountBalance)BscServiceUtils.getBean("finishAccountBalance");
//更新账单
IDeviceBill devicebillBean = (IDeviceBill)BscServiceUtils.getBean("finishDeviceBill");
DeviceBillCheckRequest deviceBillCheck = new DeviceBillCheckRequest();
deviceBillCheck.setAcctId(acctId);
deviceBillCheck.setSoNbr(CommUtil.getSoNbr());
deviceBillCheck.setCustId(acctInfo.getCustId());
deviceBillCheck.setBillType(EnumCodeDefine.BILL_FEE_PAY);
deviceBillCheck.setAcctBalanceId(balanceId);
deviceBillCheck.setPayFee(realPayFee);
deviceBillCheck.setFeeType(EnumCodeDefine.FEE_TYPE_PAYREQ_PREPAY);
deviceBillCheck.setAcctItemTypeId(acctInfo.getAcctType());
deviceBillCheck.setPhoneId(acctInfo.getPhoneId());
deviceBillCheck.setRegionCode(CommUtil.getRegionCode(acctInfo.getPhoneId()));
deviceBillCheck.setBillingType(BillingCycleSpecType.TERMINAL_PRECARD_BUY_PAY.getValue());
devicebillBean.DeviceBillCheck(deviceBillCheck);
} finally{
//发送广播
this.sendPromFee(acctId,realPayFee);
}
}
private void sendPromFee(Long acctId,Long realPayFee)throws Exception{
try {
IMailNotice imail = (IMailNotice)BscServiceUtils.getBean("finishMailNotice");
imail.sendPromFeeMail(acctId,realPayFee);
} catch (Exception e) {
IMailNotice imail = (IMailNotice)BscServiceUtils.getBean("finishMailNotice");
imail.sendPromFeeMail1(acctId,realPayFee);
throw e;
}
}
}
总结:以上是编辑:【茉新新】整理及AI智能原创关于《购买预付卡的账务处理
》优质内容解答希望能帮助到您。