|
|
@ -598,6 +598,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
public void updateClientRegisterInfo(JSONObject manager, String clientMoniker, ClientRegisterInfo info) {
|
|
|
|
public void updateClientRegisterInfo(JSONObject manager, String clientMoniker, ClientRegisterInfo info) {
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
Assert.notNull(client);
|
|
|
|
Assert.notNull(client);
|
|
|
@ -629,21 +630,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clientMapper.update(updateInfo);
|
|
|
|
clientMapper.update(updateInfo);
|
|
|
|
if (!client.getString("contact_email").equals(updateInfo.getString("contact_email"))) {
|
|
|
|
saveOrUpdateMailList(updateInfo, client);
|
|
|
|
List<String> exceptClientIds = new ArrayList<>();
|
|
|
|
|
|
|
|
exceptClientIds.add(String.valueOf(clientId));
|
|
|
|
|
|
|
|
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1,exceptClientIds);
|
|
|
|
|
|
|
|
if(sameMailClients.getJSONArray("data").size()<1) {
|
|
|
|
|
|
|
|
mailGunService.updateClientOfMailList(updateInfo, client);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
client.put("contact_email",updateInfo.getString("contact_email"));
|
|
|
|
|
|
|
|
mailGunService.addClientToMailList(client);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
public void updateClientRegisterInfoV2(JSONObject manager, String clientMoniker, JSONObject info) {
|
|
|
|
public void updateClientRegisterInfoV2(JSONObject manager, String clientMoniker, JSONObject info) {
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
Assert.notNull(client);
|
|
|
|
Assert.notNull(client);
|
|
|
@ -675,18 +667,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clientMapper.update(info);
|
|
|
|
clientMapper.update(info);
|
|
|
|
if (!client.getString("contact_email").equals(info.getString("contact_email"))) {
|
|
|
|
saveOrUpdateMailList(info, client);
|
|
|
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveOrUpdateMailList(JSONObject newClient, JSONObject oldClient) {
|
|
|
|
|
|
|
|
if (!oldClient.getString("contact_email").equals(newClient.getString("contact_email"))) {
|
|
|
|
List<String> exceptClientIds = new ArrayList<>();
|
|
|
|
List<String> exceptClientIds = new ArrayList<>();
|
|
|
|
exceptClientIds.add(String.valueOf(clientId));
|
|
|
|
exceptClientIds.add(newClient.getString("client_id"));
|
|
|
|
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1,exceptClientIds);
|
|
|
|
JSONObject sameMailClients = getByEmail(oldClient.getString("contact_email"),1,1,exceptClientIds);
|
|
|
|
if(sameMailClients.getJSONArray("data").size()<1) {
|
|
|
|
if(sameMailClients.getJSONArray("data").size()<1) {
|
|
|
|
mailGunService.updateClientOfMailList(info, client);
|
|
|
|
mailGunService.updateClientOfMailList(newClient, oldClient);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
client.put("contact_email",info.getString("contact_email"));
|
|
|
|
oldClient.put("contact_email",newClient.getString("contact_email"));
|
|
|
|
mailGunService.addClientToMailList(client);
|
|
|
|
mailGunService.addClientToMailList(oldClient);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|