|
|
|
@ -140,6 +140,28 @@ public class SysPositionController extends CoreBaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询所有岗位
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value = "/list-user")
|
|
|
|
|
@ApiOperation(value = "查询所有岗位", notes = "查询所有岗位")
|
|
|
|
|
public ResultBean findSysPositionListUser(SysPosition position) {
|
|
|
|
|
try {
|
|
|
|
|
List<SysPosition> result = null;
|
|
|
|
|
if(AuthUtil.getUserType().equals(CommonEnumUtil.USER_TYPE.USER)){
|
|
|
|
|
position.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
|
|
|
|
}
|
|
|
|
|
result = positionService.findSysPositionList(position);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setResultList(result).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ResultBean.fail(e).setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询岗位
|
|
|
|
|
* @param position 查询条件
|
|
|
|
|
* @param pager 分页信息
|
|
|
|
@ -149,23 +171,20 @@ public class SysPositionController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "查询岗位", notes = "复杂查询岗位带分页")
|
|
|
|
|
public ResultBean querySysPosition(SysPosition position, Pager pager) {
|
|
|
|
|
try {
|
|
|
|
|
List<SysRefUserPosition> refList = personnelService.findSysRefUserPositionById(getSessionUser().getUserInfo().getId());
|
|
|
|
|
if(refList != null && refList.size() > 0){
|
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if(position.getParentId() != null){
|
|
|
|
|
idList = memTreeService.findSysPositionChildIdList(position.getParentId());
|
|
|
|
|
}else{
|
|
|
|
|
for (SysRefUserPosition ref : refList) {
|
|
|
|
|
idList.add(ref.getPositionId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ListPager<SysPosition> listPager = positionService.querySysPosition(position,idList, pager);
|
|
|
|
|
return ResultBean.success("操作成功").setListPager(listPager).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
ListPager<SysPosition> listPager = null;
|
|
|
|
|
|
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
|
if(position.getParentId() != null){
|
|
|
|
|
idList = memTreeService.findSysPositionChildIdList(position.getParentId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
if(!AuthUtil.getUserType().equals(CommonEnumUtil.USER_TYPE.ADMIN)){
|
|
|
|
|
position.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listPager = positionService.querySysPosition(position,idList, pager);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setListPager(listPager).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|