|
@@ -10,6 +10,11 @@ import com.persagy.apm.energy.report.saasweb.model.dto.QueryProjectDTO;
|
|
|
import com.persagy.apm.energy.report.saasweb.model.vo.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 运维平台feign客户端包装类
|
|
@@ -42,7 +47,7 @@ public class SaasWebClientWrapper {
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/5/19 2:27 下午
|
|
|
*/
|
|
|
- public PoemsFeignResponse<BuildingInfoVO> listBuildingsByProjectId(QueryByProjectIdDTO queryByProjectIdDTO){
|
|
|
+ public PoemsFeignResponse<BuildingInfoVO> listBuildingsByProjectId(QueryByProjectIdDTO queryByProjectIdDTO) {
|
|
|
return saasWebClient.listBuildingsByProjectId(JSON.toJSONString(queryByProjectIdDTO));
|
|
|
}
|
|
|
|
|
@@ -54,7 +59,7 @@ public class SaasWebClientWrapper {
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/5/19 2:27 下午
|
|
|
*/
|
|
|
- public PoemsFeignResponse<PoemsProjectVO> queryProjects(QueryProjectDTO queryProjectDTO){
|
|
|
+ public PoemsFeignResponse<PoemsProjectVO> queryProjects(QueryProjectDTO queryProjectDTO) {
|
|
|
return saasWebClient.queryProjects(JSON.toJSONString(queryProjectDTO));
|
|
|
}
|
|
|
|
|
@@ -66,8 +71,21 @@ public class SaasWebClientWrapper {
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/5/19 2:27 下午
|
|
|
*/
|
|
|
- public PoemsFeignResponse<PoemsPartitionVO> queryPartitionsByIds(QueryPartitionDTO queryPartitionDTO){
|
|
|
- return saasWebClient.queryPartitionsByIds(JSON.toJSONString(queryPartitionDTO));
|
|
|
+ public PoemsFeignResponse<PoemsPartitionVO> queryPartitionsByIds(QueryPartitionDTO queryPartitionDTO) {
|
|
|
+ PoemsFeignBaseDTO poemsFeignBaseDTO = new PoemsFeignBaseDTO();
|
|
|
+ poemsFeignBaseDTO.setPuser(queryPartitionDTO.getPuser());
|
|
|
+
|
|
|
+ PoemsFeignResponse<PoemsPartitionVO> partitionsResponse = saasWebClient.queryAllPartitions(
|
|
|
+ JSON.toJSONString(poemsFeignBaseDTO));
|
|
|
+ List<PoemsPartitionVO> filteredContents = new ArrayList<>();
|
|
|
+ List<PoemsPartitionVO> partitionVOList = partitionsResponse.getContent();
|
|
|
+ if (!CollectionUtils.isEmpty(partitionVOList)) {
|
|
|
+ filteredContents = partitionVOList.stream().filter(
|
|
|
+ poemsPartitionVO -> queryPartitionDTO.getManagePartitionIds().contains(poemsPartitionVO.getManagePartitionId())
|
|
|
+ ).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ partitionsResponse.setContent(filteredContents);
|
|
|
+ return partitionsResponse;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -78,7 +96,7 @@ public class SaasWebClientWrapper {
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/5/19 3:36 下午
|
|
|
*/
|
|
|
- public PoemsFeignResponse<UserProjectsInfoVO> getCurrentUserProjectsInfo(PoemsFeignBaseDTO poemsFeignBaseDTO){
|
|
|
+ public PoemsFeignResponse<UserProjectsInfoVO> getCurrentUserProjectsInfo(PoemsFeignBaseDTO poemsFeignBaseDTO) {
|
|
|
return saasWebClient.getCurrentUserProjectsInfo(JSON.toJSONString(poemsFeignBaseDTO));
|
|
|
}
|
|
|
|
|
@@ -90,7 +108,7 @@ public class SaasWebClientWrapper {
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/5/19 3:36 下午
|
|
|
*/
|
|
|
- public PoemsFeignResponse<UserPartitionProjectsInfoVO> getCurrentUserPartitionProjectsInfo(PoemsFeignBaseDTO poemsFeignBaseDTO){
|
|
|
+ public PoemsFeignResponse<UserPartitionProjectsInfoVO> getCurrentUserPartitionProjectsInfo(PoemsFeignBaseDTO poemsFeignBaseDTO) {
|
|
|
return saasWebClient.getCurrentUserPartitionProjectsInfo(JSON.toJSONString(poemsFeignBaseDTO));
|
|
|
}
|
|
|
|
|
@@ -102,7 +120,7 @@ public class SaasWebClientWrapper {
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/5/19 3:36 下午
|
|
|
*/
|
|
|
- public PoemsFeignResponse<FunctionTypeVO> getAllProjectFunctionTypes(PoemsFeignBaseDTO poemsFeignBaseDTO){
|
|
|
+ public PoemsFeignResponse<FunctionTypeVO> getAllProjectFunctionTypes(PoemsFeignBaseDTO poemsFeignBaseDTO) {
|
|
|
return saasWebClient.getAllProjectFunctionTypes(JSON.toJSONString(poemsFeignBaseDTO));
|
|
|
}
|
|
|
}
|