提交 c1ffe879 作者: xiaowang

修改钱包流水bug

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