|
|
|
@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
@ -166,7 +165,7 @@ public class SysUserController { |
|
|
|
|
/** |
|
|
|
|
* @description: 根据用户角色查询下属用户 |
|
|
|
|
* @param: [user, pageNo, pageSize, req] |
|
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.baomidou.mybatisplus.core.metadata.IPage<org.jeecg.modules.system.entity.SysUser>> |
|
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.baomidou.mybatisplus.core.metadata.IPage < org.jeecg.modules.system.entity.SysUser>> |
|
|
|
|
* @author: z.h.c |
|
|
|
|
* @date: 24/11/8 15:19 |
|
|
|
|
*/ |
|
|
|
@ -194,19 +193,15 @@ public class SysUserController { |
|
|
|
|
public Result<IPage<SysUser>> getDeclarantList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
|
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
user.setUserType("shenbaoren"); |
|
|
|
|
String roleCode = loginUser.getRoleCode(); |
|
|
|
|
List<String> userIds = new LinkedList<>(); |
|
|
|
|
// List<String> userIds = new LinkedList<>();
|
|
|
|
|
//申报人是只查询自己
|
|
|
|
|
if (StringUtils.equals(roleCode, "shenbaoren_role")) { |
|
|
|
|
userIds.add(loginUser.getId()); |
|
|
|
|
} else if (StringUtils.equals(roleCode, "faren_admin")) { |
|
|
|
|
List<SysUserDepart> departList = sysUserDepartService.list(new LambdaQueryWrapper<SysUserDepart>().eq(SysUserDepart::getDepId, loginUser.getOrgId())); |
|
|
|
|
userIds = Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().map(u -> u.getUserId()).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
user.setUserType("shenbaoren"); |
|
|
|
|
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(userIds)) { |
|
|
|
|
queryWrapper.in("id", userIds); |
|
|
|
|
if (StringUtils.equals(roleCode, "shenbaoren_role")) { |
|
|
|
|
queryWrapper.eq("org_code", loginUser.getOrgCode()); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.likeRight("org_code", loginUser.getOrgCode()); |
|
|
|
|
} |
|
|
|
|
return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); |
|
|
|
|
} |
|
|
|
@ -1967,7 +1962,7 @@ public class SysUserController { |
|
|
|
|
|
|
|
|
|
SysDepart depart = sysDepartService.getById(departmentid); |
|
|
|
|
//所先部门状态为0时,说明该部门注册后未通过审核,申报人此时不能选择该部门注册
|
|
|
|
|
if(StringUtils.equals(depart.getStatus(),"0")){ |
|
|
|
|
if (StringUtils.equals(depart.getStatus(), "0")) { |
|
|
|
|
throw new JeecgBootException("该单位未通过审核,暂时不能注册为该单位申报人"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|