| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | } |
| | | } |
| | | return R.ok(feasibilityStudyReportService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取可研、可行、工艺开发工具、验证发布报告管理列表 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:feasibilityStudyReport:evaluatePageList')") |
| | | @ApiOperation(value = "获取专业报告课题评定分页列表-超管、审批人",response = TFeasibilityStudyReportQuery.class) |
| | | @PostMapping(value = "/api/t-feasibility-study-report/evaluatePageList") |
| | | public R<PageInfo<TFeasibilityStudyReportVO>> evaluatePageList(@RequestBody String param) { |
| | | TFeasibilityStudyReportQuery query = JSON.parseObject(param, TFeasibilityStudyReportQuery.class); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | if(roleType != 1){ |
| | | // 查询用户所在项目组 |
| | | List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId)); |
| | | if(projectTeamStaffs.size() > 0){ |
| | | // 查询项目组id |
| | | List<String> teamIds = projectTeamStaffs.stream().map(TProjectTeamStaff::getTeamId).distinct().collect(Collectors.toList()); |
| | | query.setTeamIds(teamIds); |
| | | } |
| | | } |
| | | return R.ok(feasibilityStudyReportService.evaluatePageList(query)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取专业报告课题评定数量统计",response = TFeasibilityStudyReportQuery.class) |
| | | @PostMapping(value = "/api/t-feasibility-study-report/evaluateCount") |
| | | public R<Map<String,Integer>> evaluateCount(@RequestBody String param) { |
| | | TFeasibilityStudyReportQuery query = JSON.parseObject(param, TFeasibilityStudyReportQuery.class); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | if(roleType != 1){ |
| | | // 查询用户所在项目组 |
| | | List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId)); |
| | | if(projectTeamStaffs.size() > 0){ |
| | | // 查询项目组id |
| | | List<String> teamIds = projectTeamStaffs.stream().map(TProjectTeamStaff::getTeamId).distinct().collect(Collectors.toList()); |
| | | query.setTeamIds(teamIds); |
| | | } |
| | | } |
| | | Map<String,Integer> map = feasibilityStudyReportService.evaluateCount(query); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | |
| | | feasibilityStudyReportService.updateById(feasibilityStudyReport); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 课题评定-进行评定 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:feasibilityStudyReport:evaluate')") |
| | | @Log(title = "课题评定-进行评定", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "课题评定") |
| | | @PutMapping(value = "/open/t-feasibility-study-report/evaluate") |
| | | public R<Boolean> evaluate(@RequestParam(value = "id") String id, |
| | | @RequestParam(value = "evaluateScore") String evaluateScore) { |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TFeasibilityStudyReport feasibilityStudyReport = feasibilityStudyReportService.getById(id); |
| | | feasibilityStudyReport.setStatus(3); |
| | | feasibilityStudyReport.setEvaluatePersonId(userId); |
| | | feasibilityStudyReport.setEvaluateTime(LocalDateTime.now()); |
| | | feasibilityStudyReport.setEvaluateScore(evaluateScore); |
| | | feasibilityStudyReportService.updateById(feasibilityStudyReport); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 课题评定-评定详情 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:feasibilityStudyReport:evaluate')") |
| | | @Log(title = "课题评定-评定详情", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "评定详情") |
| | | @GetMapping(value = "/open/t-feasibility-study-report/evaluateDetail") |
| | | public R<TFeasibilityStudyReportVO> evaluateDetail(@RequestParam(value = "id") String id) { |
| | | TFeasibilityStudyReport feasibilityStudyReport = feasibilityStudyReportService.getById(id); |
| | | TFeasibilityStudyReportVO tFeasibilityStudyReportVO = new TFeasibilityStudyReportVO(); |
| | | BeanUtils.copyProperties(feasibilityStudyReport, tFeasibilityStudyReportVO); |
| | | // 查询评定人员名称 |
| | | SysUser sysUser = sysUserService.selectUserById(feasibilityStudyReport.getEvaluatePersonId()); |
| | | if(Objects.nonNull(sysUser)){ |
| | | tFeasibilityStudyReportVO.setEvaluatePersonName(sysUser.getNickName()); |
| | | } |
| | | return R.ok(tFeasibilityStudyReportVO); |
| | | } |
| | | |
| | | } |
| | | |