| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.QAProduceReportStatusEnum; |
| | | import com.ruoyi.common.enums.QaReportFileEnum; |
| | | import com.ruoyi.common.enums.QaReportTypeEnum; |
| | | import com.ruoyi.common.enums.*; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TQaProduceReportDTO; |
| | | import com.ruoyi.system.dto.TQaProduceReportEvaluateDTO; |
| | | import com.ruoyi.system.model.TProjectTeam; |
| | | import com.ruoyi.system.model.TProjectTeamStaff; |
| | | import com.ruoyi.system.model.TQaProduceReport; |
| | |
| | | } |
| | | } |
| | | return R.ok(qaProduceReportService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取中试、生产验证分析报告;辅料;产品报告管理评定列表 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:evaluateList')") |
| | | @ApiOperation(value = "获取中试、生产验证分析报告;辅料;产品报告管理评定列表", response = TQaProduceReportQuery.class) |
| | | @PostMapping(value = "/api/t-qa-produce-report/evaluateList") |
| | | public R<PageInfo<TQaProduceReportVO>> evaluateList(@RequestBody String param) { |
| | | TQaProduceReportQuery query = JSON.parseObject(param, TQaProduceReportQuery.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(qaProduceReportService.evaluateList(query)); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 评定QA检测项管理 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:qaTestItem:evaluate')") |
| | | @Log(title = "中试、生产验证分析报告;辅料;产品报告管理信息-评定中试、生产验证分析报告;辅料;产品报告管理信息", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "评定QA检测项管理",response = TQaProduceReportEvaluateDTO.class) |
| | | @PostMapping(value = "/api/t-qa-produce-report/evaluate") |
| | | public R<Boolean> evaluate(@RequestBody String param) { |
| | | TQaProduceReportEvaluateDTO dto = JSON.parseObject(param,TQaProduceReportEvaluateDTO.class); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TQaProduceReport qaProduceReport = qaProduceReportService.getById(dto); |
| | | qaProduceReport.setStatus(QAProduceReportStatusEnum.EVALUATED.getCode()); |
| | | qaProduceReport.setEvaluatePersonId(userId); |
| | | qaProduceReport.setEvaluateTime(LocalDateTime.now()); |
| | | qaProduceReport.setEvaluateScore(dto.getEvaluateScore()); |
| | | qaProduceReportService.updateById(qaProduceReport); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |