1.解决台账数据缺少变电站个别信息
2.解决技术监督台账管理终端信息 3.增加全景展示稳态9指标数据
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
inner join pq_line substation on dev.pid = substation.id
|
||||
inner join pq_substation sub on sub.id = substation.id
|
||||
left join pq_substation sub on sub.id = substation.id
|
||||
where device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
and device.Run_Flag = 0
|
||||
|
||||
@@ -308,42 +308,46 @@
|
||||
FROM
|
||||
pq_line t1,
|
||||
pq_device t2
|
||||
WHERE
|
||||
t1.id = t2.id
|
||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||
AND t2.Dev_Model in
|
||||
<foreach collection="deviceType.devModel" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.runFlag!=null and deviceType.runFlag.size()!=0">
|
||||
AND t2.Run_Flag in
|
||||
<foreach collection="deviceType.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.dataType!=null and deviceType.dataType.size()!=0">
|
||||
AND t2.Dev_Data_Type in
|
||||
<foreach collection="deviceType.dataType" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.comFlag!=null and deviceType.comFlag.size()!=0">
|
||||
AND t2.Com_Flag in
|
||||
<foreach collection="deviceType.comFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="manufacturer!=null and manufacturer.size()!=0">
|
||||
AND t2.manufacturer in
|
||||
<foreach collection="manufacturer" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
AND t1.id IN
|
||||
<foreach collection="devIds" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<where>
|
||||
t1.id = t2.id
|
||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||
AND t2.Dev_Model in
|
||||
<foreach collection="deviceType.devModel" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.runFlag!=null and deviceType.runFlag.size()!=0">
|
||||
AND t2.Run_Flag in
|
||||
<foreach collection="deviceType.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.dataType!=null and deviceType.dataType.size()!=0">
|
||||
AND t2.Dev_Data_Type in
|
||||
<foreach collection="deviceType.dataType" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.comFlag!=null and deviceType.comFlag.size()!=0">
|
||||
AND t2.Com_Flag in
|
||||
<foreach collection="deviceType.comFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="manufacturer!=null and manufacturer.size()!=0">
|
||||
AND t2.manufacturer in
|
||||
<foreach collection="manufacturer" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="devIds!=null and devIds.size()!=0">
|
||||
AND t1.id IN
|
||||
<foreach collection="devIds" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
@@ -353,19 +357,25 @@
|
||||
from
|
||||
pq_line t1 ,
|
||||
pq_voltage t2
|
||||
where
|
||||
t1.id = t2.id
|
||||
and
|
||||
t1.id in
|
||||
<foreach collection="voltageIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="scale!=null and scale.size()!=0">
|
||||
AND t2.scale in
|
||||
<foreach collection="scale" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
<where>
|
||||
t1.id = t2.id
|
||||
<if test="voltageIds!=null and voltageIds.size()!=0">
|
||||
and t1.id in
|
||||
<foreach collection="voltageIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="scale!=null and scale.size()!=0">
|
||||
AND t2.scale in
|
||||
<foreach collection="scale" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getVoltageIdByScale" resultType="String">
|
||||
@@ -1728,21 +1738,22 @@
|
||||
select
|
||||
t1.*
|
||||
from
|
||||
pq_line t1 ,
|
||||
pq_substation t2
|
||||
where
|
||||
t1.id = t2.id
|
||||
and
|
||||
t1.id in
|
||||
<foreach collection="subIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="scale!=null and scale.size()!=0">
|
||||
AND t2.scale in
|
||||
<foreach collection="scale" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
pq_line t1
|
||||
left join pq_substation t2 on t1.id = t2.id
|
||||
<where>
|
||||
<if test="subIds!=null and subIds.size()!=0">
|
||||
AND t1.id in
|
||||
<foreach collection="subIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="scale!=null and scale.size()!=0">
|
||||
AND t2.scale in
|
||||
<foreach collection="scale" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectByName" resultType="com.njcn.device.pq.pojo.po.LineDetail">
|
||||
select
|
||||
|
||||
@@ -282,6 +282,9 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
@Override
|
||||
public Map<String, Long> getGridDiagramDevTendency(GridDiagramParam param, Integer type) {
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
if(type==3){
|
||||
param.getDeviceInfoParam().setPowerFlag(0);
|
||||
}
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
Map<String, Long> map = new LinkedHashMap<>();
|
||||
DateField dateField;
|
||||
@@ -312,13 +315,29 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<Line> list = lineService.list(new LambdaQueryWrapper<Line>().in(CollUtil.isNotEmpty(ids), Line::getId, ids).eq(Line::getState, DataStateEnum.ENABLE.getCode()).eq(Line::getLevel, type));
|
||||
times = list.stream().map(x -> Date.from(x.getCreateTime().atZone(ZoneId.systemDefault()).toInstant())).collect(Collectors.toList());
|
||||
}
|
||||
for (DateTime dateTime : dateTimes) {
|
||||
if (1 == param.getType()) {
|
||||
long count = times.stream().filter(x -> DateUtil.isIn(x, DateUtil.beginOfYear(dateTime), DateUtil.endOfYear(dateTime))).count();
|
||||
map.put(dateTime.toString().substring(0, 4), count);
|
||||
} else {
|
||||
long count = times.stream().filter(x -> DateUtil.isIn(x, DateUtil.beginOfMonth(dateTime), DateUtil.endOfMonth(dateTime))).count();
|
||||
map.put(dateTime.toString().substring(0, 7), count);
|
||||
long num =0;
|
||||
for (int i = 0; i < dateTimes.size(); i++) {
|
||||
if(i==0){
|
||||
if (1 == param.getType()) {
|
||||
long count = times.stream().filter(x -> DateUtil.isIn(x, DateUtil.beginOfYear(DateUtil.parse("1970-01-01 00:00:00")), DateUtil.endOfYear(dateTimes.get(0)))).count();
|
||||
num=num+count;
|
||||
map.put(dateTimes.get(0).toString().substring(0, 4), num);
|
||||
} else {
|
||||
long count = times.stream().filter(x -> DateUtil.isIn(x, DateUtil.beginOfYear(DateUtil.parse("1970-01-01 00:00:00")), DateUtil.endOfMonth(dateTimes.get(0)))).count();
|
||||
num=num+count;
|
||||
map.put(dateTimes.get(0).toString().substring(0, 7), num);
|
||||
}
|
||||
}else{
|
||||
int finalI = i;
|
||||
if (1 == param.getType()) {
|
||||
long count = times.stream().filter(x -> DateUtil.isIn(x, DateUtil.beginOfYear(dateTimes.get(finalI)), DateUtil.endOfYear(dateTimes.get(finalI)))).count();
|
||||
num=num+count;
|
||||
map.put(dateTimes.get(finalI).toString().substring(0, 4), num);
|
||||
} else {
|
||||
long count = times.stream().filter(x -> DateUtil.isIn(x, DateUtil.beginOfMonth(dateTimes.get(finalI)), DateUtil.endOfMonth(dateTimes.get(finalI)))).count();
|
||||
num=num+count;
|
||||
map.put(dateTimes.get(finalI).toString().substring(0, 7), num);
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
@@ -118,6 +118,11 @@ public class RunManageServiceImpl implements RunManageService {
|
||||
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
||||
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
|
||||
deviceInfoParam.setServerName("pqs-common");
|
||||
if(CollUtil.isNotEmpty(runManageParam.getRunFlag())){
|
||||
if(runManageParam.getRunFlag().get(0)==0){
|
||||
deviceInfoParam.setLineRunFlag(0);
|
||||
}
|
||||
}
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, runManageParam.getRunFlag(), Stream.of(1).collect(Collectors.toList()));
|
||||
if (CollectionUtils.isEmpty(generalDeviceDTOList)) {
|
||||
throw new BusinessException("当前部门没有装置台账");
|
||||
|
||||
Reference in New Issue
Block a user