|
|
@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
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.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
@ -194,19 +193,15 @@ public class SysUserController { |
|
|
|
public Result<IPage<SysUser>> getDeclarantList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
public Result<IPage<SysUser>> getDeclarantList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
|
|
|
user.setUserType("shenbaoren"); |
|
|
|
String roleCode = loginUser.getRoleCode(); |
|
|
|
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()); |
|
|
|
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); |
|
|
|
if (ObjectUtil.isNotEmpty(userIds)) { |
|
|
|
if (StringUtils.equals(roleCode, "shenbaoren_role")) { |
|
|
|
queryWrapper.in("id", userIds); |
|
|
|
queryWrapper.eq("org_code", loginUser.getOrgCode()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
queryWrapper.likeRight("org_code", loginUser.getOrgCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); |
|
|
|
return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); |
|
|
|
} |
|
|
|
} |
|
|
|