同步监测点上级变电站信息
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user