预处理兼容pq/pms处理

This commit is contained in:
2023-09-21 09:15:48 +08:00
parent 79865cc395
commit d868558c6e
22 changed files with 771 additions and 508 deletions

View File

@@ -1,10 +1,12 @@
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.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.NjcnDateUtils;
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
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.RestController;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
@@ -49,7 +54,7 @@ public class DayDataController extends BaseController {
private final CommTerminalGeneralClient commTerminalGeneralClient;
@Deprecated
/* @Deprecated
@ApiOperation("day表定时任务")
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
@PostMapping("dayDataHanlder")
@@ -73,7 +78,7 @@ public class DayDataController extends BaseController {
} else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
}
}
}*/
@ApiOperation("day表定时任务(MySQL库)")
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
@@ -89,22 +94,22 @@ public class DayDataController extends BaseController {
} else{
indexLists = jobParam.getLineIds();
}
if (jobParam.getType() == 3){
int year = Integer.parseInt(jobParam.getDataDate().split("-")[0]);
int month = Integer.parseInt(jobParam.getDataDate().split("-")[1]);
List<String> dayList = PublicUtil.getDayByMonth(year,month);
for (String item : dayList) {
if (jobParam.getRepairFlag()){
List<String> timeRange = NjcnDateUtils.findEveryDay(jobParam.getBeginTime(),jobParam.getEndTime());
for (String item : timeRange) {
log.info(item+"-->开始执行");
startTime = item+" "+"00:00:00";
endTime = item+" "+"23:59:59";
dayDataService.dataToDayHandler(indexLists,startTime,endTime);
}
} else {
startTime = jobParam.getDataDate()+" "+"00:00:00";
endTime = jobParam.getDataDate()+" "+"23:59:59";
log.info("统计时间范围:"+startTime+"----->"+endTime);
dayDataService.dataToDayHandler(indexLists,startTime,endTime);
dayDataService.dataToDayHandler(indexLists,jobParam.getBeginTime(),jobParam.getEndTime());
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
}
}

View File

@@ -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.response.HttpResult;
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.service.mysql.line.IntegrityService;
import com.njcn.prepare.harmonic.utils.PublicUtil;
@@ -56,16 +57,17 @@ public class IntegrityController extends BaseController {
public HttpResult<String> dataIntegrity(@RequestBody @Validated LineParam lineParam){
log.info(LocalDateTime.now()+"dataIntegrity开始执行");
String methodDescribe = getMethodDescribe("dataIntegrity");
if (lineParam.getType() == 3){
int year = Integer.parseInt(lineParam.getDataDate().split("-")[0]);
int month = Integer.parseInt(lineParam.getDataDate().split("-")[1]);
List<String> dayList = PublicUtil.getDayByMonth(year,month);
for (String item : dayList) {
String startTime,endTime;
if (lineParam.getRepairFlag()){
List<String> timeRange = NjcnDateUtils.findEveryDay(lineParam.getBeginTime(),lineParam.getEndTime());
for (String item : timeRange) {
log.info(item+"-->开始执行");
integrityService.dataIntegrity(lineParam,item);
startTime = item+" "+"00:00:00";
endTime = item+" "+"23:59:59";
integrityService.dataIntegrity(lineParam,startTime,endTime);
}
} else {
integrityService.dataIntegrity(lineParam,lineParam.getDataDate());
integrityService.dataIntegrity(lineParam,lineParam.getBeginTime(),lineParam.getEndTime());
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, CommonResponseEnum.SUCCESS.getMessage(), methodDescribe);
}

View File

@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class DayDataServiceImpl implements DayDataService {
private final RMpHarmonicVRateReportDPOService rMpHarmonicVRateReportDPOService;
/* private final RMpHarmonicVRateReportDPOService rMpHarmonicVRateReportDPOService;
private final RMpHarmonicIMagReportDPOService rMpHarmonicIMagReportDPOService;
private final RMpFlickerReportDPOService rMpFlickerReportDPOService;
private final RMpPltReportDPOService rMpPltReportDPOService;
@@ -59,7 +59,7 @@ public class DayDataServiceImpl implements DayDataService {
private final RMpInharmonicVRateReportDPOService rMpInharmonicVRateReportDPOService;
private final RMpHarmonicPReportDPOService rMpHarmonicPReportDPOService;
private final RMpMeasurePhaseReportDPOService rMpMeasurePhaseReportDPOService;
private final RMpMeasureReportDPOService rMpMeasureReportDPOService;
private final RMpMeasureReportDPOService rMpMeasureReportDPOService;*/
//MySQL
private final IRStatDataFlickerDService statDataFlickerDService;
@@ -89,452 +89,452 @@ public class DayDataServiceImpl implements DayDataService {
* @Author: clam
* @Date: 2022/10/24
*/
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Async("asyncExecutor")
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));
// @Override
// @Transactional(
// rollbackFor = {Exception.class}
// )
// @Async("asyncExecutor")
// 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);
// }
// /*RMpHarmonicIMagReportDPO*/
// /*生成dayI表*/
// List<DataIPO> dataI = getDataI(lineIndex,startTime,endTime);
// 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));
//
//
// dataIPOList.addAll (dataI);
// }
// /*生成dayFlicker表*/
// List<DataFlickerPO> dataFlickerPO = getDataFlicker(lineIndex,startTime,endTime);
// 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");
//
//
// dataFlickerPOList.addAll (dataFlickerPO);
// }
// 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));
// /*生成dayFluc表*/
// List<DataFlucPO> dataFlucPO = getDataFluc(lineIndex,startTime,endTime);
// if(!CollectionUtils.isEmpty (dataFlucPO)){
// dataFlucPOList.addAll (dataFlucPO);
// }
//
// if(!CollectionUtils.isEmpty (dataInHarmRateIPO)){
// /*转成mysql对应po*/
// /*DataInHarmRateIPO.getPhaseType ()="A"数据*/
// RMpInharmonicIRateReportD a = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO, "A",instant);
// Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
// /*生成dayHarmphasicI表*/
// List<DataHarmPhasicIPO> dataHarmphasicIPO = getDataHarmphasicI(lineIndex,startTime,endTime);
// if(!CollectionUtils.isEmpty (dataHarmphasicIPO)){
// dataHarmPhasicIPOList.addAll (dataHarmphasicIPO);
// }
//
// /*DataInHarmRateIPO.getPhaseType ()="B"数据*/
// RMpInharmonicIRateReportD b = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"B",instant);
// Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
// /*生成dayHarmphasicV表*/
// List<DataHarmPhasicVPO> dataHarmphasicVPO = getDataHarmphasicV(lineIndex,startTime,endTime);
// if(!CollectionUtils.isEmpty (dataHarmphasicVPO)){
// dataHarmPhasicVPOList.addAll (dataHarmphasicVPO);
// }
//
// /*DataInHarmRateIPO.getPhaseType ()="C"数据*/
// RMpInharmonicIRateReportD c = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"C",instant);
// Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
// /*生成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);
// }
//
// /*DataInHarmRateIPO.getPhaseType ()="T"数据*/
// RMpInharmonicIRateReportD t = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"T",instant);
// Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
// /*生成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)){
// /*转成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));
//
// 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)){
// /*转成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));
//
// dataInHarmRateVPOList.addAll (dataInHarmRateVPO);
// }
//
// 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));
//
// /*生成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));
////
////
//// }
//// /*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) &&
// !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));
//
// }
}
/*插入mysql*/
// if (!CollectionUtils.isEmpty(rMpHarmonicVRateReportDPOList)){
// rMpHarmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicVRateReportDPOList, 50);
// }
//
// if (!CollectionUtils.isEmpty(rMpHarmonicIMagReportDPOList)){
// rMpHarmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIMagReportDPOList, 50);
//
// /*插入mysql*/
//// if (!CollectionUtils.isEmpty(rMpHarmonicVRateReportDPOList)){
//// rMpHarmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicVRateReportDPOList, 50);
//// }
////
//// if (!CollectionUtils.isEmpty(rMpHarmonicIMagReportDPOList)){
//// rMpHarmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIMagReportDPOList, 50);
//// }
////
//// if (!CollectionUtils.isEmpty(rMpFlickerReportDPOList)){
//// rMpFlickerReportDPOService.saveOrUpdateBatchByMultiId (rMpFlickerReportDPOList, 50);
//// }
////
//// if (!CollectionUtils.isEmpty(rMpPltReportDPOList)){
//// 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(rMpFlickerReportDPOList)){
// rMpFlickerReportDPOService.saveOrUpdateBatchByMultiId (rMpFlickerReportDPOList, 50);
// 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);
// }
//
// if (!CollectionUtils.isEmpty(rMpPltReportDPOList)){
// 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执行完成!");
}
// log.info(LocalDateTime.now()+"dayDataJobHandler执行完成!");
// }
@Override
@Transactional(rollbackFor = {Exception.class})
@@ -563,6 +563,7 @@ public class DayDataServiceImpl implements DayDataService {
List<RStatDataInharmVDPO> dataInHarmVPOList = new ArrayList<> ();
List<RStatDataPltDPO> dataPltPOList = new ArrayList<> ();
for (String lineIndex : indexLists) {
/*生成dayV表*/

View File

@@ -3,6 +3,11 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.line;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
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.pojo.po.LineDetail;
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.param.LineParam;
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.extern.slf4j.Slf4j;
import org.influxdb.InfluxDB;
@@ -48,6 +55,10 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
private final LineFeignClient lineFeignClient;
private final DeptFeignClient deptFeignClient;
private final CommTerminalGeneralClient commTerminalGeneralClient;
/*@Override
@Async("asyncExecutor")
public String computeDataIntegrity(LineParam lineParam) {
@@ -83,33 +94,37 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
*/
@Override
@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");
String data = time + " 00:00:00";
LocalDateTime dateTime = LocalDateTime.parse(data,df);
List<LineDetail> lineDetailList = new ArrayList<>();
LocalDateTime dateTime = LocalDateTime.parse(startTime,df);
List<LineDevGetDTO> lineDevGetDTOList = new ArrayList<>();
if (CollUtil.isEmpty(lineParam.getLineIds())){
List<Overlimit> overLimitList = getAllLinesLimitData();
List<String> lineList = overLimitList.stream().map(Overlimit::getId).collect(Collectors.toList());
lineDetailList = lineFeignClient.getLineDetail(lineList).getData();
Dept dept = deptFeignClient.getRootDept().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 {
lineDetailList = lineFeignClient.getLineDetail(lineParam.getLineIds()).getData();
lineDevGetDTOList = commTerminalGeneralClient.getMonitorDetailList(lineParam.getLineIds()).getData();
}
List<RStatIntegrityD> list = new ArrayList<>();
for (LineDetail lineDetail :lineDetailList){
int dataCount = getDataCount(lineDetail.getId(),time);
for (LineDevGetDTO lineDetail :lineDevGetDTOList){
int dataCount = getDataCount(lineDetail.getPointId(),startTime,endTime);
RStatIntegrityD integrityDpo = new RStatIntegrityD();
integrityDpo.setTimeId(dateTime);
integrityDpo.setLineIndex(lineDetail.getId());
integrityDpo.setDueTime(DAY_MINUTE/lineDetail.getTimeInterval());
integrityDpo.setLineIndex(lineDetail.getPointId());
integrityDpo.setDueTime(DAY_MINUTE/lineDetail.getInterval());
integrityDpo.setRealTime(dataCount);
list.add(integrityDpo);
}
this.saveOrUpdateBatchByMultiId(list,500);
}
private int getDataCount(String lineId,String date){
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')");
private int getDataCount(String lineId,String startTime,String endTime){
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();
List<DataVPO> list = resultMapper.toPOJO(sqlResult, DataVPO.class);
if (CollectionUtils.isEmpty(list)){
@@ -119,7 +134,5 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
}
}
private List<Overlimit> getAllLinesLimitData() {
return lineFeignClient.getAllLineOverLimit("harmonic-boot","").getData();
}
}

View File

@@ -11,14 +11,14 @@ import java.util.List;
* @version V1.0.0
*/
public interface DayDataService {
/**
* @Description: 生成day表相关数据
* @Param: [indexLists, startTime, endTime]
* @return: void
/**
* @Description: 生成day表相关数据
* @Param: [indexLists, startTime, endTime]
* @return: void
* @Author: clam
* @Date: 2022/10/24
*/
void dayDataJobHandler(List<String> indexLists, String startTime, String endTime);
* @Date: 2022/10/24
*/
//void dayDataJobHandler(List<String> indexLists, String startTime, String endTime);
/**
* 处理day表并将数据入MySQL库中

View File

@@ -11,5 +11,5 @@ public interface IntegrityService {
//String computeDataIntegrity(LineParam lineParam);
void dataIntegrity(LineParam lineParam,String time);
void dataIntegrity(LineParam lineParam,String startTime,String endTime);
}