提交 b7e76afb 作者: xiaowang

修改钱包流水bug

上级 3c31fce2
...@@ -130,12 +130,6 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -130,12 +130,6 @@ public class PayWalletServiceImpl implements PayWalletService {
} }
} else if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.RECEIVED_ORDER_CANCEL.getCode())) { } else if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.RECEIVED_ORDER_CANCEL.getCode())) {
// 等于300时 发布方取消订单,有飞手接单 // 等于300时 发布方取消订单,有飞手接单
if (publisherWalletFlowVO.getYxjCashPledge() == null) {
publisherWalletFlowVO.setYxjCashPledge(BigDecimal.ZERO);
}
if (publisherWalletFlowVO.getSalaryCashPledge() == null) {
publisherWalletFlowVO.setSalaryCashPledge(BigDecimal.ZERO);
}
PayWalletDO publishUpdatePayWallet = new PayWalletDO(); PayWalletDO publishUpdatePayWallet = new PayWalletDO();
publishUpdatePayWallet.setUserAccountId(publisherWalletFlowVO.getUserAccountId()); publishUpdatePayWallet.setUserAccountId(publisherWalletFlowVO.getUserAccountId());
publishUpdatePayWallet.setPid(publishWallet.getPid()); publishUpdatePayWallet.setPid(publishWallet.getPid());
...@@ -158,14 +152,15 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -158,14 +152,15 @@ public class PayWalletServiceImpl implements PayWalletService {
assert flyerWalletFlowVO != null; assert flyerWalletFlowVO != null;
flyerUpdatePayWallet.setUserAccountId(flyerWalletFlowVO.getUserAccountId()); flyerUpdatePayWallet.setUserAccountId(flyerWalletFlowVO.getUserAccountId());
flyerUpdatePayWallet.setPid(flyerWallet.getPid()); flyerUpdatePayWallet.setPid(flyerWallet.getPid());
flyerUpdatePayWallet.setSalaryAmt(flyerWallet.getSalaryAmt().add(publisherWalletFlowVO.getPercentagePenaltyOfOrder())); flyerUpdatePayWallet.setCashAmt(flyerWallet.getCashAmt().add(flyerWalletFlowVO.getCashAmount()));
flyerUpdatePayWallet.setCashFreeze(flyerWallet.getCashFreeze().subtract(flyerWalletFlowVO.getCashAmount()));
flyerUpdatePayWallet.setSalaryAmt(flyerWallet.getSalaryAmt().add(flyerWalletFlowVO.getSalaryAmount()).subtract(publisherWalletFlowVO.getPercentagePenaltyOfOrder()));
int flyerUpdateCount = payWalletDao.updatePayWallet(flyerUpdatePayWallet); int flyerUpdateCount = payWalletDao.updatePayWallet(flyerUpdatePayWallet);
if (flyerUpdateCount > 0) { if (flyerUpdateCount > 0) {
PayLogDO flyerPayLogDO = buildPayLogDO(publisherWalletFlowVO, flyerWalletFlowVO); // 记录订单保证金退回记录
flyerPayLogDO.setCashAmtPaid(publisherWalletFlowVO.getPercentagePenaltyOfOrder()); sendBackPledge(flyerWalletFlowVO);
flyerPayLogDO.setOperateUser(publisherWalletFlowVO.getOperateUserAccountId()); // 获得违约金流水记录
// 插入流水记录表 paymentOfLiquidatedDamage(publisherWalletFlowVO, flyerWalletFlowVO, 0);
payWalletDao.insertPayLogDO(flyerPayLogDO);
return ResultBody.success(); return ResultBody.success();
} else { } else {
log.error("发布方取消订单,有飞手接单时,飞手用户钱包更新失败,飞手用户id是:{},接单方传入参数是:{},发单方违约金是:{}", flyerWalletFlowVO.getUserAccountId(), flyerWalletFlowVO, publisherWalletFlowVO.getPercentagePenaltyOfOrder()); log.error("发布方取消订单,有飞手接单时,飞手用户钱包更新失败,飞手用户id是:{},接单方传入参数是:{},发单方违约金是:{}", flyerWalletFlowVO.getUserAccountId(), flyerWalletFlowVO, publisherWalletFlowVO.getPercentagePenaltyOfOrder());
...@@ -336,6 +331,27 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -336,6 +331,27 @@ public class PayWalletServiceImpl implements PayWalletService {
return ResultBody.error("钱包操作错误"); return ResultBody.error("钱包操作错误");
} }
/**
* @param publisherWalletFlowVO 发布者信息
* @param flyerWalletFlowVO 接单者信息
* @param flag 0:支付接单者 1:支付发布者
*/
private void paymentOfLiquidatedDamage(PublisherWalletFlowVO publisherWalletFlowVO, FlyerWalletFlowVO flyerWalletFlowVO, Integer flag) {
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(flyerWalletFlowVO.getCashAmount());
flyerPayLogDO.setSalaryAmtPaid(publisherWalletFlowVO.getPercentagePenaltyOfOrder().abs());
flyerPayLogDO.setOperateUser(publisherWalletFlowVO.getOperateUserAccountId());
// 插入流水记录表
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();
// 生成支付流水号(规则"T" + 时间戳 + 用户id + 随机数4位) // 生成支付流水号(规则"T" + 时间戳 + 用户id + 随机数4位)
...@@ -418,12 +434,6 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -418,12 +434,6 @@ public class PayWalletServiceImpl implements PayWalletService {
PayLogDO payLogWalletDO = new PayLogDO(); PayLogDO payLogWalletDO = new PayLogDO();
// 获取用户钱包信息 // 获取用户钱包信息
if (publisherWalletFlowVO != null) { if (publisherWalletFlowVO != null) {
if (publisherWalletFlowVO.getCashAmount() == null) {
publisherWalletFlowVO.setCashAmount(BigDecimal.ZERO);
}
if (publisherWalletFlowVO.getSalaryAmount() == null) {
publisherWalletFlowVO.setSalaryAmount(BigDecimal.ZERO);
}
// 生成支付流水号(规则"T" + 时间戳 + 用户id + 随机数4位) // 生成支付流水号(规则"T" + 时间戳 + 用户id + 随机数4位)
String publishPayNo = "T" + TDateUtil.getDateStr(new Date(), TDateUtil.TYPE) + publisherWalletFlowVO.getUserAccountId() + CodeUtil.getRandomNum(4); String publishPayNo = "T" + TDateUtil.getDateStr(new Date(), TDateUtil.TYPE) + publisherWalletFlowVO.getUserAccountId() + CodeUtil.getRandomNum(4);
payLogWalletDO.setPayMethod(publisherWalletFlowVO.getModeOfPayment()); payLogWalletDO.setPayMethod(publisherWalletFlowVO.getModeOfPayment());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论