master
wangning 7 years ago
parent 3b9038eab6
commit 4651e63a0a

@ -304,6 +304,6 @@ public interface ClientManager {
JSONObject simpleQuery(JSONObject param, int page,int limit);
JSONObject getByEmail(String email, int page, int limit);
JSONObject getByEmail(String email, int page, int limit,List<String> ExceptClientIds);
}

@ -630,7 +630,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
clientMapper.update(updateInfo);
if (!client.getString("contact_email").equals(updateInfo.getString("contact_email"))) {
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1);
List<String> exceptClientIds = new ArrayList<>();
exceptClientIds.add(String.valueOf(clientId));
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1,exceptClientIds);
if(sameMailClients.getJSONObject("data").size()<1) {
mailGunService.updateClientOfMailList(updateInfo, client);
}
@ -671,7 +673,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
clientMapper.update(info);
if (!client.getString("contact_email").equals(info.getString("contact_email"))) {
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1);
List<String> exceptClientIds = new ArrayList<>();
exceptClientIds.add(String.valueOf(clientId));
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1,exceptClientIds);
if(sameMailClients.getJSONObject("data").size()<1) {
mailGunService.updateClientOfMailList(info, client);
}
@ -2487,7 +2491,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject client = clientDetail(manager, clientMoniker);
Assert.notEmpty(client);
clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, false));
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1);
List<String> exceptClientIds = new ArrayList<>();
exceptClientIds.add(client.getString("client_id"));
JSONObject sameMailClients = getByEmail(client.getString("contact_email"),1,1,exceptClientIds);
if(sameMailClients.getJSONObject("data").size()<1) {
mailGunService.removeMailList(client);
}
@ -3521,9 +3527,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject getByEmail(String email, int page, int limit) {
public JSONObject getByEmail(String email, int page, int limit,List<String> exceptClientIds) {
JSONObject param = new JSONObject();
param.put("contact_email",email);
param.put("except_client_ids",exceptClientIds);
return PageListUtils.buildPageListResult(clientMapper.simpleQuery(param,new PageBounds(page, limit)));
}
}

@ -322,5 +322,13 @@
<if test="contact_email!=null">
and contact_email = #{contact_email}
</if>
<if test="except_client_ids!=null">
and client_id not in (
<foreach collection="except_client_ids" item="item" separator=",">
#{item}
</foreach>
)
</if>
</select>
</mapper>
Loading…
Cancel
Save