提交 3e134fb9 作者: xiaowang

钱包流水

上级 c7a3d00c
...@@ -137,10 +137,10 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -137,10 +137,10 @@ public class PayWalletServiceImpl implements PayWalletService {
publishUpdatePayWallet.setPid(publishWallet.getPid()); publishUpdatePayWallet.setPid(publishWallet.getPid());
publishUpdatePayWallet.setCashAmt(publishWallet.getCashAmt().add(publisherWalletFlowVO.getCashAmount())); publishUpdatePayWallet.setCashAmt(publishWallet.getCashAmt().add(publisherWalletFlowVO.getCashAmount()));
publishUpdatePayWallet.setCashFreeze(publishWallet.getCashFreeze().subtract(publisherWalletFlowVO.getCashAmount()) publishUpdatePayWallet.setCashFreeze(publishWallet.getCashFreeze().subtract(publisherWalletFlowVO.getCashAmount())
.add(publisherWalletFlowVO.getYxjCashPledge())); .add(publisherWalletFlowVO.getYxjCashPledge()).add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount()));
publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().add(publisherWalletFlowVO.getSalaryAmount())); publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().add(publisherWalletFlowVO.getSalaryAmount()));
publishUpdatePayWallet.setSalaryFreeze(publishWallet.getSalaryFreeze().add(publisherWalletFlowVO.getSalaryCashPledge()) publishUpdatePayWallet.setSalaryFreeze(publishWallet.getSalaryFreeze().add(publisherWalletFlowVO.getSalaryCashPledge())
.subtract(publisherWalletFlowVO.getSalaryAmount())); .subtract(publisherWalletFlowVO.getSalaryAmount()).add(publisherWalletFlowVO.getUrgentSalaryAmount().add(publisherWalletFlowVO.getTopSalaryAmount())));
if (publisherWalletFlowVO.getCashAmount().compareTo(BigDecimal.ZERO) > 0 || publisherWalletFlowVO.getSalaryAmount().compareTo(BigDecimal.ZERO) > 0) { if (publisherWalletFlowVO.getCashAmount().compareTo(BigDecimal.ZERO) > 0 || publisherWalletFlowVO.getSalaryAmount().compareTo(BigDecimal.ZERO) > 0) {
// 更新发布者钱包数据 // 更新发布者钱包数据
int publishUpdateCount = payWalletDao.updatePayWallet(publishUpdatePayWallet); int publishUpdateCount = payWalletDao.updatePayWallet(publishUpdatePayWallet);
...@@ -148,9 +148,8 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -148,9 +148,8 @@ public class PayWalletServiceImpl implements PayWalletService {
log.error("发布方取消订单,有飞手接单时,发单方用户钱包更新失败,更新参数是:{},发单方用户id是:{},传入参数是:{}", publishUpdatePayWallet, publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO); log.error("发布方取消订单,有飞手接单时,发单方用户钱包更新失败,更新参数是:{},发单方用户id是:{},传入参数是:{}", publishUpdatePayWallet, publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO);
return ResultBody.error("钱包操作错误"); return ResultBody.error("钱包操作错误");
} }
PayLogDO publishPayLogDO = buildPayLogDO(publisherWalletFlowVO, null);
// 插入发布者流水记录表 // 插入发布者流水记录表
payWalletDao.insertPayLogDO(publishPayLogDO); sendBackPublishPayLog(publisherWalletFlowVO, 1);
} }
// 飞手钱包更新信息 // 飞手钱包更新信息
PayWalletDO flyerUpdatePayWallet = new PayWalletDO(); PayWalletDO flyerUpdatePayWallet = new PayWalletDO();
...@@ -238,7 +237,7 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -238,7 +237,7 @@ public class PayWalletServiceImpl implements PayWalletService {
|| publisherWalletFlowVO.getUrgentSalaryAmount().compareTo(BigDecimal.ZERO) > 0 || publisherWalletFlowVO.getUrgentSalaryAmount().compareTo(BigDecimal.ZERO) > 0
|| publisherWalletFlowVO.getTopSalaryAmount().compareTo(BigDecimal.ZERO) > 0) { || publisherWalletFlowVO.getTopSalaryAmount().compareTo(BigDecimal.ZERO) > 0) {
// 记录退回订单金额 // 记录退回订单金额
sendBackPublishPayLog(publisherWalletFlowVO); sendBackPublishPayLog(publisherWalletFlowVO, 0);
} }
return ResultBody.success(); return ResultBody.success();
} else { } else {
...@@ -350,14 +349,24 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -350,14 +349,24 @@ public class PayWalletServiceImpl implements PayWalletService {
return ResultBody.error("钱包操作错误"); return ResultBody.error("钱包操作错误");
} }
private void sendBackPublishPayLog(PublisherWalletFlowVO publisherWalletFlowVO) { /**
* @param publisherWalletFlowVO
* @param flag 0 未违约取消 1 违约取消
*/
private void sendBackPublishPayLog(PublisherWalletFlowVO publisherWalletFlowVO, Integer flag) {
PayLogDO payLogDO = new PayLogDO(); PayLogDO payLogDO = new PayLogDO();
String payNo = "T" + TDateUtil.getDateStr(new Date(), TDateUtil.TYPE) + publisherWalletFlowVO.getUserAccountId() + CodeUtil.getRandomNum(4); String payNo = "T" + TDateUtil.getDateStr(new Date(), TDateUtil.TYPE) + publisherWalletFlowVO.getUserAccountId() + CodeUtil.getRandomNum(4);
payLogDO.setPayMethod(200); if (flag == 0) {
payLogDO.setPayMethod(200);
payLogDO.setCashAmtPaid(publisherWalletFlowVO.getCashAmount().add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount()));
payLogDO.setSalaryAmtPaid(publisherWalletFlowVO.getSalaryAmount().add(publisherWalletFlowVO.getTopSalaryAmount()).add(publisherWalletFlowVO.getUrgentSalaryAmount()));
} else {
payLogDO.setPayMethod(300);
payLogDO.setCashAmtPaid(publisherWalletFlowVO.getYxjCashPledge().add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount()));
payLogDO.setSalaryAmtPaid(publisherWalletFlowVO.getSalaryCashPledge().add(publisherWalletFlowVO.getTopSalaryAmount().add(publisherWalletFlowVO.getUrgentSalaryAmount())));
}
payLogDO.setPayNo(payNo); payLogDO.setPayNo(payNo);
payLogDO.setUserAccountId(publisherWalletFlowVO.getUserAccountId()); payLogDO.setUserAccountId(publisherWalletFlowVO.getUserAccountId());
payLogDO.setCashAmtPaid(publisherWalletFlowVO.getCashAmount().add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount()));
payLogDO.setSalaryAmtPaid(publisherWalletFlowVO.getSalaryAmount().add(publisherWalletFlowVO.getTopSalaryAmount()).add(publisherWalletFlowVO.getUrgentSalaryAmount()));
payLogDO.setOperateUser(publisherWalletFlowVO.getUserAccountId()); payLogDO.setOperateUser(publisherWalletFlowVO.getUserAccountId());
// 插入流水记录表 // 插入流水记录表
payWalletDao.insertPayLogDO(payLogDO); payWalletDao.insertPayLogDO(payLogDO);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论