| | |
| | | evaluation.setSampleName(detail.getSampleName()); |
| | | evaluation.setSampleSpec(detail.getSampleSpec()); |
| | | } |
| | | // 评价记录里的“监督员”就是计划中指定的“评价人”,未保存过评价时直接反显评价人 |
| | | if (evaluation.getSupervisorUserId() == null) { |
| | | evaluation.setSupervisorUserId(detail.getEvaluatorUserId()); |
| | | } |
| | | // 历史评价记录可能没有保存被监督人员,回退到计划明细中的检测员 |
| | | if (evaluation.getInspectorUserId() == null) { |
| | | evaluation.setInspectorUserId(detail.getInspectorUserId()); |
| | | } |
| | | List<QualityMonitorEvaluateResult> rows = evaluation.getDetailsEvaluateId() == null |
| | | ? List.of() : resultMapper.selectList(Wrappers.<QualityMonitorEvaluateResult>lambdaQuery() |
| | | .eq(QualityMonitorEvaluateResult::getDetailsEvaluateId, evaluation.getDetailsEvaluateId()) |
| | |
| | | } |
| | | evaluation.setResultRows(rows); |
| | | evaluation.setInspectionTaskState(task == null ? null : task.getInsState()); |
| | | // 监督员、检测员可能不在前端人员下拉列表中(角色或状态被过滤),回传名称保证能正常反显 |
| | | if (evaluation.getSupervisorUserId() != null) { |
| | | var supervisor = userMapper.selectById(evaluation.getSupervisorUserId()); |
| | | if (supervisor != null) evaluation.setSupervisorName(supervisor.getName()); |
| | | } |
| | | if (evaluation.getInspectorUserId() != null) { |
| | | var inspector = userMapper.selectById(evaluation.getInspectorUserId()); |
| | | if (inspector != null) evaluation.setInspectorName(inspector.getName()); |
| | | } |
| | | if (Integer.valueOf(1).equals(evaluation.getIsFinish())) { |
| | | evaluation.setEvaluationEditReason("评价已批准归档,只能查看"); |
| | | } else if (task == null) { |
| | |
| | | throw new ErrorException("只有指定评价人可以填写评价"); |
| | | if (input.getSupervisorUserId() == null |
| | | || input.getSupervisorUserId().equals(detail.getInspectorUserId()) |
| | | || input.getSupervisorUserId().equals(detail.getEvaluatorUserId()) |
| | | || userMapper.selectById(input.getSupervisorUserId()) == null) |
| | | throw new ErrorException("请选择与检测员、评价人不同的监督员"); |
| | | throw new ErrorException("请选择监督员(默认为计划评价人,不能与检测员相同)"); |
| | | Long pendingCount = stateMapper.selectCount(Wrappers.<InsOrderState>lambdaQuery() |
| | | .eq(InsOrderState::getInsOrderId, task.getId()).ne(InsOrderState::getInsState, 5)); |
| | | if (pendingCount > 0) throw new ErrorException("原始记录复核通过后才能评价"); |