| | |
| | | import com.ruoyi.common.enums.QAProduceReportStatusEnum; |
| | | import com.ruoyi.common.enums.QaReportFileEnum; |
| | | import com.ruoyi.common.enums.QaReportTypeEnum; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TQaProduceReportDTO; |
| | |
| | | TQaProduceReportQuery query = JSON.parseObject(param, TQaProduceReportQuery.class); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | query.setRoleType(roleType); |
| | | if(roleType != 1){ |
| | | // 查询用户所在项目组 |
| | | List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | |
| | | @PostMapping(value = "/api/t-qa-produce-report/update") |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TQaProduceReportDTO dto = JSON.parseObject(param,TQaProduceReportDTO.class); |
| | | |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | dto.setStatus(null); |
| | | } |
| | | |
| | | qaProduceReportService.updateById(dto); |
| | | qaReportFileService.remove(Wrappers.lambdaQuery(TQaReportFile.class) |
| | | .eq(TQaReportFile::getReportId, dto.getId())); |
| | | // 添加检测报告文件 |
| | | List<TQaReportFile> qaReportFiles = dto.getQaReportFiles(); |
| | | for (TQaReportFile qaReportFile : qaReportFiles) { |
| | | qaReportFile.setReportId(dto.getId()); |
| | | switch (QaReportFileEnum.fromCode(qaReportFile.getReportType())) { |
| | | case TEST_REPORT: |
| | | qaReportFile.setReportType(QaReportFileEnum.TEST_REPORT.getCode()); |
| | | break; |
| | | case PILOT_PRODUCTION_VALIDATION: |
| | | qaReportFile.setReportType(QaReportFileEnum.PILOT_PRODUCTION_VALIDATION.getCode()); |
| | | break; |
| | | case RAW_MATERIAL_REPORT: |
| | | qaReportFile.setReportType(QaReportFileEnum.RAW_MATERIAL_REPORT.getCode()); |
| | | break; |
| | | case PRODUCT_APPROVAL_REPORT: |
| | | qaReportFile.setReportType(QaReportFileEnum.PRODUCT_APPROVAL_REPORT.getCode()); |
| | | break; |
| | | if (qaReportFiles != null) { |
| | | for (TQaReportFile qaReportFile : qaReportFiles) { |
| | | qaReportFile.setReportId(dto.getId()); |
| | | switch (QaReportFileEnum.fromCode(qaReportFile.getReportType())) { |
| | | case TEST_REPORT: |
| | | qaReportFile.setReportType(QaReportFileEnum.TEST_REPORT.getCode()); |
| | | break; |
| | | case PILOT_PRODUCTION_VALIDATION: |
| | | qaReportFile.setReportType(QaReportFileEnum.PILOT_PRODUCTION_VALIDATION.getCode()); |
| | | break; |
| | | case RAW_MATERIAL_REPORT: |
| | | qaReportFile.setReportType(QaReportFileEnum.RAW_MATERIAL_REPORT.getCode()); |
| | | break; |
| | | case PRODUCT_APPROVAL_REPORT: |
| | | qaReportFile.setReportType(QaReportFileEnum.PRODUCT_APPROVAL_REPORT.getCode()); |
| | | break; |
| | | } |
| | | } |
| | | qaReportFileService.saveBatch(qaReportFiles); |
| | | } |
| | | qaReportFileService.saveBatch(qaReportFiles); |
| | | |
| | | |
| | | if(dto.getStatus() != -1){ |
| | | if(dto.getStatus() != null && dto.getStatus() != -1){ |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(dto.getTeamId()); |
| | | // MESSAGE 添加消息 20251208 将qa报告审核转到审批人 |