| | |
| | | |
| | | JSONObject values = JSON.parseObject(JSON.toJSONString(dto.getValues() == null |
| | | ? Collections.emptyMap() : dto.getValues())); |
| | | List<String> exportValueCoordinates = getExportValueCoordinates(snapshot.getThing()).values().stream() |
| | | // 检验期间页面展示的是标准维护中的最新模板,保存校验必须使用同一份模板, |
| | | // 避免模板新增“导出值”批注后仍按下单时的旧快照误报未配置。 |
| | | String currentTemplateThing = getCurrentTemplateThing(snapshot); |
| | | List<String> exportValueCoordinates = getExportValueCoordinates(currentTemplateThing).values().stream() |
| | | .flatMap(Collection::stream) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 检验保存、提交校验读取标准维护中的实时模板;模板已被删除或内容为空时才回退订单快照。 |
| | | * 检验完成后的展示和报告仍由订单快照负责,不会随标准模板后续修改而变化。 |
| | | */ |
| | | private String getCurrentTemplateThing(InsOrderStandardTemplate snapshot) { |
| | | if (snapshot != null && snapshot.getTemplateId() != null) { |
| | | StandardTemplate currentTemplate = standardTemplateService.getById(snapshot.getTemplateId()); |
| | | if (currentTemplate != null && StrUtil.isNotBlank(currentTemplate.getThing())) { |
| | | return currentTemplate.getThing(); |
| | | } |
| | | } |
| | | return snapshot == null ? null : snapshot.getThing(); |
| | | } |
| | | |
| | | /** |
| | | * 直绑模板订单只校验模板中标记为“导出值”的单元格,不使用检验项状态或 last_value 判定。 |
| | | */ |
| | | private List<String> getMissingTemplateExportValues(Integer orderId) { |
| | |
| | | } |
| | | for (InsOrderStandardTemplate snapshot : snapshots) { |
| | | Integer templateId = snapshot.getTemplateId(); |
| | | List<String> coordinates = getExportValueCoordinates(snapshot.getThing()).values().stream() |
| | | List<String> coordinates = getExportValueCoordinates(getCurrentTemplateThing(snapshot)).values().stream() |
| | | .flatMap(Collection::stream) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |