预处理兼容pq/pms处理
This commit is contained in:
@@ -0,0 +1,68 @@
|
|||||||
|
package com.njcn.common.utils;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/9/20
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class NjcnDateUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入两个时间范围,返回这两个时间范围内的所有日期,并保存在一个集合中
|
||||||
|
*
|
||||||
|
* @param beginTime
|
||||||
|
* @param endTime
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static List<String> findEveryDay(String beginTime, String endTime) {
|
||||||
|
//创建一个放所有日期的集合
|
||||||
|
List<String> dates = new ArrayList<>();
|
||||||
|
|
||||||
|
//创建时间解析对象规定解析格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
//将传入的时间解析成Date类型,相当于格式化
|
||||||
|
Date dBegin = null;
|
||||||
|
Date dEnd = null;
|
||||||
|
try {
|
||||||
|
dBegin = sdf.parse(beginTime);
|
||||||
|
dEnd = sdf.parse(endTime);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.error("获取两个时间段范围异常,异常信息"+e.getMessage());
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
//将格式化后的第一天添加进集合
|
||||||
|
dates.add(sdf.format(dBegin));
|
||||||
|
|
||||||
|
//使用本地的时区和区域获取日历
|
||||||
|
Calendar calBegin = Calendar.getInstance();
|
||||||
|
|
||||||
|
//传入起始时间将此日历设置为起始日历
|
||||||
|
calBegin.setTime(dBegin);
|
||||||
|
|
||||||
|
//判断结束日期前一天是否在起始日历的日期之后
|
||||||
|
while (dEnd.after(calBegin.getTime())) {
|
||||||
|
|
||||||
|
//根据日历的规则:月份中的每一天,为起始日历加一天
|
||||||
|
calBegin.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
|
||||||
|
//得到的每一天就添加进集合
|
||||||
|
dates.add(sdf.format(calBegin.getTime()));
|
||||||
|
//如果当前的起始日历超过结束日期后,就结束循环
|
||||||
|
}
|
||||||
|
return dates;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -116,6 +116,9 @@ public interface CommTerminalGeneralClient {
|
|||||||
@GetMapping("/getRunMonitorIds")
|
@GetMapping("/getRunMonitorIds")
|
||||||
HttpResult<List<String>> getRunMonitorIds();
|
HttpResult<List<String>> getRunMonitorIds();
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/getMonitorDetailList")
|
||||||
|
HttpResult<List<LineDevGetDTO>> getMonitorDetailList(@RequestBody List<String> list);
|
||||||
/**
|
/**
|
||||||
* 用于返回pq 还是pms系统
|
* 用于返回pq 还是pms系统
|
||||||
* @author cdf
|
* @author cdf
|
||||||
|
|||||||
@@ -92,6 +92,12 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<LineDevGetDTO>> getMonitorDetailList(List<String> list) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取监测点详细信息集合", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> isPqOrPms() {
|
public HttpResult<String> isPqOrPms() {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "返回pq还是pms系统", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "返回pq还是pms系统", throwable.toString());
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ public class LineDevGetDTO {
|
|||||||
*/
|
*/
|
||||||
private Integer comFlag;
|
private Integer comFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置数据最新更新时间
|
||||||
|
*/
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ import com.njcn.device.pms.pojo.po.TerminalLog;
|
|||||||
import com.njcn.device.pms.pojo.vo.DoubleUserVO;
|
import com.njcn.device.pms.pojo.vo.DoubleUserVO;
|
||||||
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
||||||
import com.njcn.device.pms.service.majornetwork.ITerminalLogService;
|
import com.njcn.device.pms.service.majornetwork.ITerminalLogService;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -36,6 +40,7 @@ import com.njcn.web.controller.BaseController;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -58,6 +63,7 @@ public class PmsDistributionMonitorController extends BaseController {
|
|||||||
|
|
||||||
private final ITerminalLogService iTerminalLogService;
|
private final ITerminalLogService iTerminalLogService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增配网监测点表
|
* 新增配网监测点表
|
||||||
* @author cdf
|
* @author cdf
|
||||||
@@ -294,5 +300,20 @@ public class PmsDistributionMonitorController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量给配网监测点录入单位id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/9/20
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/disMonitorWriteOrgId")
|
||||||
|
@ApiOperation("批量修改配网里的单位")
|
||||||
|
public HttpResult<Boolean> disMonitorWriteOrgId() {
|
||||||
|
String methodDescribe = getMethodDescribe("disMonitorWriteOrgId");
|
||||||
|
iDistributionMonitorService.disMonitorWriteOrgId();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,4 +115,6 @@ public interface IDistributionMonitorService extends IMppService<DistributionMon
|
|||||||
*/
|
*/
|
||||||
Boolean batchOpDistributionArea();
|
Boolean batchOpDistributionArea();
|
||||||
|
|
||||||
|
Boolean disMonitorWriteOrgId();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.device.pms.service.majornetwork.impl;
|
package com.njcn.device.pms.service.majornetwork.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.TimeInterval;
|
import cn.hutool.core.date.TimeInterval;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -110,6 +111,7 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
|||||||
distributionMonitor.setMonitorId(monitor.getId());
|
distributionMonitor.setMonitorId(monitor.getId());
|
||||||
distributionMonitor.setCreatedDate(LocalDateTime.now());
|
distributionMonitor.setCreatedDate(LocalDateTime.now());
|
||||||
distributionMonitor.setIfPowerUser(0);
|
distributionMonitor.setIfPowerUser(0);
|
||||||
|
distributionMonitor.setOrgId(monitor.getOrgId());
|
||||||
distributionMonitor.setMonitorState(monitor.getMonitorState());
|
distributionMonitor.setMonitorState(monitor.getMonitorState());
|
||||||
distributionMonitor.setVoltageLevel(monitor.getVoltageLevel());
|
distributionMonitor.setVoltageLevel(monitor.getVoltageLevel());
|
||||||
distributionMonitor.setStatus(DataStateEnum.ENABLE.getCode());
|
distributionMonitor.setStatus(DataStateEnum.ENABLE.getCode());
|
||||||
@@ -129,6 +131,7 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
|||||||
}
|
}
|
||||||
PowerDistributionarea powerDistributionareaTem = powerDistributionareaMapper.selectById(powerDistributionarea.getId());
|
PowerDistributionarea powerDistributionareaTem = powerDistributionareaMapper.selectById(powerDistributionarea.getId());
|
||||||
distributionMonitor.setMonitorId(powerDistributionarea.getId());
|
distributionMonitor.setMonitorId(powerDistributionarea.getId());
|
||||||
|
distributionMonitor.setOrgId(powerDistributionarea.getOrgId());
|
||||||
distributionMonitor.setCreatedDate(LocalDateTime.now());
|
distributionMonitor.setCreatedDate(LocalDateTime.now());
|
||||||
distributionMonitor.setIfPowerUser(0);
|
distributionMonitor.setIfPowerUser(0);
|
||||||
distributionMonitor.setMonitorState(distributionMonitorParam.getMonitorState());
|
distributionMonitor.setMonitorState(distributionMonitorParam.getMonitorState());
|
||||||
@@ -158,7 +161,7 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
|||||||
}
|
}
|
||||||
distributionMonitor.setIfPowerUser(1);
|
distributionMonitor.setIfPowerUser(1);
|
||||||
distributionMonitor.setVoltageLevel(powerGenerationUser.getVoltageLevel());
|
distributionMonitor.setVoltageLevel(powerGenerationUser.getVoltageLevel());
|
||||||
|
distributionMonitor.setOrgId(powerGenerationUser.getOrgId());
|
||||||
} else {
|
} else {
|
||||||
//用电
|
//用电
|
||||||
PowerClient powerClient = powerClientMapper.selectById(distributionMonitorParam.getMonitorId());
|
PowerClient powerClient = powerClientMapper.selectById(distributionMonitorParam.getMonitorId());
|
||||||
@@ -167,6 +170,7 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
|||||||
}
|
}
|
||||||
distributionMonitor.setIfPowerUser(0);
|
distributionMonitor.setIfPowerUser(0);
|
||||||
distributionMonitor.setVoltageLevel(powerClient.getVoltageLevel());
|
distributionMonitor.setVoltageLevel(powerClient.getVoltageLevel());
|
||||||
|
distributionMonitor.setOrgId(powerClient.getOrgId());
|
||||||
|
|
||||||
}
|
}
|
||||||
distributionMonitor.setMonitorId(distributionMonitorParam.getMonitorId());
|
distributionMonitor.setMonitorId(distributionMonitorParam.getMonitorId());
|
||||||
@@ -486,6 +490,58 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean disMonitorWriteOrgId() {
|
||||||
|
List<DistributionMonitor> distributionMonitorList = this.list();
|
||||||
|
if(CollectionUtil.isNotEmpty(distributionMonitorList)){
|
||||||
|
Map<String,List<DistributionMonitor>> map = distributionMonitorList.stream().collect(Collectors.groupingBy(DistributionMonitor::getMonitorSort));
|
||||||
|
List<DistributionMonitor> po = new ArrayList<>();
|
||||||
|
|
||||||
|
map.forEach((key,val)->{
|
||||||
|
if(key.equals("78a96acb276a5fe9d6eff737fdf1973f")){
|
||||||
|
List<DistributionMonitor> one = map.get("78a96acb276a5fe9d6eff737fdf1973f");
|
||||||
|
List<String> oneIds = one.stream().map(DistributionMonitor::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
|
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().in(Monitor::getId,oneIds));
|
||||||
|
|
||||||
|
for(Monitor monitor:monitorList){
|
||||||
|
DistributionMonitor distributionMonitor = new DistributionMonitor();
|
||||||
|
distributionMonitor.setMonitorId(monitor.getId());
|
||||||
|
distributionMonitor.setOrgId(monitor.getOrgId());
|
||||||
|
LambdaUpdateWrapper<DistributionMonitor> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.set(DistributionMonitor::getOrgId,distributionMonitor.getOrgId()).eq(DistributionMonitor::getMonitorId,distributionMonitor.getMonitorId());
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else if(key.equals("a5696acb276a5fe9d6eff74fdf1973f")){
|
||||||
|
List<DistributionMonitor> two = map.get("a5696acb276a5fe9d6eff74fdf1973f");
|
||||||
|
List<String> twoIds = two.stream().map(DistributionMonitor::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
|
List<PowerDistributionarea> monitorList = powerDistributionareaMapper.selectList(new LambdaQueryWrapper<PowerDistributionarea>().in(PowerDistributionarea::getId,twoIds));
|
||||||
|
|
||||||
|
for(PowerDistributionarea monitor:monitorList){
|
||||||
|
DistributionMonitor distributionMonitor = new DistributionMonitor();
|
||||||
|
distributionMonitor.setMonitorId(monitor.getId());
|
||||||
|
distributionMonitor.setOrgId(monitor.getOrgId());
|
||||||
|
LambdaUpdateWrapper<DistributionMonitor> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.set(DistributionMonitor::getOrgId,distributionMonitor.getOrgId()).eq(DistributionMonitor::getMonitorId,distributionMonitor.getMonitorId());
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
List<DistributionMonitor> two = map.get("a5696acb276a5fe9d6eff74fdf1973f");
|
||||||
|
List<String> twoIds = two.stream().map(DistributionMonitor::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
|
List<PowerDistributionarea> monitorList = powerDistributionareaMapper.selectList(new LambdaQueryWrapper<PowerDistributionarea>().in(PowerDistributionarea::getId,twoIds));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void overLimitAdd(String voltageLevel, String id) {
|
private void overLimitAdd(String voltageLevel, String id) {
|
||||||
DictData voltageDic = dicDataFeignClient.getDicDataById(voltageLevel).getData();
|
DictData voltageDic = dicDataFeignClient.getDicDataById(voltageLevel).getData();
|
||||||
float voltageLevelValue = Float.parseFloat(voltageDic.getValue());
|
float voltageLevelValue = Float.parseFloat(voltageDic.getValue());
|
||||||
|
|||||||
@@ -7,10 +7,13 @@ 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.common.utils.LogUtil;
|
||||||
import com.njcn.device.biz.pojo.dto.*;
|
import com.njcn.device.biz.pojo.dto.*;
|
||||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||||
import com.njcn.device.pq.mapper.LineMapper;
|
import com.njcn.device.pq.mapper.LineMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
import com.njcn.device.pq.service.CommTerminalService;
|
import com.njcn.device.pq.service.CommTerminalService;
|
||||||
import com.njcn.device.pq.service.LineService;
|
import com.njcn.device.pq.service.LineService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -45,14 +48,16 @@ public class CommTerminalController extends BaseController {
|
|||||||
private final LineMapper lineMapper;
|
private final LineMapper lineMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过部门获取所有子集部门所拥有的监测点
|
* 通过部门获取所有子集部门所拥有的监测点基本信息
|
||||||
*
|
*
|
||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2023/4/24
|
* @date 2023/4/24
|
||||||
*/
|
*/
|
||||||
@PostMapping("deptGetLineIds")
|
@PostMapping("deptGetLineIds")
|
||||||
@ApiOperation("通过部门获取所有子集部门所拥有的监测点")
|
@ApiOperation("通过部门获取所有子集部门所拥有的监测点")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
public HttpResult<List<DeptGetChildrenDTO>> deptGetLineList(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetChildrenDTO>> deptGetLineList(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -68,6 +73,8 @@ public class CommTerminalController extends BaseController {
|
|||||||
* @date 2023/5/10
|
* @date 2023/5/10
|
||||||
*/
|
*/
|
||||||
@PostMapping("getDeptChildrenByParent")
|
@PostMapping("getDeptChildrenByParent")
|
||||||
|
@ApiOperation("根据单位获取所有子单位信息")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
public HttpResult<List<DeptGetBase>> getDeptChildrenByParent(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetBase>> getDeptChildrenByParent(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -78,12 +85,13 @@ public class CommTerminalController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单位获取监测点信息
|
* 根据单位获取监测点详细信息
|
||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2023/5/10
|
* @date 2023/5/10
|
||||||
*/
|
*/
|
||||||
@PostMapping("deptGetLine")
|
@PostMapping("deptGetLine")
|
||||||
@ApiOperation("根据单位获取监测点信息")
|
@ApiOperation("根据单位获取监测点信息")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
public HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -103,6 +111,7 @@ public class CommTerminalController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("deptGetSubStation")
|
@PostMapping("deptGetSubStation")
|
||||||
@ApiOperation("根据单位获取所有变电站")
|
@ApiOperation("根据单位获取所有变电站")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -119,6 +128,7 @@ public class CommTerminalController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("deptGetBusBar")
|
@PostMapping("deptGetBusBar")
|
||||||
@ApiOperation("根据单位获取所有母线")
|
@ApiOperation("根据单位获取所有母线")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
public HttpResult<List<DeptGetBusBarDTO>> deptBusBar(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetBusBarDTO>> deptBusBar(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -137,6 +147,7 @@ public class CommTerminalController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("deptGetDevice")
|
@PostMapping("deptGetDevice")
|
||||||
@ApiOperation("根据单位获取所有装置")
|
@ApiOperation("根据单位获取所有装置")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDevice(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetDeviceDTO>> deptGetDevice(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -153,6 +164,7 @@ public class CommTerminalController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("deptGetDeviceAndMonitor")
|
@PostMapping("deptGetDeviceAndMonitor")
|
||||||
@ApiOperation("根据单位获取装置以及监测点")
|
@ApiOperation("根据单位获取装置以及监测点")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDeviceAndMonitor(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetDeviceDTO>> deptGetDeviceAndMonitor(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -169,6 +181,7 @@ public class CommTerminalController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("substationGetLine")
|
@PostMapping("substationGetLine")
|
||||||
@ApiOperation("根据电站获取所有监测点")
|
@ApiOperation("根据电站获取所有监测点")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "substationId", value = "请求体", required = true)
|
@ApiImplicitParam(name = "substationId", value = "请求体", required = true)
|
||||||
public HttpResult<LineDevGetBandDTO> substationGetLine(@RequestParam("substationId")String substationId) {
|
public HttpResult<LineDevGetBandDTO> substationGetLine(@RequestParam("substationId")String substationId) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -186,6 +199,7 @@ public class CommTerminalController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("busBarGetLine")
|
@PostMapping("busBarGetLine")
|
||||||
@ApiOperation("根据母线id获取监测点信息")
|
@ApiOperation("根据母线id获取监测点信息")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiImplicitParam(name = "busBarId", value = "请求体", required = true)
|
@ApiImplicitParam(name = "busBarId", value = "请求体", required = true)
|
||||||
public HttpResult<LineDevGetBandDTO> busBarGetLine(@RequestParam("busBarId")String busBarId) {
|
public HttpResult<LineDevGetBandDTO> busBarGetLine(@RequestParam("busBarId")String busBarId) {
|
||||||
TimeInterval timer = new TimeInterval();
|
TimeInterval timer = new TimeInterval();
|
||||||
@@ -229,4 +243,21 @@ public class CommTerminalController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点集合获取监测点详情
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/9/21
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getMonitorDetailList")
|
||||||
|
@ApiOperation("根据监测点集合获取监测点详情")
|
||||||
|
@ApiImplicitParam(name = "list", value = "监测点集合")
|
||||||
|
public HttpResult<List<LineDevGetDTO>> getMonitorDetailList(@RequestBody List<String> list) {
|
||||||
|
String methodDescribe = getMethodDescribe("getMonitorDetailList");
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getMonitorListDetail(list), methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||||
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.pq.pojo.advanced.UpDevVO;
|
import com.njcn.device.pq.pojo.advanced.UpDevVO;
|
||||||
@@ -436,6 +437,13 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
List<LineDevGetDTO> getLineBySubStation(@Param("subId") String subId);
|
List<LineDevGetDTO> getLineBySubStation(@Param("subId") String subId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点集合获取监测详细信息
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/9/20
|
||||||
|
*/
|
||||||
|
List<LineDevGetDTO> getMonitorListDetail(@Param("monitorIds") List<String> monitorIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件进行监测筛选出监测点id
|
* 根据条件进行监测筛选出监测点id
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1105,6 +1105,20 @@
|
|||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getMonitorListDetail" resultType="LineDevGetDTO">
|
||||||
|
select line.id pointId,dev.id devId,0 type,1 lineType,lineDetail.Time_Interval interval
|
||||||
|
from pq_line line
|
||||||
|
inner join pq_line_detail lineDetail on line.id = lineDetail.id
|
||||||
|
inner join pq_line subv on line.pid = subv.id
|
||||||
|
inner join pq_line dev on subv.pid = dev.id
|
||||||
|
where line.id in
|
||||||
|
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="getLineByIDs" resultType="java.lang.String">
|
<select id="getLineByIDs" resultType="java.lang.String">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
line.id
|
line.id
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ public interface CommTerminalService {
|
|||||||
*/
|
*/
|
||||||
List<DeptGetChildrenMoreDTO> deptGetLine(DeptGetLineParam deptGetLineParam);
|
List<DeptGetChildrenMoreDTO> deptGetLine(DeptGetLineParam deptGetLineParam);
|
||||||
|
|
||||||
|
List<DeptGetChildrenMoreDTO> deptGetLineByIdList(List<String> monitorIds);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单位获取所有变电站
|
* 根据单位获取所有变电站
|
||||||
* @author cdf
|
* @author cdf
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -35,6 +33,7 @@ import java.util.stream.Stream;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CommTerminalServiceImpl implements CommTerminalService {
|
public class CommTerminalServiceImpl implements CommTerminalService {
|
||||||
|
|
||||||
|
//redis前缀
|
||||||
private final String commTerminal = "commTerminal#";
|
private final String commTerminal = "commTerminal#";
|
||||||
|
|
||||||
private final DeptLineService deptLineService;
|
private final DeptLineService deptLineService;
|
||||||
@@ -94,13 +93,27 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
|||||||
lineList.addAll(map.get(i));
|
lineList.addAll(map.get(i));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
deptGetChildrenMoreDTO.setLineBaseList(lineList);
|
|
||||||
|
//去重
|
||||||
|
ArrayList<LineDevGetDTO> collect = lineList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
|
||||||
|
Comparator.comparing(LineDevGetDTO::getPointId)
|
||||||
|
)), ArrayList::new));
|
||||||
|
|
||||||
|
deptGetChildrenMoreDTO.setLineBaseList(collect);
|
||||||
}
|
}
|
||||||
result.add(deptGetChildrenMoreDTO);
|
result.add(deptGetChildrenMoreDTO);
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeptGetChildrenMoreDTO> deptGetLineByIdList(List<String> monitorIds) {
|
||||||
|
List<DeptGetChildrenMoreDTO> result = new ArrayList<>();
|
||||||
|
|
||||||
|
lineMapper.getMonitorListDetail(monitorIds);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeptGetSubStationDTO> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
public List<DeptGetSubStationDTO> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
||||||
|
|||||||
@@ -540,11 +540,9 @@ public class EleAirStrategyServiceImpl extends ServiceImpl<AirStrategyMapper, Ai
|
|||||||
this.mqttSendCount = 0;
|
this.mqttSendCount = 0;
|
||||||
this.mqttJsonMsg = json;
|
this.mqttJsonMsg = json;
|
||||||
this.mqttSendTopic = topic;
|
this.mqttSendTopic = topic;
|
||||||
|
|
||||||
flag = true;
|
flag = true;
|
||||||
while (flag) {
|
|
||||||
|
|
||||||
}
|
Thread.sleep(3000);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -570,9 +568,7 @@ public class EleAirStrategyServiceImpl extends ServiceImpl<AirStrategyMapper, Ai
|
|||||||
this.mqttJsonMsg = json;
|
this.mqttJsonMsg = json;
|
||||||
this.mqttSendTopic = topic;
|
this.mqttSendTopic = topic;
|
||||||
flag = true;
|
flag = true;
|
||||||
while (flag) {
|
Thread.sleep(3000);
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,40 +35,7 @@ public class HarmPollutionJob {
|
|||||||
lineParam.setDataSource(1);
|
lineParam.setDataSource(1);
|
||||||
String date = CommonExecutorUtils.prepareTimeDeal(command);
|
String date = CommonExecutorUtils.prepareTimeDeal(command);
|
||||||
log.info("执行日期harmPollutionJob。。。。。。。。。。"+date);
|
log.info("执行日期harmPollutionJob。。。。。。。。。。"+date);
|
||||||
|
CommonExecutorUtils.commDefineDate(command,lineParam);
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.add(Calendar.DAY_OF_MONTH,-1);
|
|
||||||
|
|
||||||
Date temDate = calendar.getTime();
|
|
||||||
|
|
||||||
String begin = null;
|
|
||||||
String end = null;
|
|
||||||
|
|
||||||
switch (command){
|
|
||||||
case BizParamConstant.STAT_BIZ_DAY:
|
|
||||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
|
||||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
|
||||||
case BizParamConstant.STAT_BIZ_WEEK:
|
|
||||||
begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
|
||||||
end = sdf.format(DateUtil.endOfWeek(temDate));
|
|
||||||
case BizParamConstant.STAT_BIZ_MONTH:
|
|
||||||
begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
|
||||||
end = sdf.format(DateUtil.endOfMonth(temDate));
|
|
||||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
|
||||||
begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
|
||||||
end = sdf.format(DateUtil.endOfQuarter(temDate));
|
|
||||||
case BizParamConstant.STAT_BIZ_YEAR:
|
|
||||||
begin = sdf.format(DateUtil.beginOfYear(temDate));
|
|
||||||
end = sdf.format(DateUtil.endOfYear(temDate));
|
|
||||||
default:
|
|
||||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
|
||||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
|
||||||
}
|
|
||||||
lineParam.setBeginTime(begin);
|
|
||||||
lineParam.setEndTime(end);
|
|
||||||
|
|
||||||
|
|
||||||
//测试数据部署时注释
|
//测试数据部署时注释
|
||||||
//date = "2022-10-21";
|
//date = "2022-10-21";
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ package com.njcn.executor.utils;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,4 +37,44 @@ public class CommonExecutorUtils {
|
|||||||
log.info("job调度时间:"+sdf.format(calendar.getTime()));
|
log.info("job调度时间:"+sdf.format(calendar.getTime()));
|
||||||
return sdf.format(calendar.getTime());
|
return sdf.format(calendar.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/9/20
|
||||||
|
*/
|
||||||
|
public static void commDefineDate(String command,LineParam lineParam){
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String begin;
|
||||||
|
String end;
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH,-1);
|
||||||
|
Date temDate = calendar.getTime();
|
||||||
|
switch (command){
|
||||||
|
case BizParamConstant.STAT_BIZ_DAY:
|
||||||
|
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||||
|
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||||
|
case BizParamConstant.STAT_BIZ_WEEK:
|
||||||
|
begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||||
|
end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||||
|
case BizParamConstant.STAT_BIZ_MONTH:
|
||||||
|
begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||||
|
end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||||
|
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||||
|
begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||||
|
end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||||
|
case BizParamConstant.STAT_BIZ_YEAR:
|
||||||
|
begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||||
|
end = sdf.format(DateUtil.endOfYear(temDate));
|
||||||
|
default:
|
||||||
|
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||||
|
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||||
|
}
|
||||||
|
lineParam.setBeginTime(begin);
|
||||||
|
lineParam.setEndTime(end);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class LineParam {
|
|||||||
/**
|
/**
|
||||||
* 区分配网I II III 类监测点
|
* 区分配网I II III 类监测点
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "lineType",value = "监测点类型")
|
@ApiModelProperty(name = "lineType",value = "监测点类别")
|
||||||
private Integer lineType;
|
private Integer lineType;
|
||||||
|
|
||||||
@ApiModelProperty(name = "type",value = "时间类型(1年,2季,3月,4周,5日)")
|
@ApiModelProperty(name = "type",value = "时间类型(1年,2季,3月,4周,5日)")
|
||||||
@@ -33,6 +33,7 @@ public class LineParam {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "dataDate",value = "时间日期")
|
@ApiModelProperty(name = "dataDate",value = "时间日期")
|
||||||
@NotBlank(message = "时间不可为空")
|
@NotBlank(message = "时间不可为空")
|
||||||
|
@Deprecated
|
||||||
private String dataDate;
|
private String dataDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,4 +53,10 @@ public class LineParam {
|
|||||||
*/
|
*/
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否补招标识,默认false不补招
|
||||||
|
*/
|
||||||
|
private Boolean repairFlag = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.njcn.prepare.harmonic.controller.line;
|
package com.njcn.prepare.harmonic.controller.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
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.common.utils.NjcnDateUtils;
|
||||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
@@ -23,8 +25,11 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,7 +54,7 @@ public class DayDataController extends BaseController {
|
|||||||
|
|
||||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
|
|
||||||
@Deprecated
|
/* @Deprecated
|
||||||
@ApiOperation("day表定时任务")
|
@ApiOperation("day表定时任务")
|
||||||
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
|
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
|
||||||
@PostMapping("dayDataHanlder")
|
@PostMapping("dayDataHanlder")
|
||||||
@@ -73,7 +78,7 @@ public class DayDataController extends BaseController {
|
|||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@ApiOperation("day表定时任务(MySQL库)")
|
@ApiOperation("day表定时任务(MySQL库)")
|
||||||
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
|
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
|
||||||
@@ -89,22 +94,22 @@ public class DayDataController extends BaseController {
|
|||||||
} else{
|
} else{
|
||||||
indexLists = jobParam.getLineIds();
|
indexLists = jobParam.getLineIds();
|
||||||
}
|
}
|
||||||
if (jobParam.getType() == 3){
|
if (jobParam.getRepairFlag()){
|
||||||
int year = Integer.parseInt(jobParam.getDataDate().split("-")[0]);
|
List<String> timeRange = NjcnDateUtils.findEveryDay(jobParam.getBeginTime(),jobParam.getEndTime());
|
||||||
int month = Integer.parseInt(jobParam.getDataDate().split("-")[1]);
|
for (String item : timeRange) {
|
||||||
List<String> dayList = PublicUtil.getDayByMonth(year,month);
|
|
||||||
for (String item : dayList) {
|
|
||||||
log.info(item+"-->开始执行");
|
log.info(item+"-->开始执行");
|
||||||
startTime = item+" "+"00:00:00";
|
startTime = item+" "+"00:00:00";
|
||||||
endTime = item+" "+"23:59:59";
|
endTime = item+" "+"23:59:59";
|
||||||
dayDataService.dataToDayHandler(indexLists,startTime,endTime);
|
dayDataService.dataToDayHandler(indexLists,startTime,endTime);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
startTime = jobParam.getDataDate()+" "+"00:00:00";
|
dayDataService.dataToDayHandler(indexLists,jobParam.getBeginTime(),jobParam.getEndTime());
|
||||||
endTime = jobParam.getDataDate()+" "+"23:59:59";
|
|
||||||
log.info("统计时间范围:"+startTime+"----->"+endTime);
|
|
||||||
dayDataService.dataToDayHandler(indexLists,startTime,endTime);
|
|
||||||
}
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,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.common.utils.NjcnDateUtils;
|
||||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
import com.njcn.prepare.harmonic.service.mysql.line.IntegrityService;
|
import com.njcn.prepare.harmonic.service.mysql.line.IntegrityService;
|
||||||
import com.njcn.prepare.harmonic.utils.PublicUtil;
|
import com.njcn.prepare.harmonic.utils.PublicUtil;
|
||||||
@@ -56,16 +57,17 @@ public class IntegrityController extends BaseController {
|
|||||||
public HttpResult<String> dataIntegrity(@RequestBody @Validated LineParam lineParam){
|
public HttpResult<String> dataIntegrity(@RequestBody @Validated LineParam lineParam){
|
||||||
log.info(LocalDateTime.now()+"dataIntegrity开始执行");
|
log.info(LocalDateTime.now()+"dataIntegrity开始执行");
|
||||||
String methodDescribe = getMethodDescribe("dataIntegrity");
|
String methodDescribe = getMethodDescribe("dataIntegrity");
|
||||||
if (lineParam.getType() == 3){
|
String startTime,endTime;
|
||||||
int year = Integer.parseInt(lineParam.getDataDate().split("-")[0]);
|
if (lineParam.getRepairFlag()){
|
||||||
int month = Integer.parseInt(lineParam.getDataDate().split("-")[1]);
|
List<String> timeRange = NjcnDateUtils.findEveryDay(lineParam.getBeginTime(),lineParam.getEndTime());
|
||||||
List<String> dayList = PublicUtil.getDayByMonth(year,month);
|
for (String item : timeRange) {
|
||||||
for (String item : dayList) {
|
|
||||||
log.info(item+"-->开始执行");
|
log.info(item+"-->开始执行");
|
||||||
integrityService.dataIntegrity(lineParam,item);
|
startTime = item+" "+"00:00:00";
|
||||||
|
endTime = item+" "+"23:59:59";
|
||||||
|
integrityService.dataIntegrity(lineParam,startTime,endTime);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
integrityService.dataIntegrity(lineParam,lineParam.getDataDate());
|
integrityService.dataIntegrity(lineParam,lineParam.getBeginTime(),lineParam.getEndTime());
|
||||||
}
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, CommonResponseEnum.SUCCESS.getMessage(), methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, CommonResponseEnum.SUCCESS.getMessage(), methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DayDataServiceImpl implements DayDataService {
|
public class DayDataServiceImpl implements DayDataService {
|
||||||
|
|
||||||
private final RMpHarmonicVRateReportDPOService rMpHarmonicVRateReportDPOService;
|
/* private final RMpHarmonicVRateReportDPOService rMpHarmonicVRateReportDPOService;
|
||||||
private final RMpHarmonicIMagReportDPOService rMpHarmonicIMagReportDPOService;
|
private final RMpHarmonicIMagReportDPOService rMpHarmonicIMagReportDPOService;
|
||||||
private final RMpFlickerReportDPOService rMpFlickerReportDPOService;
|
private final RMpFlickerReportDPOService rMpFlickerReportDPOService;
|
||||||
private final RMpPltReportDPOService rMpPltReportDPOService;
|
private final RMpPltReportDPOService rMpPltReportDPOService;
|
||||||
@@ -59,7 +59,7 @@ public class DayDataServiceImpl implements DayDataService {
|
|||||||
private final RMpInharmonicVRateReportDPOService rMpInharmonicVRateReportDPOService;
|
private final RMpInharmonicVRateReportDPOService rMpInharmonicVRateReportDPOService;
|
||||||
private final RMpHarmonicPReportDPOService rMpHarmonicPReportDPOService;
|
private final RMpHarmonicPReportDPOService rMpHarmonicPReportDPOService;
|
||||||
private final RMpMeasurePhaseReportDPOService rMpMeasurePhaseReportDPOService;
|
private final RMpMeasurePhaseReportDPOService rMpMeasurePhaseReportDPOService;
|
||||||
private final RMpMeasureReportDPOService rMpMeasureReportDPOService;
|
private final RMpMeasureReportDPOService rMpMeasureReportDPOService;*/
|
||||||
|
|
||||||
//MySQL
|
//MySQL
|
||||||
private final IRStatDataFlickerDService statDataFlickerDService;
|
private final IRStatDataFlickerDService statDataFlickerDService;
|
||||||
@@ -89,452 +89,452 @@ public class DayDataServiceImpl implements DayDataService {
|
|||||||
* @Author: clam
|
* @Author: clam
|
||||||
* @Date: 2022/10/24
|
* @Date: 2022/10/24
|
||||||
*/
|
*/
|
||||||
@Override
|
// @Override
|
||||||
@Transactional(
|
// @Transactional(
|
||||||
rollbackFor = {Exception.class}
|
// rollbackFor = {Exception.class}
|
||||||
)
|
// )
|
||||||
@Async("asyncExecutor")
|
// @Async("asyncExecutor")
|
||||||
public void dayDataJobHandler(List<String> indexLists, String startTime, String endTime) {
|
// public void dayDataJobHandler(List<String> indexLists, String startTime, String endTime) {
|
||||||
|
|
||||||
|
|
||||||
Instant instant = null;
|
|
||||||
// influxDbUtils.setDbName ("pqsbase");
|
|
||||||
try {
|
|
||||||
instant = new SimpleDateFormat ("yyyy-MM-dd").parse (startTime).toInstant ( );
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace ( );
|
|
||||||
}
|
|
||||||
Long time= instant.toEpochMilli();
|
|
||||||
|
|
||||||
List<DataVPO> dataVPOList = new ArrayList<> ();
|
|
||||||
List<DataIPO> dataIPOList = new ArrayList<> ();
|
|
||||||
List<DataFlickerPO> dataFlickerPOList = new ArrayList<> ();
|
|
||||||
List<DataFlucPO> dataFlucPOList = new ArrayList<> ();
|
|
||||||
List<DataHarmPhasicIPO> dataHarmPhasicIPOList = new ArrayList<> ();
|
|
||||||
List<DataHarmPhasicVPO> dataHarmPhasicVPOList = new ArrayList<> ();
|
|
||||||
List<DataHarmPowerPPO> dataHarmPowerPPOList = new ArrayList<> ();
|
|
||||||
List<DataHarmPowerQPO> dataHarmPowerQPOList = new ArrayList<> ();
|
|
||||||
List<DataHarmPowerSPO> dataHarmPowerSPOList = new ArrayList<> ();
|
|
||||||
List<DataHarmRateIPO> dataHarmRateIPOList = new ArrayList<> ();
|
|
||||||
List<DataHarmRateVPO> dataHarmRateVPOList = new ArrayList<> ();
|
|
||||||
List<DataInHarmIPO> dataInHarmIPOList = new ArrayList<> ();
|
|
||||||
List<DataInHarmVPO> dataInHarmVPOList = new ArrayList<> ();
|
|
||||||
List<DataInHarmRateIPO> dataInHarmRateIPOList = new ArrayList<> ();
|
|
||||||
List<DataInHarmRateVPO> dataInHarmRateVPOList = new ArrayList<> ();
|
|
||||||
List<DataPltPO> dataPltPOList = new ArrayList<> ();
|
|
||||||
|
|
||||||
List<RMpHarmonicVRateReportD> rMpHarmonicVRateReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpHarmonicIMagReportD> rMpHarmonicIMagReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpFlickerReportDPO> rMpFlickerReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpPltReportDPO> rMpPltReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpHarmonicIRateReportD> rMpHarmonicIRateReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpInharmonicIRateReportD> rMpInharmonicIRateReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpInharmonicIMagReportDPO> rMpInharmonicIMagReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpInharmonicVRateReportD> rMpInharmonicVRateReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpHarmonicPReportDPO> rMpHarmonicPReportDPOList = new ArrayList<> ();
|
|
||||||
List<RMpMeasurePhaseReportD> rMpMeasurePhaseReportDPOArrayList = new ArrayList<> ();
|
|
||||||
List<RMpMeasureReportD> rMpMeasureReportDPOArrayList = new ArrayList<> ();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i <indexLists.size () ; i++) {
|
|
||||||
|
|
||||||
String lineIndex =indexLists.get (i);
|
|
||||||
/*生成dayV表*/
|
|
||||||
List<DataVPO> dataV = getDataV(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataV)){
|
|
||||||
dataVPOList.addAll (dataV);
|
|
||||||
}
|
|
||||||
/*生成dayI表*/
|
|
||||||
List<DataIPO> dataI = getDataI(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataI)){
|
|
||||||
dataIPOList.addAll (dataI);
|
|
||||||
}
|
|
||||||
List<DataFlickerPO> dataFlickerPO = getDataFlicker(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataFlickerPO)){
|
|
||||||
dataFlickerPOList.addAll (dataFlickerPO);
|
|
||||||
}
|
|
||||||
/*生成dayFluc表*/
|
|
||||||
List<DataFlucPO> dataFlucPO = getDataFluc(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataFlucPO)){
|
|
||||||
dataFlucPOList.addAll (dataFlucPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayHarmphasicI表*/
|
|
||||||
List<DataHarmPhasicIPO> dataHarmphasicIPO = getDataHarmphasicI(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataHarmphasicIPO)){
|
|
||||||
dataHarmPhasicIPOList.addAll (dataHarmphasicIPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayHarmphasicV表*/
|
|
||||||
List<DataHarmPhasicVPO> dataHarmphasicVPO = getDataHarmphasicV(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataHarmphasicVPO)){
|
|
||||||
dataHarmPhasicVPOList.addAll (dataHarmphasicVPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayHarmPowerP表*/
|
|
||||||
List<DataHarmPowerPPO> dataHarmPowerPPO = getDataHarmPowerP(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataHarmPowerPPO)){
|
|
||||||
dataHarmPowerPPOList.addAll (dataHarmPowerPPO);
|
|
||||||
}
|
|
||||||
/*生成dayHarmPowerQ表*/
|
|
||||||
List<DataHarmPowerQPO> dataHarmPowerQPO = getDataHarmPowerQ(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataHarmPowerQPO)){
|
|
||||||
dataHarmPowerQPOList.addAll (dataHarmPowerQPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayHarmPowerS表*/
|
|
||||||
List<DataHarmPowerSPO> dataHarmPowers = getDataHarmPowerS(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataHarmPowers)){
|
|
||||||
dataHarmPowerSPOList.addAll (dataHarmPowers);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayHarmRateI*/
|
|
||||||
List<DataHarmRateIPO> dataHarmRateI = getDataHarmRateI(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataHarmRateI)){
|
|
||||||
dataHarmRateIPOList.addAll (dataHarmRateI);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayHarmRateV*/
|
|
||||||
List<DataHarmRateVPO> dataHarmRateVPO = getDataHarmRateV(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataHarmRateVPO)){
|
|
||||||
dataHarmRateVPOList.addAll (dataHarmRateVPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayInHarmI*/
|
|
||||||
List<DataInHarmIPO> dataInHarmIPO = getDataInHarmI(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataInHarmIPO)){
|
|
||||||
dataInHarmIPOList.addAll (dataInHarmIPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayInHarmV*/
|
|
||||||
List<DataInHarmVPO> dataInHarmVPO = getDataInHarmV(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataInHarmVPO)){
|
|
||||||
dataInHarmVPOList.addAll (dataInHarmVPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayInHarmRateI*/
|
|
||||||
List<DataInHarmRateIPO> dataInHarmRateIPO = getDataInHarmRateI(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataInHarmRateIPO)){
|
|
||||||
dataInHarmRateIPOList.addAll (dataInHarmRateIPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayInHarmRateV*/
|
|
||||||
List<DataInHarmRateVPO> dataInHarmRateVPO = getDataInHarmRateV(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataInHarmRateVPO)){
|
|
||||||
dataInHarmRateVPOList.addAll (dataInHarmRateVPO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*生成dayPlt*/
|
|
||||||
List<DataPltPO> dataPlt = getDataPlt(lineIndex,startTime,endTime);
|
|
||||||
if(!CollectionUtils.isEmpty (dataPlt)){
|
|
||||||
dataPltPOList.addAll (dataPlt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*mysql数据转化 */
|
|
||||||
/*RMpHarmonicVRateReportDPO*/
|
|
||||||
// if(!CollectionUtils.isEmpty (dataV)&&!CollectionUtils.isEmpty (dataHarmRateVPO)){
|
|
||||||
// /*转成mysql对应po*/
|
|
||||||
// /*dataVPO.getPhaseType ()="A"数据*/
|
|
||||||
// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOA = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"A",instant);
|
|
||||||
// Optional.ofNullable (rMpHarmonicVRateReportDPOA).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
|
||||||
// /*dataVPO.getPhaseType ()="B"数据*/
|
|
||||||
// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOB = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"B",instant);
|
|
||||||
// Optional.ofNullable (rMpHarmonicVRateReportDPOB).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*dataVPO.getPhaseType ()="C"数据*/
|
|
||||||
// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOC = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO, "C",instant);
|
|
||||||
// Optional.ofNullable (rMpHarmonicVRateReportDPOC).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*dataVPO.getPhaseType ()="T"数据*/
|
|
||||||
// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOT = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"T",instant);
|
|
||||||
// Optional.ofNullable (rMpHarmonicVRateReportDPOT).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
// Instant instant = null;
|
||||||
|
//// influxDbUtils.setDbName ("pqsbase");
|
||||||
|
// try {
|
||||||
|
// instant = new SimpleDateFormat ("yyyy-MM-dd").parse (startTime).toInstant ( );
|
||||||
|
// } catch (ParseException e) {
|
||||||
|
// e.printStackTrace ( );
|
||||||
// }
|
// }
|
||||||
// /*RMpHarmonicIMagReportDPO*/
|
// Long time= instant.toEpochMilli();
|
||||||
|
//
|
||||||
|
// List<DataVPO> dataVPOList = new ArrayList<> ();
|
||||||
|
// List<DataIPO> dataIPOList = new ArrayList<> ();
|
||||||
|
// List<DataFlickerPO> dataFlickerPOList = new ArrayList<> ();
|
||||||
|
// List<DataFlucPO> dataFlucPOList = new ArrayList<> ();
|
||||||
|
// List<DataHarmPhasicIPO> dataHarmPhasicIPOList = new ArrayList<> ();
|
||||||
|
// List<DataHarmPhasicVPO> dataHarmPhasicVPOList = new ArrayList<> ();
|
||||||
|
// List<DataHarmPowerPPO> dataHarmPowerPPOList = new ArrayList<> ();
|
||||||
|
// List<DataHarmPowerQPO> dataHarmPowerQPOList = new ArrayList<> ();
|
||||||
|
// List<DataHarmPowerSPO> dataHarmPowerSPOList = new ArrayList<> ();
|
||||||
|
// List<DataHarmRateIPO> dataHarmRateIPOList = new ArrayList<> ();
|
||||||
|
// List<DataHarmRateVPO> dataHarmRateVPOList = new ArrayList<> ();
|
||||||
|
// List<DataInHarmIPO> dataInHarmIPOList = new ArrayList<> ();
|
||||||
|
// List<DataInHarmVPO> dataInHarmVPOList = new ArrayList<> ();
|
||||||
|
// List<DataInHarmRateIPO> dataInHarmRateIPOList = new ArrayList<> ();
|
||||||
|
// List<DataInHarmRateVPO> dataInHarmRateVPOList = new ArrayList<> ();
|
||||||
|
// List<DataPltPO> dataPltPOList = new ArrayList<> ();
|
||||||
|
//
|
||||||
|
// List<RMpHarmonicVRateReportD> rMpHarmonicVRateReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpHarmonicIMagReportD> rMpHarmonicIMagReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpFlickerReportDPO> rMpFlickerReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpPltReportDPO> rMpPltReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpHarmonicIRateReportD> rMpHarmonicIRateReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpInharmonicIRateReportD> rMpInharmonicIRateReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpInharmonicIMagReportDPO> rMpInharmonicIMagReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpInharmonicVRateReportD> rMpInharmonicVRateReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpHarmonicPReportDPO> rMpHarmonicPReportDPOList = new ArrayList<> ();
|
||||||
|
// List<RMpMeasurePhaseReportD> rMpMeasurePhaseReportDPOArrayList = new ArrayList<> ();
|
||||||
|
// List<RMpMeasureReportD> rMpMeasureReportDPOArrayList = new ArrayList<> ();
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// for (int i = 0; i <indexLists.size () ; i++) {
|
||||||
|
//
|
||||||
|
// String lineIndex =indexLists.get (i);
|
||||||
|
// /*生成dayV表*/
|
||||||
|
// List<DataVPO> dataV = getDataV(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataV)){
|
||||||
|
// dataVPOList.addAll (dataV);
|
||||||
|
// }
|
||||||
|
// /*生成dayI表*/
|
||||||
|
// List<DataIPO> dataI = getDataI(lineIndex,startTime,endTime);
|
||||||
// if(!CollectionUtils.isEmpty (dataI)){
|
// if(!CollectionUtils.isEmpty (dataI)){
|
||||||
//
|
// dataIPOList.addAll (dataI);
|
||||||
// /*转成mysql对应po*/
|
|
||||||
// /*dataI.getPhaseType ()="A"数据*/
|
|
||||||
// RMpHarmonicIMagReportD a = packageRMpHarmonicIMagReportDPO (dataI, "A",instant);
|
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
|
||||||
// /*dataI.getPhaseType ()="B"数据*/
|
|
||||||
// RMpHarmonicIMagReportD b = packageRMpHarmonicIMagReportDPO(dataI,"B",instant);
|
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
|
||||||
// /*dataI.getPhaseType ()="C"数据*/
|
|
||||||
// RMpHarmonicIMagReportD c = packageRMpHarmonicIMagReportDPO(dataI,"C",instant);
|
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
|
||||||
// /*dataI.getPhaseType ()="T"数据*/
|
|
||||||
// RMpHarmonicIMagReportD t = packageRMpHarmonicIMagReportDPO(dataI,"T",instant);
|
|
||||||
// Optional.ofNullable (t).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
// }
|
||||||
// /*生成dayFlicker表*/
|
// List<DataFlickerPO> dataFlickerPO = getDataFlicker(lineIndex,startTime,endTime);
|
||||||
// if(!CollectionUtils.isEmpty (dataFlickerPO)){
|
// if(!CollectionUtils.isEmpty (dataFlickerPO)){
|
||||||
// /*生成dayFlicker表*/
|
// dataFlickerPOList.addAll (dataFlickerPO);
|
||||||
// /*dataFlickerPO.getPhaseType ()="A"数据*/
|
|
||||||
// RMpFlickerReportDPO a = packageRMpFlickerReportDPOPO (dataFlickerPO, "A",instant);
|
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*dataFlickerPO.getPhaseType ()="B"数据*/
|
|
||||||
// RMpFlickerReportDPO b = packageRMpFlickerReportDPOPO(dataFlickerPO,"B",instant);
|
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*dataFlickerPO.getPhaseType ()="C"数据*/
|
|
||||||
// RMpFlickerReportDPO c = packageRMpFlickerReportDPOPO(dataFlickerPO,"C",instant);
|
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
|
|
||||||
// /*无T项数据*/
|
|
||||||
//// /*dataFlickerPO.getPhaseType ()="T"数据*/
|
|
||||||
//// RMpFlickerReportDPO t = packageRMpFlickerReportDPOPO(dataFlickerPO,"T");
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
// }
|
||||||
// if(!CollectionUtils.isEmpty (dataPlt)){
|
// /*生成dayFluc表*/
|
||||||
// /*转成mysql对应po*/
|
// List<DataFlucPO> dataFlucPO = getDataFluc(lineIndex,startTime,endTime);
|
||||||
// /*DataPltPO.getPhaseType ()="A"数据*/
|
// if(!CollectionUtils.isEmpty (dataFlucPO)){
|
||||||
// RMpPltReportDPO a = packageRMpPltReportDPO (dataPlt, "A",instant);
|
// dataFlucPOList.addAll (dataFlucPO);
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpPltReportDPOList.add (temp));
|
|
||||||
// /*DataPltPO.getPhaseType ()="B"数据*/
|
|
||||||
// RMpPltReportDPO b = packageRMpPltReportDPO(dataPlt,"B",instant);
|
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpPltReportDPOList.add (temp));
|
|
||||||
// /*DataPltPO.getPhaseType ()="C"数据*/
|
|
||||||
// RMpPltReportDPO c = packageRMpPltReportDPO(dataPlt,"C",instant);
|
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpPltReportDPOList.add (temp));
|
|
||||||
//// /*DataPltPO.getPhaseType ()="T"数据*/
|
|
||||||
//// RMpPltReportDPO t = packageRMpPltReportDPO(dataPlt,"T");
|
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayHarmphasicI表*/
|
||||||
|
// List<DataHarmPhasicIPO> dataHarmphasicIPO = getDataHarmphasicI(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataHarmphasicIPO)){
|
||||||
|
// dataHarmPhasicIPOList.addAll (dataHarmphasicIPO);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayHarmphasicV表*/
|
||||||
|
// List<DataHarmPhasicVPO> dataHarmphasicVPO = getDataHarmphasicV(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataHarmphasicVPO)){
|
||||||
|
// dataHarmPhasicVPOList.addAll (dataHarmphasicVPO);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayHarmPowerP表*/
|
||||||
|
// List<DataHarmPowerPPO> dataHarmPowerPPO = getDataHarmPowerP(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataHarmPowerPPO)){
|
||||||
|
// dataHarmPowerPPOList.addAll (dataHarmPowerPPO);
|
||||||
|
// }
|
||||||
|
// /*生成dayHarmPowerQ表*/
|
||||||
|
// List<DataHarmPowerQPO> dataHarmPowerQPO = getDataHarmPowerQ(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataHarmPowerQPO)){
|
||||||
|
// dataHarmPowerQPOList.addAll (dataHarmPowerQPO);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayHarmPowerS表*/
|
||||||
|
// List<DataHarmPowerSPO> dataHarmPowers = getDataHarmPowerS(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataHarmPowers)){
|
||||||
|
// dataHarmPowerSPOList.addAll (dataHarmPowers);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayHarmRateI*/
|
||||||
|
// List<DataHarmRateIPO> dataHarmRateI = getDataHarmRateI(lineIndex,startTime,endTime);
|
||||||
// if(!CollectionUtils.isEmpty (dataHarmRateI)){
|
// if(!CollectionUtils.isEmpty (dataHarmRateI)){
|
||||||
// /*转成mysql对应po*/
|
// dataHarmRateIPOList.addAll (dataHarmRateI);
|
||||||
// /*DataHarmRateIPO.getPhaseType ()="A"数据*/
|
|
||||||
// RMpHarmonicIRateReportD a = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "A",instant);
|
|
||||||
// Optional.ofNullable (a).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*DataHarmRateIPO.getPhaseType ()="B"数据*/
|
|
||||||
// RMpHarmonicIRateReportD b = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "B",instant);
|
|
||||||
// Optional.ofNullable (b).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*DataHarmRateIPO.getPhaseType ()="C"数据*/
|
|
||||||
// RMpHarmonicIRateReportD c = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "C",instant);
|
|
||||||
// Optional.ofNullable (c).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*DataInHarmRateIPO.getPhaseType ()="T"数据*/
|
|
||||||
// RMpHarmonicIRateReportD t = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "T",instant);
|
|
||||||
// Optional.ofNullable (t).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if(!CollectionUtils.isEmpty (dataInHarmRateIPO)){
|
|
||||||
// /*转成mysql对应po*/
|
|
||||||
// /*DataInHarmRateIPO.getPhaseType ()="A"数据*/
|
|
||||||
// RMpInharmonicIRateReportD a = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO, "A",instant);
|
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*DataInHarmRateIPO.getPhaseType ()="B"数据*/
|
|
||||||
// RMpInharmonicIRateReportD b = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"B",instant);
|
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*DataInHarmRateIPO.getPhaseType ()="C"数据*/
|
|
||||||
// RMpInharmonicIRateReportD c = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"C",instant);
|
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// /*DataInHarmRateIPO.getPhaseType ()="T"数据*/
|
|
||||||
// RMpInharmonicIRateReportD t = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"T",instant);
|
|
||||||
// Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
// /*生成dayHarmRateV*/
|
||||||
|
// List<DataHarmRateVPO> dataHarmRateVPO = getDataHarmRateV(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataHarmRateVPO)){
|
||||||
|
// dataHarmRateVPOList.addAll (dataHarmRateVPO);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayInHarmI*/
|
||||||
|
// List<DataInHarmIPO> dataInHarmIPO = getDataInHarmI(lineIndex,startTime,endTime);
|
||||||
// if(!CollectionUtils.isEmpty (dataInHarmIPO)){
|
// if(!CollectionUtils.isEmpty (dataInHarmIPO)){
|
||||||
// /*转成mysql对应po*/
|
// dataInHarmIPOList.addAll (dataInHarmIPO);
|
||||||
// /*dataInHarmIPO.getPhaseType ()="A"数据*/
|
|
||||||
// RMpInharmonicIMagReportDPO a = packageRMpInharmonicIMagReportDPO(dataInHarmIPO, "A",instant);
|
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
|
||||||
// /*dataInHarmIPO.getPhaseType ()="B"数据*/
|
|
||||||
// RMpInharmonicIMagReportDPO b = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"B",instant);
|
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
|
||||||
// /*dataInHarmIPO.getPhaseType ()="C"数据*/
|
|
||||||
// RMpInharmonicIMagReportDPO c = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"C",instant);
|
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
|
||||||
// /*dataInHarmIPO.getPhaseType ()="T"数据*/
|
|
||||||
// RMpInharmonicIMagReportDPO t = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"T",instant);
|
|
||||||
// Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayInHarmV*/
|
||||||
|
// List<DataInHarmVPO> dataInHarmVPO = getDataInHarmV(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataInHarmVPO)){
|
||||||
|
// dataInHarmVPOList.addAll (dataInHarmVPO);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayInHarmRateI*/
|
||||||
|
// List<DataInHarmRateIPO> dataInHarmRateIPO = getDataInHarmRateI(lineIndex,startTime,endTime);
|
||||||
|
// if(!CollectionUtils.isEmpty (dataInHarmRateIPO)){
|
||||||
|
// dataInHarmRateIPOList.addAll (dataInHarmRateIPO);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*生成dayInHarmRateV*/
|
||||||
|
// List<DataInHarmRateVPO> dataInHarmRateVPO = getDataInHarmRateV(lineIndex,startTime,endTime);
|
||||||
// if(!CollectionUtils.isEmpty (dataInHarmRateVPO)){
|
// if(!CollectionUtils.isEmpty (dataInHarmRateVPO)){
|
||||||
// /*转成mysql对应po*/
|
// dataInHarmRateVPOList.addAll (dataInHarmRateVPO);
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
|
|
||||||
// RMpInharmonicVRateReportD a = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO, "A",instant);
|
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
|
|
||||||
// RMpInharmonicVRateReportD b = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"B",instant);
|
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
|
|
||||||
// RMpInharmonicVRateReportD c = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"C",instant);
|
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
|
|
||||||
// RMpInharmonicVRateReportD t = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"T",instant);
|
|
||||||
// Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
|
||||||
//
|
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// if(!CollectionUtils.isEmpty (dataHarmPowerPPO)&&!CollectionUtils.isEmpty (dataHarmPowerQPO)){
|
// /*生成dayPlt*/
|
||||||
// /*转成mysql对应po*/
|
// List<DataPltPO> dataPlt = getDataPlt(lineIndex,startTime,endTime);
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
|
// if(!CollectionUtils.isEmpty (dataPlt)){
|
||||||
// RMpHarmonicPReportDPO a = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO, "A",instant);
|
// dataPltPOList.addAll (dataPlt);
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
// }
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
|
//
|
||||||
// RMpHarmonicPReportDPO b = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"B",instant);
|
// /*mysql数据转化 */
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
// /*RMpHarmonicVRateReportDPO*/
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
|
//// if(!CollectionUtils.isEmpty (dataV)&&!CollectionUtils.isEmpty (dataHarmRateVPO)){
|
||||||
// RMpHarmonicPReportDPO c = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"C",instant);
|
//// /*转成mysql对应po*/
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
//// /*dataVPO.getPhaseType ()="A"数据*/
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
|
//// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOA = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"A",instant);
|
||||||
// RMpHarmonicPReportDPO t = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"T",instant);
|
//// Optional.ofNullable (rMpHarmonicVRateReportDPOA).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
||||||
// Optional.ofNullable (t).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
//// /*dataVPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOB = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"B",instant);
|
||||||
|
//// Optional.ofNullable (rMpHarmonicVRateReportDPOB).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*dataVPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOC = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO, "C",instant);
|
||||||
|
//// Optional.ofNullable (rMpHarmonicVRateReportDPOC).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*dataVPO.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOT = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"T",instant);
|
||||||
|
//// Optional.ofNullable (rMpHarmonicVRateReportDPOT).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
//// /*RMpHarmonicIMagReportDPO*/
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataI)){
|
||||||
|
////
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*dataI.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpHarmonicIMagReportD a = packageRMpHarmonicIMagReportDPO (dataI, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
||||||
|
//// /*dataI.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpHarmonicIMagReportD b = packageRMpHarmonicIMagReportDPO(dataI,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
||||||
|
//// /*dataI.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpHarmonicIMagReportD c = packageRMpHarmonicIMagReportDPO(dataI,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
||||||
|
//// /*dataI.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpHarmonicIMagReportD t = packageRMpHarmonicIMagReportDPO(dataI,"T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
//// /*生成dayFlicker表*/
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataFlickerPO)){
|
||||||
|
//// /*生成dayFlicker表*/
|
||||||
|
//// /*dataFlickerPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpFlickerReportDPO a = packageRMpFlickerReportDPOPO (dataFlickerPO, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*dataFlickerPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpFlickerReportDPO b = packageRMpFlickerReportDPOPO(dataFlickerPO,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*dataFlickerPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpFlickerReportDPO c = packageRMpFlickerReportDPOPO(dataFlickerPO,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
|
||||||
|
//// /*无T项数据*/
|
||||||
|
////// /*dataFlickerPO.getPhaseType ()="T"数据*/
|
||||||
|
////// RMpFlickerReportDPO t = packageRMpFlickerReportDPOPO(dataFlickerPO,"T");
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataPlt)){
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*DataPltPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpPltReportDPO a = packageRMpPltReportDPO (dataPlt, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpPltReportDPOList.add (temp));
|
||||||
|
//// /*DataPltPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpPltReportDPO b = packageRMpPltReportDPO(dataPlt,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpPltReportDPOList.add (temp));
|
||||||
|
//// /*DataPltPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpPltReportDPO c = packageRMpPltReportDPO(dataPlt,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpPltReportDPOList.add (temp));
|
||||||
|
////// /*DataPltPO.getPhaseType ()="T"数据*/
|
||||||
|
////// RMpPltReportDPO t = packageRMpPltReportDPO(dataPlt,"T");
|
||||||
|
//// }
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataHarmRateI)) {
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*DataHarmRateIPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpHarmonicIRateReportD a = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*DataHarmRateIPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpHarmonicIRateReportD b = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*DataHarmRateIPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpHarmonicIRateReportD c = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*DataInHarmRateIPO.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpHarmonicIRateReportD t = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataInHarmRateIPO)){
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*DataInHarmRateIPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpInharmonicIRateReportD a = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*DataInHarmRateIPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpInharmonicIRateReportD b = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*DataInHarmRateIPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpInharmonicIRateReportD c = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// /*DataInHarmRateIPO.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpInharmonicIRateReportD t = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataInHarmIPO)){
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*dataInHarmIPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpInharmonicIMagReportDPO a = packageRMpInharmonicIMagReportDPO(dataInHarmIPO, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmIPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpInharmonicIMagReportDPO b = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmIPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpInharmonicIMagReportDPO c = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmIPO.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpInharmonicIMagReportDPO t = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataInHarmRateVPO)){
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpInharmonicVRateReportD a = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpInharmonicVRateReportD b = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpInharmonicVRateReportD c = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpInharmonicVRateReportD t = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// if(!CollectionUtils.isEmpty (dataHarmPowerPPO)&&!CollectionUtils.isEmpty (dataHarmPowerQPO)){
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpHarmonicPReportDPO a = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO, "A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpHarmonicPReportDPO b = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpHarmonicPReportDPO c = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpHarmonicPReportDPO t = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// if (!CollectionUtils.isEmpty (dataV) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataI) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataHarmPowerPPO) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataHarmPowers) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataHarmPowerQPO)) {
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
|
||||||
|
//// RMpMeasurePhaseReportD a = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"A",instant);
|
||||||
|
//// Optional.ofNullable (a).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
|
||||||
|
//// RMpMeasurePhaseReportD b = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"B",instant);
|
||||||
|
//// Optional.ofNullable (b).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
|
||||||
|
//// RMpMeasurePhaseReportD c = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"C",instant);
|
||||||
|
//// Optional.ofNullable (c).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
||||||
|
//// /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
|
||||||
|
//// RMpMeasurePhaseReportD t = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
//// /* todo
|
||||||
|
//// * r_mp_measure_report_d
|
||||||
|
//// * */
|
||||||
|
//// if (!CollectionUtils.isEmpty (dataV) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataI) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataHarmPowerPPO) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataHarmPowers) &&
|
||||||
|
//// !CollectionUtils.isEmpty (dataHarmPowerQPO)) {
|
||||||
|
//// /*转成mysql对应po*/
|
||||||
|
//// /*稳态监测点非谐波不带相位指标即是T项指标*/
|
||||||
|
//// RMpMeasureReportD t = packageRMpMeasureReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"T",instant);
|
||||||
|
//// Optional.ofNullable (t).ifPresent (temp ->rMpMeasureReportDPOArrayList.add (temp));
|
||||||
|
////
|
||||||
|
//// }
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// if (!CollectionUtils.isEmpty (dataV) &&
|
// /*插入mysql*/
|
||||||
// !CollectionUtils.isEmpty (dataI) &&
|
//// if (!CollectionUtils.isEmpty(rMpHarmonicVRateReportDPOList)){
|
||||||
// !CollectionUtils.isEmpty (dataHarmPowerPPO) &&
|
//// rMpHarmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicVRateReportDPOList, 50);
|
||||||
// !CollectionUtils.isEmpty (dataHarmPowers) &&
|
//// }
|
||||||
// !CollectionUtils.isEmpty (dataHarmPowerQPO)) {
|
////
|
||||||
// /*转成mysql对应po*/
|
//// if (!CollectionUtils.isEmpty(rMpHarmonicIMagReportDPOList)){
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
|
//// rMpHarmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIMagReportDPOList, 50);
|
||||||
// RMpMeasurePhaseReportD a = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"A",instant);
|
//// }
|
||||||
// Optional.ofNullable (a).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
////
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
|
//// if (!CollectionUtils.isEmpty(rMpFlickerReportDPOList)){
|
||||||
// RMpMeasurePhaseReportD b = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"B",instant);
|
//// rMpFlickerReportDPOService.saveOrUpdateBatchByMultiId (rMpFlickerReportDPOList, 50);
|
||||||
// Optional.ofNullable (b).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
//// }
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
|
////
|
||||||
// RMpMeasurePhaseReportD c = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"C",instant);
|
//// if (!CollectionUtils.isEmpty(rMpPltReportDPOList)){
|
||||||
// Optional.ofNullable (c).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
//// rMpPltReportDPOService.saveOrUpdateBatchByMultiId (rMpPltReportDPOList, 50);
|
||||||
// /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
|
//// }
|
||||||
// RMpMeasurePhaseReportD t = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"T",instant);
|
////
|
||||||
// Optional.ofNullable (t).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
|
//// if (!CollectionUtils.isEmpty(rMpHarmonicIRateReportDPOList)){
|
||||||
|
//// rMpHarmonicIRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIRateReportDPOList, 50);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// if (!CollectionUtils.isEmpty(rMpInharmonicIRateReportDPOList)){
|
||||||
|
//// rMpInharmonicIRateReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicIRateReportDPOList, 50);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// if (!CollectionUtils.isEmpty(rMpInharmonicIMagReportDPOList)){
|
||||||
|
//// rMpInharmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicIMagReportDPOList, 50);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// if (!CollectionUtils.isEmpty(rMpInharmonicVRateReportDPOList)){
|
||||||
|
//// rMpInharmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicVRateReportDPOList, 50);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// if (!CollectionUtils.isEmpty(rMpMeasurePhaseReportDPOArrayList)){
|
||||||
|
//// rMpMeasurePhaseReportDPOService.saveOrUpdateBatchByMultiId (rMpMeasurePhaseReportDPOArrayList, 50);
|
||||||
|
//// }
|
||||||
|
//// if (!CollectionUtils.isEmpty(rMpMeasureReportDPOArrayList)){
|
||||||
|
//// rMpMeasureReportDPOService.saveOrUpdateBatchByMultiId (rMpMeasureReportDPOArrayList, 50);
|
||||||
|
//// }
|
||||||
//
|
//
|
||||||
// }
|
|
||||||
// /* todo
|
|
||||||
// * r_mp_measure_report_d
|
|
||||||
// * */
|
|
||||||
// if (!CollectionUtils.isEmpty (dataV) &&
|
|
||||||
// !CollectionUtils.isEmpty (dataI) &&
|
|
||||||
// !CollectionUtils.isEmpty (dataHarmPowerPPO) &&
|
|
||||||
// !CollectionUtils.isEmpty (dataHarmPowers) &&
|
|
||||||
// !CollectionUtils.isEmpty (dataHarmPowerQPO)) {
|
|
||||||
// /*转成mysql对应po*/
|
|
||||||
// /*稳态监测点非谐波不带相位指标即是T项指标*/
|
|
||||||
// RMpMeasureReportD t = packageRMpMeasureReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"T",instant);
|
|
||||||
// Optional.ofNullable (t).ifPresent (temp ->rMpMeasureReportDPOArrayList.add (temp));
|
|
||||||
//
|
//
|
||||||
// }
|
//
|
||||||
|
// if (!CollectionUtils.isEmpty(dataVPOList)){
|
||||||
}
|
// insertDayV(dataVPOList,time);
|
||||||
|
|
||||||
|
|
||||||
/*插入mysql*/
|
|
||||||
// if (!CollectionUtils.isEmpty(rMpHarmonicVRateReportDPOList)){
|
|
||||||
// rMpHarmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicVRateReportDPOList, 50);
|
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// if (!CollectionUtils.isEmpty(rMpHarmonicIMagReportDPOList)){
|
// if (!CollectionUtils.isEmpty(dataIPOList)){
|
||||||
// rMpHarmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIMagReportDPOList, 50);
|
// insertDayI(dataIPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataFlickerPOList)){
|
||||||
|
// insertDayFlicker(dataFlickerPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataFlucPOList)){
|
||||||
|
// insertDayFluc(dataFlucPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataHarmPhasicIPOList)){
|
||||||
|
// insertDayHarmphasicI(dataHarmPhasicIPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataHarmPhasicVPOList)){
|
||||||
|
// insertDayHarmphasicV(dataHarmPhasicVPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataHarmPowerPPOList)){
|
||||||
|
// insertDayHarmPowerP(dataHarmPowerPPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataHarmPowerQPOList)){
|
||||||
|
// insertDayHarmPowerQ(dataHarmPowerQPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataHarmPowerSPOList)){
|
||||||
|
// insertDayHarmPowerS(dataHarmPowerSPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataHarmRateIPOList)){
|
||||||
|
// insertDayHarmRateI(dataHarmRateIPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataHarmRateVPOList)){
|
||||||
|
// insertDayHarmRateV(dataHarmRateVPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataInHarmIPOList)){
|
||||||
|
// insertDayInHarmI(dataInHarmIPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataInHarmVPOList)){
|
||||||
|
// insertDayInHarmV(dataInHarmVPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataInHarmRateIPOList)){
|
||||||
|
// insertDayInHarmRateI(dataInHarmRateIPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataInHarmRateVPOList)){
|
||||||
|
// insertDayInHarmRateV(dataInHarmRateVPOList,time);
|
||||||
|
// }
|
||||||
|
// if (!CollectionUtils.isEmpty(dataPltPOList)){
|
||||||
|
// insertDayPlt(dataPltPOList,time);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// if (!CollectionUtils.isEmpty(rMpFlickerReportDPOList)){
|
|
||||||
// rMpFlickerReportDPOService.saveOrUpdateBatchByMultiId (rMpFlickerReportDPOList, 50);
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
// if (!CollectionUtils.isEmpty(rMpPltReportDPOList)){
|
// log.info(LocalDateTime.now()+"dayDataJobHandler执行完成!");
|
||||||
// rMpPltReportDPOService.saveOrUpdateBatchByMultiId (rMpPltReportDPOList, 50);
|
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// if (!CollectionUtils.isEmpty(rMpHarmonicIRateReportDPOList)){
|
|
||||||
// rMpHarmonicIRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIRateReportDPOList, 50);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (!CollectionUtils.isEmpty(rMpInharmonicIRateReportDPOList)){
|
|
||||||
// rMpInharmonicIRateReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicIRateReportDPOList, 50);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (!CollectionUtils.isEmpty(rMpInharmonicIMagReportDPOList)){
|
|
||||||
// rMpInharmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicIMagReportDPOList, 50);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (!CollectionUtils.isEmpty(rMpInharmonicVRateReportDPOList)){
|
|
||||||
// rMpInharmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicVRateReportDPOList, 50);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (!CollectionUtils.isEmpty(rMpMeasurePhaseReportDPOArrayList)){
|
|
||||||
// rMpMeasurePhaseReportDPOService.saveOrUpdateBatchByMultiId (rMpMeasurePhaseReportDPOArrayList, 50);
|
|
||||||
// }
|
|
||||||
// if (!CollectionUtils.isEmpty(rMpMeasureReportDPOArrayList)){
|
|
||||||
// rMpMeasureReportDPOService.saveOrUpdateBatchByMultiId (rMpMeasureReportDPOArrayList, 50);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPOList)){
|
|
||||||
insertDayV(dataVPOList,time);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(dataIPOList)){
|
|
||||||
insertDayI(dataIPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataFlickerPOList)){
|
|
||||||
insertDayFlicker(dataFlickerPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataFlucPOList)){
|
|
||||||
insertDayFluc(dataFlucPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmPhasicIPOList)){
|
|
||||||
insertDayHarmphasicI(dataHarmPhasicIPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmPhasicVPOList)){
|
|
||||||
insertDayHarmphasicV(dataHarmPhasicVPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmPowerPPOList)){
|
|
||||||
insertDayHarmPowerP(dataHarmPowerPPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmPowerQPOList)){
|
|
||||||
insertDayHarmPowerQ(dataHarmPowerQPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmPowerSPOList)){
|
|
||||||
insertDayHarmPowerS(dataHarmPowerSPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmRateIPOList)){
|
|
||||||
insertDayHarmRateI(dataHarmRateIPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmRateVPOList)){
|
|
||||||
insertDayHarmRateV(dataHarmRateVPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataInHarmIPOList)){
|
|
||||||
insertDayInHarmI(dataInHarmIPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataInHarmVPOList)){
|
|
||||||
insertDayInHarmV(dataInHarmVPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataInHarmRateIPOList)){
|
|
||||||
insertDayInHarmRateI(dataInHarmRateIPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataInHarmRateVPOList)){
|
|
||||||
insertDayInHarmRateV(dataInHarmRateVPOList,time);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataPltPOList)){
|
|
||||||
insertDayPlt(dataPltPOList,time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
log.info(LocalDateTime.now()+"dayDataJobHandler执行完成!");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
@@ -563,6 +563,7 @@ public class DayDataServiceImpl implements DayDataService {
|
|||||||
List<RStatDataInharmVDPO> dataInHarmVPOList = new ArrayList<> ();
|
List<RStatDataInharmVDPO> dataInHarmVPOList = new ArrayList<> ();
|
||||||
List<RStatDataPltDPO> dataPltPOList = new ArrayList<> ();
|
List<RStatDataPltDPO> dataPltPOList = new ArrayList<> ();
|
||||||
|
|
||||||
|
|
||||||
for (String lineIndex : indexLists) {
|
for (String lineIndex : indexLists) {
|
||||||
|
|
||||||
/*生成dayV表*/
|
/*生成dayV表*/
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.line;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||||
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||||
|
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||||
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
@@ -12,6 +17,8 @@ import com.njcn.prepare.harmonic.mapper.mysql.day.RStatIntegrityDMapper;
|
|||||||
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
|
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
|
||||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
import com.njcn.prepare.harmonic.service.mysql.line.IntegrityService;
|
import com.njcn.prepare.harmonic.service.mysql.line.IntegrityService;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.po.Dept;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.influxdb.InfluxDB;
|
import org.influxdb.InfluxDB;
|
||||||
@@ -48,6 +55,10 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
|
|||||||
|
|
||||||
private final LineFeignClient lineFeignClient;
|
private final LineFeignClient lineFeignClient;
|
||||||
|
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
|
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
|
|
||||||
/*@Override
|
/*@Override
|
||||||
@Async("asyncExecutor")
|
@Async("asyncExecutor")
|
||||||
public String computeDataIntegrity(LineParam lineParam) {
|
public String computeDataIntegrity(LineParam lineParam) {
|
||||||
@@ -83,33 +94,37 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Async("asyncExecutor")
|
@Async("asyncExecutor")
|
||||||
public void dataIntegrity(LineParam lineParam,String time) {
|
public void dataIntegrity(LineParam lineParam,String startTime,String endTime) {
|
||||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
String data = time + " 00:00:00";
|
LocalDateTime dateTime = LocalDateTime.parse(startTime,df);
|
||||||
LocalDateTime dateTime = LocalDateTime.parse(data,df);
|
|
||||||
List<LineDetail> lineDetailList = new ArrayList<>();
|
List<LineDevGetDTO> lineDevGetDTOList = new ArrayList<>();
|
||||||
if (CollUtil.isEmpty(lineParam.getLineIds())){
|
if (CollUtil.isEmpty(lineParam.getLineIds())){
|
||||||
List<Overlimit> overLimitList = getAllLinesLimitData();
|
Dept dept = deptFeignClient.getRootDept().getData();
|
||||||
List<String> lineList = overLimitList.stream().map(Overlimit::getId).collect(Collectors.toList());
|
|
||||||
lineDetailList = lineFeignClient.getLineDetail(lineList).getData();
|
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||||
|
deptGetLineParam.setDeptId(dept.getId());
|
||||||
|
deptGetLineParam.setServerName(ServerEnum.HARMONIC.getName());
|
||||||
|
List<String> monitorIds = commTerminalGeneralClient.getRunMonitorIds().getData();
|
||||||
|
lineDevGetDTOList = commTerminalGeneralClient.getMonitorDetailList(monitorIds).getData();
|
||||||
}else {
|
}else {
|
||||||
lineDetailList = lineFeignClient.getLineDetail(lineParam.getLineIds()).getData();
|
lineDevGetDTOList = commTerminalGeneralClient.getMonitorDetailList(lineParam.getLineIds()).getData();
|
||||||
}
|
}
|
||||||
List<RStatIntegrityD> list = new ArrayList<>();
|
List<RStatIntegrityD> list = new ArrayList<>();
|
||||||
for (LineDetail lineDetail :lineDetailList){
|
for (LineDevGetDTO lineDetail :lineDevGetDTOList){
|
||||||
int dataCount = getDataCount(lineDetail.getId(),time);
|
int dataCount = getDataCount(lineDetail.getPointId(),startTime,endTime);
|
||||||
RStatIntegrityD integrityDpo = new RStatIntegrityD();
|
RStatIntegrityD integrityDpo = new RStatIntegrityD();
|
||||||
integrityDpo.setTimeId(dateTime);
|
integrityDpo.setTimeId(dateTime);
|
||||||
integrityDpo.setLineIndex(lineDetail.getId());
|
integrityDpo.setLineIndex(lineDetail.getPointId());
|
||||||
integrityDpo.setDueTime(DAY_MINUTE/lineDetail.getTimeInterval());
|
integrityDpo.setDueTime(DAY_MINUTE/lineDetail.getInterval());
|
||||||
integrityDpo.setRealTime(dataCount);
|
integrityDpo.setRealTime(dataCount);
|
||||||
list.add(integrityDpo);
|
list.add(integrityDpo);
|
||||||
}
|
}
|
||||||
this.saveOrUpdateBatchByMultiId(list,500);
|
this.saveOrUpdateBatchByMultiId(list,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDataCount(String lineId,String date){
|
private int getDataCount(String lineId,String startTime,String endTime){
|
||||||
QueryResult sqlResult = influxDbUtils.query("SELECT * FROM data_v WHERE time >= '" + date + " 00:00:00' and time <= '" + date + " 23:59:59' and line_id = '" + lineId + "' and phasic_type = 'T' and value_type = 'MAX' tz('Asia/Shanghai')");
|
QueryResult sqlResult = influxDbUtils.query("SELECT * FROM data_v WHERE time >= '" + startTime + "' and time <= '" + endTime + "' and line_id = '" + lineId + "' and phasic_type = 'T' and value_type = 'MAX' tz('Asia/Shanghai')");
|
||||||
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
|
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
|
||||||
List<DataVPO> list = resultMapper.toPOJO(sqlResult, DataVPO.class);
|
List<DataVPO> list = resultMapper.toPOJO(sqlResult, DataVPO.class);
|
||||||
if (CollectionUtils.isEmpty(list)){
|
if (CollectionUtils.isEmpty(list)){
|
||||||
@@ -119,7 +134,5 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Overlimit> getAllLinesLimitData() {
|
|
||||||
return lineFeignClient.getAllLineOverLimit("harmonic-boot","").getData();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public interface DayDataService {
|
|||||||
* @Author: clam
|
* @Author: clam
|
||||||
* @Date: 2022/10/24
|
* @Date: 2022/10/24
|
||||||
*/
|
*/
|
||||||
void dayDataJobHandler(List<String> indexLists, String startTime, String endTime);
|
//void dayDataJobHandler(List<String> indexLists, String startTime, String endTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理day表,并将数据入MySQL库中
|
* 处理day表,并将数据入MySQL库中
|
||||||
|
|||||||
@@ -11,5 +11,5 @@ public interface IntegrityService {
|
|||||||
|
|
||||||
//String computeDataIntegrity(LineParam lineParam);
|
//String computeDataIntegrity(LineParam lineParam);
|
||||||
|
|
||||||
void dataIntegrity(LineParam lineParam,String time);
|
void dataIntegrity(LineParam lineParam,String startTime,String endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user