1.数据完整性列表调整
2.区域电能质量评估列表调整 3.调整监测点台账列表顺序 4.删除灿能电力字样 5.调整loge和ico图标 6.调整概览首页在线率和完整率数据 7.调整设备树的查询方式
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.njcn.pojo.configuration.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.session.Session;
|
||||
@@ -530,14 +531,14 @@ public class UserUtil {
|
||||
return ag;
|
||||
}
|
||||
|
||||
public List<AreaGeneralData> getAreaGeneralRun(Integer devFlag,String deptId) {
|
||||
public List<AreaGeneralData> getAreaGeneralRun(Integer devFlag,String deptId,Integer powerId) {
|
||||
List<AreaGeneralData> ag;
|
||||
Depts depts = getDeptsByIndex(deptId);
|
||||
DeviceType deviceType = getOnLineDeviceType();
|
||||
if (null == depts) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
ag = getAreaDatas(depts, deviceType, devFlag);
|
||||
ag = getAreaPowerIdData(depts, deviceType, devFlag,powerId);
|
||||
return ag;
|
||||
}
|
||||
|
||||
@@ -644,6 +645,63 @@ public class UserUtil {
|
||||
return ag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dept 部门 只统计在线装置 且投运状态
|
||||
* 1:判断该部门有没有直接子部门
|
||||
* 2:根据有效部门获取部门对应的各项信息
|
||||
*/
|
||||
private List<AreaGeneralData> getAreaPowerIdData(Depts dept, DeviceType deviceType, Integer devFlag,Integer powerId) {
|
||||
List<AreaGeneralData> ag = new ArrayList<>();
|
||||
try {
|
||||
List<Depts> depts = getDirectDeptsByNode(dept.getDeptsIndex());
|
||||
if (CollectionUtils.isEmpty(depts)) {
|
||||
//则只获取当前部门下的所有信息
|
||||
ag.add(getAreaPowerIdDept(dept, deviceType, devFlag,powerId));
|
||||
} else {
|
||||
//返回当前用户下所有子部门的信息
|
||||
for (Depts deptsTemp : depts) {
|
||||
ag.add(getAreaPowerIdDept(deptsTemp, deviceType, devFlag,powerId));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
return ag;
|
||||
}
|
||||
/**
|
||||
* 获取部门下详细信息(监测点性质)
|
||||
*
|
||||
* @param dept 部门
|
||||
*/
|
||||
private AreaGeneralData getAreaPowerIdDept(Depts dept, DeviceType deviceType, Integer devicdStatus,Integer powerId) {
|
||||
AreaGeneralData areaGeneralData = new AreaGeneralData();
|
||||
if (dept.getCustomDept() == 0) {
|
||||
areaGeneralData.setName(dept.getArea());
|
||||
} else {
|
||||
areaGeneralData.setName(dept.getDeptsName());
|
||||
}
|
||||
areaGeneralData.setDeptIndex(dept.getDeptsIndex());
|
||||
String sysType = getSysType().equals(ProjectEnum.APP.getKey()) ? null : getSysType();
|
||||
List<IndexsCount> indexsCountsByDept = deptsLineMapper.selectIndexsPowerIdByDeptRun(Arrays.asList(dept.getDeptsIndex()), sysType, deviceType.getDevModel(), deviceType.getDataType(), devicdStatus,null,powerId);
|
||||
if (CollectionUtils.isEmpty(indexsCountsByDept)) {
|
||||
//如果该部门没有任何的监测点关联,有可能是因为其是父节点(程序默认,当存在子节点时,当前部门节点不可绑定监测点)
|
||||
List<Depts> depts = getDeptsByNode(dept.getDeptsIndex());
|
||||
if (CollectionUtils.isEmpty(depts)) {
|
||||
areaGeneralData.setMonitors(0);
|
||||
} else {
|
||||
List<String> deptIds = depts.stream().map(Depts::getDeptsIndex).collect(Collectors.toList());
|
||||
List<IndexsCount> indexsCountsByDepts = deptsLineMapper.selectIndexsPowerIdByDeptRun(deptIds, sysType, deviceType.getDevModel(), deviceType.getDataType(), devicdStatus,null,powerId);
|
||||
if (CollectionUtils.isEmpty(indexsCountsByDepts)) {
|
||||
areaGeneralData.setMonitors(0);
|
||||
} else {
|
||||
areaGeneralData = filtIndexData(indexsCountsByDepts, areaGeneralData);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
areaGeneralData = filtIndexData(indexsCountsByDept, areaGeneralData);
|
||||
}
|
||||
return areaGeneralData;
|
||||
}
|
||||
private List<AreaGeneralData> getDeptsDatas(Depts dept, DeviceType deviceType, Integer devStatus) {
|
||||
List<AreaGeneralData> ag = new ArrayList<>();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user