【QQYUN-7028】用户职务保存后未回显

pull/5623/head
zhangdaiscott 2023-11-20 11:22:32 +08:00
parent 60b4a038f6
commit b3e4a73a34
3 changed files with 22 additions and 15 deletions

View File

@ -1,16 +1,17 @@
package org.jeecg.modules.system.mapper; package org.jeecg.modules.system.mapper;
import java.util.List; import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.entity.SysUserPosition; import org.jeecg.modules.system.entity.SysUserPosition;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.system.vo.SysUserPositionVo; import org.jeecg.modules.system.vo.SysUserPositionVo;
import java.util.List;
/** /**
* @Description: * @Description:
* @Author: jeecg-boot * @Author: jeecg-boot
@ -64,7 +65,8 @@ public interface SysUserPositionMapper extends BaseMapper<SysUserPosition> {
* @param tenantId * @param tenantId
* @return * @return
*/ */
List<String> getPositionIdByUserTenantId(@Param("userId")String userId, @Param("tenantId")Integer tenantId); @InterceptorIgnore(tenantLine = "true")
List<String> getPositionIdByUserTenantId(@Param("userId") String userId, @Param("tenantId") Integer tenantId);
/** /**
* id * id

View File

@ -26,7 +26,9 @@
LEFT JOIN sys_position sp ON sup.position_id = sp.id LEFT JOIN sys_position sp ON sup.position_id = sp.id
WHERE WHERE
sup.user_id = #{userId} sup.user_id = #{userId}
AND sp.tenant_id = #{tenantId} <if test="tenantId != null and tenantId != 0">
AND sp.tenant_id = #{tenantId}
</if>
</select> </select>
<!--职位列表移除成员--> <!--职位列表移除成员-->

View File

@ -1,13 +1,11 @@
package org.jeecg.modules.system.service.impl; package org.jeecg.modules.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@ -28,7 +26,6 @@ import org.jeecg.common.constant.enums.MessageTypeEnum;
import org.jeecg.common.constant.enums.RoleIndexConfigEnum; import org.jeecg.common.constant.enums.RoleIndexConfigEnum;
import org.jeecg.common.desensitization.annotation.SensitiveEncode; import org.jeecg.common.desensitization.annotation.SensitiveEncode;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.system.vo.SysUserCacheInfo; import org.jeecg.common.system.vo.SysUserCacheInfo;
import org.jeecg.common.util.*; import org.jeecg.common.util.*;
@ -43,9 +40,9 @@ import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.vo.SysUserDepVo; import org.jeecg.modules.system.vo.SysUserDepVo;
import org.jeecg.modules.system.vo.SysUserPositionVo; import org.jeecg.modules.system.vo.SysUserPositionVo;
import org.jeecg.modules.system.vo.UserAvatar; import org.jeecg.modules.system.vo.UserAvatar;
import org.jeecg.modules.system.vo.lowapp.AppExportUserVo;
import org.jeecg.modules.system.vo.lowapp.DepartAndUserInfo; import org.jeecg.modules.system.vo.lowapp.DepartAndUserInfo;
import org.jeecg.modules.system.vo.lowapp.DepartInfo; import org.jeecg.modules.system.vo.lowapp.DepartInfo;
import org.jeecg.modules.system.vo.lowapp.AppExportUserVo;
import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo; import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@ -103,13 +100,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Autowired @Autowired
private SysThirdAccountMapper sysThirdAccountMapper; private SysThirdAccountMapper sysThirdAccountMapper;
@Autowired @Autowired
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService; ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
@Autowired @Autowired
ThirdAppDingtalkServiceImpl dingtalkService; ThirdAppDingtalkServiceImpl dingtalkService;
@Autowired @Autowired
SysRoleIndexMapper sysRoleIndexMapper; SysRoleIndexMapper sysRoleIndexMapper;
@Autowired @Autowired
SysTenantMapper sysTenantMapper; SysTenantMapper sysTenantMapper;
@Autowired @Autowired
private SysUserTenantMapper relationMapper; private SysUserTenantMapper relationMapper;
@Autowired @Autowired
@ -178,8 +175,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
} else { } else {
item.setRelTenantIds(""); item.setRelTenantIds("");
} }
Integer posTenantId = null;
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
posTenantId = tenantId;
}
//查询用户职位关系表(获取租户下面的) //查询用户职位关系表(获取租户下面的)
List<String> positionList = sysUserPositionMapper.getPositionIdByUserTenantId(item.getId(),tenantId); //update-begin---author:wangshuai---date:2023-11-15---for:【QQYUN-7028】用户职务保存后未回显---
List<String> positionList = sysUserPositionMapper.getPositionIdByUserTenantId(item.getId(),posTenantId);
//update-end---author:wangshuai---date:2023-11-15---for:【QQYUN-7028】用户职务保存后未回显---
//update-end---author:wangshuai ---date:20230228 for[QQYUN-4354]加入更多字段:当前加入时间应该取当前租户的/职位也是当前租户下的------------ //update-end---author:wangshuai ---date:20230228 for[QQYUN-4354]加入更多字段:当前加入时间应该取当前租户的/职位也是当前租户下的------------
item.setPost(CommonUtils.getSplitText(positionList,SymbolConstant.COMMA)); item.setPost(CommonUtils.getSplitText(positionList,SymbolConstant.COMMA));