Commit e94ee362 authored by ZWT's avatar ZWT

feat(能源管理系统): 基础信息配置

1.修改基础信息配置--输电线路配置模块查询井口列表接口,增加返回结果参数,修改查询逻辑,完成接口冒烟测试同时修改接口文档;
2.修改基础信息配置模块业务工具类,增加匹配查询字典名称方法;
3.修改基础信息配置模块业务工具类,增加匹配查询地区名称方法;
4.修改基础信息配置模块业务工具类,增加匹配查询组织名称方法;
5.修改基础信息配置--市电峰谷配置模块详情接口,增加时段类型值返回结果字段;
6.修改基础信息配置--市电峰谷配置模块表结构字段类型,同时更新相应代码,修改部分接口业务处理逻辑,重新完成接口冒烟测试;
7.修改基础信息配置--输电线路配置模块表结构字段类型,同时更新相应代码,修改部分接口业务处理逻辑,重新完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 43362550
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import org.apache.commons.lang3.StringUtils;
import pps.cloud.system.service.data.GetOuListTreeOutput;
import pps.cloud.system.service.data.QuerySysDictionaryViewOutput;
import pps.core.base.entity.*;
import pps.core.base.mapper.*;
......@@ -38,6 +39,7 @@ import xstartup.helper.XTransactionHelper;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 输电线路配置模块
......@@ -224,11 +226,23 @@ public class BasePowerLineService {
PageInfo<BasePowerLineView> pageInfo = new PageInfo<>(list);
List<QueryBasePowerLineViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QueryBasePowerLineViewOutput.class);
if (CollUtil.isNotEmpty(outputs)) {
String ouName = DictUtils.getSysOrgNameById(context, input.getOuId());
List<GetOuListTreeOutput> ouInfos = DictUtils.getOuListByOuIds(
context,
outputs.stream()
.map(QueryBasePowerLineViewOutput::getOuId)
.distinct()
.collect(Collectors.toList())
);
List<QuerySysDictionaryViewOutput> gridTypeList = DictUtils.getDictList(context, DictTypeConstant.GRID_TYPE);
List<QuerySysDictionaryViewOutput> lineTypeList = DictUtils.getDictList(context, DictTypeConstant.LINE_TYPE);
for (QueryBasePowerLineViewOutput output : outputs) {
output.setOuName(ouName);
output.setOuName(
ouInfos.stream()
.filter(row -> StringUtils.equals(row.getOuId(), output.getOuId()))
.map(GetOuListTreeOutput::getOuName)
.findAny()
.orElse(null)
);
output.setGridTypeName(
DictUtils.getDicNameByStream(gridTypeList, output.getGridTypeKey())
);
......
......@@ -89,6 +89,23 @@ public class DictUtils {
return listByOuIdResult.stream().map(GetSysOrganizationViewOutput::getId).collect(Collectors.toList());
}
/**
* 通过组织机构ID集合获取详情列表
*
* @param context 上下文
* @param ouIds ou id
* @return {@link List}<{@link GetOuListTreeOutput}>
*/
public static List<GetOuListTreeOutput> getOuListByOuIds(XContext context, List<String> ouIds) {
GetOuListByOuIdsInput input = new GetOuListByOuIdsInput();
input.setOuIdList(ouIds);
SysOrganizationCloudService organizationCloudService = context.getBean(SysOrganizationCloudService.class);
XListResult<GetOuListTreeOutput> ouListByOuIds = organizationCloudService.getOuListByOuIds(context, input);
ouListByOuIds.throwIfFail();
return ouListByOuIds.getResult();
}
/*-------------------------其他-------------------------*/
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment