| | |
| | | .filter(f -> StringUtils.isBlank(f.getMeterId())) |
| | | .map(EnergyIndex::getIndexId) |
| | | .collect(Collectors.toList()); |
| | | /** |
| | | * 处理能源指标列表并生成需要移除的指标ID集合 |
| | | * 1. 过滤出meterId非空的能源指标对象 |
| | | * 2. 提取这些对象的indexId字段 |
| | | * 3. 将提取的指标ID收集到字符串集合中 |
| | | */ |
| | | List<String> removeLink = energyIndexList.stream() |
| | | .filter(f -> StringUtils.isNotBlank(f.getMeterId())) |
| | | .map(EnergyIndex::getIndexId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if (!removeLink.isEmpty()) { |
| | | energyIndexService.removeNodeIndex(nodeId, removeLink); |
| | | } |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 新增通过id删除采集点接口 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:remove')") |
| | | @Log(title = "指标信息", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{indexId}") |
| | | public AjaxResult deleteCollectIndex(@PathVariable String indexId) { |
| | | return toAjax(energyIndexService.deleteByIndexId(indexId)); |
| | | } |
| | | |
| | | @Log(title = "增加计量器具采集点", businessType = BusinessType.INSERT) |
| | | @PostMapping("/meterIndex/{meterId}") |
| | | public AjaxResult addCollectIndex(@PathVariable("meterId") String meterId) { |