| | |
| | | @PostMapping(value = "/api/t-experiment-scheme/pageList") |
| | | public R<PageInfo<TExperimentSchemeVO>> pageList(@RequestBody String param) { |
| | | TExperimentSchemeQuery query = JSON.parseObject(param, TExperimentSchemeQuery.class); |
| | | // 获取当前用户 |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | if (roleType != 1){ |
| | | query.setUserId(userId); |
| | | // 查询实验参与人员 |
| | | List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getUserId, userId)); |
| | | if(!CollectionUtils.isEmpty(experimentDispatchParticipants)){ |
| | | List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList()); |
| | | query.setDispatchIds(dispatchIds); |
| | | } |
| | | } |
| | | return R.ok(experimentSchemeService.pageList(query)); |
| | | } |
| | | /** |
| | |
| | | @PostMapping(value = "/api/t-experiment-scheme/auditPageList") |
| | | public R<PageInfo<TExperimentSchemeVO>> auditPageList(@RequestBody String param) { |
| | | TExperimentSchemeQuery query = JSON.parseObject(param, TExperimentSchemeQuery.class); |
| | | // 获取当前用户 |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | if (roleType != 1){ |
| | | query.setUserId(userId); |
| | | // 查询实验参与人员 |
| | | List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getUserId, userId)); |
| | | if(!CollectionUtils.isEmpty(experimentDispatchParticipants)){ |
| | | List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList()); |
| | | query.setDispatchIds(dispatchIds); |
| | | } |
| | | } |
| | | return R.ok(experimentSchemeService.auditPageList(query)); |
| | | } |
| | | |