员工业绩目标固定查询角色为销售的所有员工

This commit is contained in:
aikai 2024-12-05 10:50:35 +08:00
parent 0dfcf47093
commit de49d148b1
6 changed files with 31 additions and 1 deletions

View File

@ -161,7 +161,9 @@ public class CrmAchievementServiceImpl implements CrmAchievementService {
AdminUserPageApiDTO userPageReqVO = new AdminUserPageApiDTO();
userPageReqVO.setPageNo(pageReqVO.getPageNo());
userPageReqVO.setPageSize(pageReqVO.getPageSize());
PageResult<AdminUserApiVO> pageResult = adminUserApi.getUserPage(userPageReqVO).getCheckedData();
// -- 这里固定查询销售的
userPageReqVO.setRoleCode("sale");
PageResult<AdminUserApiVO> pageResult = adminUserApi.getUserBringDeptPage(userPageReqVO).getCheckedData();
PageResult<UserAchieveRespVO> pageResult1 = BeanUtils.toBean(pageResult, UserAchieveRespVO.class);
List<Long> typeIds = new ArrayList<>();
for (UserAchieveRespVO vo : pageResult1.getList()) {

View File

@ -116,4 +116,8 @@ public interface AdminUserApi {
@GetMapping(PREFIX + "/getUserListBySubordinateIds")
@Operation(summary = "获取当前部门以及下级部门所有人员(负责人)")
CommonResult<List<Long>> getUserListBySubordinateIds(@RequestParam(name = "adminId") Long adminId);
@PostMapping(PREFIX + "/getUserBringDeptPage")
@Operation(summary = "获取用户分页列表通过条件")
CommonResult<PageResult<AdminUserApiVO>> getUserBringDeptPage(@RequestBody AdminUserPageApiDTO userPageReqVO);
}

View File

@ -40,4 +40,7 @@ public class AdminUserPageApiDTO extends PageParam {
@Schema(description = "考勤组ids", example = "1024")
private List<Long> groupIds;
@Schema(description = "角色code", example = "1")
private String roleCode;
}

View File

@ -145,4 +145,13 @@ public class AdminUserApiImpl implements AdminUserApi {
return success(ids);
}
@Override
public CommonResult<PageResult<AdminUserApiVO>> getUserBringDeptPage(AdminUserPageApiDTO dto) {
PageResult<AdminUserApiVO> vo = new PageResult<>();
UserPageReqVO userPageReqVO = BeanUtil.copyProperties(dto, UserPageReqVO.class);
PageResult<AdminUserDO> pageResult = userService.getUserBringDeptPage(userPageReqVO);
BeanUtil.copyProperties(pageResult, vo);
return success(vo);
}
}

View File

@ -45,4 +45,7 @@ public class UserPageReqVO extends PageParam {
@Schema(description = "考勤组ids", example = "1024")
private List<Long> groupIds;
@Schema(description = "角色编码", example = "1024")
private String roleCode;
}

View File

@ -129,6 +129,10 @@
<if test="vo.groupIds != null and vo.groupIds.size() > 0">
left join kq_attendance_group_user c on a.id = c.user_id
</if>
<if test="vo.roleCode != null and vo.roleCode != ''">
left join system_user_role as d on a.id = d.user_id AND d.deleted = 0
left join system_role as e on d.role_id = e.id AND e.deleted = 0
</if>
<where>
a.deleted = 0
and a.user_type = 1
@ -166,6 +170,9 @@
#{groupId}
</foreach>
</if>
<if test="vo.roleCode != null and vo.roleCode != ''">
and e.code = #{vo.roleCode}
</if>
</where>
</select>
<select id="selectListByCondition"
@ -201,4 +208,6 @@
</if>
</where>
</select>
</mapper>