| | |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TQaProduceReportDTO; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.dto.TQaProduceReportEvaluateDTO; |
| | | import com.ruoyi.system.model.TProjectTeam; |
| | | import com.ruoyi.system.model.TProjectTeamStaff; |
| | | import com.ruoyi.system.model.TQaProduceReport; |
| | | import com.ruoyi.system.model.TQaReportFile; |
| | | import com.ruoyi.system.query.TQaProduceReportQuery; |
| | | import com.ruoyi.system.service.TProjectTeamService; |
| | | import com.ruoyi.system.service.TProjectTeamStaffService; |
| | |
| | | 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.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Api(tags = "中试、生产验证分析报告;辅料;产品报告管理") |
| | | @RestController |
| | | @RequestMapping("/t-qa-produce-report") |
| | | @RequestMapping("") |
| | | public class TQaProduceReportController { |
| | | |
| | | private final TQaProduceReportService qaProduceReportService; |
| | |
| | | /** |
| | | * 获取中试、生产验证分析报告;辅料;产品报告管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:list')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:list')") |
| | | @ApiOperation(value = "获取中试、生产验证分析报告;辅料;产品报告管理分页列表", response = TQaProduceReportQuery.class) |
| | | @PostMapping(value = "/api/t-qa-produce-report/pageList") |
| | | public R<PageInfo<TQaProduceReportVO>> pageList(@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.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)); |
| | | } |
| | | |
| | | /** |
| | | * 添加中试、生产验证分析报告;辅料;产品报告管理管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:add')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:add')") |
| | | @Log(title = "中试、生产验证分析报告;辅料;产品报告管理信息-新增中试、生产验证分析报告;辅料;产品报告管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加中试、生产验证分析报告;辅料;产品报告管理",response = TQaProduceReportDTO.class) |
| | | @PostMapping(value = "/api/t-qa-produce-report/add") |
| | |
| | | /** |
| | | * 修改中试、生产验证分析报告;辅料;产品报告管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:edit')") |
| | | @Log(title = "中试、生产验证分析报告;辅料;产品报告管理信息-修改中试、生产验证分析报告;辅料;产品报告管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改中试、生产验证分析报告;辅料;产品报告管理") |
| | | @PostMapping(value = "/api/t-qa-produce-report/update") |
| | |
| | | /** |
| | | * 查看中试、生产验证分析报告;辅料;产品报告管理详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:detail')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:detail')") |
| | | @ApiOperation(value = "查看中试、生产验证分析报告;辅料;产品报告管理详情") |
| | | @GetMapping(value = "/open/t-qa-produce-report/getDetailById") |
| | | public R<TQaProduceReportVO> getDetailById(@RequestParam String id) { |
| | |
| | | /** |
| | | * 删除中试、生产验证分析报告;辅料;产品报告管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:delete')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:delete')") |
| | | @Log(title = "中试、生产验证分析报告;辅料;产品报告管理信息-删除中试、生产验证分析报告;辅料;产品报告管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除中试、生产验证分析报告;辅料;产品报告管理") |
| | | @DeleteMapping(value = "/open/t-qa-produce-report/deleteById") |
| | |
| | | /** |
| | | * 批量删除中试、生产验证分析报告;辅料;产品报告管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:delete')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:delete')") |
| | | @Log(title = "中试、生产验证分析报告;辅料;产品报告管理信息-删除中试、生产验证分析报告;辅料;产品报告管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除中试、生产验证分析报告;辅料;产品报告管理") |
| | | @DeleteMapping(value = "/open/t-qa-produce-report/deleteByIds") |
| | |
| | | /** |
| | | * 撤销中试、生产验证分析报告;辅料;产品报告管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:revokedReport')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:revokedReport')") |
| | | @Log(title = "中试、生产验证分析报告;辅料;产品报告管理信息-撤销中试、生产验证分析报告;辅料;产品报告管理状态", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "撤销中试、生产验证分析报告;辅料;产品报告管理状态") |
| | | @PutMapping(value = "/open/t-qa-produce-report/revokedReport") |
| | |
| | | /** |
| | | * 审核中试、生产验证分析报告;辅料;产品报告管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:auditReport')") |
| | | //@PreAuthorize("@ss.hasPermi('system:qaProduceReport:auditReport')") |
| | | @Log(title = "中试、生产验证分析报告;辅料;产品报告管理信息-审核中试、生产验证分析报告;辅料;产品报告管理状态", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "审核中试、生产验证分析报告;辅料;产品报告管理状态") |
| | | @PostMapping(value = "/api/t-qa-produce-report/auditReport") |
| | |
| | | qaProduceReportService.updateById(qaProduceReport); |
| | | 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(); |
| | | } |
| | | |
| | | } |
| | | |