Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Echo 2024-04-19 17:05:18 +08:00
commit 819c09d5f0
8 changed files with 51 additions and 2 deletions

View File

@ -41,4 +41,7 @@ public class LogInstancePageReqVO extends PageParam {
@Schema(description = "已读、未读 | 0未读、1已读", example = "0")
private Integer readStatus;
@Schema(description = "查询所有领导人日志 ||判断老板角色,是则传参,不是则不传;如要查询全部分页也不传", example = "0")
private Integer isBoss;
}

View File

@ -62,4 +62,6 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
void emptyOpenId(@Param("openId") String openId);
List<UserRespVO> selectByDeptIds(Collection<Long> deptIds);
List<Long> selectUserByBoss();
}

View File

@ -40,7 +40,8 @@ public interface LogInstanceMapper extends BaseMapperX<LogInstanceDO> {
}
IPage<LogInstanceRespVO> selectPageResult(@Param("page") Page<LogInstanceRespVO> page, @Param("reqVO") LogInstancePageReqVO reqVO,
@Param("userId") Long userId, @Param("pagingType") Integer pagingType);
@Param("userId") Long userId, @Param("pagingType") Integer pagingType,
@Param("userIds") List<Long> userIds);
@DataPermission(enable = false)
List<LogReadUserRespDTO> selectRaedUser(@Param("userId")Long userId, @Param("deptId")Long deptId);

View File

@ -255,4 +255,10 @@ public interface AdminUserService {
* @return
*/
String getSignImgPath(Long userId) ;
/**
* 获取 岗位为总监或副总裁 以及部门层级为2级或3级的负责人的用户编号
* @return 用户编号
*/
List<Long> getUserByBoss();
}

View File

@ -565,4 +565,10 @@ public class AdminUserServiceImpl implements AdminUserService {
String path = fileApi.getUserSignImgPath(userId).getData();
return path ;
}
@Override
public List<Long> getUserByBoss() {
return userMapper.selectUserByBoss();
}
}

View File

@ -231,8 +231,18 @@ public class LogInstanceServiceImpl implements LogInstanceService {
@Override
public IPage<LogInstanceRespVO> getLogInstancePage(LogInstancePageReqVO pageReqVO, Integer pagingType) {
List<Long> leaderUserIds = new ArrayList<>();
//判断特殊情况 只需查看各部门领导人得日志
if (pageReqVO.getIsBoss()!= null && pageReqVO.getIsBoss() == 1) {
//查询两级以及三级部门得领导人
//以及岗位为总监或副总监的用户
leaderUserIds = adminUserService.getUserByBoss();
}
Page<LogInstanceRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
IPage<LogInstanceRespVO> pageList = logInstanceMapper.selectPageResult(page, pageReqVO, getLoginUserId(), pagingType);
IPage<LogInstanceRespVO> pageList = logInstanceMapper.selectPageResult(page, pageReqVO, getLoginUserId(), pagingType, leaderUserIds);
List<LogInstanceRespVO> records = pageList.getRecords();
if (!records.isEmpty()) {

View File

@ -23,4 +23,19 @@
#{deptIds}
</foreach>
</select>
<select id="selectUserByBoss">
SELECT DISTINCT
a.id
FROM
system_users AS a,
system_dept AS b
WHERE
( LOCATE( '7', a.post_ids ) OR LOCATE( '8', a.post_ids ) )
OR ((
b.`level` = 2
OR b.`level` = 3
)
AND b.leader_user_id = a.id)
</select>
</mapper>

View File

@ -124,6 +124,12 @@
<if test="pagingType == 1">
and a.start_user_id = #{userId}
</if>
<if test="reqVO.isBoss != null">
and a.start_user_id in
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
#{userId}
</foreach>
</if>
</where>
GROUP BY a.id, readStatus, readCount, unReadCount, comment
ORDER BY a.create_time DESC