Commit a65128f6 authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改系统首页大屏总览接口,增加区分组织机构逻辑,完成接口冒烟测试;
2.修改系统首页获取井场列表接口,增加区分组织机构逻辑,完成接口冒烟测试;
3.修改系统首页井场功能下钻后提示报错问题,修改用电功率数据获取逻辑,修复报错问题;
4.修改输电线路分页列表查询接口,增加查询条件,在查询父线路列表时只查询10千伏线路,修改线上接口文档同时完成接口冒烟测试;
5.修改系统首页井场实时监控接口,增加区分组织机构逻辑,完成接口冒烟测试;
6.修改系统首页用能分析接口,增加区分组织机构逻辑,完成接口冒烟测试;
7.修改系统首页井场用能分析(双坐标轴)接口,增加区分组织机构逻辑,完成接口冒烟测试;
8.修改系统首页累积用电接口,增加区分组织机构逻辑,完成接口冒烟测试;
9.修改系统首页光伏实时监控接口,增加区分组织机构逻辑,完成接口冒烟测试;
10.修改系统首页井场效果评价接口,增加区分组织机构逻辑,完成接口冒烟测试;
11.修改系统首页先导实验井间开制度接口,增加区分组织机构逻辑,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 0ac45baf
package pps.core.system.module; package pps.core.system.module;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.ObjectUtils;
import pps.core.common.utils.ManifestComponentInfoHelper; import pps.core.common.utils.ManifestComponentInfoHelper;
import pps.core.system.cache.SysDictionaryCache; import pps.core.system.cache.SysDictionaryCache;
import pps.core.system.entity.SysDictionaryEnt; import pps.core.system.entity.SysDictionaryEnt;
...@@ -46,7 +47,7 @@ public class PpsCoreSystemModule extends XModule { ...@@ -46,7 +47,7 @@ public class PpsCoreSystemModule extends XModule {
List<SysDictionaryEnt> sysDictionarys = dictionaryMapper.selectList(new LambdaQueryWrapper<SysDictionaryEnt>() List<SysDictionaryEnt> sysDictionarys = dictionaryMapper.selectList(new LambdaQueryWrapper<SysDictionaryEnt>()
.isNotNull(SysDictionaryEnt::getAlias).gt(SysDictionaryEnt::getEndTime, DateUtil.date()) .isNotNull(SysDictionaryEnt::getAlias).gt(SysDictionaryEnt::getEndTime, DateUtil.date())
); );
sysDictionarys = sysDictionarys.stream().filter(p -> !CharSequenceUtil.equals("", p.getAlias())).collect(Collectors.toList()); sysDictionarys = sysDictionarys.stream().filter(p -> CharSequenceUtil.isNotBlank(p.getAlias())).collect(Collectors.toList());
for (SysDictionaryEnt dictObj : sysDictionarys) { for (SysDictionaryEnt dictObj : sysDictionarys) {
List<SysDictionaryCache> list = new ArrayList<>(); List<SysDictionaryCache> list = new ArrayList<>();
SysDictionaryCache dictMap = new SysDictionaryCache(); SysDictionaryCache dictMap = new SysDictionaryCache();
...@@ -62,13 +63,12 @@ public class PpsCoreSystemModule extends XModule { ...@@ -62,13 +63,12 @@ public class PpsCoreSystemModule extends XModule {
List<SysDictionaryEnt> sysDictionaryChilds = dictionaryMapper.selectList(new LambdaQueryWrapper<SysDictionaryEnt>() List<SysDictionaryEnt> sysDictionaryChilds = dictionaryMapper.selectList(new LambdaQueryWrapper<SysDictionaryEnt>()
.in(SysDictionaryEnt::getPid, dictIds).gt(SysDictionaryEnt::getEndTime, DateUtil.date()) .in(SysDictionaryEnt::getPid, dictIds).gt(SysDictionaryEnt::getEndTime, DateUtil.date())
); );
Set<String> aliasObjs = dictCashMap.keySet();
//放入到缓存map中 //放入到缓存map中
for (String aliasObj : aliasObjs) { for (String aliasObj : dictCashMap.keySet()) {
List<SysDictionaryCache> sysDictionaryCaches = dictCashMap.get(aliasObj); List<SysDictionaryCache> sysDictionaryCaches = dictCashMap.get(aliasObj);
Iterator<SysDictionaryCache> iterator = sysDictionaryCaches.iterator(); Iterator<SysDictionaryCache> iterator = sysDictionaryCaches.iterator();
if (iterator.hasNext()) { if (iterator.hasNext()) {
if (ObjectUtils.isNotEmpty(sysDictionaryChilds)) { if (CollUtil.isNotEmpty(sysDictionaryChilds)) {
SysDictionaryCache dict = iterator.next(); SysDictionaryCache dict = iterator.next();
for (SysDictionaryEnt dictChild : sysDictionaryChilds) { for (SysDictionaryEnt dictChild : sysDictionaryChilds) {
if (CharSequenceUtil.equals(dict.getId(), dictChild.getPid())) { if (CharSequenceUtil.equals(dict.getId(), dictChild.getPid())) {
...@@ -86,20 +86,19 @@ public class PpsCoreSystemModule extends XModule { ...@@ -86,20 +86,19 @@ public class PpsCoreSystemModule extends XModule {
size = dictIds.size(); size = dictIds.size();
} }
//放入到缓存redis //放入到缓存redis
Set<String> keys = dictCashMap.keySet(); for (String key : dictCashMap.keySet()) {
for (String key : keys) {
List<SysDictionaryCache> sysDictionaryCaches = dictCashMap.get(key); List<SysDictionaryCache> sysDictionaryCaches = dictCashMap.get(key);
SysDictionaryCache.deleteCache(context, key); SysDictionaryCache.deleteCache(context, key);
SysDictionaryCache.set(context, key, sysDictionaryCaches); SysDictionaryCache.set(context, key, sysDictionaryCaches);
} }
XThreadHelper.async(() -> this.fixDicPath(context)); XThreadHelper.async(() -> this.fixDicPath(context));
} }
private void fixDicPath(XContext context) { private void fixDicPath(XContext context) {
SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class);
List<SysDictionaryEnt> sysDictionaryEnts = mapper.selectList(new QueryWrapper<>()); List<SysDictionaryEnt> sysDictionaryEnts = mapper.selectList(new QueryWrapper<>());
final Map<String, SysDictionaryEnt> dics = sysDictionaryEnts.stream().collect(Collectors.toMap(SysDictionaryEnt::getId, Function.identity())); final Map<String, SysDictionaryEnt> dics = sysDictionaryEnts.stream()
.collect(Collectors.toMap(SysDictionaryEnt::getId, Function.identity()));
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sysDictionaryEnts.forEach(item -> { sysDictionaryEnts.forEach(item -> {
sb.setLength(0); sb.setLength(0);
...@@ -109,42 +108,34 @@ public class PpsCoreSystemModule extends XModule { ...@@ -109,42 +108,34 @@ public class PpsCoreSystemModule extends XModule {
if (CharSequenceUtil.isNotBlank(item.getDicPath())) { if (CharSequenceUtil.isNotBlank(item.getDicPath())) {
return; return;
} }
buildPath(dics, item.getPid(), sb); buildPath(dics, item.getPid(), sb);
String path = sb.toString(); String path = sb.toString();
if (CharSequenceUtil.isBlank(path)) { if (CharSequenceUtil.isBlank(path)) {
return; return;
} }
if (CharSequenceUtil.equals(path, item.getDicPath())) {
if (path.equals(item.getDicPath())) {
return; return;
} }
SysDictionaryEnt dicForUpdate = new SysDictionaryEnt(); SysDictionaryEnt dicForUpdate = new SysDictionaryEnt();
dicForUpdate.setId(item.getId()); dicForUpdate.setId(item.getId());
dicForUpdate.setDicPath(path); dicForUpdate.setDicPath(path);
mapper.updateById(dicForUpdate); mapper.updateById(dicForUpdate);
}); });
} }
private void buildPath(Map<String, SysDictionaryEnt> dics, String parentId, StringBuilder sb) { private void buildPath(Map<String, SysDictionaryEnt> dics, String parentId, StringBuilder sb) {
if (CharSequenceUtil.isBlank(parentId) || "1".equals(parentId)) { if (CharSequenceUtil.isBlank(parentId) || CharSequenceUtil.equals("1", parentId)) {
return; return;
} }
sb.insert(0, parentId); sb.insert(0, parentId);
sb.insert(0, "/"); sb.insert(0, "/");
if (!dics.containsKey(parentId)) { if (!dics.containsKey(parentId)) {
return; return;
} }
SysDictionaryEnt parent = dics.get(parentId); SysDictionaryEnt parent = dics.get(parentId);
if (parent == null) { if (ObjectUtil.isNull(parent)) {
return; return;
} }
buildPath(dics, parent.getPid(), sb); buildPath(dics, parent.getPid(), sb);
} }
} }
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