| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.TExperimentResultReportDTO; |
| | | import com.ruoyi.system.model.TExperimentResultReport; |
| | | import com.ruoyi.system.model.TExperimentScheme; |
| | | import com.ruoyi.system.model.TInspectionReport; |
| | | import com.ruoyi.system.model.TResultWorkEvaluate; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TExperimentResultReportQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TExperimentResultReportVO; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TResultWorkEvaluateService resultWorkEvaluateService; |
| | | private final TExperimentSchemeService experimentSchemeService; |
| | | private final TInspectionReportService inspectionReportService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final TExperimentDispatchParticipantsService experimentDispatchParticipantsService; |
| | | @Autowired |
| | | public TExperimentResultReportController(TExperimentResultReportService experimentResultReportService, TokenService tokenService, ISysUserService sysUserService, TResultWorkEvaluateService resultWorkEvaluateService, TExperimentSchemeService experimentSchemeService, TInspectionReportService inspectionReportService) { |
| | | public TExperimentResultReportController(TExperimentResultReportService experimentResultReportService, TokenService tokenService, ISysUserService sysUserService, TResultWorkEvaluateService resultWorkEvaluateService, TExperimentSchemeService experimentSchemeService, TInspectionReportService inspectionReportService, TProjectTeamStaffService projectTeamStaffService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService) { |
| | | this.experimentResultReportService = experimentResultReportService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | | this.resultWorkEvaluateService = resultWorkEvaluateService; |
| | | this.experimentSchemeService = experimentSchemeService; |
| | | this.inspectionReportService = inspectionReportService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.experimentDispatchParticipantsService = experimentDispatchParticipantsService; |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping(value = "/api/t-experiment-result-report/pageList") |
| | | public R<PageInfo<TExperimentResultReportVO>> pageList(@RequestBody String param) { |
| | | TExperimentResultReportQuery query = JSON.parseObject(param, TExperimentResultReportQuery.class); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | if(roleType != 1){ |
| | | // 查询用户所参与的实验调度 |
| | | List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getUserId, userId)); |
| | | if(experimentDispatchParticipants.size() > 0){ |
| | | // 查询项目组id |
| | | List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList()); |
| | | query.setDispatchIds(dispatchIds); |
| | | } |
| | | } |
| | | return R.ok(experimentResultReportService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取实验结果汇报评定列表 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:list')") |
| | | @ApiOperation(value = "获取实验结果汇报评定列表-审批人使用",response = TExperimentResultReportQuery.class) |
| | | @PostMapping(value = "/api/t-experiment-result-report/evaluatePageList") |
| | | public R<PageInfo<TExperimentResultReportVO>> evaluatePageList(@RequestBody String param) { |
| | | TExperimentResultReportQuery query = JSON.parseObject(param, TExperimentResultReportQuery.class); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | if(roleType != 1){ |
| | | // 查询用户所参与的实验调度 |
| | | List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getUserId, userId)); |
| | | if(experimentDispatchParticipants.size() > 0){ |
| | | // 查询项目组id |
| | | List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList()); |
| | | query.setDispatchIds(dispatchIds); |
| | | } |
| | | } |
| | | return R.ok(experimentResultReportService.evaluatePageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加实验结果汇报管理 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:add')") |