|
@@ -35,6 +35,7 @@ import javax.json.JsonObject;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
import javax.ws.rs.QueryParam;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -246,24 +247,24 @@ public class AdmSystemController {
|
|
|
if(CollUtil.isNotEmpty(syses.getContent())){
|
|
|
admSystemList = (List<AdmSystem>) syses.getContent();
|
|
|
admSystemList.stream().forEach(admSystem -> {
|
|
|
- List<AdmBuildingFloorInfo> buildingFloorInfoList = new ArrayList<>();
|
|
|
+ List<ObjectNode> buildingFloorInfoList = new ArrayList<>();
|
|
|
List<AdmBuilding> buildingList = admSystem.getBuildingList();
|
|
|
if(CollUtil.isNotEmpty(buildingList)){
|
|
|
buildingList.stream().forEach(admBuilding -> {
|
|
|
List<AdmFloor> admFloorList = admBuilding.getFloor();
|
|
|
if(CollUtil.isNotEmpty(admFloorList)){
|
|
|
admFloorList.stream().forEach(floor -> {
|
|
|
- AdmBuildingFloorInfo info = new AdmBuildingFloorInfo();
|
|
|
- info.setBuildID(admBuilding.getId());
|
|
|
- info.setBuildName(admBuilding.getLocalName());
|
|
|
- info.setFloorID(floor.getId());
|
|
|
- info.setFloorName(floor.getLocalName());
|
|
|
+ ObjectNode info = JsonNodeFactory.instance.objectNode();
|
|
|
+ info.put("BuildID",admBuilding.getId());
|
|
|
+ info.put("BuildName",admBuilding.getLocalName());
|
|
|
+ info.put("FloorID",floor.getId());
|
|
|
+ info.put("FloorName",floor.getLocalName());
|
|
|
buildingFloorInfoList.add(info);
|
|
|
});
|
|
|
}else{
|
|
|
- AdmBuildingFloorInfo info = new AdmBuildingFloorInfo();
|
|
|
- info.setBuildID(admBuilding.getId());
|
|
|
- info.setBuildName(admBuilding.getLocalName());
|
|
|
+ ObjectNode info = JsonNodeFactory.instance.objectNode();
|
|
|
+ info.put("BuildID",admBuilding.getId());
|
|
|
+ info.put("BuildName",admBuilding.getLocalName());
|
|
|
buildingFloorInfoList.add(info);
|
|
|
}
|
|
|
});
|
|
@@ -378,7 +379,7 @@ public class AdmSystemController {
|
|
|
return null;
|
|
|
}
|
|
|
if(StrUtil.isEmpty(buildingId)){//处理成adm目标格式
|
|
|
- List<AdmBuildingFloorInfo> nullList = new ArrayList<>(0);
|
|
|
+ List<ObjectNode> nullList = new ArrayList<>(0);
|
|
|
admSystemList.stream().forEach(admSystem -> {
|
|
|
admSystem.setBuildingFloorInfoList(nullList);
|
|
|
});
|
|
@@ -394,19 +395,20 @@ public class AdmSystemController {
|
|
|
AdmQueryCriteria admQueryCriteria = getAdmQueryCriteria(AdmFloor.OBJ_TYPE, floorId);
|
|
|
floors = floorService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmFloor.class);
|
|
|
}
|
|
|
- AdmBuildingFloorInfo buildingFloorInfo = new AdmBuildingFloorInfo();
|
|
|
+
|
|
|
+ ObjectNode buildingFloorInfo = JsonNodeFactory.instance.objectNode();
|
|
|
if (CollUtil.isNotEmpty(buildings.getContent())) {
|
|
|
- AdmBuilding building = (AdmBuilding) buildings.getContent().get(0);
|
|
|
- buildingFloorInfo.setBuildName(building.getLocalName());
|
|
|
- buildingFloorInfo.setBuildID(buildingId);
|
|
|
+ AdmBuilding admBuilding = (AdmBuilding) buildings.getContent().get(0);
|
|
|
+ buildingFloorInfo.put("BuildID",admBuilding.getId());
|
|
|
+ buildingFloorInfo.put("BuildName",admBuilding.getLocalName());
|
|
|
}
|
|
|
if (null!=floors && CollUtil.isNotEmpty(floors.getContent())) {
|
|
|
AdmFloor floor = (AdmFloor) floors.getContent().get(0);
|
|
|
- buildingFloorInfo.setFloorName(floor.getLocalName());
|
|
|
- buildingFloorInfo.setFloorID(floorId);
|
|
|
+ buildingFloorInfo.put("FloorID",floor.getId());
|
|
|
+ buildingFloorInfo.put("FloorName",floor.getLocalName());
|
|
|
}
|
|
|
admSystemList.stream().forEach(admSystem -> {
|
|
|
- admSystem.setBuildingFloorInfoList(CollUtil.newArrayList(buildingFloorInfo));
|
|
|
+ admSystem.setBuildingFloorInfoList(Arrays.asList(buildingFloorInfo));
|
|
|
});
|
|
|
return admSystemList;
|
|
|
}
|