master
wangning 8 years ago
parent ad08428964
commit 4920ab324b

@ -11,4 +11,6 @@ public interface ClientConfigService {
JSONObject find(int client_id); JSONObject find(int client_id);
JSONObject save(JSONObject record);
} }

@ -9,6 +9,7 @@ import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientApplyInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientApplyInfo;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.core.ClientApply; import au.com.royalpay.payment.manage.merchants.core.ClientApply;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.impls.SourceModify; import au.com.royalpay.payment.manage.merchants.entity.impls.SourceModify;
import au.com.royalpay.payment.manage.merchants.events.ClientApplyEvent; import au.com.royalpay.payment.manage.merchants.events.ClientApplyEvent;
@ -62,6 +63,8 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
@Value("${app.redis.prefix}") @Value("${app.redis.prefix}")
private String redisPrefix; private String redisPrefix;
private ApplicationEventPublisher publisher; private ApplicationEventPublisher publisher;
@Resource
private ClientConfigService clientConfigService;
@Override @Override
@Transactional @Transactional
@ -146,6 +149,7 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
} }
@Override @Override
@Transactional
public JSONObject passPartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager) { public JSONObject passPartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager) {
JSONObject apply = clientApplyMapper.findClientApplicationById(client_apply_id); JSONObject apply = clientApplyMapper.findClientApplicationById(client_apply_id);
@ -211,6 +215,10 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
partner.put("country","AUS");//自主申请 partner.put("country","AUS");//自主申请
clientMapper.save(partner); clientMapper.save(partner);
JSONObject clientConfig = new JSONObject();
clientConfig.put("client_id",partner.getIntValue("client_id"));
clientConfigService.save(clientConfig);
JSONObject client_bd = new JSONObject(); JSONObject client_bd = new JSONObject();
client_bd.put("client_id", partner.getIntValue("client_id")); client_bd.put("client_id", partner.getIntValue("client_id"));
client_bd.put("bd_id", manager.getString("manager_id")); client_bd.put("bd_id", manager.getString("manager_id"));

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -17,9 +18,18 @@ public class ClientConfigServiceImpl implements ClientConfigService {
public void update(JSONObject record) { public void update(JSONObject record) {
} }
@Override @Override
public JSONObject find(int client_id) { public JSONObject find(int client_id) {
return clientConfigMapper.find(client_id); return clientConfigMapper.find(client_id);
} }
@Override
public JSONObject save(JSONObject record) {
JSONObject clientConfig= clientConfigMapper.find(record.getIntValue("Client_id"));
if(clientConfig!=null){
throw new ServerErrorException("client config is repeated");
}
clientConfigMapper.save(record);
return record;
}
} }

@ -532,6 +532,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
try { try {
clientMapper.save(partner); clientMapper.save(partner);
JSONObject clientConfig = new JSONObject();
clientConfig.put("client_id",partner.getIntValue("client_id"));
clientConfigService.save(clientConfig);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
} }

Loading…
Cancel
Save