Merge remote-tracking branch 'origin/main' into liaoning
This commit is contained in:
@@ -264,7 +264,7 @@ public class AnalyWave {
|
||||
break;
|
||||
case 1:// 总点数 //这里的strTemp是一个偏移量
|
||||
OneRate.nSampleNum = (long) (Float.parseFloat(strTempArray[j]) - nOffset);
|
||||
nOffset = OneRate.nSampleNum;
|
||||
nOffset += OneRate.nSampleNum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ public class GovernSchemeCalcServiceImpl implements IGovernSchemeCalcService {
|
||||
throw new BusinessException(AdvanceResponseEnum.INCOMING_LINE_DATA_MISS);
|
||||
}
|
||||
sgGovernSchemeHistoryAllVO.setInComingLineName(sgIncomingLine.getName());
|
||||
sgGovernSchemeHistoryAllVO.getQuick().setIncomingLineId(sgIncomingLine.getName());
|
||||
//时间内的电网接入水平(暂降次数)
|
||||
String startTime = sgGovernSchemeHistoryParam.getStartTime();
|
||||
String endTime = sgGovernSchemeHistoryParam.getEndTime();
|
||||
|
||||
@@ -432,7 +432,7 @@ public class WaveFileComponent {
|
||||
rateDTO.setNOneSample(result);
|
||||
// 总点数 //这里的strTemp是一个偏移量
|
||||
rateDTO.setNSampleNum((Integer.parseInt(strTempArray[1]) - nOffset));
|
||||
nOffset = rateDTO.getNSampleNum();
|
||||
nOffset += rateDTO.getNSampleNum();
|
||||
lstRate.add(rateDTO);
|
||||
}
|
||||
comtradeCfgDTO.setLstRate(lstRate);
|
||||
@@ -497,7 +497,7 @@ public class WaveFileComponent {
|
||||
int nDigSize = (comtradeCfgDTO.getNDigitalNum() % 16) > 0 ? (comtradeCfgDTO.getNDigitalNum() / 16 + 1) * 2 : comtradeCfgDTO.getNDigitalNum() / 16 * 2;
|
||||
int nBlockSize = 2 * Integer.SIZE / 8 + comtradeCfgDTO.getNAnalogNum() * 2 + nDigSize;
|
||||
// 总长度除以每个块的大小
|
||||
int nBlockNum = datArray.length / nBlockSize;
|
||||
int nBlockNum = (int)Math.floor(datArray.length / nBlockSize);
|
||||
|
||||
// 获取采样率
|
||||
int finalSampleRate = getFinalWaveSample(comtradeCfgDTO.getLstRate(), iType);
|
||||
@@ -612,6 +612,9 @@ public class WaveFileComponent {
|
||||
}
|
||||
float fCoef = comtradeCfgDTO.getLstAnalogDTO().get(j).getFCoefficent();
|
||||
|
||||
if((i * nBlockSize + 2 * 4 + j * 2) == 2437568){
|
||||
System.out.println(55);
|
||||
}
|
||||
fValue = BitConverter.byte2ToUnsignedShort(datArray, i * nBlockSize + 2 * 4 + j * 2) * fCoef;
|
||||
//WW 2019-11-14
|
||||
/*************************
|
||||
@@ -767,6 +770,7 @@ public class WaveFileComponent {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new BusinessException(WaveFileResponseEnum.DAT_DATA_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,26 @@ public interface BusinessTopic {
|
||||
*/
|
||||
String DEVICE_RUN_FLAG_TOPIC = "Device_Run_Flag_Topic";
|
||||
|
||||
/**
|
||||
* 云前置日志主题
|
||||
*/
|
||||
String LOG_TOPIC = "log_Topic";
|
||||
|
||||
/**
|
||||
* 台账更新下发
|
||||
*/
|
||||
String CONTROL_TOPIC = "control_Topic";
|
||||
|
||||
/**
|
||||
* 台账更新前置端响应
|
||||
*/
|
||||
String REPLY_TOPIC = "Reply_Topic";
|
||||
|
||||
/**
|
||||
* 前置进程控制
|
||||
*/
|
||||
String PROCESS_TOPIC = "process_Topic";
|
||||
|
||||
/********************************数据中心*********************************/
|
||||
|
||||
String RMP_EVENT_DETAIL_TOPIC = "rmpEventDetailTopic";
|
||||
|
||||
@@ -28,14 +28,14 @@ public class AppFileMessage extends BaseMessage {
|
||||
|
||||
private Integer code;
|
||||
|
||||
private AppFileMessage.Msg msg;
|
||||
private Msg msg;
|
||||
|
||||
@Data
|
||||
public static class Msg{
|
||||
|
||||
private String type;
|
||||
|
||||
private AppFileMessage.FileInfo fileInfo;
|
||||
private FileInfo fileInfo;
|
||||
|
||||
private String data;
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.mq.message;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 类的介绍:日志信息
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2025/9/18 15:06
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CldControlMessage {
|
||||
|
||||
@ApiModelProperty("请求的guid")
|
||||
private String guid;
|
||||
|
||||
@ApiModelProperty("功能代号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("指定处理的进程号")
|
||||
private Integer processNo;
|
||||
|
||||
@ApiModelProperty("delete用于杀死进程")
|
||||
private String fun;
|
||||
|
||||
@ApiModelProperty("进程数")
|
||||
private Integer processNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.mq.message;
|
||||
|
||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 类的介绍:日志信息
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2025/9/18 15:06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CldLogMessage extends BaseMessage {
|
||||
|
||||
@ApiModelProperty("前置id")
|
||||
private String nodeId;
|
||||
|
||||
@ApiModelProperty("进程id")
|
||||
private String processNo;
|
||||
|
||||
@ApiModelProperty("监测点id、装置id")
|
||||
private String businessId;
|
||||
|
||||
@ApiModelProperty("级别(process进程、terminal装置、measurepoint监测点)")
|
||||
private String level;
|
||||
|
||||
@ApiModelProperty("日志等级")
|
||||
private String grade;
|
||||
|
||||
@ApiModelProperty("告警码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("告警时间")
|
||||
private String time;
|
||||
|
||||
@ApiModelProperty("日志信息")
|
||||
private String log;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.njcn.mq.message;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* cld设备更新台账实体
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class CldUpdateLedgerMessage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("消息唯一标识")
|
||||
private String guid;
|
||||
|
||||
@ApiModelProperty("add_terminal/delete_terminal/ledger_modify")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("进程号")
|
||||
private Integer processNo;
|
||||
|
||||
@ApiModelProperty("数据")
|
||||
private List<CldDeviceDto> data;
|
||||
|
||||
@Data
|
||||
public static class CldDeviceDto implements Serializable {
|
||||
|
||||
@ApiModelProperty("最大进程数")
|
||||
private Integer maxProcessNum;
|
||||
|
||||
@ApiModelProperty("进程号")
|
||||
private Integer node;
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("设备MAC")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("设备型号")
|
||||
private String devType;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("监测点信息集合")
|
||||
private List<CldMonitorDto> monitorData;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CldMonitorDto implements Serializable {
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("监测点线路号")
|
||||
private String lineNo;
|
||||
|
||||
@ApiModelProperty("电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@ApiModelProperty("status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("接线方式")
|
||||
private String ptType;
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("pt一次变比")
|
||||
private Double pt1;
|
||||
|
||||
@ApiModelProperty("pt二次变比")
|
||||
private Double pt2;
|
||||
|
||||
@ApiModelProperty("ct一次变比")
|
||||
private Double ct1;
|
||||
|
||||
@ApiModelProperty("ct二次变比")
|
||||
private Double ct2;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,14 +1,10 @@
|
||||
package com.njcn.mq.message;
|
||||
|
||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
@@ -39,4 +35,7 @@ public class RealDataMessage {
|
||||
@ApiModelProperty("限制")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty("idx")
|
||||
private Integer idx;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.mq.message;
|
||||
|
||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2025/9/29 15:06
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UpdateLedgerMessage extends BaseMessage {
|
||||
|
||||
@ApiModelProperty("唯一标识")
|
||||
private String guid;
|
||||
|
||||
@ApiModelProperty("数据")
|
||||
private List<HandleData> data;
|
||||
|
||||
@Data
|
||||
public static class HandleData implements Serializable {
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("响应码")
|
||||
private Integer code;
|
||||
|
||||
@ApiModelProperty("结果描述")
|
||||
private String result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.mq.template;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||
import com.njcn.mq.constant.BusinessResource;
|
||||
import com.njcn.mq.constant.BusinessTopic;
|
||||
import com.njcn.mq.message.CldControlMessage;
|
||||
import org.apache.rocketmq.client.producer.SendResult;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:实时数据模板
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/8/11 15:28
|
||||
*/
|
||||
@Component
|
||||
public class CldControlMessageTemplate extends RocketMQEnhanceTemplate {
|
||||
|
||||
public CldControlMessageTemplate(RocketMQTemplate template) {
|
||||
super(template);
|
||||
}
|
||||
|
||||
public SendResult sendMember(CldControlMessage message, String tag) {
|
||||
BaseMessage baseMessage = new BaseMessage();
|
||||
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||
baseMessage.setMessageBody(new Gson().toJson(message));
|
||||
return send(BusinessTopic.PROCESS_TOPIC,tag,baseMessage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.mq.template;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||
import com.njcn.mq.constant.BusinessResource;
|
||||
import com.njcn.mq.constant.BusinessTopic;
|
||||
import com.njcn.mq.message.CldUpdateLedgerMessage;
|
||||
import org.apache.rocketmq.client.producer.SendResult;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:实时数据模板
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/8/11 15:28
|
||||
*/
|
||||
@Component
|
||||
public class CldUpdateLedgerMessageTemplate extends RocketMQEnhanceTemplate {
|
||||
|
||||
public CldUpdateLedgerMessageTemplate(RocketMQTemplate template) {
|
||||
super(template);
|
||||
}
|
||||
|
||||
public SendResult sendMember(CldUpdateLedgerMessage cldUpdateLedgerMessage, String tag) {
|
||||
BaseMessage baseMessage = new BaseMessage();
|
||||
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||
baseMessage.setMessageBody(new Gson().toJson(cldUpdateLedgerMessage));
|
||||
return send(BusinessTopic.CONTROL_TOPIC,tag,baseMessage);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.njcn.oss.utils;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.huawei.obs.util.OBSUtil;
|
||||
@@ -88,16 +89,23 @@ public class FileStorageUtil {
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
// 确保目录存在
|
||||
Path uploadPath = Paths.get(generalInfo.getLocalStorePath());
|
||||
// 构建完整目录:基准目录 + dir子目录
|
||||
Path basePath = Paths.get(generalInfo.getLocalStorePath());
|
||||
Path uploadPath = basePath.resolve(dir); // 将dir作为子目录添加
|
||||
|
||||
// 确保完整目录存在(包括dir子目录)
|
||||
if (!Files.exists(uploadPath)) {
|
||||
Files.createDirectories(uploadPath);
|
||||
}
|
||||
|
||||
// 生成本地文件名(可以添加时间戳或UUID防止重名)
|
||||
// 生成本地文件名(处理扩展名,防止异常)
|
||||
String originalFilename = multipartFile.getOriginalFilename();
|
||||
String fileExtension = originalFilename.substring(originalFilename.lastIndexOf("."));
|
||||
String newFilename = UUID.randomUUID().toString() + fileExtension;
|
||||
String fileExtension = "";
|
||||
int extIndex = originalFilename.lastIndexOf(".");
|
||||
if (extIndex > 0 && extIndex < originalFilename.length() - 1) {
|
||||
fileExtension = originalFilename.substring(extIndex);
|
||||
}
|
||||
String newFilename = IdUtil.simpleUUID().toUpperCase() + fileExtension;
|
||||
|
||||
// 构建完整路径
|
||||
Path filePathPath = uploadPath.resolve(newFilename);
|
||||
@@ -105,7 +113,7 @@ public class FileStorageUtil {
|
||||
// 保存文件
|
||||
multipartFile.transferTo(filePathPath.toFile());
|
||||
|
||||
// 返回相对路径或完整路径,根据需求调整
|
||||
// 返回相对路径或完整路径
|
||||
filePath = dir + File.separator + newFilename;
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException("本地文件上传失败: " + e.getMessage());
|
||||
|
||||
@@ -95,7 +95,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
DeviceRunEvaluateVO.Info evaluateVO;
|
||||
for (GeneralDeviceDTO deptDeviceInfo : deptDeviceInfos) {
|
||||
List<String> lineIndexes = deptDeviceInfo.getLineIndexes();
|
||||
List<String> devIndexes = deptDeviceInfo.getLineIndexes();
|
||||
List<String> devIndexes = deptDeviceInfo.getDeviceIndexes();
|
||||
if (CollUtil.isNotEmpty(lineIndexes)) {
|
||||
evaluateVO = new DeviceRunEvaluateVO.Info();
|
||||
evaluateVO.setName(deptDeviceInfo.getName());
|
||||
|
||||
@@ -794,8 +794,8 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
@Override
|
||||
public List<TimeVO> getReasonTypeTime(StatisticsParam statisticsParam) throws ParseException {
|
||||
//获取暂降字典信息
|
||||
DictData dataDto = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
List<TimeVO> list = new ArrayList<>();
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
List<String> typeList = data.stream().filter(it->it.getCode().equals(DicDataEnum.VOLTAGE_DIP.getCode()) || it.getCode().equals(DicDataEnum.SHORT_INTERRUPTIONS.getCode())).map(DictData::getId).collect(Collectors.toList()); List<TimeVO> list = new ArrayList<>();
|
||||
//参数
|
||||
StringBuilder builder1 = new StringBuilder();
|
||||
StringBuilder builder2 = new StringBuilder();
|
||||
@@ -826,11 +826,11 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
// long count = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count();
|
||||
List<RmpEventDetailPO> eventDetailList = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.eq(StringUtils.isNotBlank(dataDto.getId()), RmpEventDetailPO::getEventType, dataDto.getId())
|
||||
.in(RmpEventDetailPO::getEventType,typeList)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
long count = eventDetailList.stream().filter(x -> dataDto.getId().equals(x.getEventType())).count();
|
||||
long count = eventDetailList.stream().filter(x -> typeList.contains(x.getEventType())).count();
|
||||
if (startMonth < 10) {
|
||||
list.add(new TimeVO(null, null, "", "0" + startMonth.toString(), count + "", startYear.toString(), startYear.toString() + "-" + "0" + startMonth.toString()));
|
||||
} else {
|
||||
@@ -852,11 +852,11 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
// long count1 = eventDetailList.stream().filter(x -> x.getWaveType() == 1).count();
|
||||
List<RmpEventDetailPO> eventDetailList = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.eq(StringUtils.isNotBlank(dataDto.getId()), RmpEventDetailPO::getEventType, dataDto.getId())
|
||||
.in(RmpEventDetailPO::getEventType, typeList)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
long count1 = eventDetailList.stream().filter(x -> dataDto.getId().equals(x.getEventType())).count();
|
||||
long count1 = eventDetailList.stream().filter(x -> typeList.contains(x.getEventType())).count();
|
||||
if (startMonth < 10) {
|
||||
list.add(new TimeVO(null, null, "", "0" + startMonth.toString(), count1 + "", startYear.toString(), startYear.toString() + "-" + "0" + startMonth.toString()));
|
||||
} else {
|
||||
@@ -871,12 +871,12 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
|
||||
List<RmpEventDetailPO> eventDetailList = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.eq(StringUtils.isNotBlank(dataDto.getId()), RmpEventDetailPO::getEventType, dataDto.getId())
|
||||
.in(RmpEventDetailPO::getEventType, typeList)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
|
||||
Map<String, List<RmpEventDetailPO>> map = eventDetailList.stream().filter(x -> dataDto.getId().equals(x.getEventType()))
|
||||
Map<String, List<RmpEventDetailPO>> map = eventDetailList.stream().filter(x -> typeList.contains(x.getEventType()))
|
||||
.peek(t -> t.setFormatTime(t.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))))
|
||||
.collect(Collectors.groupingBy(RmpEventDetailPO::getFormatTime));
|
||||
Set<String> keySet = map.keySet();
|
||||
@@ -931,11 +931,12 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
List<ReasonsVO> reasonsVOS = new ArrayList<>();
|
||||
List<TypesVO> typesVOS = new ArrayList<>();
|
||||
//获取暂降字典信息
|
||||
DictData dataDto = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
List<DictData> dataDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
List<String> typeList = dataDic.stream().filter(it->it.getCode().equals(DicDataEnum.VOLTAGE_DIP.getCode()) || it.getCode().equals(DicDataEnum.SHORT_INTERRUPTIONS.getCode())).map(DictData::getId).collect(Collectors.toList());
|
||||
//数据暂降查询
|
||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.eq(StringUtils.isNotBlank(dataDto.getId()), RmpEventDetailPO::getEventType, dataDto.getId())
|
||||
.in( RmpEventDetailPO::getEventType,typeList)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
@@ -952,7 +953,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
//添加detail
|
||||
for (RmpEventDetailPO detail : info) {
|
||||
EventDetail details = null;
|
||||
if (dataDto.getId().equals(detail.getEventType())) {
|
||||
if (typeList.contains(detail.getEventType())) {
|
||||
for (DictData data : reasonData) {
|
||||
reasonMap.put(data.getName(), 0);
|
||||
if (detail.getAdvanceReason().equals(data.getId())) {
|
||||
@@ -1326,11 +1327,12 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
// }
|
||||
// }
|
||||
//获取电压暂降信息
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
List<String> typeList = data.stream().filter(it->it.getCode().equals(DicDataEnum.VOLTAGE_DIP.getCode()) || it.getCode().equals(DicDataEnum.SHORT_INTERRUPTIONS.getCode())).map(DictData::getId).collect(Collectors.toList());
|
||||
//查询监测点未处理暂态事件
|
||||
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.eq(StrUtil.isNotBlank(data.getId()), RmpEventDetailPO::getEventType, data.getId())
|
||||
.in(RmpEventDetailPO::getEventType,typeList)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
@@ -1353,7 +1355,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
eventDetailNew.setFeatureAmplitude(eventDetail.getFeatureAmplitude());
|
||||
//波形路径
|
||||
eventDetailNew.setWavePath(eventDetail.getWavePath());
|
||||
if (data.getId().equals(eventDetail.getEventType())) {
|
||||
//if (data.getId().equals(eventDetail.getEventType())) {
|
||||
if (reasonMap.containsKey(eventDetail.getAdvanceReason())) {
|
||||
//暂降原因
|
||||
DictData dictData = reasonMap.get(eventDetail.getAdvanceReason());
|
||||
@@ -1364,7 +1366,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
DictData dictData = typeMap.get(eventDetail.getAdvanceType());
|
||||
eventDetailNew.setAdvanceType(dictData.getName());
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
result.add(eventDetailNew);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class QualifiedReportController extends BaseController {
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
String searchValue = qualifiedReportParam.getSearchValue();
|
||||
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
||||
if(!pattern.matcher(searchValue).find()){
|
||||
if(pattern.matcher(searchValue).find()){
|
||||
throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
||||
}
|
||||
String methodDescribe = getMethodDescribe("pageTable");
|
||||
|
||||
@@ -365,7 +365,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
steadyQualifyDTO.getIharm24Overtime() +
|
||||
steadyQualifyDTO.getIharm25Overtime())));
|
||||
//间谐波电压含有率
|
||||
steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime(), (steadyQualifyDTO.getInuharm1Overtime() +
|
||||
steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime()*16, (steadyQualifyDTO.getInuharm1Overtime() +
|
||||
steadyQualifyDTO.getInuharm2Overtime() +
|
||||
steadyQualifyDTO.getInuharm3Overtime() +
|
||||
steadyQualifyDTO.getInuharm4Overtime() +
|
||||
@@ -497,7 +497,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
return 3.14159;
|
||||
} else {
|
||||
if (allTime >= overTime) {
|
||||
return NumberUtil.round((1 - (overTime / (allTime * 16.0))) * 100, 2).doubleValue();
|
||||
return NumberUtil.round((1 - ((double) overTime /allTime)) * 100, 2).doubleValue();
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user