| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | | * 获取实验结果汇报管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentResultReport:list')") |
| | | @ApiOperation(value = "获取实验结果汇报分页列表") |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:list')") |
| | | @ApiOperation(value = "获取实验结果汇报分页列表",response = TExperimentResultReportQuery.class) |
| | | @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')") |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:add')") |
| | | @Log(title = "实验结果汇报信息-新增实验结果汇报", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加实验结果汇报",response = TExperimentResultReportDTO.class) |
| | | @PostMapping(value = "/api/t-experiment-result-report/add") |
| | |
| | | /** |
| | | * 修改实验结果汇报 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentResultReport:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:edit')") |
| | | @Log(title = "实验结果汇报信息-修改实验结果汇报", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改实验结果汇报") |
| | | @PostMapping(value = "/api/t-experiment-result-report/update") |
| | |
| | | /** |
| | | * 修改实验结果汇报 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentResultReport:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:edit')") |
| | | @Log(title = "实验结果汇报信息-评定工艺工程师实验", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "评定工艺工程师实验") |
| | | @PostMapping(value = "/api/t-experiment-result-report/evaluateProcess") |
| | |
| | | /** |
| | | * 查看实验结果汇报详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentResultReport:detail')") |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:detail')") |
| | | @ApiOperation(value = "查看实验结果汇报详情") |
| | | @GetMapping(value = "/open/t-experiment-result-report/getDetailById") |
| | | public R<TExperimentResultReportVO> getDetailById(@RequestParam String id) { |
| | |
| | | /** |
| | | * 删除实验结果汇报 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentResultReport:delete')") |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:delete')") |
| | | @Log(title = "实验结果汇报信息-删除实验结果汇报", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除实验结果汇报") |
| | | @DeleteMapping(value = "/open/t-experiment-result-report/deleteById") |
| | |
| | | /** |
| | | * 批量删除实验结果汇报 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentResultReport:delete')") |
| | | //@PreAuthorize("@ss.hasPermi('system:experimentResultReport:delete')") |
| | | @Log(title = "实验结果汇报信息-删除实验结果汇报", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除实验结果汇报") |
| | | @DeleteMapping(value = "/open/t-experiment-result-report/deleteByIds") |