|
@@ -68,7 +68,7 @@ public class MtCompanyUserService extends ServiceImpl<MtCompanyUserMapper, MtCom
|
|
|
return RestResponse.fail(ApiConstants.RESULT_ERROR, "删除原有关联关系失败");
|
|
|
}
|
|
|
}
|
|
|
- //保存新的关联关系
|
|
|
+ //2.保存新的关联关系
|
|
|
userRole = new UserRole();
|
|
|
userRole.setCompanyId(mtCompanyUserRequest.getCompanyId());
|
|
|
userRole.setRoleId(mtCompanyUserRequest.getRoleId());
|
|
@@ -102,7 +102,7 @@ public class MtCompanyUserService extends ServiceImpl<MtCompanyUserMapper, MtCom
|
|
|
//获取角色关联的用户信息
|
|
|
List<Long> userIdList = ProjectUtils.getAttrList(userRoleList, "userId", null);
|
|
|
//获取用户信息集合
|
|
|
- if(userIdList != null && userIdList.size() > 0){
|
|
|
+ if (userIdList != null && userIdList.size() > 0) {
|
|
|
List<UserInfo> userInfoList = (List<UserInfo>) userInfoService.listByIds(userIdList);
|
|
|
Map<Long, UserInfo> userIdToUserInfo = ProjectUtils.attrToObjMap(userInfoList, "userId", null);
|
|
|
if (userIdToUserInfo != null && userIdToUserInfo.size() > 0) {
|
|
@@ -123,15 +123,16 @@ public class MtCompanyUserService extends ServiceImpl<MtCompanyUserMapper, MtCom
|
|
|
|
|
|
@Override
|
|
|
public RestResponse kickOutTeam(MtCompanyUserRequest mtCompanyUserRequest) {
|
|
|
+ MtCompanyUser mtCompanyUser = this.getById(mtCompanyUserRequest.getId());
|
|
|
//判断用户是否可以踢出团队
|
|
|
- ProjectUser projectUser = new ProjectUser(mtCompanyUserRequest.getUserId(), mtCompanyUserRequest.getCompanyId());
|
|
|
+ ProjectUser projectUser = new ProjectUser(mtCompanyUser.getUserId(), mtCompanyUser.getMtCompanyId());
|
|
|
Map<String, String> judgeMsg = projectService.judgeKickOutTeam(projectUser);
|
|
|
//获取判断返回的状态码
|
|
|
String code = judgeMsg.get(CommonConstants.RETURN_CODE_FIELD);
|
|
|
if (ApiConstants.RESULT_ERROR.equals(code)) {
|
|
|
return RestResponse.fail(ApiConstants.RESULT_ERROR, judgeMsg.get(CommonConstants.RETURN_MSG_FIELD));
|
|
|
}
|
|
|
- MtCompanyUser mtCompanyUser = this.getById(mtCompanyUserRequest.getId());
|
|
|
+ //设置用户为踢出团队状态
|
|
|
mtCompanyUser.setStatus(ApiConstants.ApplicationConstants.COMPANY_USER_FAIL);
|
|
|
this.updateById(mtCompanyUser);
|
|
|
return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, "踢出用户成功");
|
|
@@ -140,10 +141,19 @@ public class MtCompanyUserService extends ServiceImpl<MtCompanyUserMapper, MtCom
|
|
|
@Override
|
|
|
public RestResponse getCompanyUserList(MtCompanyUserRequest mtCompanyUserRequest) {
|
|
|
|
|
|
+ List<Long> userQueryIdList = null;
|
|
|
+ //通过用户名或手机号查找用户id
|
|
|
+ if (StringUtils.isNotBlank(mtCompanyUserRequest.getQueryCondition())) {
|
|
|
+ userQueryIdList = userService.getIdListByQueryCondition(mtCompanyUserRequest.getQueryCondition());
|
|
|
+ }
|
|
|
List<MtCompanyUserResponse> mtCompanyUserResponseList = new ArrayList<>();
|
|
|
IPage mtCompanyUserPage = new Page(mtCompanyUserRequest.getPageNum(), mtCompanyUserRequest.getPageSize());
|
|
|
mtCompanyUserPage = this.page(mtCompanyUserPage, new QueryWrapper<MtCompanyUser>()
|
|
|
+ //判断用户是否在符合查询条件的用户列表中
|
|
|
+ .in(userQueryIdList != null && userQueryIdList.size() > 0, "userId", userQueryIdList)
|
|
|
.eq("mt_company_id", mtCompanyUserRequest.getCompanyId())
|
|
|
+ //获取在团队中的用户
|
|
|
+ .eq("status", ApiConstants.ApplicationConstants.COMPANY_USER_PASS)
|
|
|
.eq("delete_flag", ApiConstants.DELETE_NO)
|
|
|
);
|
|
|
List<MtCompanyUser> mtCompanyUserList = mtCompanyUserPage.getRecords();
|