增加业务逻辑接口
This commit is contained in:
parent
017a50762d
commit
927210cedb
@ -144,4 +144,37 @@ public interface IDepartmentUserBaseService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SuccessResultList<List<UserDTO>> listPageUserByDepartmentId(String departmentId, ListPage page);
|
SuccessResultList<List<UserDTO>> listPageUserByDepartmentId(String departmentId, ListPage page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门ID列表
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> listDepartmentIdByUserId(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门ID列表
|
||||||
|
*
|
||||||
|
* @param userIds 用户ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> listDepartmentIdByUserIds(List<String> userIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门用户ID列表
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> listSameDepartmentUserIdByUserId(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门用户ID列表
|
||||||
|
*
|
||||||
|
* @param userIds 用户ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> listSameDepartmentUserIdByUserIds(List<String> userIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -125,4 +125,11 @@ public interface IPositionBaseService {
|
|||||||
*/
|
*/
|
||||||
List<PositionDTO> listParentByPositionIds(List<String> positionIds);
|
List<PositionDTO> listParentByPositionIds(List<String> positionIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职位列表
|
||||||
|
*
|
||||||
|
* @param positionParentIds 上级职位ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PositionDTO> listByPositionParentIds(List<String> positionParentIds);
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,18 @@ public interface IDepartmentUserRemoteService {
|
|||||||
List<UserDTO> listUserByDepartmentId(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemotePathParams("departmentId") String departmentId);
|
List<UserDTO> listUserByDepartmentId(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemotePathParams("departmentId") String departmentId);
|
||||||
|
|
||||||
@RemoteGetMethod("/listpage-user/department-id/{departmentId}")
|
@RemoteGetMethod("/listpage-user/department-id/{departmentId}")
|
||||||
SuccessResultList<List<UserDTO>> listPageUserByDepartmentId(String userCenter, @RemotePathParams("departmentId") String departmentId, @RemoteQueryParams("access_token") String accessToken, @RemoteQueryParams("page") int page, @RemoteQueryParams("rows") int rows, @RemoteQueryParamsMap Map<String, Object> params);
|
SuccessResultList<List<UserDTO>> listPageUserByDepartmentId(@RemoteServerParams String userCenter, @RemotePathParams("departmentId") String departmentId, @RemoteQueryParams("access_token") String accessToken, @RemoteQueryParams("page") int page, @RemoteQueryParams("rows") int rows, @RemoteQueryParamsMap Map<String, Object> params);
|
||||||
|
|
||||||
|
@RemoteGetMethod("/list-department-id/user-id/{userId}")
|
||||||
|
List<String> listDepartmentIdByUserId(@RemoteServerParams String userCenter, @RemotePathParams("userId") String userId, @RemoteQueryParams("access_token") String accessToken);
|
||||||
|
|
||||||
|
@RemotePostMethod("/list-department-id/user-ids")
|
||||||
|
List<String> listDepartmentIdByUserIds(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);
|
||||||
|
|
||||||
|
@RemotePostMethod("/list-save-department-user-id/user-id/{userId}")
|
||||||
|
List<String> listSameDepartmentUserIdByUserId(@RemoteServerParams String userCenter, @RemotePathParams("userId") String userId, @RemoteQueryParams("access_token") String accessToken);
|
||||||
|
|
||||||
|
@RemotePostMethod("/list-save-department-user-ids/user-ids")
|
||||||
|
List<String> listSameDepartmentUserIdByUserIds(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -60,4 +60,6 @@ public interface IPositionRemoteService {
|
|||||||
@RemotePostMethod("/list-parent/position-ids")
|
@RemotePostMethod("/list-parent/position-ids")
|
||||||
List<PositionDTO> listParentByPositionIds(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);
|
List<PositionDTO> listParentByPositionIds(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);
|
||||||
|
|
||||||
|
@RemotePostMethod("/list/position-parent-ids")
|
||||||
|
List<PositionDTO> listByPositionParentIds(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);
|
||||||
}
|
}
|
||||||
|
@ -145,4 +145,40 @@ public class DepartmentUserServiceImpl extends DefaultBaseService implements IDe
|
|||||||
return departmentUserRemoteService.listPageUserByDepartmentId(apiPathProperties.getUserCenter(), departmentId, OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(), page.getPage(), page.getRows(), page.getParams());
|
return departmentUserRemoteService.listPageUserByDepartmentId(apiPathProperties.getUserCenter(), departmentId, OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(), page.getPage(), page.getRows(), page.getParams());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listDepartmentIdByUserId(String userId) {
|
||||||
|
if (StringUtils.isBlank(userId)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return departmentUserRemoteService.listDepartmentIdByUserId(apiPathProperties.getUserCenter(), userId, OAuth2ClientTokenManager.getInstance().getToken().getAccessToken());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listDepartmentIdByUserIds(List<String> userIds) {
|
||||||
|
if (userIds == null && userIds.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
IdsVO idsVO = new IdsVO();
|
||||||
|
idsVO.setIds(userIds);
|
||||||
|
return departmentUserRemoteService.listDepartmentIdByUserIds(apiPathProperties.getUserCenter(), OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(), idsVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listSameDepartmentUserIdByUserId(String userId) {
|
||||||
|
if (StringUtils.isBlank(userId)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return departmentUserRemoteService.listSameDepartmentUserIdByUserId(apiPathProperties.getUserCenter(), userId, OAuth2ClientTokenManager.getInstance().getToken().getAccessToken());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listSameDepartmentUserIdByUserIds(List<String> userIds) {
|
||||||
|
if (userIds == null || userIds.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
IdsVO idsVO = new IdsVO();
|
||||||
|
idsVO.setIds(userIds);
|
||||||
|
return departmentUserRemoteService.listSameDepartmentUserIdByUserIds(apiPathProperties.getUserCenter(), OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(), idsVO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -110,11 +110,21 @@ public class PositionServiceImpl extends DefaultBaseService implements IPosition
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PositionDTO> listParentByPositionIds(List<String> positionIds) {
|
public List<PositionDTO> listParentByPositionIds(List<String> positionIds) {
|
||||||
if (positionIds.isEmpty()) {
|
if (positionIds == null && positionIds.isEmpty()) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
IdsVO idsVO = new IdsVO();
|
IdsVO idsVO = new IdsVO();
|
||||||
idsVO.setIds(positionIds);
|
idsVO.setIds(positionIds);
|
||||||
return positionRemoteService.listParentByPositionIds(apiPathProperties.getUserCenter(), OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(), idsVO);
|
return positionRemoteService.listParentByPositionIds(apiPathProperties.getUserCenter(), OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(), idsVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PositionDTO> listByPositionParentIds(List<String> positionParentIds) {
|
||||||
|
if (positionParentIds == null && positionParentIds.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
IdsVO idsVO = new IdsVO();
|
||||||
|
idsVO.setIds(positionParentIds);
|
||||||
|
return positionRemoteService.listByPositionParentIds(apiPathProperties.getUserCenter(), OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(), idsVO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package ink.wgink.service.department.controller.resources;
|
package ink.wgink.service.department.controller.resources;
|
||||||
|
|
||||||
import ink.wgink.common.base.DefaultBaseController;
|
import ink.wgink.common.base.DefaultBaseController;
|
||||||
|
import ink.wgink.exceptions.ParamsException;
|
||||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
import ink.wgink.pojo.ListPage;
|
import ink.wgink.pojo.ListPage;
|
||||||
import ink.wgink.pojo.dtos.department.DepartmentDTO;
|
import ink.wgink.pojo.dtos.department.DepartmentDTO;
|
||||||
@ -156,4 +157,44 @@ public class DepartmentUserResourceController extends DefaultBaseController {
|
|||||||
return departmentUserService.listPageUserByDepartmentId(departmentId, page);
|
return departmentUserService.listPageUserByDepartmentId(departmentId, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "部门ID列表", notes = "通过用户ID获取部门ID列表接口")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "path", dataType = "String"),
|
||||||
|
})
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@GetMapping("list-department-id/user-id/{userId}")
|
||||||
|
public List<String> listDepartmentIdByUserId(@PathVariable("userId") String userId) {
|
||||||
|
return departmentUserService.listDepartmentIdByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "部门ID列表", notes = "通过用户ID列表获取部门ID列表")
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("list-department-id/user-ids")
|
||||||
|
public List<String> listDepartmentIdByUserIds(@RequestBody IdsVO idsVO) {
|
||||||
|
if (idsVO.getIds().isEmpty()) {
|
||||||
|
throw new ParamsException("id列表不能为空");
|
||||||
|
}
|
||||||
|
return departmentUserService.listDepartmentIdByUserIds(idsVO.getIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "通过用户ID同部门用户ID列表", notes = "通过用户ID同部门用户ID列表接口")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "path", dataType = "String"),
|
||||||
|
})
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@GetMapping("list-save-department-user-id/user-id/{userId}")
|
||||||
|
public List<String> listSameDepartmentUserIdByUserId(@PathVariable("userId") String userId) {
|
||||||
|
return departmentUserService.listSameDepartmentUserIdByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "通过用户ID列表同部门用户ID列表", notes = "通过用户ID列表同部门用户ID列表接口")
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("list-save-department-user-ids/user-ids")
|
||||||
|
public List<String> listSameDepartmentUserIdByUserIds(@RequestBody IdsVO idsVO) {
|
||||||
|
if (idsVO.getIds().isEmpty()) {
|
||||||
|
throw new ParamsException("id列表不能为空");
|
||||||
|
}
|
||||||
|
return departmentUserService.listSameDepartmentUserIdByUserIds(idsVO.getIds());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -92,4 +92,14 @@ public interface IDepartmentUserDao extends IInitBaseTable {
|
|||||||
* @throws SearchException
|
* @throws SearchException
|
||||||
*/
|
*/
|
||||||
List<UserDTO> listUser(Map<String, Object> params) throws SearchException;
|
List<UserDTO> listUser(Map<String, Object> params) throws SearchException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同部门用户ID列表
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
* @throws SearchException
|
||||||
|
*/
|
||||||
|
List<String> listSameDepartmentUserId(Map<String, Object> params) throws SearchException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -452,4 +452,32 @@ public class DepartmentUserServiceImpl extends DefaultBaseService implements IDe
|
|||||||
PageInfo<UserDTO> pageInfo = new PageInfo<>(userDTOs);
|
PageInfo<UserDTO> pageInfo = new PageInfo<>(userDTOs);
|
||||||
return new SuccessResultList<>(userDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
return new SuccessResultList<>(userDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listDepartmentIdByUserId(String userId) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userId", userId);
|
||||||
|
return departmentUserDao.listDepartmentId(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listDepartmentIdByUserIds(List<String> userIds) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userIds", userIds);
|
||||||
|
return departmentUserDao.listDepartmentId(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listSameDepartmentUserIdByUserId(String userId) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userId", userId);
|
||||||
|
return departmentUserDao.listSameDepartmentUserId(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listSameDepartmentUserIdByUserIds(List<String> userIds) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userIds", userIds);
|
||||||
|
return departmentUserDao.listSameDepartmentUserId(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,17 +167,19 @@
|
|||||||
department_id
|
department_id
|
||||||
FROM
|
FROM
|
||||||
sys_department_user
|
sys_department_user
|
||||||
WHERE
|
<where>
|
||||||
<if test="userId != null and userId != ''">
|
<if test="userId != null and userId != ''">
|
||||||
user_id = #{userId}
|
user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
<if test="userIds != null and userIds.size > 0">
|
<if test="userIds != null and userIds.size > 0">
|
||||||
|
AND
|
||||||
user_id IN (
|
user_id IN (
|
||||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||||
#{userIds[${index}]}
|
#{userIds[${index}]}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 用户列表 -->
|
<!-- 用户列表 -->
|
||||||
@ -217,4 +219,31 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 同部门用户ID列表 -->
|
||||||
|
<select id="listSameDepartmentUserId" parameterType="map" resultType="java.lang.String" useCache="false">
|
||||||
|
SELECT
|
||||||
|
t1.user_id
|
||||||
|
FROM
|
||||||
|
sys_department_user t1
|
||||||
|
WHERE
|
||||||
|
t1.department_id IN (
|
||||||
|
SELECT
|
||||||
|
department_id
|
||||||
|
FROM
|
||||||
|
sys_department_user st1
|
||||||
|
<where>
|
||||||
|
<if test="userId != null and userId != ''">
|
||||||
|
user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="userIds != null and userIds.size > 0">
|
||||||
|
AND
|
||||||
|
user_id IN
|
||||||
|
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||||
|
#{userIds[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -174,5 +174,14 @@ public class PositionResourceController extends DefaultBaseController {
|
|||||||
return positionService.listParentByPositionIds(idsVO.getIds());
|
return positionService.listParentByPositionIds(idsVO.getIds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "通过上级职位ID列表获取职位列表", notes = "通过上级职位ID列表获取职位列表接口")
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("list/position-parent-ids")
|
||||||
|
public List<PositionDTO> listByPositionParentIds(@RequestBody IdsVO idsVO) {
|
||||||
|
if (idsVO.getIds().isEmpty()) {
|
||||||
|
throw new ParamsException("ids不能为空");
|
||||||
|
}
|
||||||
|
return positionService.listByPositionParentIds(idsVO.getIds());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -162,6 +162,13 @@ public class PositionServiceImpl extends DefaultBaseService implements IPosition
|
|||||||
return positionDao.listParent(params);
|
return positionDao.listParent(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PositionDTO> listByPositionParentIds(List<String> positionParentIds) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("positionParentIds", positionParentIds);
|
||||||
|
return positionDao.list(params);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 递归查询子组
|
* 递归查询子组
|
||||||
*
|
*
|
||||||
|
@ -162,6 +162,13 @@
|
|||||||
#{positionIds[${index}]}
|
#{positionIds[${index}]}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="positionParentIds != null and positionParentIds.size > 0">
|
||||||
|
AND
|
||||||
|
position_parent_id IN
|
||||||
|
<foreach collection="positionParentIds" index="index" open="(" separator="," close=")">
|
||||||
|
#{positionParentIds[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and (sort == 'positionName' or sort == 'positionCode')">
|
<when test="sort != null and (sort == 'positionName' or sort == 'positionCode')">
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
#{userIds[${index}]}
|
#{userIds[${index}]}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 用户ID列表 -->
|
<!-- 用户ID列表 -->
|
||||||
|
Loading…
Reference in New Issue
Block a user