master
taylor.dang 5 years ago
parent e76ab9af54
commit a838820de2

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

@ -500,20 +500,20 @@ public class TestController implements ApplicationEventPublisherAware {
return aliforexcelService.registerAlipayOnlineMerchant(); return aliforexcelService.registerAlipayOnlineMerchant();
} }
@ManagerMapping(value = "/register/wechatGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) @GetMapping(value = "/register/wechatGms")
public void registerWechatMerchant() { public void registerWechatMerchant() {
aliforexcelService.registerWechatMerchant(); aliforexcelService.registerWechatMerchant();
} }
@ManagerMapping(value = "/register/alipayOnlineGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) @GetMapping(value = "/register/alipayOnlineGms")
public JSONObject registerRangeAlipayOnlineMerchant(@RequestParam int start, @RequestParam int end) { public void registerRangeAlipayOnlineMerchant(@RequestParam int start, @RequestParam int end) {
return aliforexcelService.registerRangeAlipayOnlineMerchant(start, end); aliforexcelService.registerRangeAlipayOnlineMerchant(start, end);
} }
@ManagerMapping(value = "/register/alipayGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) @GetMapping(value = "/register/alipayGms")
public JSONObject registerAlipayMerchant() { public void registerAlipayMerchant() {
return aliforexcelService.registerAlipayMerchant(); aliforexcelService.registerAlipayMerchant();
} }
@ManagerMapping(value = "/register/alipayGms/insert_partner", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) @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); JSONObject findClient(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT) @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> findApClient();
List<JSONObject> listValidClient(); List<JSONObject> listValidClient();

Loading…
Cancel
Save