同步监测点上级变电站信息
This commit is contained in:
@@ -15,7 +15,7 @@ import com.njcn.oracle.bo.param.DataAsynParam;
|
||||
public interface PqsOnlineratePOService extends IService<PqsOnlineratePO>{
|
||||
|
||||
|
||||
void minutesDataBacthSysc(DataAsynParam dataAsynParam);
|
||||
void minutesDataBacthSysc(DataAsynParam dataAsynParam);
|
||||
|
||||
void AsyncData(DataAsynParam dataAsynParam);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class OracleToInfluxDBJob {
|
||||
}*/
|
||||
|
||||
//每小时03分钟时执行上一个小时的数据同步
|
||||
@Scheduled(cron="0/10 0 * * * ?")
|
||||
@Scheduled(cron="0 3 * * * ?")
|
||||
public void executeHours() {
|
||||
DataAsynParam dataAsynParam = new DataAsynParam();
|
||||
// 获取当前时间
|
||||
@@ -72,9 +72,6 @@ public class OracleToInfluxDBJob {
|
||||
DataAsynParam dataAsynParam = new DataAsynParam();
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
|
||||
|
||||
dataAsynParam.setStartDateTime(now);
|
||||
pqsOnlineratePOService.minutesDataBacthSysc(dataAsynParam);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -40,7 +39,7 @@ public class InfluxManufactServiceImpl implements IInfluxManufactService {
|
||||
|
||||
private final DataVMapper dataVMapper;
|
||||
|
||||
private final IDataIMapper dataIMapper;
|
||||
private final DataIMapper dataIMapper;
|
||||
|
||||
private final DataInHarmVMapper dataInHarmVMapper;
|
||||
|
||||
@@ -162,7 +161,7 @@ public class InfluxManufactServiceImpl implements IInfluxManufactService {
|
||||
while (startTime.isBefore(endTime)) {
|
||||
|
||||
//电压
|
||||
Map<String, List<DataV>> stringListMapDataV = dataVList.stream().collect(Collectors.groupingBy(obj -> obj.getPhasicType().concat(StrPool.UNDERLINE).concat(obj.getValueType())));
|
||||
Map<String, List<DataV>> stringListMapDataV = dataVList.stream().collect(Collectors.groupingBy(obj -> obj.getPhaseType().concat(StrPool.UNDERLINE).concat(obj.getValueType())));
|
||||
for (String string : stringListMapDataV.keySet()) {
|
||||
DataV tempEle = new DataV();
|
||||
List<DataV> dataVS = stringListMapDataV.get(string);
|
||||
|
||||
@@ -89,4 +89,11 @@ public interface OracleDataService {
|
||||
* @return
|
||||
*/
|
||||
List<Line> getLineList();
|
||||
|
||||
/**
|
||||
* 查询oracle中PQ_Line_Detail数据
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<LineDetail> getLineDetail();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class OracleDataServiceImpl implements OracleDataService {
|
||||
private final DayFlickerMapper dayFlickerMapper;
|
||||
private final DayInharmVMapper dayInharmVMapper;
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
|
||||
|
||||
@@ -114,4 +114,9 @@ public class OracleDataServiceImpl implements OracleDataService {
|
||||
public List<Line> getLineList() {
|
||||
return lineMapper.selectList(new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDetail> getLineDetail() {
|
||||
return lineDetailMapper.selectList(new LambdaQueryWrapper<>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,5 +147,14 @@ public class OracleToMysqlController {
|
||||
return true;
|
||||
}
|
||||
|
||||
@GetMapping("/lineSubstation")
|
||||
@ApiOperation("监测点电网变电站同步")
|
||||
public Boolean LineSubstation() {
|
||||
System.out.println("--------------------------------监测点电网侧变电站同步------------------------------------");
|
||||
oracleToMysqlService.lineSubstation();
|
||||
System.out.println("-----------------------------------------------------------------------------------\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -84,4 +84,9 @@ public interface OracleToMysqlService {
|
||||
* @Author: wr
|
||||
*/
|
||||
void LineRunFlag();
|
||||
|
||||
/**
|
||||
* @Description: 监测点电网变电站同步
|
||||
*/
|
||||
void lineSubstation();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.mysql.util.MaxValueProcessor;
|
||||
import com.njcn.mysql.util.PubUtils;
|
||||
import com.njcn.oracle.bo.po.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -547,6 +548,24 @@ public class OracleToMysqlServiceImpl implements OracleToMysqlService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lineSubstation() {
|
||||
List<PqLineBak> bakList = pqLineBakService.list();
|
||||
Map<String, String> map = bakList.stream().collect(Collectors.toMap(PqLineBak::getLineId, PqLineBak::getId));
|
||||
List<LineDetail> lineDetailList = oracleDataService.getLineDetail();
|
||||
if(CollUtil.isNotEmpty(lineDetailList)){
|
||||
lineDetailList.forEach(item->{
|
||||
String mysqlId = map.get(String.valueOf(item.getLineIndex()));
|
||||
if (ObjUtil.isNotNull(mysqlId) && StringUtils.isNotBlank(mysqlId)) {
|
||||
pqLineDetailService.update(new LambdaUpdateWrapper<PqLineDetail>()
|
||||
.set(PqLineDetail::getPowerSubstationName, item.getPowerSubstationName())
|
||||
.eq(PqLineDetail::getId, mysqlId)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public RStatDataHarmrateVD getData1(DayHarmrateV data, Map<String, String> oracleRelationMysql, String valueType) {
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
RStatDataHarmrateVD po1 = new RStatDataHarmrateVD();
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.njcn.oracle.bo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 线路参数附加定义表
|
||||
* */
|
||||
@Data
|
||||
@TableName("PQ_LINEDETAIL")
|
||||
public class LineDetail {
|
||||
|
||||
@TableField("LINE_INDEX")
|
||||
private Long lineIndex;
|
||||
|
||||
@TableField("SUB_INDEX")
|
||||
private Long subIndex;
|
||||
|
||||
@TableField("GD_INDEX")
|
||||
private Long gdIndex;
|
||||
|
||||
@TableField("LINE_NAME")
|
||||
private String lineName;
|
||||
|
||||
//接线类型
|
||||
@TableField("PTTYPE")
|
||||
private Integer ptType;
|
||||
|
||||
//上次更新时间
|
||||
@TableField("LAST_TIME")
|
||||
private Date lastTime;
|
||||
|
||||
//测量间隔
|
||||
@TableField("TINTERVAL")
|
||||
private Integer tinterval;
|
||||
|
||||
//干扰源类型终
|
||||
@TableField("LOADTYPE")
|
||||
private String loadType;
|
||||
|
||||
//行业类型
|
||||
@TableField("BUSINESSTYPE")
|
||||
private String businessType;
|
||||
|
||||
//监测点性质
|
||||
@TableField("POWERID")
|
||||
private Integer powerId;
|
||||
|
||||
//备注
|
||||
@TableField("REMARK")
|
||||
private String remark;
|
||||
|
||||
//国网谐波监测平台监测点号
|
||||
@TableField("MONITOR_ID")
|
||||
private String monitorId;
|
||||
|
||||
@TableField("OBJNAME")
|
||||
private String objName; //监测点对象名称
|
||||
|
||||
//统计类型
|
||||
@TableField("STATFLAG")
|
||||
private Integer statFlag;
|
||||
|
||||
|
||||
//电网侧变电站名称
|
||||
@TableField("POWER_SUBSTATION_NAME")
|
||||
private String powerSubstationName;
|
||||
|
||||
//分类等级 内容为Ⅰ、Ⅱ、Ⅲ、Ⅳ
|
||||
@TableField("CLASSIFICATION_GRADE")
|
||||
private String calssificationGrade;
|
||||
|
||||
|
||||
//上级电站
|
||||
@TableField("SUPERIORS_SUBSTATION")
|
||||
private String superiorsSubstation;
|
||||
|
||||
//挂接线路
|
||||
@TableField("HANG_LINE")
|
||||
private String hangLine;
|
||||
|
||||
|
||||
//监测点拥有者
|
||||
@TableField("OWNER")
|
||||
private String owner;
|
||||
|
||||
//拥有者职务
|
||||
@TableField("OWNER_DUTY")
|
||||
private String ownerDuty;
|
||||
|
||||
//拥有者联系方式
|
||||
@TableField("OWNER_TEL")
|
||||
private String ownerTel;
|
||||
|
||||
//接线图
|
||||
@TableField("WIRING_DIAGRAM")
|
||||
private String wiringDiagram;
|
||||
|
||||
//是否并网点
|
||||
@TableField("IS_GRID_POINT")
|
||||
private Integer isGridPoint;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.oracle.mapper;
|
||||
|
||||
import com.njcn.oracle.bo.po.LineDetail;
|
||||
import com.njcn.oracle.mybatis.mapper.BatchBaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-12-28
|
||||
*/
|
||||
public interface LineDetailMapper extends BatchBaseMapper<LineDetail> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.oracle.mapper.LineDetailMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user