master
wangning 7 years ago
parent ad08428964
commit 4920ab324b

@ -11,4 +11,6 @@ public interface ClientConfigService {
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.PartnerQuery;
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.entity.impls.SourceModify;
import au.com.royalpay.payment.manage.merchants.events.ClientApplyEvent;
@ -62,6 +63,8 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
@Value("${app.redis.prefix}")
private String redisPrefix;
private ApplicationEventPublisher publisher;
@Resource
private ClientConfigService clientConfigService;
@Override
@Transactional
@ -146,6 +149,7 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
}
@Override
@Transactional
public JSONObject passPartnerApplication(String client_apply_id, ClientApplyInfo info, JSONObject manager) {
JSONObject apply = clientApplyMapper.findClientApplicationById(client_apply_id);
@ -211,6 +215,10 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
partner.put("country","AUS");//自主申请
clientMapper.save(partner);
JSONObject clientConfig = new JSONObject();
clientConfig.put("client_id",partner.getIntValue("client_id"));
clientConfigService.save(clientConfig);
JSONObject client_bd = new JSONObject();
client_bd.put("client_id", partner.getIntValue("client_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.merchants.core.ClientConfigService;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import com.alibaba.fastjson.JSONObject;
@ -17,9 +18,18 @@ public class ClientConfigServiceImpl implements ClientConfigService {
public void update(JSONObject record) {
}
@Override
public JSONObject find(int 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 {
clientMapper.save(partner);
JSONObject clientConfig = new JSONObject();
clientConfig.put("client_id",partner.getIntValue("client_id"));
clientConfigService.save(clientConfig);
} catch (Exception e) {
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
}

Loading…
Cancel
Save