master
taylor.dang 5 years ago
parent e76ab9af54
commit a838820de2

@ -12,9 +12,9 @@ public interface AliforexcelService {
void registerWechatMerchant();
JSONObject registerRangeAlipayOnlineMerchant(int start,int end);
void registerRangeAlipayOnlineMerchant(int start,int end);
JSONObject registerAlipayMerchant();
void registerAlipayMerchant();
JSONObject registerInsertAlipayMerchant(String partners);

@ -13,6 +13,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import com.alibaba.fastjson.JSONObject;
import com.yeepay.shade.org.apache.commons.lang3.StringUtils;
import org.apache.commons.io.IOUtils;
@ -52,6 +53,8 @@ public class AliforexcelServiceImpl implements AliforexcelService {
@Resource
private SysWxMerchantApplyMapper sysWxMerchantApplyMapper;
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
@Override
@ -170,6 +173,7 @@ public class AliforexcelServiceImpl implements AliforexcelService {
@Override
public void registerWechatMerchant() {
royalThreadPoolExecutor.execute(() -> {
List<JSONObject> apClients = clientMapper.findApClient();
apClients.forEach(client -> {
JSONObject params = new JSONObject();
@ -195,11 +199,12 @@ public class AliforexcelServiceImpl implements AliforexcelService {
throw new BadRequestException(elem.elementText("return_msg"));
}
});
});
}
@Override
public JSONObject registerRangeAlipayOnlineMerchant(int start, int end) {
JSONObject result = new JSONObject();
public void registerRangeAlipayOnlineMerchant(int start, int end) {
royalThreadPoolExecutor.execute(() -> {
List<String> needRegisterMerchant = new ArrayList<>();
List<String> registerSuccessMerchant = new ArrayList<>();
List<JSONObject> registerFailMerchant = new ArrayList<>();
@ -249,16 +254,12 @@ public class AliforexcelServiceImpl implements AliforexcelService {
registerFailMerchant.add(exception);
}
});
result.put("need_register_merchant", needRegisterMerchant);
result.put("success_register_merchant", registerSuccessMerchant);
result.put("fail_register_merchant", registerFailMerchant);
result.put("less_info_merchant", lessInfoMerchant);
logger.info("-------AlipayOnline Gms end----fail_register_merchant" + registerFailMerchant.toString());
return result;
});
}
@Override
public JSONObject registerAlipayMerchant() {
public void registerAlipayMerchant() {
royalThreadPoolExecutor.execute(() -> {
JSONObject result = new JSONObject();
List<String> needRegisterMerchant = new ArrayList<>();
List<String> registerSuccessMerchant = new ArrayList<>();
@ -297,7 +298,7 @@ public class AliforexcelServiceImpl implements AliforexcelService {
result.put("success_register_merchant", registerSuccessMerchant);
result.put("fail_register_merchant", registerFailMerchant);
result.put("less_info_merchant", lessInfoMerchant);
return result;
});
}
@Override

@ -500,20 +500,20 @@ public class TestController implements ApplicationEventPublisherAware {
return aliforexcelService.registerAlipayOnlineMerchant();
}
@ManagerMapping(value = "/register/wechatGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
@GetMapping(value = "/register/wechatGms")
public void registerWechatMerchant() {
aliforexcelService.registerWechatMerchant();
}
@ManagerMapping(value = "/register/alipayOnlineGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public JSONObject registerRangeAlipayOnlineMerchant(@RequestParam int start, @RequestParam int end) {
return aliforexcelService.registerRangeAlipayOnlineMerchant(start, end);
@GetMapping(value = "/register/alipayOnlineGms")
public void registerRangeAlipayOnlineMerchant(@RequestParam int start, @RequestParam int end) {
aliforexcelService.registerRangeAlipayOnlineMerchant(start, end);
}
@ManagerMapping(value = "/register/alipayGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public JSONObject registerAlipayMerchant() {
return aliforexcelService.registerAlipayMerchant();
@GetMapping(value = "/register/alipayGms")
public void registerAlipayMerchant() {
aliforexcelService.registerAlipayMerchant();
}
@ManagerMapping(value = "/register/alipayGms/insert_partner", role = ManagerRole.DEVELOPER, method = RequestMethod.POST)

@ -24,7 +24,7 @@ public interface ClientMapper {
JSONObject findClient(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1 and length( client_moniker ) > 5")
@AdvanceSelect(addonWhereClause = "is_valid=1 and length( client_moniker ) > 5 and sub_merchant_id='321888408'")
List<JSONObject> findApClient();
List<JSONObject> listValidClient();

Loading…
Cancel
Save