提交 c1ffe879 作者: xiaowang

修改钱包流水bug

上级 64f8c852
......@@ -206,25 +206,16 @@ public class PayWalletServiceImpl implements PayWalletService {
log.error("飞手有责取消订单,飞手用户钱包更新失败,飞手用户id是:{},接单方传入参数是:{}", flyerWalletFlowVO.getUserAccountId(), flyerWalletFlowVO);
return ResultBody.error("钱包操作错误");
}
// PayLogDO flyerPayLogDO = buildPayLogDO(null, flyerWalletFlowVO);
// flyerPayLogDO.setCashAmtPaid(flyerWalletFlowVO.getYxjCashPledge());
// flyerPayLogDO.setSalaryAmtPaid(flyerWalletFlowVO.getSalaryAmount());
// // 插入接单者流水记录表
// payWalletDao.insertPayLogDO(flyerPayLogDO);
// 飞手钱包更新信息
// 发单者钱包更新信息
PayWalletDO publishUpdatePayWallet = new PayWalletDO();
// 断言此处必定不为空
assert publisherWalletFlowVO != null;
publishUpdatePayWallet.setUserAccountId(publisherWalletFlowVO.getUserAccountId());
publishUpdatePayWallet.setPid(publishWallet.getPid());
publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().add(flyerWalletFlowVO.getPercentagePenaltyOfOrder()));
publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().subtract(flyerWalletFlowVO.getPercentagePenaltyOfOrder()));
int publishUpdateCount = payWalletDao.updatePayWallet(publishUpdatePayWallet);
if (publishUpdateCount > 0) {
PayLogDO publishPayLogDO = buildPayLogDO(publisherWalletFlowVO, null);
publishPayLogDO.setCashAmtPaid(flyerWalletFlowVO.getPercentagePenaltyOfOrder());
publishPayLogDO.setOperateUser(flyerWalletFlowVO.getOperateUserAccountId());
// 插入流水记录表
payWalletDao.insertPayLogDO(publishPayLogDO);
paymentOfLiquidatedDamage(publisherWalletFlowVO, flyerWalletFlowVO, 1);
return ResultBody.success();
} else {
log.error("飞手有责取消订单,发布者用户钱包更新失败,发布者用户id是:{},发布方传入参数是:{},接单方方违约金是:{}", publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO, flyerWalletFlowVO.getPercentagePenaltyOfOrder());
......@@ -341,19 +332,30 @@ public class PayWalletServiceImpl implements PayWalletService {
* @param flag 0:支付接单者 1:支付发布者
*/
private void paymentOfLiquidatedDamage(PublisherWalletFlowVO publisherWalletFlowVO, FlyerWalletFlowVO flyerWalletFlowVO, Integer flag) {
PayLogDO flyerPayLogDO = new PayLogDO();
String payNo;
Integer userAccountId;
BigDecimal percentagePenaltyOfOrder;
if (flag == 0) {
// 生成支付流水号(规则"T" + 时间戳 + 用户id + 随机数4位)
String flyerPayNo = "T" + TDateUtil.getDateStr(new Date(), TDateUtil.TYPE) + flyerWalletFlowVO.getUserAccountId() + CodeUtil.getRandomNum(4);
PayLogDO flyerPayLogDO = new PayLogDO();
flyerPayLogDO.setPayMethod(1300);
flyerPayLogDO.setPayNo(flyerPayNo);
flyerPayLogDO.setUserAccountId(flyerWalletFlowVO.getUserAccountId());
flyerPayLogDO.setCashAmtPaid(new BigDecimal((0)));
flyerPayLogDO.setSalaryAmtPaid(publisherWalletFlowVO.getPercentagePenaltyOfOrder().abs());
flyerPayLogDO.setOperateUser(publisherWalletFlowVO.getOperateUserAccountId());
// 插入流水记录表
payWalletDao.insertPayLogDO(flyerPayLogDO);
payNo = "T" + TDateUtil.getDateStr(new Date(), TDateUtil.TYPE) + flyerWalletFlowVO.getUserAccountId() + CodeUtil.getRandomNum(4);
userAccountId = flyerWalletFlowVO.getUserAccountId();
percentagePenaltyOfOrder = publisherWalletFlowVO.getPercentagePenaltyOfOrder();
flyerPayLogDO.setOperateUser(userAccountId);
} else {
// 生成支付流水号(规则"T" + 时间戳 + 用户id + 随机数4位)
payNo = "T" + TDateUtil.getDateStr(new Date(), TDateUtil.TYPE) + publisherWalletFlowVO.getUserAccountId() + CodeUtil.getRandomNum(4);
userAccountId = publisherWalletFlowVO.getUserAccountId();
flyerPayLogDO.setOperateUser(userAccountId);
percentagePenaltyOfOrder = flyerWalletFlowVO.getPercentagePenaltyOfOrder();
}
flyerPayLogDO.setPayMethod(1300);
flyerPayLogDO.setPayNo(payNo);
flyerPayLogDO.setUserAccountId(userAccountId);
flyerPayLogDO.setCashAmtPaid(new BigDecimal((0)));
flyerPayLogDO.setSalaryAmtPaid(percentagePenaltyOfOrder.abs());
// 插入流水记录表
payWalletDao.insertPayLogDO(flyerPayLogDO);
}
private PayLogDO buildFlyerLog(PublisherWalletFlowVO publisherWalletFlowVO, Integer userAccountId) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论