Authored by mali

Merge branch 'master' into hotfix_erp_add_mobile_1218

... ... @@ -129,6 +129,9 @@ public class PaymentServiceImpl implements IPaymentService {
TradeBillsMapper tradeBillsMapper;
@Autowired
EntrySellerRechargeOrderMapper entrySellerRechargeOrderMapper;
@Autowired
private BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler;
... ... @@ -884,10 +887,27 @@ public class PaymentServiceImpl implements IPaymentService {
throw new ServiceException(400, "manualDeal:流水已经处理过id=" + tradeBills.getId());
}
boolean isMerchantExit = false;
// 是否为退出入驻订单
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
if(codeMeta.getType() == OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType()) {
EntrySellerRechargeOrder order = entrySellerRechargeOrderMapper.selectByOrderCode(orderCode);
if(order != null && order.getStatus() != null && order.getType() != null && order.getType() == 3) {
if (order.getStatus() == 0) {
isMerchantExit = true;
} else {
throw new ServiceException(400, "manualDeal:退款已成功,id=" + tradeBills.getId());
}
} else {
throw new ServiceException(400, "manualDeal:商家退出入驻订单异常,id=" + tradeBills.getId());
}
}
// '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出'
try {
if (/* 退货款 */ (tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
/* 退保证金 */ || (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1)) {
if (/* 退货款 */((tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
/* 退保证金(普通用户) */
|| (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1 && !isMerchantExit))) {
logger.warn("manualDeal人工退款 , tradeBills is {}", tradeBills);
PayRefundBo refundBo = manualRefund(orderCode, amount);
if (refundBo.getRefundStatus() == RefundContant.PAYMENT_REFUND_RESULTCODE_SUCCESS) {
... ...