设备监控代码提交(临时)
This commit is contained in:
@@ -15,5 +15,6 @@ public interface DataParam {
|
|||||||
List<String> phases = Stream.of("A","B","C","T").collect(Collectors.toList());
|
List<String> phases = Stream.of("A","B","C","T").collect(Collectors.toList());
|
||||||
List<String> statMethods = Stream.of("avg","max","min","cp95").collect(Collectors.toList());
|
List<String> statMethods = Stream.of("avg","max","min","cp95").collect(Collectors.toList());
|
||||||
long FILE_SIZE = 10 * 1024 * 1024;
|
long FILE_SIZE = 10 * 1024 * 1024;
|
||||||
|
//便携式设备编码(用于某些业务判断)
|
||||||
|
String portableDevType = "8b45cf6b7f5266e777d07c166ad5fa77";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,33 +12,21 @@ import java.util.List;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class WlRecordPageParam extends BaseParam {
|
public class WlRecordPageParam extends BaseParam {
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试项ID
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value="测试项ID")
|
@ApiModelProperty(value="测试项ID")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试项ID
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value="是否匹配测试项ID")
|
@ApiModelProperty(value="是否匹配测试项ID")
|
||||||
private Integer isTrueFlag;
|
private Integer isTrueFlag;
|
||||||
|
|
||||||
/**
|
@ApiModelProperty(value="添加设备时左侧的监测点ID")
|
||||||
* 添加设备时左侧的设备或测点ID
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value="添加设备时左侧的设备或测点ID")
|
|
||||||
private List<String> treeIds = new ArrayList<>();
|
private List<String> treeIds = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加测试项的时候顺便添加基础数据列表要排除临时已经添加的基础设备数据
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value="添加测试项的时候顺便添加基础数据列表要排除临时已经添加的基础设备数据")
|
@ApiModelProperty(value="添加测试项的时候顺便添加基础数据列表要排除临时已经添加的基础设备数据")
|
||||||
private List<String> isBandIds = new ArrayList<>();
|
private List<String> isBandIds = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
@ApiModelProperty(value="添加设备时左侧的设备ID")
|
||||||
* 关键字多个匹配
|
private List<String> pIds = new ArrayList<>();
|
||||||
*/
|
|
||||||
@ApiModelProperty(value="关键字多个匹配")
|
@ApiModelProperty(value="关键字多个匹配")
|
||||||
private String searchText;
|
private String searchText;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @date 2023/6/19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DataGroupEventVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty("事件ID")
|
||||||
|
private String eventId;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("工程名称")
|
||||||
|
private String gcName;
|
||||||
|
|
||||||
|
@ApiModelProperty("测试项名称")
|
||||||
|
private String itemName;
|
||||||
|
|
||||||
|
@ApiModelProperty("持续时间")
|
||||||
|
private Double persistTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("发生时刻")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
private String tag;
|
||||||
|
@ApiModelProperty("事件描述")
|
||||||
|
private String showName;
|
||||||
|
|
||||||
|
@ApiModelProperty("相别")
|
||||||
|
private String phaseType;
|
||||||
|
|
||||||
|
@ApiModelProperty("暂降幅值")
|
||||||
|
private Float amplitude;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -32,5 +32,8 @@ public class RecordAllDevTreeVo {
|
|||||||
@ApiModelProperty("线路名称")
|
@ApiModelProperty("线路名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("设备ID")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,6 +154,12 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>event-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.DeviceOperate;
|
import com.njcn.csdevice.enums.DeviceOperate;
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
import com.njcn.csdevice.pojo.param.*;
|
import com.njcn.csdevice.pojo.param.*;
|
||||||
@@ -164,7 +165,7 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
Page<CsEquipmentDeliveryVO> page = csEquipmentDeliveryService.list(param);
|
Page<CsEquipmentDeliveryVO> page = csEquipmentDeliveryService.list(param);
|
||||||
//新增逻辑(只针对便携式设备):修改设备中的未注册状态(status = 1)改为5(前端定义的字典也即未接入)
|
//新增逻辑(只针对便携式设备):修改设备中的未注册状态(status = 1)改为5(前端定义的字典也即未接入)
|
||||||
for(CsEquipmentDeliveryVO csEquipmentDeliveryVO : page.getRecords()){
|
for(CsEquipmentDeliveryVO csEquipmentDeliveryVO : page.getRecords()){
|
||||||
if("8b45cf6b7f5266e777d07c166ad5fa77".equals(csEquipmentDeliveryVO.getDevType()) && csEquipmentDeliveryVO.getStatus() == 1){
|
if(DataParam.portableDevType.equals(csEquipmentDeliveryVO.getDevType()) && csEquipmentDeliveryVO.getStatus() == 1){
|
||||||
csEquipmentDeliveryVO.setStatus(5);
|
csEquipmentDeliveryVO.setStatus(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.csdevice.pojo.po.CsGroup;
|
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -25,4 +26,6 @@ public interface CsGroupMapper extends BaseMapper<CsGroup> {
|
|||||||
List<CsGroupVO> getArrayData(@Param("list") List<String> list);
|
List<CsGroupVO> getArrayData(@Param("list") List<String> list);
|
||||||
|
|
||||||
Page<DataGroupTemplateVO> getGroupDataList(IPage<DataGroupTemplateVO> page, @Param("id") String id, @Param("searchValue") String searchValue);
|
Page<DataGroupTemplateVO> getGroupDataList(IPage<DataGroupTemplateVO> page, @Param("id") String id, @Param("searchValue") String searchValue);
|
||||||
|
|
||||||
|
Page<DataGroupEventVO> getGroupEventList(IPage<DataGroupEventVO> page, @Param("id") String id, @Param("searchValue") String searchValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,4 +75,19 @@
|
|||||||
order by sort
|
order by sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getGroupEventList" resultType="com.njcn.csdevice.pojo.vo.DataGroupEventVO">
|
||||||
|
select REPLACE(UUID(),'-','') as id, ce.id as eventId,
|
||||||
|
w1.item_name as projectName,w4.gc_name as gcName,
|
||||||
|
w4.item_name as itemName,ce.persist_time as persistTime,ce.start_time as startTime,
|
||||||
|
ce.tag
|
||||||
|
from (select id,item_name,state from wl_record where type = 0 and p_id is null) w1
|
||||||
|
inner join (select id,p_id,state from wl_record where type = 0 and p_id is not null) w2 on w1.id = w2.p_id
|
||||||
|
inner join wl_record_test_data w3 on w2.id = w3.test_item_id
|
||||||
|
inner join wl_record w4 on w3.data_id = w4.id
|
||||||
|
inner join cs_event ce on w4.dev_id = ce.device_id and w4.line_id = ce.line_id
|
||||||
|
where ce.type = 0 and w1.state = 1 and w2.state = 1 and w4.state = 1
|
||||||
|
and ce.device_id = '893446032df751a48683a662691265e6' and ce.line_id = '0008C0A801C81'
|
||||||
|
order by w1.item_name
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -24,17 +24,17 @@
|
|||||||
and not exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and a.id = wd.data_id)
|
and not exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and a.id = wd.data_id)
|
||||||
</if>
|
</if>
|
||||||
<if test="wlRecordPageParam.treeIds != null and wlRecordPageParam.treeIds.size() > 0">
|
<if test="wlRecordPageParam.treeIds != null and wlRecordPageParam.treeIds.size() > 0">
|
||||||
and
|
and a.line_id in
|
||||||
(
|
|
||||||
a.dev_id in
|
|
||||||
<foreach collection="wlRecordPageParam.treeIds" index="index" item="item" open="(" separator="," close=")">
|
<foreach collection="wlRecordPageParam.treeIds" index="index" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
or a.line_id in
|
|
||||||
<foreach collection="wlRecordPageParam.treeIds" index="index" item="item" open="(" separator="," close=")">
|
</if>
|
||||||
|
<if test="wlRecordPageParam.pIds != null and wlRecordPageParam.pIds.size() > 0">
|
||||||
|
and a.dev_id in
|
||||||
|
<foreach collection="wlRecordPageParam.pIds" index="index" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
|
||||||
</if>
|
</if>
|
||||||
<if test="wlRecordPageParam.searchText != null and wlRecordPageParam.searchText != ''">
|
<if test="wlRecordPageParam.searchText != null and wlRecordPageParam.searchText != ''">
|
||||||
and (b.name like concat('%',#{wlRecordPageParam.searchText},'%')
|
and (b.name like concat('%',#{wlRecordPageParam.searchText},'%')
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRecordAllLine" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllLineTreeVo">
|
<select id="getRecordAllLine" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllLineTreeVo">
|
||||||
select a.line_id as id,c.name as name from wl_record a
|
select a.line_id as id,c.name as name, #{devId} as pid from wl_record a
|
||||||
left join cs_line c on a.line_id = c.line_id
|
left join cs_line c on a.line_id = c.line_id
|
||||||
where a.type=1 and a.state =1 and a.dev_id=#{devId}
|
where a.type=1 and a.state =1 and a.dev_id=#{devId}
|
||||||
group by a.line_id,c.name having a.line_id is not null and c.name is not null
|
group by a.line_id,c.name having a.line_id is not null and c.name is not null
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||||
import com.njcn.csdevice.pojo.param.*;
|
import com.njcn.csdevice.pojo.param.*;
|
||||||
@@ -355,6 +356,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
dataSetVo2.setName("历史" + item.getAnotherName());
|
dataSetVo2.setName("历史" + item.getAnotherName());
|
||||||
dataSetVo2.setType("history");
|
dataSetVo2.setType("history");
|
||||||
dataSetList.add(dataSetVo2);
|
dataSetList.add(dataSetVo2);
|
||||||
|
//下面这些tab仅仅只限于设备监控的便携式设备才会有
|
||||||
|
if(DataParam.portableDevType.equals(csEquipmentDeliveryPo.getDevType())){
|
||||||
//趋势数据tab
|
//趋势数据tab
|
||||||
DeviceManagerVO.DataSetVO dataSetVo3 = new DeviceManagerVO.DataSetVO();
|
DeviceManagerVO.DataSetVO dataSetVo3 = new DeviceManagerVO.DataSetVO();
|
||||||
dataSetVo3.setId(item.getId());
|
dataSetVo3.setId(item.getId());
|
||||||
@@ -375,6 +378,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
dataSetList.add(dataSetVo5);
|
dataSetList.add(dataSetVo5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
deviceManagerVo.setDataSetList(dataSetList);
|
deviceManagerVo.setDataSetList(dataSetList);
|
||||||
deviceManagerVo.setTime(csLinePOService.findByNdid(csEquipmentDeliveryPo.getNdid()).get(0).getCreateTime());
|
deviceManagerVo.setTime(csLinePOService.findByNdid(csEquipmentDeliveryPo.getNdid()).get(0).getCreateTime());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
@@ -20,25 +21,31 @@ import com.njcn.csdevice.pojo.po.CsGroArr;
|
|||||||
import com.njcn.csdevice.pojo.po.CsGroup;
|
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csdevice.pojo.vo.EnergyTemplateVO;
|
import com.njcn.csdevice.pojo.vo.EnergyTemplateVO;
|
||||||
import com.njcn.csdevice.service.ICsDataArrayService;
|
import com.njcn.csdevice.service.ICsDataArrayService;
|
||||||
import com.njcn.csdevice.service.ICsGroupService;
|
import com.njcn.csdevice.service.ICsGroupService;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
|
import com.njcn.event.api.EventDetailFeignClient;
|
||||||
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||||
|
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
import com.njcn.influx.service.CommonService;
|
import com.njcn.influx.service.CommonService;
|
||||||
|
import com.njcn.influx.service.EvtDataService;
|
||||||
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.api.EleEvtFeignClient;
|
||||||
import com.njcn.system.api.EpdFeignClient;
|
import com.njcn.system.api.EpdFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import com.njcn.system.pojo.po.EleEvtParm;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
@@ -79,8 +86,14 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
|
|
||||||
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||||
|
|
||||||
|
private final EvtDataService evtDataService;
|
||||||
|
|
||||||
|
private final EventDetailFeignClient eventDetailFeignClient;
|
||||||
|
|
||||||
private final DecimalFormat df = new DecimalFormat("#0.0000");
|
private final DecimalFormat df = new DecimalFormat("#0.0000");
|
||||||
|
|
||||||
|
private final EleEvtFeignClient eleEvtFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public List<CsGroupVO> getGroupData(String dataSet) {
|
public List<CsGroupVO> getGroupData(String dataSet) {
|
||||||
@@ -253,7 +266,6 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
commonQueryParam.setDataType(valueType.toString());
|
commonQueryParam.setDataType(valueType.toString());
|
||||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||||
commonQueryParam.setClDid(getClDidByLineId(temp.getLineId()));
|
commonQueryParam.setClDid(getClDidByLineId(temp.getLineId()));
|
||||||
|
|
||||||
return commonQueryParam;
|
return commonQueryParam;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||||
@@ -278,8 +290,54 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
return result;
|
return result;
|
||||||
}else if("2".equals(type.toString())){
|
}else if("2".equals(type.toString())){
|
||||||
//传2 则是实时数据tab页面
|
//传2 则是实时数据tab页面
|
||||||
|
|
||||||
}else if("3".equals(type.toString())){
|
}else if("3".equals(type.toString())){
|
||||||
//传2 则是暂态事件tab页面
|
//传3 则是暂态事件tab页面
|
||||||
|
Object pageNum = map.get("pageNum");
|
||||||
|
Object pageSize = map.get("pageSize");
|
||||||
|
Object devId = map.get("devId");
|
||||||
|
Object lineId = map.get("lineId");
|
||||||
|
if (devId == null) throw new BusinessException("devId参数缺失!");
|
||||||
|
if (lineId == null) throw new BusinessException("lineId参数缺失!");
|
||||||
|
if (pageNum == null) throw new BusinessException("pageNum参数缺失!");
|
||||||
|
if (pageSize == null) throw new BusinessException("pageSize参数缺失!");
|
||||||
|
Page<DataGroupEventVO> returnpage = new Page<> (Integer.parseInt(pageNum.toString()),Integer.parseInt(pageSize.toString()));
|
||||||
|
returnpage = this.getBaseMapper().getGroupEventList(returnpage,devId.toString(),lineId.toString());
|
||||||
|
returnpage.getRecords().forEach(temp->{
|
||||||
|
//事件描述、相别、暂降幅值,需要特殊处理赋值
|
||||||
|
//事件描述
|
||||||
|
EleEpdPqd ele = epdFeignClient.findByName(temp.getTag()).getData();
|
||||||
|
if(ele!=null){
|
||||||
|
temp.setShowName(ele.getShowName());
|
||||||
|
//相别
|
||||||
|
List<EleEvtParm> data1 = eleEvtFeignClient.queryByPid(ele.getId()).getData();
|
||||||
|
List<EventDataSetDTO> eventDataSetDTOS = new ArrayList<>();
|
||||||
|
for (EleEvtParm eleEvtParm : data1) {
|
||||||
|
EventDataSetDTO eventDataSetDTO = new EventDataSetDTO();
|
||||||
|
BeanUtils.copyProperties(eleEvtParm,eventDataSetDTO);
|
||||||
|
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
|
||||||
|
if (evtData == null) {
|
||||||
|
eventDataSetDTO.setValue("-");
|
||||||
|
}else {
|
||||||
|
eventDataSetDTO.setValue(Optional.ofNullable(evtData.getValue()).orElse("-"));
|
||||||
|
|
||||||
|
}
|
||||||
|
eventDataSetDTOS.add(eventDataSetDTO);
|
||||||
|
}
|
||||||
|
List<EventDataSetDTO> evtParamPhase = eventDataSetDTOS.stream().
|
||||||
|
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), "Evt_Param_Phase")).
|
||||||
|
collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isEmpty(evtParamPhase)){
|
||||||
|
temp.setPhaseType("-");
|
||||||
|
}else {
|
||||||
|
temp.setPhaseType(evtParamPhase.get(0).getValue()+(Objects.isNull(evtParamPhase.get(0).getUnit())?"":evtParamPhase.get(0).getUnit()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//暂降幅值
|
||||||
|
List<RmpEventDetailPO> eventDetails = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(temp.getEventId())).getData();
|
||||||
|
if(eventDetails !=null && !eventDetails.isEmpty()) temp.setAmplitude(PubUtils.floatRound(2, eventDetails.get(0).getFeatureAmplitude().floatValue()));
|
||||||
|
});
|
||||||
|
return returnpage;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryPage(WlRecordPageParam wlRecordPageParam) {
|
public Object queryPage(WlRecordPageParam wlRecordPageParam) {
|
||||||
//根据isTrueFlag及treeIds判断返回的数据集
|
//如果没有分页请求则直接返回tree
|
||||||
if(wlRecordPageParam.getIsTrueFlag()!=1 && wlRecordPageParam.getTreeIds().isEmpty()){
|
if(wlRecordPageParam.getPageNum() == null){
|
||||||
//组装tree用于测试项绑定数据页面左侧的搜索树
|
//组装tree用于测试项绑定数据页面左侧的搜索树
|
||||||
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll();
|
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll();
|
||||||
for (RecordAllDevTreeVo recordAllDevTreeVo : recordAllDevTreeVos){
|
for (RecordAllDevTreeVo recordAllDevTreeVo : recordAllDevTreeVos){
|
||||||
@@ -188,6 +188,10 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
Page<RecordPageVo> returnpage = new Page<> (wlRecordPageParam.getPageNum(), wlRecordPageParam.getPageSize ());
|
Page<RecordPageVo> returnpage = new Page<> (wlRecordPageParam.getPageNum(), wlRecordPageParam.getPageSize ());
|
||||||
if(wlRecordPageParam.getSearchBeginTime()!=null) wlRecordPageParam.setSearchBeginTime(wlRecordPageParam.getSearchBeginTime()+" 00:00:00");
|
if(wlRecordPageParam.getSearchBeginTime()!=null) wlRecordPageParam.setSearchBeginTime(wlRecordPageParam.getSearchBeginTime()+" 00:00:00");
|
||||||
if(wlRecordPageParam.getSearchEndTime()!=null) wlRecordPageParam.setSearchEndTime(wlRecordPageParam.getSearchEndTime()+" 23:59:59");
|
if(wlRecordPageParam.getSearchEndTime()!=null) wlRecordPageParam.setSearchEndTime(wlRecordPageParam.getSearchEndTime()+" 23:59:59");
|
||||||
|
if(wlRecordPageParam.getIsTrueFlag() == 0 && wlRecordPageParam.getTreeIds().isEmpty()){
|
||||||
|
wlRecordPageParam.setTreeIds(new ArrayList<>());
|
||||||
|
wlRecordPageParam.getTreeIds().add("-1");
|
||||||
|
}
|
||||||
returnpage = this.getBaseMapper().queryPage(returnpage,wlRecordPageParam);
|
returnpage = this.getBaseMapper().queryPage(returnpage,wlRecordPageParam);
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
@@ -311,11 +315,10 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(wl.getDevId()).collect(Collectors.toList())).getData();
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(wl.getDevId()).collect(Collectors.toList())).getData();
|
||||||
//获取指标下的具体分类指标
|
//获取指标下的具体分类指标
|
||||||
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(commonStatisticalQueryParam.getStatisticalId()).getData();
|
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||||
List<CommonQueryParam> commonQueryParams = new ArrayList<>();
|
eleEpdPqds.forEach(epdPqd->{
|
||||||
for(EleEpdPqd epdPqd : eleEpdPqds){
|
List<CommonQueryParam> commonQueryParams = finalCsLinePOList.stream().map(temp -> {
|
||||||
commonQueryParams.clear();
|
|
||||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||||
commonQueryParam.setLineId(wl.getLineId());
|
commonQueryParam.setLineId(temp.getLineId());
|
||||||
commonQueryParam.setTableName(getTableNameByClassId(epdPqd.getClassId()));
|
commonQueryParam.setTableName(getTableNameByClassId(epdPqd.getClassId()));
|
||||||
commonQueryParam.setColumnName(epdPqd.getName()+ frequency);
|
commonQueryParam.setColumnName(epdPqd.getName()+ frequency);
|
||||||
commonQueryParam.setPhasic(epdPqd.getPhase());
|
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||||
@@ -323,14 +326,15 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
commonQueryParam.setEndTime(LocalDateTimeUtil.format(wl.getEndTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
commonQueryParam.setEndTime(LocalDateTimeUtil.format(wl.getEndTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||||
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
||||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||||
commonQueryParam.setClDid(getClDidByLineId(wl.getLineId()));
|
commonQueryParam.setClDid(getClDidByLineId(temp.getLineId()));
|
||||||
commonQueryParams.add(commonQueryParam);
|
return commonQueryParam;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
ThdDataVO vo = new ThdDataVO();
|
ThdDataVO vo = new ThdDataVO();
|
||||||
vo.setLineId(temp.getLineId());
|
vo.setLineId(temp.getLineId());
|
||||||
vo.setPhase(temp.getPhaseType());
|
vo.setPhase(temp.getPhaseType());
|
||||||
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(wl.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
vo.setPosition(position);
|
vo.setPosition(position);
|
||||||
vo.setTime(temp.getTime());
|
vo.setTime(temp.getTime());
|
||||||
vo.setStatMethod(temp.getValueType());
|
vo.setStatMethod(temp.getValueType());
|
||||||
@@ -342,7 +346,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
result.addAll(collect1);
|
result.addAll(collect1);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user