| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.QATestItemReportStatusEnum; |
| | | import com.ruoyi.common.enums.QaReportFileEnum; |
| | |
| | | import com.ruoyi.system.model.TQaReportFile; |
| | | import com.ruoyi.system.model.TQaTestItemReport; |
| | | import com.ruoyi.system.query.TQaTestItemReportQuery; |
| | | import com.ruoyi.system.service.TProjectTeamService; |
| | | import com.ruoyi.system.service.TProjectTeamStaffService; |
| | | import com.ruoyi.system.service.TQaReportFileService; |
| | | import com.ruoyi.system.service.TQaTestItemReportService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TQaTestItemReportVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | private final TokenService tokenService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TQaTestItemReportController(TQaTestItemReportService qaTestItemReportService, TQaReportFileService qaReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | public TQaTestItemReportController(TQaTestItemReportService qaTestItemReportService, TQaReportFileService qaReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, ISysUserService sysUserService) { |
| | | this.qaTestItemReportService = qaTestItemReportService; |
| | | this.qaReportFileService = qaReportFileService; |
| | | this.tokenService = tokenService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | |
| | | .eq(TQaReportFile::getReportId, dto.getId())); |
| | | // 添加检测报告文件 |
| | | List<TQaReportFile> qaReportFiles = dto.getQaReportFiles(); |
| | | for (TQaReportFile qaReportFile : qaReportFiles) { |
| | | qaReportFile.setReportId(dto.getId()); |
| | | qaReportFile.setReportType(QaReportFileEnum.TEST_REPORT.getCode()); |
| | | if(!CollectionUtils.isEmpty(qaReportFiles)){ |
| | | for (TQaReportFile qaReportFile : qaReportFiles) { |
| | | qaReportFile.setReportId(dto.getId()); |
| | | qaReportFile.setReportType(QaReportFileEnum.TEST_REPORT.getCode()); |
| | | } |
| | | qaReportFileService.saveBatch(qaReportFiles); |
| | | } |
| | | qaReportFileService.saveBatch(qaReportFiles); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | .eq(TQaReportFile::getReportId, id) |
| | | .eq(TQaReportFile::getReportType, QaReportFileEnum.TEST_REPORT.getCode())); |
| | | testItemReportVO.setQaReportFileList(qaReportFiles); |
| | | // 查询审批人姓名 |
| | | SysUser sysUser = sysUserService.selectUserById(testItemReportVO.getAuditPersonId()); |
| | | if(Objects.nonNull(sysUser)){ |
| | | testItemReportVO.setAuditPersonName(sysUser.getNickName()); |
| | | } |
| | | return R.ok(testItemReportVO); |
| | | } |
| | | |