Authored by Lixiaodi

增加ali转账

... ... @@ -448,11 +448,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
return money;
}
public boolean returnAllEarnest(Integer uid, long orderCode,BigDecimal money, String alipayAccount) {
public boolean returnAllEarnest(Integer uid, long orderCode,BigDecimal money, String alipayId, String alipayAccount) {
if (money == null) {
return false;
}
return paymentService.transAllEarnest(orderCode, uid, money, alipayAccount);
return paymentService.transAllEarnest(orderCode, uid, money, alipayId, alipayAccount);
}
// 退出入驻:归还所有保证金 总账+明细
... ...
... ... @@ -206,8 +206,8 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi
throw new UfoServiceException(400,"商户存在出售中商品,不允许退驻!");
}
String aliPayAccount = getAlipayIDOrAccount(uid);
if(StringUtils.isBlank(aliPayAccount)){
AuthorizeResultRespVO aliPayAccount = getAlipayIDOrAccount(uid);
if(aliPayAccount == null){
logger.error("quitStoredSeller not allowed cause of aliPayAccount is blank ,uid {}" ,uid);
throw new UfoServiceException(400,"支付宝账号未绑定,不允许退驻!");
}
... ... @@ -253,7 +253,7 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi
boolean returnResult=false;
if(returnAmount!=null){
returnResult=merchantOrderPaymentService.returnAllEarnest(uid,orderCode,returnAmount,aliPayAccount);
returnResult=merchantOrderPaymentService.returnAllEarnest(uid,orderCode,returnAmount,aliPayAccount.getAlipayId(), aliPayAccount.getAlipayAccount());
logger.info("StoredSellerServiceImpl merchantOrderPaymentService end ,uid {}",uid);
}
... ... @@ -279,18 +279,12 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi
@SuppressWarnings("unchecked")
private String getAlipayIDOrAccount(int targetUid) {
private AuthorizeResultRespVO getAlipayIDOrAccount(int targetUid) {
ApiResponse<AuthorizeResultRespVO> resp = ufoServiceCaller.call("ufo.user.aliPayAccountQuery", ApiResponse.class, targetUid);
if (resp != null) {
AuthorizeResultRespVO data = (AuthorizeResultRespVO) resp.getData();
if (data != null ) {
if(StringUtils.isNotBlank(data.getAlipayId()) ){
return data.getAlipayId();
}else if(StringUtils.isNotBlank(data.getAlipayAccount())){
return data.getAlipayAccount();
}else{
return null;
}
return data ;
}
}
return null;
... ...