白名单

master
zhangshanxue 2020-07-29 20:49:16 +08:00
parent cb3ba613c9
commit 14aa8271e6
1 changed files with 7 additions and 10 deletions

View File

@ -128,27 +128,24 @@ public class UserInfoController {
String userIds = parameterMap.get("userIds");
int type = Integer.parseInt(parameterMap.get("type"));
String[] split = userIds.split("#");
for (String uid : split){
CUserInfo cUserInfo = userInfoDao.findUserInfoByUserId(Integer.parseInt(uid));
if (cUserInfo == null){
System.out.println("addWhiteList== uid={},cUserInfo is null"+uid);
continue;
}
for (String openid : split){
if (type == 0){
WhiteList whiteList = userInfoDao.findWhiteListInfo(cUserInfo.getOpenId());
WhiteList whiteList = userInfoDao.findWhiteListInfo(openid);
if (whiteList != null){
continue;
}
whiteList = new WhiteList();
whiteList.setWhite_openid(cUserInfo.getOpenId());
whiteList.setId(openid);
whiteList.setWhite_openid(openid);
whiteList.setServerid(0);
userInfoDao.addWhiteList(whiteList);
}else{
WhiteList whiteList = userInfoDao.findWhiteListInfo(cUserInfo.getOpenId());
WhiteList whiteList = userInfoDao.findWhiteListInfo(openid);
if (whiteList == null){
continue;
}
userInfoDao.delWhiteList(cUserInfo.getOpenId());
userInfoDao.delWhiteList(openid);
}
}
return 0;