|
|
@ -110,14 +110,18 @@ public class UserService implements IUserService{ |
|
|
|
//获取个人信息和tall的userId
|
|
|
|
UserDto.UserInfo userInfo = params.getParam(); |
|
|
|
Long userId = params.getUserId(); |
|
|
|
//判断是否绑定企业微信
|
|
|
|
EmployeeExample newExample = new EmployeeExample(); |
|
|
|
newExample.createCriteria().andTallUserIdEqualTo(userId); |
|
|
|
long bindQyCount = employeeDao.countByExample(newExample); |
|
|
|
//检查是否认证过
|
|
|
|
RealNameAuthExample userIdExample = new RealNameAuthExample(); |
|
|
|
userIdExample.createCriteria().andUserIdEqualTo(userId); |
|
|
|
List<RealNameAuth> userIdAuth = realNameAuthDao.selectByExample(userIdExample); |
|
|
|
if (CollectionUtil.isNotEmpty(userIdAuth)) { |
|
|
|
log.info("userId:{}已经实名认证了。", userId); |
|
|
|
throw new BaseException(CodeEnum.ALREADY_REAL_AUTH); |
|
|
|
} |
|
|
|
|
|
|
|
//检查是否认证过
|
|
|
|
RealNameAuthExample realNameAuthExample = new RealNameAuthExample(); |
|
|
|
realNameAuthExample.createCriteria().andUserIdEqualTo(userId); |
|
|
|
realNameAuthExample.createCriteria().andNoEqualTo(userInfo.getNo()).andNameEqualTo(userInfo.getName()); |
|
|
|
List<RealNameAuth> realNameAuthList = realNameAuthDao.selectByExample(realNameAuthExample); |
|
|
|
if(CollectionUtil.isNotEmpty(realNameAuthList)){ |
|
|
|
//判断是否为同一个user_id
|
|
|
@ -127,14 +131,15 @@ public class UserService implements IUserService{ |
|
|
|
throw new BaseException(CodeEnum.ALREADY_REAL_AUTH); |
|
|
|
} else { |
|
|
|
// 判断哪个userid和企业微信绑定
|
|
|
|
|
|
|
|
//判断是否绑定企业微信
|
|
|
|
EmployeeExample newExample = new EmployeeExample(); |
|
|
|
newExample.createCriteria().andTallUserIdEqualTo(userId); |
|
|
|
long bindQyCount = employeeDao.countByExample(newExample); |
|
|
|
// 授权帐号是否绑定企业
|
|
|
|
EmployeeExample oldExample = new EmployeeExample(); |
|
|
|
oldExample.createCriteria().andTallUserIdEqualTo(auth.getUserId()); |
|
|
|
long authCount = employeeDao.countByExample(oldExample); |
|
|
|
boolean hasBind = bindQyCount > 0 && authCount <= 0 || bindQyCount <= 0 && authCount > 0; |
|
|
|
if (!hasBind) { |
|
|
|
throw new BaseException(CodeEnum.ALREADY_REAL_AUTH); |
|
|
|
} else { |
|
|
|
//更新返校行程,健康打卡,
|
|
|
|
if (bindQyCount > 0) { |
|
|
|
bindUser(auth.getUserId(), userId); |
|
|
@ -143,7 +148,6 @@ public class UserService implements IUserService{ |
|
|
|
} |
|
|
|
throw new BaseException(CodeEnum.ACCOUNT_BIND); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//实名认证,检查是否属于该学校的学生
|
|
|
|