Authored by Lixiaodi

Merge branch 'dev_order' into test6.8.2

... ... @@ -144,7 +144,7 @@ public class PaymentServiceImpl implements IPaymentService {
}
AbstractOrderPaymentService paymentService = null;
logger.info("orderCode is {}, type is {}", orderCode, codeMeta.getType());
// 买家订单
if (codeMeta.getType() == OrderCodeType.BUYER_TYPE.getType()){
paymentService = this.buyerOrderPaymentService;
... ... @@ -154,7 +154,7 @@ public class PaymentServiceImpl implements IPaymentService {
}else if(codeMeta.getType() == OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType()){
paymentService = this.merchantOrderPaymentService;
}
logger.info("orderCode is {}, type is {}, service is {}", orderCode, codeMeta.getType(), paymentService);
return paymentService;
}
... ... @@ -576,7 +576,7 @@ public class PaymentServiceImpl implements IPaymentService {
// 转账
try {
logger.info("transferMon开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", buyerOrderCode, alipayAccount, transferAmount);
JSONObject jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), alipayAccount, transferAmount);
JSONObject jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), null, alipayAccount, transferAmount);
if (jsonObject == null) {
logger.warn("transferMonErr 转账失败 , orderCode is {}", buyerOrderCode);
transfer.setStatus(3);
... ... @@ -683,7 +683,7 @@ public class PaymentServiceImpl implements IPaymentService {
// 转账
try {
logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, alipayAccount, amount);
JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), alipayAccount, amount);
JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), null, alipayAccount, amount);
if (jsonObject == null) {
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode);
transfer.setStatus(3);
... ... @@ -890,7 +890,7 @@ public class PaymentServiceImpl implements IPaymentService {
throw new ServiceException(400, "转账记录已成功转账,流水id=" + tradeBillsId);
}
JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), alipayAccount, amount);
JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), null, alipayAccount, amount);
if (jsonObject == null) {
logger.warn("manualDeal 转账失败 , req is {}", req);
throw new ServiceException(500, "转账失败:阿里接口返回null");
... ...
... ... @@ -137,9 +137,9 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
* @param transferAmount
* @return
*/
public JSONObject transferMoney(String transferOrderCode, String alipayAccount, BigDecimal transferAmount){
public JSONObject transferMoney(String transferOrderCode, String alipayUid, String alipayAccount, BigDecimal transferAmount){
Map<String, String> queryParams = buildTransferParams(transferOrderCode, alipayAccount, transferAmount);
Map<String, String> queryParams = buildTransferParams(transferOrderCode, alipayUid, alipayAccount, transferAmount);
String respTxt = sendOpenApiRequest(transferOrderCode, queryParams);
JSONObject result = null;
... ... @@ -234,7 +234,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
* @param orderData
* @return
*/
private Map<String, String> buildTransferParams(String transferOrderCode, String alipayAccount, BigDecimal transferAmount) {
private Map<String, String> buildTransferParams(String transferOrderCode, String alipayUid, String alipayAccount, BigDecimal transferAmount) {
Map<String, String> params = new HashMap<String, String>();
params.put("app_id", getAppId());
params.put("method", "alipay.fund.trans.toaccount.transfer");
... ... @@ -246,8 +246,13 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
JSONObject bizJson = new JSONObject();
bizJson.put("out_biz_no", transferOrderCode); // 商户转账唯一订单号
bizJson.put("payee_type", "ALIPAY_LOGONID");
bizJson.put("payee_account", alipayAccount); // 支付宝账号
if(StringUtils.isNotBlank(alipayUid)) {
bizJson.put("payee_type", "ALIPAY_USERID");
bizJson.put("payee_account", alipayUid); // 支付宝uid
} else {
bizJson.put("payee_type", "ALIPAY_LOGONID");
bizJson.put("payee_account", alipayAccount); // 支付宝账号
}
bizJson.put("amount", transferAmount.toString());
... ...