|
|
|
@ -8,6 +8,7 @@ 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; |
|
|
|
@ -193,15 +194,19 @@ 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<>(); |
|
|
|
|
//申报人是只查询自己
|
|
|
|
|
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); |
|
|
|
|
if (StringUtils.equals(roleCode, "shenbaoren_role")) { |
|
|
|
|
queryWrapper.eq("org_code", loginUser.getOrgCode()); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.likeRight("org_code", loginUser.getOrgCode()); |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); |
|
|
|
|
} |
|
|
|
|