|
@@ -1,11 +1,24 @@
|
|
|
package com.jiayue.ipfcst.console.service;
|
|
|
|
|
|
import com.jiayue.ipfcst.common.core.exception.BusinessException;
|
|
|
+import com.jiayue.ipfcst.common.core.util.JsonBeanUtil;
|
|
|
import com.jiayue.ipfcst.common.data.constant.enums.ElectricFieldStatrsEnum;
|
|
|
-import com.jiayue.ipfcst.common.data.entity.ElectricField;
|
|
|
-import com.jiayue.ipfcst.common.data.entity.UploadFileChannel;
|
|
|
+import com.jiayue.ipfcst.common.data.entity.*;
|
|
|
+import com.jiayue.ipfcst.common.data.entity.gathertunnelinfo.*;
|
|
|
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.Sender104TcpTunnelInfo;
|
|
|
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderCdtRtuTunnelInfo;
|
|
|
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderModbusRtuTunnelInfo;
|
|
|
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderModbusTcpTunnelInfo;
|
|
|
import com.jiayue.ipfcst.common.data.repository.ElectricFieldRepository;
|
|
|
import com.jiayue.ipfcst.common.data.service.BaseService;
|
|
|
+import com.jiayue.ipfcst.dataexchange.service.EquipmentAttributeService;
|
|
|
+import com.jiayue.ipfcst.dataexchange.service.ProtocolGatherDataPointService;
|
|
|
+import com.jiayue.ipfcst.dataexchange.service.ProtocolSenderDataPointService;
|
|
|
+import com.jiayue.ipfcst.dataexchange.service.TunnelInfoService;
|
|
|
+import com.jiayue.ipfcst.fileupload.service.UploadFileChannelService;
|
|
|
+import com.jiayue.ipfcst.fileupload.service.UploadFileCodeService;
|
|
|
+import com.jiayue.ipfcst.fileupload.service.UploadObjectService;
|
|
|
+import com.jiayue.ipfcst.fileupload.service.UploadURLService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import net.sf.ehcache.Cache;
|
|
|
import net.sf.ehcache.Element;
|
|
@@ -38,6 +51,66 @@ public class ElectricFieldService extends BaseService {
|
|
|
@Autowired
|
|
|
EhCacheCacheManager ehCacheCacheManager;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ PvModuleModelService pvModuleModelService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ InverterInfoService inverterInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ WeatherStationInfoService weatherStationInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ WindTowerInfoService windTowerInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ WindTurbineInfoService windTurbineInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ AGC_AVCInfoService agcAvcInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ BoosterStationInfoService boosterStationInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ SubsidiaryEquipmentInfoService subsidiaryEquipmentInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ UploadObjectService uploadObjectService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ UploadURLService uploadURLService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ UploadFileChannelService uploadFileChannelService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ UploadFileCodeService uploadFileCodeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ OverHaulPlanService overHaulPlanService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ QuartzService quartzService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ InitJobClassService initJobClassService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ SysParameterService sysParameterService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ TunnelInfoService tunnelInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ EquipmentAttributeService equipmentAttributeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ProtocolSenderDataPointService protocolSenderDataPointService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ProtocolGatherDataPointService protocolGatherDataPointService;
|
|
|
+
|
|
|
private final ElectricFieldRepository electricFieldRepository;
|
|
|
|
|
|
@Autowired
|
|
@@ -129,4 +202,298 @@ public class ElectricFieldService extends BaseService {
|
|
|
}
|
|
|
return electricField;
|
|
|
}
|
|
|
+
|
|
|
+ public List<String> queryAllParamsFromDb(ElectricField electricField) throws Exception{
|
|
|
+ String header = electricField.getStationCode();
|
|
|
+ List<String> valList = new ArrayList<>();
|
|
|
+ //场站信息
|
|
|
+ List<ElectricField> electricFields = new ArrayList<>();
|
|
|
+ electricFields.add(electricField);
|
|
|
+ String val = "ElectricField:::" + JsonBeanUtil.beanToJson(electricFields);
|
|
|
+ valList.add(val);
|
|
|
+
|
|
|
+ //光伏组件信息
|
|
|
+ List<PvModuleModel> pvModuleModelList = pvModuleModelService.getAll();
|
|
|
+ if (null != pvModuleModelList && pvModuleModelList.size() > 0) {
|
|
|
+ for (PvModuleModel bean : pvModuleModelList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "PvModuleModel:::" + JsonBeanUtil.beanToJson(pvModuleModelList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //检修计划
|
|
|
+ List<OverhaulPlan> overhaulPlanList = overHaulPlanService.getAll();
|
|
|
+ if (null != overhaulPlanList && overhaulPlanList.size() > 0) {
|
|
|
+ for (OverhaulPlan bean : overhaulPlanList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "OverhaulPlan:::" + JsonBeanUtil.beanToJson(overhaulPlanList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //逆变器信息
|
|
|
+ List<InverterInfo> inverterInfoList = inverterInfoService.getAll();
|
|
|
+ if (null != inverterInfoList && inverterInfoList.size() > 0) {
|
|
|
+ for (InverterInfo bean : inverterInfoList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "InverterInfo:::" + JsonBeanUtil.beanToJson(inverterInfoList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //气象站数据
|
|
|
+ List<WeatherStationInfo> weatherStationInfoList = weatherStationInfoService.getAll();
|
|
|
+ if (null != weatherStationInfoList && weatherStationInfoList.size() > 0) {
|
|
|
+ for (WeatherStationInfo bean : weatherStationInfoList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "WeatherStationInfo:::" + JsonBeanUtil.beanToJson(weatherStationInfoList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //测风塔
|
|
|
+ List<WindTowerInfo> windTowerInfoList = windTowerInfoService.getAll();
|
|
|
+ if (null != windTowerInfoList && windTowerInfoList.size() > 0) {
|
|
|
+ for (WindTowerInfo bean : windTowerInfoList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "WindTowerInfo:::" + JsonBeanUtil.beanToJson(windTowerInfoList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //风机
|
|
|
+ List<WindTurbineInfo> windTurbineInfoList = windTurbineInfoService.getAll();
|
|
|
+ if (null != windTurbineInfoList && windTurbineInfoList.size() > 0) {
|
|
|
+ for (WindTurbineInfo bean : windTurbineInfoList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "WindTurbineInfo:::" + JsonBeanUtil.beanToJson(windTurbineInfoList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //初始化定时任务
|
|
|
+ List<InitJobClass> initJobClassList = initJobClassService.findAll();
|
|
|
+ if (null != initJobClassList && initJobClassList.size() > 0) {
|
|
|
+ for (InitJobClass bean : initJobClassList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "InitJobClass:::" + JsonBeanUtil.beanToJson(initJobClassList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //定时任务
|
|
|
+ List<Quartz> quartzList = quartzService.getAll();
|
|
|
+ if (null != quartzList && quartzList.size() > 0) {
|
|
|
+ for (Quartz bean : quartzList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "Quartz:::" + JsonBeanUtil.beanToJson(quartzList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //系统参数
|
|
|
+ List<SysParameter> sysParameterList = sysParameterService.getAll();
|
|
|
+ if (null != sysParameterList && sysParameterList.size() > 0) {
|
|
|
+ for (SysParameter bean : sysParameterList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "SysParameter:::" + JsonBeanUtil.beanToJson(sysParameterList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //文件上报部分
|
|
|
+ List<UploadObject> uploadObjectList = uploadObjectService.get();
|
|
|
+ if (null != uploadObjectList && uploadObjectList.size() > 0) {
|
|
|
+ for (UploadObject bean : uploadObjectList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "UploadObject:::" + JsonBeanUtil.beanToJson(uploadObjectList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //上报通道
|
|
|
+ List<UploadFileChannel> uploadFileChannels = uploadFileChannelService.get();
|
|
|
+ if (null != uploadFileChannels && uploadFileChannels.size() > 0) {
|
|
|
+ for (UploadFileChannel bean : uploadFileChannels) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "UploadFileChannel:::" + JsonBeanUtil.beanToJson(uploadFileChannels);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //上报文件编码
|
|
|
+ List<UploadFileCode> uploadFileCodes = uploadFileCodeService.get();
|
|
|
+ if (null != uploadFileCodes && uploadFileCodes.size() > 0) {
|
|
|
+ for (UploadFileCode bean : uploadFileCodes) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "UploadFileCode:::" + JsonBeanUtil.beanToJson(uploadFileCodes);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //上报文件路径
|
|
|
+ List<UploadURL> uploadURLS = uploadURLService.findAll();
|
|
|
+ if (null != uploadURLS && uploadURLS.size() > 0) {
|
|
|
+ for (UploadURL bean : uploadURLS) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "UploadURL:::" + JsonBeanUtil.beanToJson(uploadURLS);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //数据接入部分
|
|
|
+ List<EquipmentAttribute> equipmentAttributes = equipmentAttributeService.getAll();
|
|
|
+ if (null != equipmentAttributes && equipmentAttributes.size() > 0) {
|
|
|
+ for (EquipmentAttribute bean : equipmentAttributes) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "EquipmentAttribute:::" + JsonBeanUtil.beanToJson(equipmentAttributes);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //文件解析通道信息
|
|
|
+ List<FileParseTunnelInfo> fileParseTunnelInfos = tunnelInfoService.getAllFileParseTunnel();
|
|
|
+ if (null != fileParseTunnelInfos && fileParseTunnelInfos.size() > 0) {
|
|
|
+ for (FileParseTunnelInfo bean : fileParseTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "FileParseTunnelInfo:::" + JsonBeanUtil.beanToJson(fileParseTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //104tcp 接入通道
|
|
|
+ List<Gather104TcpTunnelInfo> gather104TcpTunnelInfos = tunnelInfoService.getAllGather104TcpTunnel();
|
|
|
+ if (null != gather104TcpTunnelInfos && gather104TcpTunnelInfos.size() > 0) {
|
|
|
+ for (Gather104TcpTunnelInfo bean : gather104TcpTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "Gather104TcpTunnelInfo:::" + JsonBeanUtil.beanToJson(gather104TcpTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //cdtRtu接入通道
|
|
|
+ List<GatherCdtRtuTunnelInfo> gatherCdtRtuTunnelInfos = tunnelInfoService.getAllGatherCdtRtuTunnel();
|
|
|
+ if (null != gatherCdtRtuTunnelInfos && gatherCdtRtuTunnelInfos.size() > 0) {
|
|
|
+ for (GatherCdtRtuTunnelInfo bean : gatherCdtRtuTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "GatherCdtRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherCdtRtuTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //modbusRtu接入通道
|
|
|
+ List<GatherModbusRtuTunnelInfo> gatherModbusRtuTunnelInfos =
|
|
|
+ tunnelInfoService.getAllGatherModbusRtuTunnel();
|
|
|
+ if (null != gatherModbusRtuTunnelInfos && gatherModbusRtuTunnelInfos.size() > 0) {
|
|
|
+ for (GatherModbusRtuTunnelInfo bean : gatherModbusRtuTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "GatherModbusRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusRtuTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //modbusTcp接入通道
|
|
|
+ List<GatherModbusTcpTunnelInfo> gatherModbusTcpTunnelInfos =
|
|
|
+ tunnelInfoService.getAllGatherModbusTcpTunnel();
|
|
|
+ if (null != gatherModbusTcpTunnelInfos && gatherModbusTcpTunnelInfos.size() > 0) {
|
|
|
+ for (GatherModbusTcpTunnelInfo bean : gatherModbusTcpTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "GatherModbusTcpTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusTcpTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //ModbusRtuWithTcp 接入通道
|
|
|
+ List<GatherModbusRtuWithTcpServerTunnelInfo> gatherModbusRtuWithTcpServerTunnelInfos =
|
|
|
+ tunnelInfoService.getAllGatherModbusRtuWithTcpServerTunnel();
|
|
|
+ if (null != gatherModbusRtuWithTcpServerTunnelInfos && gatherModbusRtuWithTcpServerTunnelInfos.size() > 0) {
|
|
|
+ for (GatherModbusRtuWithTcpServerTunnelInfo bean : gatherModbusRtuWithTcpServerTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "GatherModbusRtuWithTcpServerTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusRtuWithTcpServerTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //104tcp转发通道
|
|
|
+ List<Sender104TcpTunnelInfo> sender104TcpTunnelInfos = tunnelInfoService.getAllSender104TcpTunnel();
|
|
|
+ if (null != sender104TcpTunnelInfos && sender104TcpTunnelInfos.size() > 0) {
|
|
|
+ for (Sender104TcpTunnelInfo bean : sender104TcpTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "Sender104TcpTunnelInfo:::" + JsonBeanUtil.beanToJson(sender104TcpTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //CdtRtu转发通道
|
|
|
+ List<SenderCdtRtuTunnelInfo> senderCdtRtuTunnelInfos = tunnelInfoService.getAllSenderCdtRtuTunnel();
|
|
|
+ if (null != senderCdtRtuTunnelInfos && senderCdtRtuTunnelInfos.size() > 0) {
|
|
|
+ for (SenderCdtRtuTunnelInfo bean : senderCdtRtuTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "SenderCdtRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(senderCdtRtuTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //ModbusRtu 转发通道
|
|
|
+ List<SenderModbusRtuTunnelInfo> senderModbusRtuTunnelInfos =
|
|
|
+ tunnelInfoService.getAllSenderModbusRtuTunnel();
|
|
|
+ if (null != senderModbusRtuTunnelInfos && senderModbusRtuTunnelInfos.size() > 0) {
|
|
|
+ for (SenderModbusRtuTunnelInfo bean : senderModbusRtuTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "SenderModbusRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(senderModbusRtuTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //ModbusTcp 转发通道
|
|
|
+ List<SenderModbusTcpTunnelInfo> senderModbusTcpTunnelInfos =
|
|
|
+ tunnelInfoService.getAllSenderModbusTcpTunnel();
|
|
|
+ if (null != senderModbusTcpTunnelInfos && senderModbusTcpTunnelInfos.size() > 0) {
|
|
|
+ for (SenderModbusTcpTunnelInfo bean : senderModbusTcpTunnelInfos) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "SenderModbusTcpTunnelInfo:::" + JsonBeanUtil.beanToJson(senderModbusTcpTunnelInfos);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //转发点表
|
|
|
+ List<ProtocolSenderDataPoint> protocolSenderDataPoints = protocolSenderDataPointService.getAll();
|
|
|
+ if (null != protocolSenderDataPoints && protocolSenderDataPoints.size() > 0) {
|
|
|
+ for (ProtocolSenderDataPoint bean : protocolSenderDataPoints) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "ProtocolSenderDataPoint:::" + JsonBeanUtil.beanToJson(protocolSenderDataPoints);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+ //接入点表
|
|
|
+ List<ProtocolGatherDataPoint> protocolGatherDataPoints = protocolGatherDataPointService.getAll();
|
|
|
+ if (null != protocolGatherDataPoints && protocolGatherDataPoints.size() > 0) {
|
|
|
+ for (ProtocolGatherDataPoint bean : protocolGatherDataPoints) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "ProtocolGatherDataPoint:::" + JsonBeanUtil.beanToJson(protocolGatherDataPoints);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ // -------------------------20220615 新增agc/avc 升压站 南方电网设备-----------------------------------
|
|
|
+ //gac/avc
|
|
|
+ List<AGC_AVCInfo> agcAvcInfoList = agcAvcInfoService.getAll();
|
|
|
+ if (null != agcAvcInfoList && agcAvcInfoList.size() > 0) {
|
|
|
+ for (AGC_AVCInfo bean : agcAvcInfoList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "AgcAvcInfo:::" + JsonBeanUtil.beanToJson(agcAvcInfoList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //升压站
|
|
|
+ List<BoosterStationInfo> boosterStationInfoList = boosterStationInfoService.getAll();
|
|
|
+ if (null != boosterStationInfoList && boosterStationInfoList.size() > 0) {
|
|
|
+ for (BoosterStationInfo bean : boosterStationInfoList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "BoosterStationInfo:::" + JsonBeanUtil.beanToJson(boosterStationInfoList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ //南方电网设备
|
|
|
+ List<SubsidiaryEquipmentInfo> subsidiaryEquipmentInfoList = subsidiaryEquipmentInfoService.getAll();
|
|
|
+ if (null != subsidiaryEquipmentInfoList && subsidiaryEquipmentInfoList.size() > 0) {
|
|
|
+ for (SubsidiaryEquipmentInfo bean : subsidiaryEquipmentInfoList) {
|
|
|
+ bean.setStationCode(header);
|
|
|
+ }
|
|
|
+ val = "SubsidiaryEquipmentInfo:::" + JsonBeanUtil.beanToJson(subsidiaryEquipmentInfoList);
|
|
|
+ valList.add(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ return valList;
|
|
|
+ }
|
|
|
}
|