| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建检验结果") |
| | | @PreAuthorize("@ss.hasPermission('mes:qc-iqc:create')") |
| | | @PreAuthorize("@ss.hasAnyPermissions('mes:qc-iqc:create', 'mes:qc-ipqc:create', 'mes:qc-oqc:create', 'mes:qc-rqc:create')") |
| | | public CommonResult<Long> createIndicatorResult(@Valid @RequestBody MesQcIndicatorResultSaveReqVO createReqVO) { |
| | | return success(resultService.createIndicatorResult(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新检验结果") |
| | | @PreAuthorize("@ss.hasPermission('mes:qc-iqc:update')") |
| | | @PreAuthorize("@ss.hasAnyPermissions('mes:qc-iqc:update', 'mes:qc-ipqc:update', 'mes:qc-oqc:update', 'mes:qc-rqc:update')") |
| | | public CommonResult<Boolean> updateIndicatorResult(@Valid @RequestBody MesQcIndicatorResultSaveReqVO updateReqVO) { |
| | | resultService.updateIndicatorResult(updateReqVO); |
| | | return success(true); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除检验结果") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:qc-iqc:delete')") |
| | | @PreAuthorize("@ss.hasAnyPermissions('mes:qc-iqc:delete', 'mes:qc-ipqc:delete', 'mes:qc-oqc:delete', 'mes:qc-rqc:delete')") |
| | | public CommonResult<Boolean> deleteIndicatorResult(@RequestParam("id") Long id) { |
| | | resultService.deleteIndicatorResult(id); |
| | | return success(true); |
| | |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | // 过程检验支持质检手工增删检验行:已有明细时以明细实际指标及顺序为准, |
| | | // 避免模板里的指标把已删除的行重新带出来。 |
| | | if (Objects.equals(qcType, MesQcTypeEnum.IPQC.getType()) && CollUtil.isNotEmpty(details)) { |
| | | indicatorIds = details.stream().map(MesQcIndicatorResultDetailDO::getIndicatorId) |
| | | .filter(Objects::nonNull).distinct().toList(); |
| | | } |
| | | // 1.2 批量查询检测指标 |
| | | Map<Long, MesQcIndicatorDO> indicatorMap = indicatorService.getIndicatorMap(new HashSet<>(indicatorIds)); |
| | | // 1.3 构建已有明细 Map(按 indicatorId 索引) |