Commit e7290ffa authored by 赵啸非's avatar 赵啸非

添加员工钉钉同步userId

parent e19e5146
...@@ -184,11 +184,20 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U ...@@ -184,11 +184,20 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(req.getPhone())); StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(req.getPhone()));
if (ObjectUtils.isEmpty(staffEntity)) if (ObjectUtils.isEmpty(staffEntity))
throw new AppException(String.format("系统未找到当前用户,姓名:%s,手机:%s,请联系管理员!", req.getUserName(), req.getPhone())); throw new AppException(String.format("系统未找到当前用户,姓名:%s,手机:%s,请联系管理员!", req.getUserName(), req.getPhone()));
UserQuery userQuery = new UserQuery(); UserQuery userQuery = new UserQuery();
userQuery.setLoginName(req.getUserName());
userEntity = userService.selectOne(userQuery);
if (!ObjectUtils.isEmpty(userEntity))
throw new AppException(String.format("登录用户名已经存在!"));
userQuery = new UserQuery();
userQuery.setCustomerId(staffEntity.getId()); userQuery.setCustomerId(staffEntity.getId());
userEntity = userService.selectOne(userQuery); userEntity = userService.selectOne(userQuery);
if (ObjectUtils.isEmpty(userEntity)) if (ObjectUtils.isEmpty(userEntity))
throw new AppException(String.format("员工未与系统用户绑定,staffId:%s", staffEntity.getId())); throw new AppException(String.format("员工未与系统用户绑定,staffId:%s", staffEntity.getId()));
userEntity.setDingUserId(req.getOpenId()); userEntity.setDingUserId(req.getOpenId());
userEntity.setLoginName(req.getUserName()); userEntity.setLoginName(req.getUserName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment