|
|
|
@ -23,8 +23,6 @@ import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.apache.commons.compress.archivers.zip.ZipUtil;
|
|
|
|
|
import org.aspectj.util.FileUtil;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -58,7 +56,7 @@ public class SysUserInfoController extends CoreBaseController{
|
|
|
|
|
private ISysDepartmentService departmentService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysPositionService sysPositionService;
|
|
|
|
|
private ISysPositionService positionService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysConfigService sysConfigService;
|
|
|
|
@ -72,6 +70,12 @@ public class SysUserInfoController extends CoreBaseController{
|
|
|
|
|
@Autowired
|
|
|
|
|
private EntityManager entityManager;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ICoreMemTreeService memTreeService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IPersonnelService personnelService;
|
|
|
|
|
|
|
|
|
|
@Resource(name="redisRes")
|
|
|
|
|
private ImppRedis redisRes;
|
|
|
|
|
/**
|
|
|
|
@ -189,8 +193,37 @@ public class SysUserInfoController extends CoreBaseController{
|
|
|
|
|
@ApiOperation(value="查询用户信息",notes="复杂查询用户信息带分页")
|
|
|
|
|
public ResultBean querySysUserInfo(SysUserInfo userInfo, Pager pager){
|
|
|
|
|
try{
|
|
|
|
|
ListPager<SysUserInfo> listPager = sysUserInfoService.querySysUserInfo(userInfo, pager);
|
|
|
|
|
return ResultBean.success("操作成功").setListPager(listPager).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
|
if(userInfo.getOrganizeId() == null || userInfo.getOrganizeId() <= 0) {
|
|
|
|
|
if (AuthUtil.getUserType().equals(CommonEnumUtil.USER_TYPE.ADMIN)) {
|
|
|
|
|
userInfo.setOrganizeCode(null);
|
|
|
|
|
userInfo.setOrganizeId(null);
|
|
|
|
|
} else {
|
|
|
|
|
userInfo.setOrganizeId(AuthUtil.getOrganize().getId());
|
|
|
|
|
userInfo.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Long> departmentIdList = memTreeService.findDepartmentIdListByOrganizeIdAndDepartmentId(userInfo.getOrganizeId(), userInfo.getDepartmentId());
|
|
|
|
|
if(departmentIdList != null && departmentIdList.size() > 0){
|
|
|
|
|
List<SysRefUserInfoDepartment> refList = personnelService.findSysRefUserInfoDepartmentByDepartmentIdList(departmentIdList);
|
|
|
|
|
if(refList != null && refList.size() > 0){
|
|
|
|
|
refList.forEach(ref -> idList.add(ref.getUserId()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(userInfo.getPositionId() != null && userInfo.getPositionId() > 0){
|
|
|
|
|
List<Long> refList = memTreeService.findSysPositionChildIdList(userInfo.getPositionId());
|
|
|
|
|
if(refList != null && refList.size() > 0){
|
|
|
|
|
List<SysRefUserPosition> refUserPositionList = personnelService.findSysRefUserPositionByIdList(refList);
|
|
|
|
|
if(refUserPositionList != null && refUserPositionList.size() > 0){
|
|
|
|
|
refUserPositionList.forEach(ref -> idList.add(ref.getUserId()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ListPager<SysUserInfo> result = sysUserInfoService.querySysUserInfo(userInfo,idList, pager);
|
|
|
|
|
return ResultBean.success("操作成功").setListPager(result).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
@ -350,7 +383,7 @@ public class SysUserInfoController extends CoreBaseController{
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SysPosition position = sysPositionService.getSysPositionById(userInfo.getPositionId());
|
|
|
|
|
SysPosition position = positionService.getSysPositionById(userInfo.getPositionId());
|
|
|
|
|
if(position == null){
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|