|
|
@ -995,15 +995,25 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
throw new SysException("当前关系无详情,无需导出物物关系列表"); |
|
|
throw new SysException("当前关系无详情,无需导出物物关系列表"); |
|
|
} |
|
|
} |
|
|
List<IotThingRelationDetailExcel> resList = list.stream().map(node -> { |
|
|
List<IotThingRelationDetailExcel> resList = list.stream().map(node -> { |
|
|
IotThingRelationDetailExcel excel = JacksonUtil.convertValue(node, IotThingRelationDetailExcel.class); |
|
|
|
|
|
|
|
|
IotThingRelationDetailExcel excel = new IotThingRelationDetailExcel(); |
|
|
|
|
|
excel.setFromName(node.get("fromName").asText()); |
|
|
|
|
|
excel.setFromCode(node.get("fromCode").asText()); |
|
|
|
|
|
excel.setToName(node.get("toName").asText()); |
|
|
|
|
|
excel.setToCode(node.get("toCode").asText()); |
|
|
|
|
|
excel.setConfig(node.get("config").isEmpty() ? "" : node.get("config").asText()); |
|
|
|
|
|
excel.setRemark(node.get("remark").isEmpty() ? "" : node.get("remark").asText()); |
|
|
|
|
|
excel.setSort(node.get("sort").asLong()); |
|
|
|
|
|
excel.setUrl(node.get("url").isEmpty() ? "" : node.get("url").asText()); |
|
|
|
|
|
excel.setTag(node.get("tag").isEmpty() ? "" : node.get("tag").asText()); |
|
|
long rootThingId = node.get("rootThingId").asLong(); |
|
|
long rootThingId = node.get("rootThingId").asLong(); |
|
|
IotThingEntityInfoDTO entity = thingEntitiesService.findEntityById(rootThingId); |
|
|
IotThingEntityInfoDTO entity = thingEntitiesService.findEntityById(rootThingId); |
|
|
excel.setRootThingCode(entity.getCode()); |
|
|
excel.setRootThingCode(entity.getCode()); |
|
|
|
|
|
long rootId = node.get("rootId").asLong(); |
|
|
|
|
|
IotThingRelationRootDTO rootDTO = relationRootsService.findById(rootId); |
|
|
|
|
|
excel.setName(rootDTO.getName()); |
|
|
return excel; |
|
|
return excel; |
|
|
}).toList(); |
|
|
}).toList(); |
|
|
|
|
|
|
|
|
ExcelUtils.exportExcel(resList, "物关系详情信息", "物关系详情", IotThingViewExcel.class, "物关系详情模板.xls", response); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExcelUtils.exportExcel(new ArrayList<>(resList), "物关系详情信息", "物关系详情", IotThingRelationDetailExcel.class, "物关系详情模板.xls", response); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@ -1072,7 +1082,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
excel.setTag("下级节点名称-标签"); |
|
|
excel.setTag("下级节点名称-标签"); |
|
|
excel.setRemark("备注"); |
|
|
excel.setRemark("备注"); |
|
|
excel.setUrl("图片地址"); |
|
|
excel.setUrl("图片地址"); |
|
|
ExcelUtils.exportExcel(Lists.newArrayList(excel), "物关系详情信息", "物关系详情", IotThingViewExcel.class, "物关系详情模板.xls", response); |
|
|
|
|
|
|
|
|
ExcelUtils.exportExcel(Lists.newArrayList(excel), "物关系详情信息", "物关系详情", IotThingRelationDetailExcel.class, "物关系详情模板.xls", response); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
|