Merge remote-tracking branch 'origin/develop'

master
james.zhao 6 years ago
commit 7118cb25c5

@ -11,7 +11,9 @@ public interface CustomerRewardLogService {
void saveReward(int type2,int type3,String type1,String date);
void checkRedpacksStatus(String rewardId);
void checkRedpacksStatus(String rewardId,String sendListId);
void reSendRedPacks();
}

@ -188,9 +188,9 @@ public class CustomerRewardLogServiceImpl implements CustomerRewardLogService {
}
@Override
public void checkRedpacksStatus(String rewardId) {
public void checkRedpacksStatus(String rewardId,String sendListId) {
MpWechatApi redpackApi = mpWechatApiProvider.getApi("redpack");
JSONObject redpack = redpackApi.redpackStatus(rewardId);
JSONObject redpack = redpackApi.redpackStatus(sendListId);
int status = redpack.getIntValue("status");
JSONObject params = new JSONObject();
if(status == 2){

@ -24,7 +24,7 @@ public class RedpackSendingTask {
public void checkRedpacks() {
List<JSONObject> unConfirmedRedpacks = cusRewardLogsMapper.listUnconfirmRewards();
for (JSONObject redpack : unConfirmedRedpacks) {
customerRewardLogService.checkRedpacksStatus(redpack.getString("send_listid"));
customerRewardLogService.checkRedpacksStatus(redpack.getString("reward_id"),redpack.getString("send_listid"));
}
}
}

@ -313,6 +313,8 @@ public interface ClientManager {
String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager);
void registerAlipayGms(String clientMoniker,JSONObject manager);
List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager);
void clearCacheSubMerchantIdApplices(String clientMoniker);

@ -1,5 +1,8 @@
package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.channels.alipay.config.AlipayConfig;
import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment;
import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient;
import au.com.royalpay.payment.channels.rpay.runtime.RpayApi;
import au.com.royalpay.payment.channels.rpay.runtime.beans.SubRpayMerchantInfo;
import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig;
@ -12,6 +15,7 @@ import au.com.royalpay.payment.channels.yeepay.runtime.YeePayClient;
import au.com.royalpay.payment.core.PaymentChannelApi;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
@ -144,6 +148,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.net.URL;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@ -225,6 +230,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private SignInAccountService signInAccountService;
@Resource
private WxPayClient wxPayClient;
@Resource
private AlipayClient alipayClient;
@Resource
private RpayApi rpayApi;
@ -3664,6 +3671,31 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return sub_merchant_id;
}
@Override
public void registerAlipayGms(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) {
throw new InvalidParameterException("store photo cannot be empty ");
}
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
throw new BadRequestException(resultElement.elementText("error"));
}
try {
Element responseElement = resultElement.element("response").element("alipay");
if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) {
throw new BadRequestException(responseElement.elementText("result_code"));
}
} catch (Exception e) {
throw new ServerErrorException(e);
}
}
@Override
public void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo,JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);

@ -566,6 +566,11 @@ public class PartnerManageController {
return clientManager.subMerchantApplication(clientMoniker,subMerchantIdApply,manager);
}
@ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void registerAlipayGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayGms(clientMoniker,manager);
}
@ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})
public List<JSONObject> getMerchantIds(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listMerchantIds(clientMoniker,manager);

Loading…
Cancel
Save