Merge branch 'hotfix' into develop

master
wangning 7 years ago
commit ea90957965

@ -304,6 +304,6 @@ public interface ClientManager {
JSONObject simpleQuery(JSONObject param, int page,int limit); 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,8 +630,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
clientMapper.update(updateInfo); clientMapper.update(updateInfo);
if (!client.getString("contact_email").equals(updateInfo.getString("contact_email"))) { if (!client.getString("contact_email").equals(updateInfo.getString("contact_email"))) {
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); mailGunService.updateClientOfMailList(updateInfo, client);
} }
}
clientInfoCacheSupport.clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@ -668,8 +673,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
clientMapper.update(info); clientMapper.update(info);
if (!client.getString("contact_email").equals(info.getString("contact_email"))) { if (!client.getString("contact_email").equals(info.getString("contact_email"))) {
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); mailGunService.updateClientOfMailList(info, client);
} }
}
clientInfoCacheSupport.clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@ -2481,7 +2491,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject client = clientDetail(manager, clientMoniker); JSONObject client = clientDetail(manager, clientMoniker);
Assert.notEmpty(client); Assert.notEmpty(client);
clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, false)); 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) { if(sameMailClients.getJSONObject("data").size()<1) {
mailGunService.removeMailList(client); mailGunService.removeMailList(client);
} }
@ -3515,9 +3527,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @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(); JSONObject param = new JSONObject();
param.put("contact_email",email); param.put("contact_email",email);
param.put("except_client_ids",exceptClientIds);
return PageListUtils.buildPageListResult(clientMapper.simpleQuery(param,new PageBounds(page, limit))); return PageListUtils.buildPageListResult(clientMapper.simpleQuery(param,new PageBounds(page, limit)));
} }
} }

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