提交 5d5101be 作者: xiaowang

客服介入

上级 3aaab560
...@@ -108,25 +108,7 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -108,25 +108,7 @@ public class PayWalletServiceImpl implements PayWalletService {
} }
} else if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.CANCEL_ORDER_TAKING.getCode())) { } else if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.CANCEL_ORDER_TAKING.getCode())) {
// 等于200时 发布方取消订单,无飞手接单 // 等于200时 发布方取消订单,无飞手接单
PayWalletDO publishUpdatePayWallet = new PayWalletDO(); return publishCancelOrder(publisherWalletFlowVO, publishWallet, 200);
publishUpdatePayWallet.setUserAccountId(publisherWalletFlowVO.getUserAccountId());
publishUpdatePayWallet.setPid(publishWallet.getPid());
publishUpdatePayWallet.setCashAmt(publishWallet.getCashAmt().add(publisherWalletFlowVO.getCashAmount()));
publishUpdatePayWallet.setCashFreeze(publishWallet.getCashFreeze().add(publisherWalletFlowVO.getTopYxjAmount())
.add(publisherWalletFlowVO.getUrgentYxjAmount()).subtract(publisherWalletFlowVO.getCashAmount()));
publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().add(publisherWalletFlowVO.getSalaryAmount()));
publishUpdatePayWallet.setSalaryFreeze(publishWallet.getSalaryFreeze().add(publisherWalletFlowVO.getTopSalaryAmount())
.add(publisherWalletFlowVO.getUrgentSalaryAmount()).subtract(publisherWalletFlowVO.getSalaryAmount()));
int i = payWalletDao.updatePayWallet(publishUpdatePayWallet);
if ((i > 0) && (publisherWalletFlowVO.getCashAmount().compareTo(BigDecimal.ZERO) > 0 || publisherWalletFlowVO.getSalaryAmount().compareTo(BigDecimal.ZERO) > 0)) {
PayLogDO payLogDO = buildPayLogDO(publisherWalletFlowVO, null);
// 插入流水记录表
payWalletDao.insertPayLogDO(payLogDO);
return ResultBody.success();
} else {
log.error("发布方取消订单,无飞手接单时,用户id是:{},传入参数是:{}", publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO);
return ResultBody.error("钱包操作错误");
}
} 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时 发布方取消订单,有飞手接单
PayWalletDO publishUpdatePayWallet = new PayWalletDO(); PayWalletDO publishUpdatePayWallet = new PayWalletDO();
...@@ -183,7 +165,9 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -183,7 +165,9 @@ public class PayWalletServiceImpl implements PayWalletService {
log.error("飞手抢单时,飞手用户钱包更新失败,飞手用户id是:{},传入参数是:{}", flyerWalletFlowVO.getUserAccountId(), flyerWalletFlowVO); log.error("飞手抢单时,飞手用户钱包更新失败,飞手用户id是:{},传入参数是:{}", flyerWalletFlowVO.getUserAccountId(), flyerWalletFlowVO);
} }
} else if (flyerWalletFlowVO != null && flyerWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.CUSTOMER_SERVICE_CANCEL_ORDER.getCode())) { } else if (flyerWalletFlowVO != null && flyerWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.CUSTOMER_SERVICE_CANCEL_ORDER.getCode())) {
// 状态为500时 客服判定飞手无责取消订单 // 状态为500时 客服判定双方无责取消订单
assert publisherWalletFlowVO != null;
publishCancelOrder(publisherWalletFlowVO, publishWallet, 500);
// 飞手钱包更新信息 // 飞手钱包更新信息
int flyerUpdateCount = buildFlyerWallet(flyerWalletFlowVO, flyerWallet); int flyerUpdateCount = buildFlyerWallet(flyerWalletFlowVO, flyerWallet);
if (flyerUpdateCount > 0) { if (flyerUpdateCount > 0) {
...@@ -192,7 +176,7 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -192,7 +176,7 @@ public class PayWalletServiceImpl implements PayWalletService {
payWalletDao.insertPayLogDO(flyerPayLogDO); payWalletDao.insertPayLogDO(flyerPayLogDO);
return ResultBody.success(); return ResultBody.success();
} else { } else {
log.error("客服判定飞手无责取消订单时,飞手用户钱包更新失败,飞手用户id是:{},传入参数是:{}", flyerWalletFlowVO.getUserAccountId(), flyerWalletFlowVO); log.error("客服判定双方无责取消订单时,飞手用户钱包更新失败,飞手用户id是:{},传入参数是:{}", flyerWalletFlowVO.getUserAccountId(), flyerWalletFlowVO);
} }
} else if (flyerWalletFlowVO != null && flyerWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.FLYER_CANCEL_ORDER.getCode())) { } else if (flyerWalletFlowVO != null && flyerWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.FLYER_CANCEL_ORDER.getCode())) {
// 状态为600时 飞手有责取消订单 // 状态为600时 飞手有责取消订单
...@@ -348,6 +332,32 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -348,6 +332,32 @@ public class PayWalletServiceImpl implements PayWalletService {
return ResultBody.error("钱包操作错误"); return ResultBody.error("钱包操作错误");
} }
private ResultBody publishCancelOrder(PublisherWalletFlowVO publisherWalletFlowVO, PayWalletDO publishWallet, Integer status) {
PayWalletDO publishUpdatePayWallet = new PayWalletDO();
publishUpdatePayWallet.setUserAccountId(publisherWalletFlowVO.getUserAccountId());
publishUpdatePayWallet.setPid(publishWallet.getPid());
publishUpdatePayWallet.setCashAmt(publishWallet.getCashAmt().add(publisherWalletFlowVO.getCashAmount()));
publishUpdatePayWallet.setCashFreeze(publishWallet.getCashFreeze().add(publisherWalletFlowVO.getTopYxjAmount())
.add(publisherWalletFlowVO.getUrgentYxjAmount()).subtract(publisherWalletFlowVO.getCashAmount()));
publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().add(publisherWalletFlowVO.getSalaryAmount()));
publishUpdatePayWallet.setSalaryFreeze(publishWallet.getSalaryFreeze().add(publisherWalletFlowVO.getTopSalaryAmount())
.add(publisherWalletFlowVO.getUrgentSalaryAmount()).subtract(publisherWalletFlowVO.getSalaryAmount()));
int i = payWalletDao.updatePayWallet(publishUpdatePayWallet);
if ((i > 0) && (publisherWalletFlowVO.getCashAmount().compareTo(BigDecimal.ZERO) > 0 || publisherWalletFlowVO.getSalaryAmount().compareTo(BigDecimal.ZERO) > 0)) {
PayLogDO payLogDO = buildPayLogDO(publisherWalletFlowVO, null);
// 插入流水记录表
payWalletDao.insertPayLogDO(payLogDO);
return ResultBody.success();
} else {
if (status == 200) {
log.error("发布方取消订单,无飞手接单时,用户id是:{},传入参数是:{}", publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO);
} else {
log.error("客服判定双方无责取消订单时,发布方钱包更新失败,用户id是:{},传入参数是:{}", publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO);
}
return ResultBody.error("钱包操作错误");
}
}
/** /**
* @param publisherWalletFlowVO * @param publisherWalletFlowVO
* @param flag 0 未违约取消 1 违约取消 * @param flag 0 未违约取消 1 违约取消
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论