Authored by LUOXC

添加手动打款

... ... @@ -1015,8 +1015,12 @@ public class PaymentServiceImpl implements IPaymentService {
throwServiceExceptionIf(!tryLock(logTag, lockKey), 500, "流水已经处理过id=" + tradeBills.getId());
// 财务手动标注为已付款
if(ManualDealRequest.SCENE_ID_MARK_PAID == req.getSceneId()){
markPaid(logTag, tradeBills, lockKey);
}
// 退货款或普通用户退保证金
if (isRefundGoodsMoneyTradeBills(tradeBills) || isRefundEarnestMoneyTradeBills(tradeBills)) {
else if (isRefundGoodsMoneyTradeBills(tradeBills) || isRefundEarnestMoneyTradeBills(tradeBills)) {
refund(logTag, tradeBills, amount, lockKey);
}
// 转账
... ... @@ -1025,6 +1029,18 @@ public class PaymentServiceImpl implements IPaymentService {
}
}
private void markPaid(String logTag, TradeBills tradeBills, TradeBills lockKey) {
try {
// 加新流水
addSuccessTradeBills(tradeBills);
} catch (Exception e) {
logger.warn("{}, refund fail.", logTag, e);
releaseLock(logTag, lockKey);
String message = "订单号:" + tradeBills.getOrderCode() + ",操作类型(已打款),流水id=" + tradeBills.getId() + ",msg=" + e.getMessage();
throwServiceException(e, 500, "退款失败[" + message + "]");
}
}
// '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出'
private boolean isRefundGoodsMoneyTradeBills(TradeBills tradeBills) {
return tradeBills.getUserType() == 1
... ...