Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eed647d3d1 | ||
|
|
4a5fde6a47 | ||
|
|
82ab1de5b9 | ||
|
|
ecc56dd2f6 | ||
| 39ae7412a8 | |||
| 52677f84dc | |||
| abdb855919 | |||
| 64bcbfff91 | |||
|
|
499eee6784 | ||
|
|
c58bd87a78 | ||
|
|
0902f92838 | ||
| 87818db6f3 | |||
|
|
850b3174a2 | ||
| aad5943d64 | |||
| 9c467310d5 | |||
| ca3b125424 | |||
|
|
0c5c9bf067 | ||
|
|
c692282ea4 | ||
| 232e84aad3 | |||
| 59f2588488 | |||
|
|
46f521c7a7 | ||
|
|
6d69027e16 | ||
|
|
1afed2c9a4 | ||
|
|
9bb250bdb9 | ||
|
|
d33b3637a5 | ||
|
|
f50f11b159 | ||
| 30984aa908 |
@@ -26,8 +26,6 @@ import java.util.*;
|
||||
public class AnalyWave {
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************
|
||||
* 解析comtrate文件工具类
|
||||
* author yexb根据Ww算法装换
|
||||
@@ -94,7 +92,7 @@ public class AnalyWave {
|
||||
** ** strFilePath *** cfg文件路径
|
||||
* *** auth *** 读取方式 null则使用本地读取方式读取
|
||||
******************************************/
|
||||
public AnalyWaveModel.tagDataValue readComtrade(List<String> temCfgList,byte[] array, int iFlag) {
|
||||
public AnalyWaveModel.tagDataValue readComtrade(List<String> temCfgList, byte[] array, int iFlag) {
|
||||
//初始化参数
|
||||
ComtradeCfg = new AnalyWaveModel.tagComtradeCfg();
|
||||
RatesCfg = new AnalyWaveModel.tagRates();
|
||||
@@ -297,14 +295,11 @@ public class AnalyWave {
|
||||
strBinType = iterable.next().toUpperCase();
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("读取文件内容出错"+e.getMessage());
|
||||
logger.error("读取文件内容出错" + e.getMessage());
|
||||
return false;
|
||||
}finally {
|
||||
|
||||
} finally {
|
||||
|
||||
|
||||
}
|
||||
@@ -319,15 +314,8 @@ public class AnalyWave {
|
||||
private List<List<Float>> AnalyseComtradeDat(byte[] array, int iFlag) {
|
||||
float xValueAll = 0;//初始化xValue的值
|
||||
boolean blxValue = false;//判断是否首次登陆
|
||||
|
||||
List<List<Float>> listWaveData = new ArrayList<>();//返回数据
|
||||
|
||||
|
||||
try {
|
||||
|
||||
|
||||
|
||||
|
||||
// 计算每个单独的数据块的大小 4字节的序号 4字节的时间 2字节的值
|
||||
// 示例中的排布是 4字节的序号 4字节的时间 UA(2字节) UB(2字节) UC(2字节) IA(2字节) IB(2字节)
|
||||
// IC(2字节)
|
||||
@@ -470,7 +458,7 @@ public class AnalyWave {
|
||||
{
|
||||
if (ComtradeCfg.OneChannleCfg.get(j).fPrimary != 0.0f)//根据cfg内的变比,将一次值转换成二次值
|
||||
{
|
||||
fValue = ComtradeCfg.OneChannleCfg.get(j).fSecondary / ComtradeCfg.OneChannleCfg.get(j).fPrimary;
|
||||
fValue = fValue * ComtradeCfg.OneChannleCfg.get(j).fSecondary / ComtradeCfg.OneChannleCfg.get(j).fPrimary;
|
||||
} else {
|
||||
fValue = fValue;
|
||||
}
|
||||
@@ -500,7 +488,7 @@ public class AnalyWave {
|
||||
} catch (Exception e) {
|
||||
logger.error("读取文件出错:" + e.getMessage());
|
||||
return listWaveData;
|
||||
}finally {
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService {
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
}
|
||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 0);
|
||||
waveDataDTO = waveFileComponent.getComtradeNoAddPoints(cfgStream, datStream, 0);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath2);
|
||||
|
||||
@@ -223,6 +223,10 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService {
|
||||
RmpEventDetailPO rmpEventDetailPO = rmpEventAdvanceMapper.selectById(eventIndex);
|
||||
EntityAdvancedData entityAdvancedData;
|
||||
|
||||
if (Objects.isNull(rmpEventDetailPO.getFileFlag())) {
|
||||
throw new BusinessException("系统检测到波形文件未从装置招到本地,请联系管理员");
|
||||
}
|
||||
|
||||
if (rmpEventDetailPO.getFileFlag() == 1) {
|
||||
//获取所有暂态原因
|
||||
List<DictData> dicDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_TYPE.getCode()).getData();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.njcn.advance.utils;
|
||||
|
||||
import cn.hutool.core.io.resource.ClassPathResource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URLDecoder;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -20,21 +20,20 @@ public class JnaCallDllOrSo {
|
||||
|
||||
public JnaCallDllOrSo(String name) {
|
||||
super();
|
||||
String suffix = ".dll";
|
||||
try {
|
||||
String os = System.getProperty("os.name");
|
||||
// windows操作系统为1 否则为0
|
||||
int beginIndex = os != null && os.startsWith("Windows") ? 1 : 0;
|
||||
String nameDll;
|
||||
if (beginIndex == 0) {
|
||||
//linux操作系统
|
||||
nameDll = "lib" + name + "_dll";
|
||||
suffix = ".so";
|
||||
nameDll = "lib" + name + ".so";
|
||||
} else {
|
||||
nameDll = name;
|
||||
if (!name.endsWith(".dll")) {
|
||||
nameDll = name + ".dll";
|
||||
}
|
||||
}
|
||||
|
||||
String tem = "/usr/local/dllFile/"+ nameDll.concat(suffix);
|
||||
String tem = "/usr/local/dllFile/"+ nameDll;
|
||||
File dockerFile = new File(tem);
|
||||
if(!dockerFile.exists()){
|
||||
boolean f = dockerFile.getParentFile().mkdirs();
|
||||
@@ -42,7 +41,11 @@ public class JnaCallDllOrSo {
|
||||
System.out.println("文件夹创建:"+f);
|
||||
System.out.println("文件创建:"+d);
|
||||
|
||||
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(nameDll.concat(suffix))) {
|
||||
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(nameDll)) {
|
||||
if (inputStream == null) {
|
||||
log.error("找不到资源文件: {}", nameDll);
|
||||
throw new FileNotFoundException("找不到资源文件: " + nameDll);
|
||||
}
|
||||
try (FileOutputStream outputStream = new FileOutputStream(dockerFile)) {
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
@@ -53,9 +56,11 @@ public class JnaCallDllOrSo {
|
||||
}
|
||||
}
|
||||
this.path = dockerFile.getAbsolutePath();
|
||||
System.out.println("动态库路径: " + this.path);
|
||||
} catch (Exception e) {
|
||||
log.error("调用高级算法文件异常,异常信息如下:");
|
||||
log.error(e.getMessage());
|
||||
log.error(e.getMessage(), e);
|
||||
throw new RuntimeException("加载动态库失败: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -97,11 +97,11 @@
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
<!--mqtt相关依赖-->
|
||||
<dependency>
|
||||
<groupId>com.github.tocrhz</groupId>
|
||||
<artifactId>mqtt-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- <!–mqtt相关依赖–>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.github.tocrhz</groupId>-->
|
||||
<!-- <artifactId>mqtt-spring-boot-starter</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
@@ -32,6 +33,7 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.lang.Integer.parseInt;
|
||||
|
||||
@@ -281,6 +283,30 @@ public class PubUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于获取对象中,前缀一样,后缀为2~50的属性值
|
||||
*
|
||||
* @param methodPrefix 方法前缀
|
||||
* @param number 方法后缀
|
||||
* @return 对象属性值
|
||||
*/
|
||||
public static Double getValueByMethodDouble(List data ,Class clazz, String methodPrefix, Integer number) {
|
||||
try {
|
||||
Method method = clazz.getMethod(methodPrefix + number);
|
||||
OptionalDouble average = data.stream().mapToDouble(temp -> {
|
||||
try {
|
||||
return (Double) method.invoke(temp);
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(CommonResponseEnum.REFLECT_METHOD_EXCEPTION);
|
||||
}
|
||||
}).average();
|
||||
return average.orElse(0.0);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(CommonResponseEnum.REFLECT_METHOD_EXCEPTION);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static List<String> getStartTimeEndTime(String beginDate, String endDate) throws Exception {
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ public class DrawPicUtil {
|
||||
|
||||
|
||||
/***
|
||||
* 绘制波形图
|
||||
* @author hongawen
|
||||
* 绘制波形图
|
||||
* @date 2023/6/21 11:01
|
||||
* @return String base64数据
|
||||
*/
|
||||
|
||||
@@ -3,11 +3,9 @@ package com.njcn.event.file.component;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.wave.BitConverter;
|
||||
import com.njcn.event.file.pojo.dto.*;
|
||||
@@ -16,11 +14,13 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
@@ -81,6 +81,46 @@ public class WaveFileComponent {
|
||||
return waveDataDTO;
|
||||
}
|
||||
|
||||
public WaveDataDTO getComtradeNoAddPoints(InputStream cfgStream, InputStream datStream, int iType) {
|
||||
WaveDataDTO waveDataDTO = new WaveDataDTO();
|
||||
// 首先判断文件路径是否为空
|
||||
// 读取cfg文件
|
||||
ComtradeCfgDTO comtradeCfgDTO = getComtradeCfgNoAddPoints(cfgStream);
|
||||
// 为空或者未找到结束符号
|
||||
if (comtradeCfgDTO == null || !"BINARY".equalsIgnoreCase(comtradeCfgDTO.getStrBinType())) {
|
||||
throw new BusinessException(WaveFileResponseEnum.CFG_DATA_ERROR);
|
||||
}
|
||||
|
||||
/*****根据通道号计算相别** add by yexb -----Start****
|
||||
* 1、判断是否是3的倍数,是3的倍数则是3相
|
||||
* 2、假如不是3的倍数 ,是1的倍数则是单相
|
||||
********************************************************/
|
||||
if (comtradeCfgDTO.getNAnalogNum() % 3 == 0) {
|
||||
comtradeCfgDTO.setNPhasic(3);
|
||||
} else {
|
||||
comtradeCfgDTO.setNPhasic(1);
|
||||
}
|
||||
|
||||
// 给相别数量赋值
|
||||
waveDataDTO.setIPhasic(comtradeCfgDTO.getNPhasic());
|
||||
|
||||
// 组装解析抬头
|
||||
getWaveTitle(waveDataDTO, comtradeCfgDTO);
|
||||
|
||||
// 解析.dat文件
|
||||
List<List<Float>> listWaveData = getComtradeDatNoAddPoints(comtradeCfgDTO, datStream, iType);
|
||||
|
||||
waveDataDTO.setComtradeCfgDTO(comtradeCfgDTO);
|
||||
|
||||
waveDataDTO.setListWaveData(listWaveData);
|
||||
|
||||
//add by hongawen,将暂态触发起始时间记录下来
|
||||
waveDataDTO.setTime(DateUtil.format(comtradeCfgDTO.getTimeTrige(), DatePattern.NORM_DATETIME_MS_PATTERN));
|
||||
/*****根据通道号计算相别** add by yexb -----end****/
|
||||
|
||||
return waveDataDTO;
|
||||
}
|
||||
|
||||
/*********************************
|
||||
* 根据波形数据算出rms值数据
|
||||
* param waveDataDTO 瞬时波形(包含了CFG配置文件)
|
||||
@@ -472,6 +512,127 @@ public class WaveFileComponent {
|
||||
return comtradeCfgDTO;
|
||||
}
|
||||
|
||||
private ComtradeCfgDTO getComtradeCfgNoAddPoints(InputStream cfgStream) {
|
||||
ComtradeCfgDTO comtradeCfgDTO = new ComtradeCfgDTO();
|
||||
try (InputStreamReader read = new InputStreamReader(cfgStream, CharsetUtil.CHARSET_GBK); BufferedReader bufferedReader = new BufferedReader(read);) {
|
||||
// 第一行不关心仅仅是一些描述类的信息
|
||||
String strFileLine = bufferedReader.readLine();
|
||||
|
||||
// 第二行需要关心第二个(模拟量的个数)和第三个参数(开关量的个数)
|
||||
strFileLine = bufferedReader.readLine();
|
||||
// 按“,”进行分割
|
||||
String[] strTempArray = strFileLine.split(StrUtil.COMMA);
|
||||
// 总个数
|
||||
comtradeCfgDTO.setNChannelNum(Integer.parseInt(strTempArray[0]));
|
||||
// 模拟量的个数
|
||||
comtradeCfgDTO.setNAnalogNum(Integer.parseInt(strTempArray[1].substring(0, strTempArray[1].length() - 1)));
|
||||
// 开关量的个数
|
||||
comtradeCfgDTO.setNDigitalNum(Integer.parseInt(strTempArray[2].substring(0, strTempArray[2].length() - 1)));
|
||||
|
||||
// 从第三行开始的ComtradeCfg.nChannelNum行是模拟量通道和数字量通道
|
||||
List<AnalogDTO> lstAnalogDTO = new ArrayList<>();
|
||||
comtradeCfgDTO.setLstAnalogDTO(lstAnalogDTO);
|
||||
for (int i = 0; i < comtradeCfgDTO.getNChannelNum(); i++) {
|
||||
AnalogDTO analogDTO = new AnalogDTO();
|
||||
lstAnalogDTO.add(analogDTO);
|
||||
strFileLine = bufferedReader.readLine();
|
||||
strTempArray = strFileLine.split(StrUtil.COMMA);
|
||||
//通道序号
|
||||
analogDTO.setNIndex(Integer.parseInt(strTempArray[0]));
|
||||
// 通道名称
|
||||
analogDTO.setSzChannleName(strTempArray[1]);
|
||||
// 相位名称
|
||||
analogDTO.setSzPhasicName(strTempArray[2]);
|
||||
// 监视的通道名称
|
||||
analogDTO.setSzMonitoredChannleName(strTempArray[3]);
|
||||
// 通道的单位
|
||||
analogDTO.setSzUnitName(strTempArray[4]);
|
||||
// 通道的系数
|
||||
analogDTO.setFCoefficent(Float.parseFloat(strTempArray[5]));
|
||||
// 通道的偏移量
|
||||
analogDTO.setFOffset(Float.parseFloat(strTempArray[6]));
|
||||
// 起始采样时间的偏移量
|
||||
analogDTO.setFTimeOffset(Float.parseFloat(strTempArray[7]));
|
||||
// 采样值的最小值
|
||||
analogDTO.setNMin(Integer.parseInt(strTempArray[8]));
|
||||
// 采样值的最大值
|
||||
analogDTO.setNMax(Integer.parseInt(strTempArray[9]));
|
||||
// 一次变比
|
||||
analogDTO.setFPrimary(Float.parseFloat(strTempArray[10]));
|
||||
// 二次变比
|
||||
analogDTO.setFSecondary(Float.parseFloat(strTempArray[11]));
|
||||
// 一次值还是二次值标志
|
||||
analogDTO.setSzValueType(strTempArray[12]);
|
||||
}
|
||||
|
||||
//WW 2019-11-14 // 采样频率
|
||||
String freqLine = bufferedReader.readLine();
|
||||
int nFreq;
|
||||
try {
|
||||
// 先尝试解析为double再四舍五入为整数,以兼容"50.00"这样的格式
|
||||
nFreq = (int) Math.round(Double.parseDouble(freqLine));
|
||||
} catch (NumberFormatException e) {
|
||||
// 如果失败则使用原来的整数解析方式
|
||||
nFreq = Integer.parseInt(freqLine);
|
||||
}
|
||||
|
||||
// 获取采样段数
|
||||
strFileLine = bufferedReader.readLine();
|
||||
int nRates = Integer.parseInt(strFileLine);
|
||||
comtradeCfgDTO.setNRates(nRates);
|
||||
// 获得每段的采样率 //采样率
|
||||
List<RateDTO> lstRate = new ArrayList<>();
|
||||
int nOffset = 0;
|
||||
for (int i = 0; i < nRates; i++) {
|
||||
strFileLine = bufferedReader.readLine();
|
||||
strTempArray = strFileLine.split(StrUtil.COMMA);
|
||||
RateDTO rateDTO = new RateDTO();
|
||||
// 单周波采样点数 //WW 2019-11-14
|
||||
double doubleValue = Double.parseDouble(strTempArray[0]); // 解析为 double
|
||||
int result = (int) (doubleValue / nFreq); // 强制转换为 int
|
||||
rateDTO.setNOneSample(result);
|
||||
// 总点数 //这里的strTemp是一个偏移量
|
||||
rateDTO.setNSampleNum((Integer.parseInt(strTempArray[1]) - nOffset));
|
||||
nOffset = rateDTO.getNSampleNum();
|
||||
lstRate.add(rateDTO);
|
||||
}
|
||||
comtradeCfgDTO.setLstRate(lstRate);
|
||||
// 增加读取波形起始时间个结束时间
|
||||
String timeFormat = "dd/MM/yyyy,HH:mm:ss.SSS";
|
||||
// 波形起始时间
|
||||
strFileLine = bufferedReader.readLine();
|
||||
strFileLine = strFileLine.substring(0, strFileLine.length() - 3);
|
||||
comtradeCfgDTO.setTimeStart(DateUtil.parse(strFileLine, timeFormat));
|
||||
|
||||
// 暂态触发时间
|
||||
strFileLine = bufferedReader.readLine();
|
||||
strFileLine = strFileLine.substring(0, strFileLine.length() - 3);
|
||||
comtradeCfgDTO.setTimeTrige(DateUtil.parse(strFileLine, timeFormat));
|
||||
|
||||
// 获取触发时间的时间 + 毫秒
|
||||
Calendar calendar = DateUtil.calendar(comtradeCfgDTO.getTimeTrige());
|
||||
comtradeCfgDTO.setFirstMs(calendar.get(Calendar.MILLISECOND));
|
||||
comtradeCfgDTO.setFirstTime(calendar.getTime());
|
||||
|
||||
|
||||
long a = comtradeCfgDTO.getTimeStart().getTime();
|
||||
long b = comtradeCfgDTO.getTimeTrige().getTime();
|
||||
|
||||
int c = (int) (b - a);
|
||||
if (c >= 90 && c <= 110) {
|
||||
comtradeCfgDTO.setNPush(100);
|
||||
} else if (c >= 190 && c <= 210) {
|
||||
comtradeCfgDTO.setNPush(200);
|
||||
}
|
||||
// 赋值编码格式(二进制)
|
||||
comtradeCfgDTO.setStrBinType(bufferedReader.readLine().toUpperCase());
|
||||
} catch (Exception e) {
|
||||
// 解析.cfg文件出错
|
||||
comtradeCfgDTO = null;
|
||||
}
|
||||
return comtradeCfgDTO;
|
||||
}
|
||||
|
||||
/*********************************
|
||||
* 读取dat方法
|
||||
* param strFilePath .dat访问路径
|
||||
@@ -511,13 +672,14 @@ public class WaveFileComponent {
|
||||
//抽点后新的的采样率
|
||||
List<RateDTO> newLstRate = new ArrayList<>();
|
||||
for (int iRate = 0; iRate < comtradeCfgDTO.getNRates(); iRate++) {
|
||||
// if (comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() >= 32) {
|
||||
// 计算本段录波总共有多少波形
|
||||
nWaveNum = comtradeCfgDTO.getLstRate().get(iRate).getNSampleNum() / comtradeCfgDTO.getLstRate().get(iRate).getNOneSample();
|
||||
//设置总波形大小
|
||||
comtradeCfgDTO.setNAllWaveNum(comtradeCfgDTO.getNAllWaveNum() + nWaveNum);
|
||||
// 将最低采样率替换到本段录波内
|
||||
RateDTO tmpRateDTO = new RateDTO();
|
||||
// C# 原实现中 bool 默认是 false,16~31 点/周波段也应按普通抽点处理
|
||||
tmpRateDTO.bRMSFlag = false;
|
||||
// 有效值标志,如果是有效值,那么就需要反向补点,而不是抽点
|
||||
if (comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() >= 32) {
|
||||
//YXB 2025-08-27
|
||||
@@ -547,12 +709,7 @@ public class WaveFileComponent {
|
||||
newLstRate.get(nnInd).setNSampleNum(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() * nWaveNum);
|
||||
}
|
||||
|
||||
// 正常的配置中采样率
|
||||
/* comtradeCfgDTO.getLstRate().get(nnInd).setNOneSample(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample());
|
||||
comtradeCfgDTO.getLstRate().get(nnInd).setNSampleNum(comtradeCfgDTO.getLstRate().get(iRate).getNSampleNum());*/
|
||||
|
||||
nnInd++;
|
||||
// }
|
||||
}
|
||||
// 偏移量,采样间隔
|
||||
long nOffSet = 0, nWaveSpan;
|
||||
@@ -560,7 +717,6 @@ public class WaveFileComponent {
|
||||
float fValue, dfValue;
|
||||
// 计算不同块的采样率
|
||||
int nIndex = 0;
|
||||
// 将最低采样率替换到本段录波内
|
||||
// .CFG中采样率
|
||||
RateDTO tmpRateDTO;
|
||||
// nBlockNum 总循环次数
|
||||
@@ -575,46 +731,29 @@ public class WaveFileComponent {
|
||||
}
|
||||
}
|
||||
tmpRateDTO = comtradeCfgDTO.getLstRate().get(nIndex);
|
||||
//YXB 2025-08-27 如果是有效值,那么需要去补点,而不是抽点
|
||||
if (newLstRate.get(nIndex).bRMSFlag == true) {
|
||||
dfValue = (float) 20 / tmpRateDTO.getNOneSample();
|
||||
// C# 原实现中 RMS 段与普通抽点是两条独立控制流,不能挂在同一个取模条件下
|
||||
if (Boolean.TRUE.equals(newLstRate.get(nIndex).bRMSFlag)) {
|
||||
//计算本段补点采样间隔
|
||||
nWaveSpan = newLstRate.get(nIndex).getNOneSample() / tmpRateDTO.getNOneSample();
|
||||
} else {
|
||||
// 计算本段抽点采样间隔
|
||||
nWaveSpan = tmpRateDTO.getNOneSample() / newLstRate.get(nIndex).getNOneSample();
|
||||
}
|
||||
|
||||
dfValue = (float) 20 / tmpRateDTO.getNOneSample();
|
||||
// 判断是否到了需要抽的采样点
|
||||
if (i % nWaveSpan == 0) {
|
||||
// 计算每个通道的值
|
||||
//存储局部数据集合,包含了时间,A,B,C三相
|
||||
List<Float> tmpWaveData = new ArrayList<>();
|
||||
//YXB 2025-08-27 如果是有效值,那么需要去补点,而不是抽点
|
||||
if (newLstRate.get(nIndex).bRMSFlag == true) {
|
||||
// 计算有多少个周波
|
||||
long allWaveTemp = newLstRate.get(nIndex).getNSampleNum() / newLstRate.get(nIndex).getNOneSample();
|
||||
// 本段需要补多少点
|
||||
long allempSample = newLstRate.get(nIndex).getNOneSample();
|
||||
//int iStartWaveTemp = i ;// 开始补点的起点
|
||||
int segmentEndIndex = (int) (nOffSet + tmpRateDTO.getNSampleNum() - 1);
|
||||
for (int iWaveTemp = 0; iWaveTemp < allWaveTemp; iWaveTemp++) {
|
||||
for (int mTempSample = 0; mTempSample < allempSample; mTempSample++) {
|
||||
//最多只有半波有效值,也就是每周波是1个或者2个点,然后去补最少16个点
|
||||
// 2 点/周波时,半周波位置需要切换到该周波的第二个原始采样点
|
||||
if (mTempSample / nWaveSpan == 1 && mTempSample % nWaveSpan == 0) {
|
||||
i++;
|
||||
}
|
||||
//存储局部数据集合,包含了时间,A,B,C三相
|
||||
tmpWaveData = new ArrayList<>();
|
||||
List<Float> tmpWaveData = new ArrayList<>();
|
||||
for (int j = 0; j < comtradeCfgDTO.getNAnalogNum(); j++) {
|
||||
//数据只有电压ABC三相数据,不展示U0、I0等数据 YXB2020-10-09 去除相别为N相的数据
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzPhasicName().equalsIgnoreCase("N")) {
|
||||
break;
|
||||
}
|
||||
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
|
||||
/*************************
|
||||
@@ -659,7 +798,7 @@ public class WaveFileComponent {
|
||||
{
|
||||
//根据cfg内的变比,将一次值转换成二次值
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) {
|
||||
fValue = comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
|
||||
fValue = fValue * comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
|
||||
} else {
|
||||
fValue = fValue;
|
||||
}
|
||||
@@ -684,12 +823,25 @@ public class WaveFileComponent {
|
||||
//把每个单独的值赋予到整体里面去
|
||||
listWaveData.add(tmpWaveData);
|
||||
}
|
||||
// 把每个单独的值赋予到整体里面去
|
||||
// 本周波处理完成后,推进到下一周波的原始采样点
|
||||
if (iWaveTemp < (allWaveTemp - 1)) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 某些文件的段点数并不是原始每周波点数的整倍数。
|
||||
// RMS 段处理完成后,强制把原始游标对齐到当前段末尾,
|
||||
// 这样外层 for 的下一次自增才能稳定落到下一段起点,避免重复进入同一 RMS 段。
|
||||
i = segmentEndIndex;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 计算本段抽点采样间隔
|
||||
nWaveSpan = tmpRateDTO.getNOneSample() / newLstRate.get(nIndex).getNOneSample();
|
||||
// 判断是否到了需要抽的采样点
|
||||
if (i % nWaveSpan == 0) {
|
||||
// 计算每个通道的值
|
||||
//存储局部数据集合,包含了时间,A,B,C三相
|
||||
List<Float> tmpWaveData = new ArrayList<>();
|
||||
for (int j = 0; j < comtradeCfgDTO.getNAnalogNum(); j++) {
|
||||
//数据只有电压ABC三相数据,不展示U0、I0等数据 YXB2020-10-09 去除相别为N相的数据
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzPhasicName().equalsIgnoreCase("N")) {
|
||||
@@ -742,7 +894,7 @@ public class WaveFileComponent {
|
||||
{
|
||||
//根据cfg内的变比,将一次值转换成二次值
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) {
|
||||
fValue = comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
|
||||
fValue = fValue * comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
|
||||
} else {
|
||||
fValue = fValue;
|
||||
}
|
||||
@@ -768,6 +920,204 @@ public class WaveFileComponent {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new BusinessException(WaveFileResponseEnum.DAT_DATA_ERROR);
|
||||
}
|
||||
|
||||
return listWaveData;
|
||||
}
|
||||
|
||||
private List<List<Float>> getComtradeDatNoAddPoints(ComtradeCfgDTO comtradeCfgDTO, InputStream datStream, int iType) {
|
||||
//返回数据,如果仅仅做展示后期考虑换String类型,降低内存开销
|
||||
List<List<Float>> listWaveData = new ArrayList<>();
|
||||
//初始化xValue的值
|
||||
float xValueAll = 0;
|
||||
//判断是否首次登陆
|
||||
boolean blxValue = false;
|
||||
byte[] datArray;
|
||||
try {
|
||||
datArray = IoUtil.readBytes(datStream);
|
||||
if (ArrayUtil.isEmpty(datArray)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.DAT_DATA_ERROR);
|
||||
}
|
||||
// 计算每个单独的数据块的大小 4个字节的序号 4个字节的时间 2个字节的值
|
||||
// 示例中的排布是 4个字节的序号 4个字节的时间 UA(2字节) UB(2字节) UC(2字节) IA(2字节) IB(2字节) IC(2字节)
|
||||
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 = (int)Math.floor(datArray.length / nBlockSize);
|
||||
|
||||
// 获取采样率
|
||||
int finalSampleRate = getFinalWaveSample(comtradeCfgDTO.getLstRate(), iType);
|
||||
if (finalSampleRate != -1) {
|
||||
//设置最终采样率
|
||||
comtradeCfgDTO.setFinalSampleRate(finalSampleRate);
|
||||
// 计算转换后的采样率
|
||||
int nnInd = 0;
|
||||
// 抽点后总共多少点数据
|
||||
int nWaveNum;
|
||||
//抽点后新的的采样率
|
||||
List<RateDTO> newLstRate = new ArrayList<>();
|
||||
for (int iRate = 0; iRate < comtradeCfgDTO.getNRates(); iRate++) {
|
||||
if (comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() >= 32) {
|
||||
// 计算本段录波总共有多少波形
|
||||
nWaveNum = comtradeCfgDTO.getLstRate().get(iRate).getNSampleNum() / comtradeCfgDTO.getLstRate().get(iRate).getNOneSample();
|
||||
//设置总波形大小
|
||||
comtradeCfgDTO.setNAllWaveNum(comtradeCfgDTO.getNAllWaveNum() + nWaveNum);
|
||||
// 将最低采样率替换到本段录波内
|
||||
RateDTO tmpRateDTO = new RateDTO();
|
||||
// 有效值标志,如果是有效值,那么就需要反向补点,而不是抽点
|
||||
// if (comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() >= 32) {
|
||||
// //YXB 2025-08-27
|
||||
// tmpRateDTO.bRMSFlag = false;
|
||||
// }
|
||||
// //如果采样是全波有效值或者半波有效值,需要去补足周波点数 YXB 2025-08-27
|
||||
// else if (comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() <= 2) {
|
||||
// //YXB 2025-08-27
|
||||
// tmpRateDTO.bRMSFlag = true;
|
||||
// }
|
||||
newLstRate.add(tmpRateDTO);
|
||||
//iFlag =3 一定不进行抽点算法
|
||||
if (iType != 3) {
|
||||
//true 抽点算法(当前采样率跟统一采样率不一样则是抽点,否则是未抽点)
|
||||
if (!Objects.equals(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample(), comtradeCfgDTO.getFinalSampleRate())) {
|
||||
newLstRate.get(nnInd).setNOneSample(comtradeCfgDTO.getFinalSampleRate());
|
||||
// 计算本段录波按照最低采样点应该有多少录波
|
||||
newLstRate.get(nnInd).setNSampleNum(comtradeCfgDTO.getFinalSampleRate() * nWaveNum);
|
||||
} else {
|
||||
newLstRate.get(nnInd).setNOneSample(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample());
|
||||
// 计算本段录波按照最低采样点应该有多少录波
|
||||
newLstRate.get(nnInd).setNSampleNum(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() * nWaveNum);
|
||||
}
|
||||
} else {
|
||||
newLstRate.get(nnInd).setNOneSample(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample());
|
||||
// 计算本段录波按照最低采样点应该有多少录波
|
||||
newLstRate.get(nnInd).setNSampleNum(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample() * nWaveNum);
|
||||
}
|
||||
|
||||
// 正常的配置中采样率
|
||||
comtradeCfgDTO.getLstRate().get(nnInd).setNOneSample(comtradeCfgDTO.getLstRate().get(iRate).getNOneSample());
|
||||
comtradeCfgDTO.getLstRate().get(nnInd).setNSampleNum(comtradeCfgDTO.getLstRate().get(iRate).getNSampleNum());
|
||||
|
||||
nnInd++;
|
||||
}
|
||||
}
|
||||
// 偏移量,采样间隔
|
||||
long nOffSet = 0, nWaveSpan;
|
||||
//两个点之间的时间差
|
||||
float fValue, dfValue;
|
||||
// 计算不同块的采样率
|
||||
int nIndex = 0;
|
||||
// 将最低采样率替换到本段录波内
|
||||
// .CFG中采样率
|
||||
RateDTO tmpRateDTO;
|
||||
// nBlockNum 总循环次数
|
||||
for (int i = 0; i < nBlockNum; i++) {
|
||||
tmpRateDTO = comtradeCfgDTO.getLstRate().get(nIndex);
|
||||
// 判断是否进入下一段
|
||||
if (i == tmpRateDTO.getNSampleNum() + nOffSet) {
|
||||
nOffSet += tmpRateDTO.getNSampleNum();
|
||||
nIndex++;
|
||||
if (nIndex == nnInd) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
nWaveSpan = tmpRateDTO.getNOneSample() / newLstRate.get(nIndex).getNOneSample();
|
||||
// tmpRateDTO = comtradeCfgDTO.getLstRate().get(nIndex);
|
||||
// //YXB 2025-08-27 如果是有效值,那么需要去补点,而不是抽点
|
||||
// if (newLstRate.get(nIndex).bRMSFlag == true) {
|
||||
// //计算本段补点采样间隔
|
||||
// nWaveSpan = newLstRate.get(nIndex).getNOneSample() / tmpRateDTO.getNOneSample();
|
||||
// } else {
|
||||
// // 计算本段抽点采样间隔
|
||||
// nWaveSpan = tmpRateDTO.getNOneSample() / newLstRate.get(nIndex).getNOneSample();
|
||||
// }
|
||||
|
||||
dfValue = (float) 20 / tmpRateDTO.getNOneSample();
|
||||
// 判断是否到了需要抽的采样点
|
||||
if (i % nWaveSpan == 0) {
|
||||
// 计算每个通道的值
|
||||
//存储局部数据集合,包含了时间,A,B,C三相
|
||||
List<Float> tmpWaveData = new ArrayList<>();
|
||||
for (int j = 0; j < comtradeCfgDTO.getNAnalogNum(); j++) {
|
||||
//数据只有电压ABC三相数据,不展示U0、I0等数据 YXB2020-10-09 去除相别为N相的数据
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzPhasicName().equalsIgnoreCase("N")) {
|
||||
break;
|
||||
}
|
||||
|
||||
float fCoef = comtradeCfgDTO.getLstAnalogDTO().get(j).getFCoefficent();
|
||||
fValue = BitConverter.byte2ToUnsignedShort(datArray, i * nBlockSize + 2 * 4 + j * 2) * fCoef;
|
||||
|
||||
//WW 2019-11-14
|
||||
/**************************
|
||||
* 1、接口返回的默认是二次值
|
||||
* 2、P是一次值 S是二次值
|
||||
* 3、S(二次值)情况下:
|
||||
* ①、单位为"V"时候则直接等于;
|
||||
* ②、单位为"kV"时候需要乘以1000
|
||||
* 4、P(一次值)情况下:
|
||||
* ①、单位为"V"时候则直接等于;
|
||||
* ②、单位为"kV"时候需要乘以1000
|
||||
**************************/
|
||||
//P是一次值 S是二次值
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzValueType().equalsIgnoreCase("S")) {
|
||||
//判断单位是V还是kV
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzUnitName().equalsIgnoreCase("KV")) {
|
||||
fValue = fValue * 1000.0f;
|
||||
} else {
|
||||
fValue = fValue;
|
||||
}
|
||||
}
|
||||
//P是一次值 S是二次值
|
||||
else if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzValueType().equalsIgnoreCase("P")) {
|
||||
//判断单位是V还是kV
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzUnitName().equalsIgnoreCase("V")) {
|
||||
//根据cfg内的变比,将一次值转换成二次值
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) {
|
||||
fValue = fValue * comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
|
||||
} else {
|
||||
fValue = fValue;
|
||||
}
|
||||
}
|
||||
//判断单位是V还是kV
|
||||
else if (comtradeCfgDTO.getLstAnalogDTO().get(j).getSzUnitName().equalsIgnoreCase("KV")) {
|
||||
//根据cfg内的变比,将一次值转换成二次值
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) {
|
||||
fValue = fValue * 1000.0f * comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
|
||||
} else {
|
||||
fValue = fValue;
|
||||
}
|
||||
} else //还有可能是 电流,单位是A
|
||||
{
|
||||
//根据cfg内的变比,将一次值转换成二次值
|
||||
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) {
|
||||
fValue = fValue *comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
|
||||
} else {
|
||||
fValue = fValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
//xValue前移量,假如是第一次时候则需要前移
|
||||
if (!blxValue && j == 0) {
|
||||
xValueAll = (float) (i * 20) / tmpRateDTO.getNOneSample() - comtradeCfgDTO.getNPush();
|
||||
blxValue = true;
|
||||
//只增加一个xValue的值 //增加时间值
|
||||
tmpWaveData.add((float) (Math.round(xValueAll * 100)) / 100);
|
||||
} else if (j == 0) {
|
||||
xValueAll += (float) nWaveSpan * dfValue;
|
||||
//只增加一个xValue的值 //增加时间值
|
||||
tmpWaveData.add((float) (Math.round(xValueAll * 100)) / 100);
|
||||
}
|
||||
|
||||
//不同通道yValue的值都需要增加,最终成ABC三相 //每个通道的值
|
||||
tmpWaveData.add((float) (Math.round(fValue * 100)) / 100);
|
||||
}
|
||||
//把每个单独的值赋予到整体里面去
|
||||
listWaveData.add(tmpWaveData);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -1370,10 +1720,10 @@ public class WaveFileComponent {
|
||||
s = sdf.format(d);
|
||||
System.out.println(s);
|
||||
WaveFileComponent waveFileComponent = new WaveFileComponent();
|
||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath("F:\\PQ_PQLD3_9_20250821_081038_640.cfg");
|
||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath("F:\\PQ_PQLD3_9_20250821_081038_640.dat");
|
||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\无名\\Desktop\\月报\\2026\\202603\\文档\\暂态事件及波形\\新建文件夹 (3)\\Comtrade\\Comtrade\\10.95.0.201\\PQMonitor_PQM1_001183_20260320_175042_316.CFG");
|
||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\无名\\Desktop\\月报\\2026\\202603\\文档\\暂态事件及波形\\新建文件夹 (3)\\Comtrade\\Comtrade\\10.95.0.201\\PQMonitor_PQM1_001183_20260320_175042_316.DAT");
|
||||
// 获取瞬时波形 //获取原始波形值
|
||||
WaveDataDTO waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||
WaveDataDTO waveDataDTO = waveFileComponent.getComtradeNoAddPoints(cfgStream, datStream, 0);
|
||||
d = new Date();
|
||||
s = sdf.format(d);
|
||||
System.out.println(s);
|
||||
|
||||
@@ -81,6 +81,29 @@ public interface BusinessTopic {
|
||||
|
||||
String RMP_EVENT_DETAIL_TOPIC = "rmpEventDetailTopic";
|
||||
|
||||
// /**
|
||||
// * 云前置文件信息请求主题
|
||||
// */
|
||||
// String FILE_INFO_REQUEST_TOPIC = "fileInfoRequestTopic";
|
||||
//
|
||||
// /**
|
||||
// * 云前置文件信息响应主题
|
||||
// */
|
||||
// String FILE_INFO_RESPONSE_TOPIC = "fileInfoResponseTopic";
|
||||
//
|
||||
// /**
|
||||
// * 云前置文件下载请求主题
|
||||
// */
|
||||
// String FILE_DOWNLOAD_REQUEST_TOPIC = "fileDownloadRequestTopic";
|
||||
// /**
|
||||
// * 云前置文件下载响应主题
|
||||
// */
|
||||
// String FILE_DOWNLOAD_RESPONSE_TOPIC = "fileDownloadResponseTopic";
|
||||
|
||||
String CLOUD_TOPIC = "Cloud_Topic";
|
||||
|
||||
String CLOUD_REPLY_TOPIC = "Cloud_Reply_Topic";
|
||||
|
||||
|
||||
interface AppDataTag {
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ package com.njcn.oss.utils;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.aliyun.oss.OSS;
|
||||
import com.njcn.ali.oss.config.AliYunOssConfig;
|
||||
import com.njcn.ali.oss.util.AliYunOssUtils;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.huawei.obs.config.HuaweiObsProperties;
|
||||
import com.njcn.huawei.obs.util.OBSUtil;
|
||||
import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||
import com.njcn.minioss.config.MinIossProperties;
|
||||
@@ -12,6 +15,8 @@ import com.njcn.minioss.util.MinIoUtils;
|
||||
import com.njcn.oss.constant.GeneralConstant;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.enums.OssResponseEnum;
|
||||
import com.obs.services.ObsClient;
|
||||
import com.obs.services.model.PutObjectRequest;
|
||||
import io.minio.*;
|
||||
import io.minio.messages.Item;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -70,6 +75,11 @@ public class FileStorageUtil {
|
||||
*/
|
||||
private final AliYunOssUtils aliYunOssUtils;
|
||||
|
||||
private final HuaweiObsProperties huaweiObsProperties;
|
||||
|
||||
private final OSS ossClient;
|
||||
private final AliYunOssConfig ossConfig;
|
||||
|
||||
|
||||
/***
|
||||
* 上传MultipartFile文件,
|
||||
@@ -442,4 +452,62 @@ public class FileStorageUtil {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void mkdir(String directoryPath) {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
this.createDirectoryHW(directoryPath);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
minIoUtils.createDirectory(minIossProperties.getBucket(), directoryPath);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
this.createDirectoryAli(directoryPath);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 华为文件服务器创建空目录
|
||||
*
|
||||
* @param dirPath
|
||||
*/
|
||||
private void createDirectoryHW(String dirPath) {
|
||||
ObsClient obsClient = null;
|
||||
try {
|
||||
obsClient = this.huaweiObsProperties.getInstance();
|
||||
String bucketName = this.huaweiObsProperties.getObs().getBucket();
|
||||
|
||||
// 确保路径以 / 结尾
|
||||
String directoryKey = dirPath.endsWith("/") ? dirPath : dirPath + "/";
|
||||
|
||||
// 创建空对象作为目录占位符
|
||||
InputStream emptyStream = new ByteArrayInputStream(new byte[0]);
|
||||
PutObjectRequest request = new PutObjectRequest(bucketName, directoryKey, emptyStream);
|
||||
obsClient.putObject(request);
|
||||
|
||||
log.info("已创建目录占位符:" + directoryKey);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("创建目录失败" + dirPath, e);
|
||||
} finally {
|
||||
this.huaweiObsProperties.destroy(obsClient);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 阿里云文件服务器创建空目录
|
||||
*
|
||||
* @param dirPath
|
||||
*/
|
||||
public void createDirectoryAli(String dirPath) {
|
||||
try {
|
||||
// 确保路径以 / 结尾,表示目录
|
||||
String directoryKey = dirPath.endsWith("/") ? dirPath : dirPath + "/";
|
||||
|
||||
// 创建空输入流作为目录占位符
|
||||
ByteArrayInputStream emptyStream = new ByteArrayInputStream(new byte[0]);
|
||||
|
||||
this.ossClient.putObject(this.ossConfig.getBucket(), directoryKey, emptyStream);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("创建目录失败:" + dirPath, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,4 +115,8 @@ public interface AppRedisKey {
|
||||
* 补召文件
|
||||
*/
|
||||
String MAKE_UP_FILES = "makeUpFilesKey:";
|
||||
|
||||
String COMMON_REQUEST = "commonRequestKey:";
|
||||
|
||||
String COMMON_RESOPNSE = "commonResponseKey:";
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.njcn.redis.utils;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.core.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -325,8 +323,25 @@ public class RedisUtil {
|
||||
* @return
|
||||
*/
|
||||
public List<?> getLikeListAllValues(String key) {
|
||||
List<Object> info=new ArrayList<>();
|
||||
for (String s : redisTemplate.keys(key + "*")) {
|
||||
List<Object> info = new ArrayList<>();
|
||||
// 使用 SCAN 替代 keys,解决 Tair 禁用 KEYS 命令的问题
|
||||
Set<String> keys = redisTemplate.execute((RedisCallback<Set<String>>) connection -> {
|
||||
Set<String> keySet = new HashSet<>();
|
||||
ScanOptions options = ScanOptions.scanOptions()
|
||||
.match(key + "*")
|
||||
.count(1000)
|
||||
.build();
|
||||
|
||||
try (Cursor<byte[]> cursor = connection.scan(options)) {
|
||||
while (cursor.hasNext()) {
|
||||
keySet.add(new String(cursor.next()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Redis SCAN 模糊查询失败", e);
|
||||
}
|
||||
return keySet;
|
||||
});
|
||||
for (String s : keys) {
|
||||
info.add(redisTemplate.opsForValue().get(s));
|
||||
}
|
||||
return info;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -17,6 +19,7 @@ import java.io.Serializable;
|
||||
public class DeviceProcess implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//设备id
|
||||
@TableId("Id")
|
||||
private String id;
|
||||
//设备设备所在前置机进程号
|
||||
private Integer processNo;
|
||||
|
||||
@@ -105,6 +105,9 @@ public class LineDetailVO implements Serializable {
|
||||
@ApiModelProperty(name = "终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(name = "终端厂家")
|
||||
private String objId;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -116,6 +116,9 @@ public class DeviceOnlineRate {
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("监测对象")
|
||||
private String objName;
|
||||
|
||||
@ApiModelProperty("监测点运行状态")
|
||||
private String runFlag;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.device.node.mapper.NodeMapper;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.message.constant.RedisKeyPrefix;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -21,6 +22,7 @@ import org.springframework.util.CollectionUtils;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -63,8 +65,17 @@ public class DeviceComflagTasks {
|
||||
pqsCommunicateDto.setTime(LocalDateTimeUtil.now().format(DatePattern.NORM_DATETIME_FORMATTER));
|
||||
pqsCommunicateDto.setDevId(temp);
|
||||
pqsCommunicateDto.setType(0);
|
||||
//获取之前设备状态
|
||||
String devFalg =redisUtil.getStringByKey(RedisKeyPrefix.DEVICE_RUN_FLAG.concat(temp));
|
||||
|
||||
if(StringUtils.isBlank(devFalg)||(!Objects.equals(Integer.valueOf(devFalg),pqsCommunicateDto.getType()))){
|
||||
//状态翻转
|
||||
redisUtil.saveByKey(RedisKeyPrefix.DEVICE_RUN_FLAG.concat(temp),pqsCommunicateDto.getType()+"");
|
||||
pqsCommunicateFeignClient.insertion(pqsCommunicateDto) ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,11 @@ import com.njcn.device.pq.pojo.vo.RStatIntegrityVO;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
import com.njcn.device.pq.service.IRStatIntegrityDService;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.userledger.service.UserLedgerService;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -61,6 +65,7 @@ public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMa
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
private final GeneralDeviceService deviceService;
|
||||
private final LineService lineService;
|
||||
private final UserLedgerService userLedgerService;
|
||||
|
||||
@Override
|
||||
public Float getTotalIntegrityByLineIds(LineBaseQueryParam param) {
|
||||
@@ -160,6 +165,9 @@ public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMa
|
||||
List<DeviceOnlineRate.CitDetail> citDetailList = new ArrayList<>();
|
||||
DeviceOnlineRate.CitDetail citDetail;
|
||||
DeviceOnlineRate.LineDetail detail;
|
||||
//用户侧监测点 监测对象
|
||||
List<UserLedgerVO> userLedgerVOS = userLedgerService.selectUserList(new UserReportParam());
|
||||
Map<String, String> objMap = userLedgerVOS.stream().collect(Collectors.toMap(UserLedgerVO::getId, UserLedgerVO::getProjectName));
|
||||
for (GeneralDeviceDTO dto : deviceInfo) {
|
||||
//获取部门终端集合
|
||||
List<RStatIntegrityVO> citDevOnRate = lineIntegrityRateInfo.stream().filter(x -> dto.getLineIndexes().contains(x.getLineIndex())).collect(Collectors.toList());
|
||||
@@ -184,6 +192,8 @@ public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMa
|
||||
detail.setRunFlag(RunFlagEnum.getRunFlagRemarkByStatus(Integer.valueOf(line.getLineRunType())));
|
||||
detail.setLineId(line.getLineId());
|
||||
detail.setLineName(line.getLineName());
|
||||
//用户侧监测点 监测对象
|
||||
detail.setObjName(StringUtils.isBlank(line.getObjId())?"/":objMap.get(line.getObjId()));
|
||||
detail.setLatestTime(line.getTimeID());
|
||||
detail.setIntegrity(onlineRateByDevMap.getOrDefault(line.getLineId(), BigDecimal.valueOf(0)).doubleValue()>100.0?BigDecimal.valueOf(100.0):onlineRateByDevMap.getOrDefault(line.getLineId(), BigDecimal.valueOf(0)));
|
||||
detailList.add(detail);
|
||||
|
||||
@@ -139,7 +139,7 @@ public class RunManageServiceImpl implements RunManageService {
|
||||
List<String> devIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getDeviceIndexes().stream()).collect(Collectors.toList());
|
||||
List<String> manuList = runManageParam.getManufacturer().stream().map(SimpleDTO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(devIndexes)) {
|
||||
throw new BusinessException("当前部门没有装置台账");
|
||||
return new Page<>(PageFactory.getPageNum(runManageParam), PageFactory.getPageSize(runManageParam));
|
||||
}
|
||||
return deviceMapper.getRunManageDevList(new Page<>(PageFactory.getPageNum(runManageParam), PageFactory.getPageSize(runManageParam)),devIndexes, runManageParam.getComFlag(), runManageParam.getRunFlag(), manuList, runManageParam.getSearchValue());
|
||||
}
|
||||
|
||||
@@ -853,7 +853,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
if (!Objects.equals(lineDetail.getCt1(), lineDetailRes.getCt1()) || !Objects.equals(lineDetail.getCt2(), lineDetailRes.getCt2())
|
||||
|| !Objects.equals(lineDetail.getPt1(), lineDetailRes.getPt1()) || !Objects.equals(lineDetail.getPt2(), lineDetailRes.getPt2())
|
||||
|| !Objects.equals(lineDetail.getDevCapacity(), lineDetailRes.getDevCapacity()) || !Objects.equals(lineDetail.getShortCapacity(), lineDetailRes.getShortCapacity())
|
||||
|| !Objects.equals(lineDetail.getStandardCapacity(), lineDetailRes.getStandardCapacity()) || !Objects.equals(lineDetail.getDealCapacity(), lineDetailRes.getDealCapacity())) {
|
||||
|| !Objects.equals(lineDetail.getStandardCapacity(), lineDetailRes.getStandardCapacity()) || !Objects.equals(lineDetail.getDealCapacity(), lineDetailRes.getDealCapacity())
|
||||
|| !Objects.equals(lineDetail.getPtType(), lineDetailRes.getPtType())) {
|
||||
//获取用户信息
|
||||
String index = RequestUtil.getUserIndex();
|
||||
queryUpdateAndInsertLog(userName, index, lineDetail, lineDetailRes);
|
||||
@@ -959,6 +960,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
sbNew.append("协议容量: ").append(newLine.getDealCapacity()).append(";");
|
||||
sbOld.append("协议容量: ").append(oldLine.getDealCapacity()).append(";");
|
||||
}
|
||||
//接线方式
|
||||
if (!Objects.equals(newLine.getPtType(), oldLine.getPtType())) {
|
||||
sbNew.append("接线方式: ").append(newLine.getPtType()).append(";");
|
||||
sbOld.append("接线方式: ").append(oldLine.getPtType()).append(";");
|
||||
}
|
||||
sb.append(sbNew).append(sbOld);
|
||||
HttpResult<DictData> dicDataByCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.LINE_PARAMETER.getCode());
|
||||
DictData data = dicDataByCode.getData();
|
||||
@@ -3851,6 +3857,15 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
//设备删除找不到设备名称,重日志截取
|
||||
if (Objects.equals(temp.getOperateType(), Param.DEL)) {
|
||||
//删除有2种情况,1.设备删除,2,设备状态修改;
|
||||
if (lineMap.containsKey(deviceId)) {
|
||||
pqsTerminalPushLogDTO.setDevName(lineMap.get(deviceId).getName());
|
||||
String nodeId = deviceMap.get(deviceId).getNodeId();
|
||||
pqsTerminalPushLogDTO.setNodeId(nodeId);
|
||||
pqsTerminalPushLogDTO.setNodeName(nodeMap.containsKey(nodeId)?nodeMap.get(nodeId).getName():"删除前置");
|
||||
|
||||
}else {
|
||||
if(temp.getTerminalDescribe().contains("前置信息")){
|
||||
String temLos = "%s名称:%s;前置信息:%s";
|
||||
List<String> strings = this.parseTemplateValues(temLos, temp.getTerminalDescribe());
|
||||
String devName = strings.get(1); // 设备名称
|
||||
@@ -3859,6 +3874,12 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
String nodeId = nodeNameMap.get(nodeName).getId();
|
||||
pqsTerminalPushLogDTO.setNodeId(nodeId);
|
||||
pqsTerminalPushLogDTO.setNodeName(nodeName);
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
//如果存在说明设备未被删除,不存在说明有一条删除日志,直接return;
|
||||
if (lineMap.containsKey(deviceId)) {
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.njcn.device.device.controller;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.tocrhz.mqtt.annotation.MqttSubscribe;
|
||||
import com.github.tocrhz.mqtt.annotation.NamedValue;
|
||||
import com.github.tocrhz.mqtt.annotation.Payload;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
@@ -27,12 +24,10 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -57,132 +52,132 @@ public class DeviceController extends BaseController {
|
||||
|
||||
private final GeneralDeviceService generalDeviceService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketLine")
|
||||
@ApiOperation("获取监测点定值信息")
|
||||
public HttpResult<String> socketLine(@RequestBody @Validated ConstantValueParam.Constant param) {
|
||||
String methodDescribe = getMethodDescribe("socketLine");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentLine(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateSocketLine")
|
||||
@ApiOperation("修改监测点定值信息")
|
||||
public HttpResult<String> updateSocketLine(@RequestBody @Validated ConstantValueParam.ValueData param) {
|
||||
String methodDescribe = getMethodDescribe("updateSocketLine");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentLineData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketDev")
|
||||
@ApiOperation("获取终端定值信息")
|
||||
public HttpResult<String> socketDev(@RequestBody @Validated ConstantValueParam.Constant param) {
|
||||
String methodDescribe = getMethodDescribe("socketDev");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentDev(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateSocketDev")
|
||||
@ApiOperation("修改终端定值信息")
|
||||
public HttpResult<String> updateSocketDev(@RequestBody @Validated ConstantValueParam.ValueData param) {
|
||||
String methodDescribe = getMethodDescribe("updateSocketDev");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentDevData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketDevProperty")
|
||||
@ApiOperation("获取终端性能信息")
|
||||
public HttpResult<String> socketDevProperty(String devID) {
|
||||
String methodDescribe = getMethodDescribe("socketDevProperty");
|
||||
String s = iDeviceService.socketDevProperty(devID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketDevPropertyClose")
|
||||
@ApiOperation("终端性能关闭")
|
||||
public HttpResult<String> socketDevPropertyClose(String devID) {
|
||||
String methodDescribe = getMethodDescribe("socketDevPropertyClose");
|
||||
String s = iDeviceService.socketDevPropertyClose(devID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/realTimeData")
|
||||
@ApiOperation("监测点实时数据查看")
|
||||
public HttpResult<String> realTimeData(String lineID) {
|
||||
String methodDescribe = getMethodDescribe("realTimeData");
|
||||
String s = iDeviceService.realTimeData(lineID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/heartRealTimeData")
|
||||
@ApiOperation("监测实施数据心跳")
|
||||
public HttpResult<String> heartRealTimeData(String lineID) {
|
||||
String methodDescribe = getMethodDescribe("heartRealTimeData");
|
||||
String s = iDeviceService.heartRealTimeData(lineID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/closeRealTimeData")
|
||||
@ApiOperation("监测点实施数据关闭")
|
||||
public HttpResult<String> closeRealTimeData(String lineID) {
|
||||
String methodDescribe = getMethodDescribe("closeRealTimeData");
|
||||
String s = iDeviceService.closeRealTimeData(lineID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getDevUpgrades")
|
||||
@ApiOperation("终端版本升级")
|
||||
public HttpResult<String> getDevUpgrades(@RequestBody @Validated ConstantValueParam.Upgrades param) {
|
||||
String methodDescribe = getMethodDescribe("getDevUpgrades");
|
||||
String s = iDeviceService.getDevUpgrades(param.getList(),param.getEdIndex());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/closeUpgrades")
|
||||
@ApiOperation("终端升级取消")
|
||||
public HttpResult<String> closeUpgrades(@RequestBody List<String> devList) {
|
||||
String methodDescribe = getMethodDescribe("closeUpgrades");
|
||||
String s = iDeviceService.closeUpgrades(devList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/restartDev")
|
||||
@ApiOperation("重启装置命令")
|
||||
public HttpResult<String> restartDev(@RequestBody List<String> devList) {
|
||||
String methodDescribe = getMethodDescribe("restartDev");
|
||||
String s = iDeviceService.restartDev(devList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
@MqttSubscribe(value = "/zl/devData/{devID}",qos = 1)
|
||||
public void responseRtData(String topic, @NamedValue("devID") String pageId, MqttMessage message, @Payload String payload) {
|
||||
Console.log("receive from : {}", topic);
|
||||
Console.log("receive from : {}", pageId);
|
||||
Console.log("message : {}", message.getPayload());
|
||||
Console.log("message payload : {}", new String(message.getPayload(), StandardCharsets.UTF_8));
|
||||
Console.log("string payload : {}", payload);
|
||||
}
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/socketLine")
|
||||
// @ApiOperation("获取监测点定值信息")
|
||||
// public HttpResult<String> socketLine(@RequestBody @Validated ConstantValueParam.Constant param) {
|
||||
// String methodDescribe = getMethodDescribe("socketLine");
|
||||
// if(StrUtil.isBlank(param.getIp())){
|
||||
// param.setIp(RequestUtil.getRealIp());
|
||||
// }
|
||||
// String s = iDeviceService.sentLine(param);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/updateSocketLine")
|
||||
// @ApiOperation("修改监测点定值信息")
|
||||
// public HttpResult<String> updateSocketLine(@RequestBody @Validated ConstantValueParam.ValueData param) {
|
||||
// String methodDescribe = getMethodDescribe("updateSocketLine");
|
||||
// if(StrUtil.isBlank(param.getIp())){
|
||||
// param.setIp(RequestUtil.getRealIp());
|
||||
// }
|
||||
// String s = iDeviceService.sentLineData(param);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/socketDev")
|
||||
// @ApiOperation("获取终端定值信息")
|
||||
// public HttpResult<String> socketDev(@RequestBody @Validated ConstantValueParam.Constant param) {
|
||||
// String methodDescribe = getMethodDescribe("socketDev");
|
||||
// if(StrUtil.isBlank(param.getIp())){
|
||||
// param.setIp(RequestUtil.getRealIp());
|
||||
// }
|
||||
// String s = iDeviceService.sentDev(param);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/updateSocketDev")
|
||||
// @ApiOperation("修改终端定值信息")
|
||||
// public HttpResult<String> updateSocketDev(@RequestBody @Validated ConstantValueParam.ValueData param) {
|
||||
// String methodDescribe = getMethodDescribe("updateSocketDev");
|
||||
// if(StrUtil.isBlank(param.getIp())){
|
||||
// param.setIp(RequestUtil.getRealIp());
|
||||
// }
|
||||
// String s = iDeviceService.sentDevData(param);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/socketDevProperty")
|
||||
// @ApiOperation("获取终端性能信息")
|
||||
// public HttpResult<String> socketDevProperty(String devID) {
|
||||
// String methodDescribe = getMethodDescribe("socketDevProperty");
|
||||
// String s = iDeviceService.socketDevProperty(devID);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/socketDevPropertyClose")
|
||||
// @ApiOperation("终端性能关闭")
|
||||
// public HttpResult<String> socketDevPropertyClose(String devID) {
|
||||
// String methodDescribe = getMethodDescribe("socketDevPropertyClose");
|
||||
// String s = iDeviceService.socketDevPropertyClose(devID);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/realTimeData")
|
||||
// @ApiOperation("监测点实时数据查看")
|
||||
// public HttpResult<String> realTimeData(String lineID) {
|
||||
// String methodDescribe = getMethodDescribe("realTimeData");
|
||||
// String s = iDeviceService.realTimeData(lineID);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/heartRealTimeData")
|
||||
// @ApiOperation("监测实施数据心跳")
|
||||
// public HttpResult<String> heartRealTimeData(String lineID) {
|
||||
// String methodDescribe = getMethodDescribe("heartRealTimeData");
|
||||
// String s = iDeviceService.heartRealTimeData(lineID);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/closeRealTimeData")
|
||||
// @ApiOperation("监测点实施数据关闭")
|
||||
// public HttpResult<String> closeRealTimeData(String lineID) {
|
||||
// String methodDescribe = getMethodDescribe("closeRealTimeData");
|
||||
// String s = iDeviceService.closeRealTimeData(lineID);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/getDevUpgrades")
|
||||
// @ApiOperation("终端版本升级")
|
||||
// public HttpResult<String> getDevUpgrades(@RequestBody @Validated ConstantValueParam.Upgrades param) {
|
||||
// String methodDescribe = getMethodDescribe("getDevUpgrades");
|
||||
// String s = iDeviceService.getDevUpgrades(param.getList(),param.getEdIndex());
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/closeUpgrades")
|
||||
// @ApiOperation("终端升级取消")
|
||||
// public HttpResult<String> closeUpgrades(@RequestBody List<String> devList) {
|
||||
// String methodDescribe = getMethodDescribe("closeUpgrades");
|
||||
// String s = iDeviceService.closeUpgrades(devList);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/restartDev")
|
||||
// @ApiOperation("重启装置命令")
|
||||
// public HttpResult<String> restartDev(@RequestBody List<String> devList) {
|
||||
// String methodDescribe = getMethodDescribe("restartDev");
|
||||
// String s = iDeviceService.restartDev(devList);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
// }
|
||||
// @MqttSubscribe(value = "/zl/devData/{devID}",qos = 1)
|
||||
// public void responseRtData(String topic, @NamedValue("devID") String pageId, MqttMessage message, @Payload String payload) {
|
||||
// Console.log("receive from : {}", topic);
|
||||
// Console.log("receive from : {}", pageId);
|
||||
// Console.log("message : {}", message.getPayload());
|
||||
// Console.log("message payload : {}", new String(message.getPayload(), StandardCharsets.UTF_8));
|
||||
// Console.log("string payload : {}", payload);
|
||||
// }
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateDevCheckTime")
|
||||
|
||||
@@ -19,113 +19,113 @@ import java.util.List;
|
||||
public interface IDeviceService extends IService<Device> {
|
||||
|
||||
|
||||
/***
|
||||
* @Description: mqtt获取外部定值
|
||||
* @param param
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 10:17
|
||||
*/
|
||||
String sentLine(ConstantValueParam.Constant param);
|
||||
|
||||
/***
|
||||
* @Description: mqtt修改外部定值
|
||||
* @param param
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 11:07
|
||||
*/
|
||||
String sentLineData(ConstantValueParam.ValueData param);
|
||||
|
||||
/**
|
||||
* @param param
|
||||
* @Description: mqtt获取内部定值
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 14:51
|
||||
*/
|
||||
String sentDev(ConstantValueParam.Constant param);
|
||||
|
||||
/**
|
||||
* @param param
|
||||
* @Description: mqtt修改内部定值
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 14:51
|
||||
*/
|
||||
String sentDevData(ConstantValueParam.ValueData param);
|
||||
|
||||
/**
|
||||
* @param devID
|
||||
* @Description: 终端性能查看
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 11:27
|
||||
*/
|
||||
String socketDevProperty(String devID);
|
||||
|
||||
/**
|
||||
* @param devID
|
||||
* @Description: 终端性能关闭
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:13
|
||||
*/
|
||||
String socketDevPropertyClose(String devID);
|
||||
|
||||
/**
|
||||
* @param lineIndex
|
||||
* @Description: 监测点实时数据查看
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:13
|
||||
*/
|
||||
String realTimeData(String lineIndex);
|
||||
|
||||
/**
|
||||
* @param lineIndex
|
||||
* @Description: 监测实施数据心跳
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:14
|
||||
*/
|
||||
String heartRealTimeData(String lineIndex);
|
||||
|
||||
/**
|
||||
* @param lineIndex
|
||||
* @Description: 监测点实施数据关闭
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:14
|
||||
*/
|
||||
String closeRealTimeData(String lineIndex);
|
||||
|
||||
/**
|
||||
* 终端版本升级,批量升级条件必须是相同终端系列的终端才能升级
|
||||
*
|
||||
* @param list
|
||||
* @param edIndex
|
||||
* @return
|
||||
*/
|
||||
String getDevUpgrades(List<String> list, String edIndex);
|
||||
|
||||
/**
|
||||
* @param devList
|
||||
* @Description: 终端升级取消
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/17 9:24
|
||||
*/
|
||||
String closeUpgrades(List<String> devList);
|
||||
|
||||
/**
|
||||
* @param devList
|
||||
* @Description: 重启装置命令
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/17 9:24
|
||||
*/
|
||||
String restartDev(List<String> devList);
|
||||
// /***
|
||||
// * @Description: mqtt获取外部定值
|
||||
// * @param param
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/14 10:17
|
||||
// */
|
||||
// String sentLine(ConstantValueParam.Constant param);
|
||||
//
|
||||
// /***
|
||||
// * @Description: mqtt修改外部定值
|
||||
// * @param param
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/14 11:07
|
||||
// */
|
||||
// String sentLineData(ConstantValueParam.ValueData param);
|
||||
//
|
||||
// /**
|
||||
// * @param param
|
||||
// * @Description: mqtt获取内部定值
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/14 14:51
|
||||
// */
|
||||
// String sentDev(ConstantValueParam.Constant param);
|
||||
//
|
||||
// /**
|
||||
// * @param param
|
||||
// * @Description: mqtt修改内部定值
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/14 14:51
|
||||
// */
|
||||
// String sentDevData(ConstantValueParam.ValueData param);
|
||||
//
|
||||
// /**
|
||||
// * @param devID
|
||||
// * @Description: 终端性能查看
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/15 11:27
|
||||
// */
|
||||
// String socketDevProperty(String devID);
|
||||
//
|
||||
// /**
|
||||
// * @param devID
|
||||
// * @Description: 终端性能关闭
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/15 16:13
|
||||
// */
|
||||
// String socketDevPropertyClose(String devID);
|
||||
//
|
||||
// /**
|
||||
// * @param lineIndex
|
||||
// * @Description: 监测点实时数据查看
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/15 16:13
|
||||
// */
|
||||
// String realTimeData(String lineIndex);
|
||||
//
|
||||
// /**
|
||||
// * @param lineIndex
|
||||
// * @Description: 监测实施数据心跳
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/15 16:14
|
||||
// */
|
||||
// String heartRealTimeData(String lineIndex);
|
||||
//
|
||||
// /**
|
||||
// * @param lineIndex
|
||||
// * @Description: 监测点实施数据关闭
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/15 16:14
|
||||
// */
|
||||
// String closeRealTimeData(String lineIndex);
|
||||
//
|
||||
// /**
|
||||
// * 终端版本升级,批量升级条件必须是相同终端系列的终端才能升级
|
||||
// *
|
||||
// * @param list
|
||||
// * @param edIndex
|
||||
// * @return
|
||||
// */
|
||||
// String getDevUpgrades(List<String> list, String edIndex);
|
||||
//
|
||||
// /**
|
||||
// * @param devList
|
||||
// * @Description: 终端升级取消
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/17 9:24
|
||||
// */
|
||||
// String closeUpgrades(List<String> devList);
|
||||
//
|
||||
// /**
|
||||
// * @param devList
|
||||
// * @Description: 重启装置命令
|
||||
// * @return: java.lang.String
|
||||
// * @Author: wr
|
||||
// * @Date: 2023/8/17 9:24
|
||||
// */
|
||||
// String restartDev(List<String> devList);
|
||||
|
||||
/**
|
||||
* @param devId 装置id
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package com.njcn.device.device.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -14,16 +10,11 @@ import com.njcn.device.device.mapper.DeviceMapper;
|
||||
import com.njcn.device.device.service.IDeviceService;
|
||||
import com.njcn.device.device.service.ProgramVersionService;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.advanced.*;
|
||||
import com.njcn.device.pq.pojo.param.ConstantValueParam;
|
||||
import com.njcn.device.pq.pojo.po.DevVersion;
|
||||
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.Version;
|
||||
|
||||
import com.njcn.device.pq.pojo.vo.DevStatusNumVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeviceIpRVO;
|
||||
import com.njcn.device.utils.SocketClient;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -45,360 +36,360 @@ import java.util.stream.Collectors;
|
||||
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements IDeviceService {
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
private final SocketClient socketClient;
|
||||
// private final SocketClient socketClient;
|
||||
private final DevVersionMapper devVersionMapper;
|
||||
private final ProgramVersionService programVersionService;
|
||||
|
||||
@Value("${socket.port:60000}")
|
||||
private Integer socketPort;
|
||||
|
||||
@Override
|
||||
public String sentLine(ConstantValueParam.Constant param) {
|
||||
try {
|
||||
//获取根据监测点获取终端信息
|
||||
UpDevVO upDevVO = lineMapper.getDevInfo(param.getId());
|
||||
//查询前置ip
|
||||
String host = lineMapper.getNodeIp(upDevVO.getDevIndex(),0);
|
||||
//拼接属性
|
||||
ContValueRVO upParamVO = new ContValueRVO();
|
||||
ContValueVO valueVO = new ContValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setLineid(param.getId());
|
||||
valueVO.setHander(param.getHander());
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentLine(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "获取定值失败";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sentLineData(ConstantValueParam.ValueData param) {
|
||||
try {
|
||||
//获取根据监测点获取终端信息
|
||||
UpDevVO upDevVO = lineMapper.getDevInfo(param.getId());
|
||||
//查询前置ip
|
||||
String host = lineMapper.getNodeIp(upDevVO.getDevIndex(),0);
|
||||
ContUpdateValueRVO upParamVO = new ContUpdateValueRVO();
|
||||
ContUpdateValueVO valueVO = new ContUpdateValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setLineid(param.getId());
|
||||
valueVO.setHander(param.getHander());
|
||||
float[] intArr;
|
||||
if (StrUtil.isBlank(param.getInterValue())) {
|
||||
intArr = new float[0];
|
||||
} else {
|
||||
String[] valueArr = param.getInterValue().split(",");
|
||||
intArr = new float[valueArr.length];
|
||||
for (int i = 0; i < valueArr.length; i++) {
|
||||
intArr[i] = Float.parseFloat(valueArr[i]);
|
||||
}
|
||||
}
|
||||
valueVO.setValue(intArr);
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentLine(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "运行失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sentDev(ConstantValueParam.Constant param) {
|
||||
try {
|
||||
Line line = lineMapper.selectById(param.getId());
|
||||
UpDevVO upDevVO = new UpDevVO();
|
||||
upDevVO.setDevIndex(line.getId());
|
||||
upDevVO.setDevName(line.getName());
|
||||
String host = lineMapper.getNodeIp(line.getId(),1);
|
||||
ContValueRVO upParamVO = new ContValueRVO();
|
||||
ContValueVO valueVO = new ContValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setIndex(param.getId());
|
||||
valueVO.setHander(param.getHander());
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentDZDev(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "获取定值失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sentDevData(ConstantValueParam.ValueData param) {
|
||||
try {
|
||||
Line line = lineMapper.selectById(param.getId());
|
||||
UpDevVO upDevVO = new UpDevVO();
|
||||
upDevVO.setDevIndex(line.getId());
|
||||
upDevVO.setDevName(line.getName());
|
||||
String host = lineMapper.getNodeIp(line.getId(),1);
|
||||
ContUpdateDevValueRVO upParamVO = new ContUpdateDevValueRVO();
|
||||
ContUpdateDevValueVO valueVO = new ContUpdateDevValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setIndex(line.getId());
|
||||
valueVO.setHander(String.valueOf(param.getHander()));
|
||||
int[] intArr;
|
||||
if (StrUtil.isBlank(param.getInterValue())) {
|
||||
intArr = new int[0];
|
||||
} else {
|
||||
String[] valueArr = param.getInterValue().split(",");
|
||||
intArr = new int[valueArr.length];
|
||||
for (int i = 0; i < valueArr.length; i++) {
|
||||
intArr[i] = Integer.parseInt(valueArr[i]);
|
||||
}
|
||||
}
|
||||
valueVO.setInterValue(intArr);
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentDZDev(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "运行失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String socketDevProperty(String devID) {
|
||||
String host = lineMapper.getNodeIp(devID,1);
|
||||
if(StrUtil.isBlank(host)){
|
||||
return "前置ip获取失败";
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("type","190");
|
||||
map.put("index",devID);
|
||||
map.put("hander","1");
|
||||
jsonObject.set("data", map);
|
||||
Integer len = jsonObject.get("data").toString().length();
|
||||
jsonObject.set("len", len.toString());
|
||||
socketClient.showProperty(jsonObject.toString(),host,socketPort,RequestUtil.getLoginName());
|
||||
return "终端性能获取成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String socketDevPropertyClose(String devID) {
|
||||
String host = lineMapper.getNodeIp(devID,1);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("type", "190");
|
||||
map.put("index", devID);
|
||||
map.put("hander", "0");
|
||||
jsonObject.set("data", map);
|
||||
Integer len = jsonObject.get("data").toString().length();
|
||||
jsonObject.set("len", len.toString());
|
||||
socketClient.closeDevSocket(jsonObject.toString(),host,socketPort,RequestUtil.getLoginName());
|
||||
return "执行成功";
|
||||
}catch (Exception e){
|
||||
return "执行失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String realTimeData(String lineIndex) {
|
||||
//查询前置ip
|
||||
String host = lineMapper.getNodeIp(lineIndex,0);
|
||||
if(StrUtil.isBlank(host)){
|
||||
return "设备前置机服务器配置异常,请联系管理员";
|
||||
}else {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("LineId", lineIndex);
|
||||
jsonObject.set("type", 0);
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.set("len",0);
|
||||
jsonObject1.set("data",jsonObject);
|
||||
socketClient.realTimeData(jsonObject1.toString(),host,socketPort,lineIndex);
|
||||
}
|
||||
return "请求成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String heartRealTimeData(String lineIndex) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("LineId", lineIndex);
|
||||
jsonObject.set("type", 1);
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.set("len", 0);
|
||||
jsonObject1.set("data", jsonObject);
|
||||
String host = lineMapper.getNodeIp(lineIndex,0);
|
||||
socketClient.heartRealData(jsonObject1.toString(),host,socketPort,lineIndex);
|
||||
return "实时数据心跳请求成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String closeRealTimeData(String lineIndex) {
|
||||
socketClient.closeRealData(lineIndex);
|
||||
return "关闭实时数据请求成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDevUpgrades(List<String> list, String edIndex) {
|
||||
List<DeviceIpRVO> resTemlist = new ArrayList<>();
|
||||
|
||||
List<DeviceIpRVO> relist = lineMapper.getDevicesIp(list);
|
||||
//判断设备版本号
|
||||
Integer isExit = devVersionMapper.selectCount(new LambdaQueryWrapper<DevVersion>()
|
||||
.eq(DevVersion::getVersionId,edIndex)
|
||||
.in(DevVersion::getLineId,list)
|
||||
.eq(DevVersion::getState,1)
|
||||
);
|
||||
if (isExit > 0) {
|
||||
return "请勿选择相同版本号升级";
|
||||
}
|
||||
if (!CollectionUtil.isEmpty(relist)) {
|
||||
Version version = programVersionService.getById(edIndex);
|
||||
String series = version.getDevType();
|
||||
//判断设备是否存在相同型号
|
||||
for (DeviceIpRVO deviceIpRVO : relist) {
|
||||
if (!series.equals(deviceIpRVO.getDevSeries())) {
|
||||
return "当前装置版本系列与目标版本系列不相同";
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否断开
|
||||
if (relist.stream().filter(w -> w.getComFlag() == 0).findAny().isPresent()) {
|
||||
return "存在通讯中断设备";
|
||||
}
|
||||
|
||||
|
||||
Set<String> set = new HashSet<>();
|
||||
for (DeviceIpRVO d : relist) {
|
||||
set.add(d.getIp());
|
||||
}
|
||||
Iterator<String> iterator = set.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
List<UpDevVO> devIndex = new ArrayList<>();
|
||||
DeviceIpRVO deviceIpRVO = new DeviceIpRVO();
|
||||
String ip = iterator.next();
|
||||
for (DeviceIpRVO d : relist) {
|
||||
UpDevVO upDevVO = new UpDevVO();
|
||||
upDevVO.setDevIndex(d.getDevIndex());
|
||||
upDevVO.setDevName(d.getDevName());
|
||||
if (ip.equals(d.getIp())) {
|
||||
devIndex.add(upDevVO);
|
||||
}
|
||||
}
|
||||
deviceIpRVO.setIp(ip);
|
||||
deviceIpRVO.setDevlist(devIndex);
|
||||
resTemlist.add(deviceIpRVO);
|
||||
}
|
||||
} else {
|
||||
return "存在未知错误";
|
||||
}
|
||||
for (DeviceIpRVO deviceIpRVO : resTemlist) {
|
||||
String ip = deviceIpRVO.getIp();
|
||||
List<UpDevVO> devlist = deviceIpRVO.getDevlist();
|
||||
UpDataVO upDataVO = new UpDataVO();
|
||||
UpParamVO upParamVO = new UpParamVO();
|
||||
upDataVO.setTerminal(devlist);
|
||||
upDataVO.setType("180");
|
||||
upDataVO.setEdIndex(edIndex);
|
||||
upDataVO.setUserIndex(RequestUtil.getUserIndex());
|
||||
JSONObject jsonstr = new JSONObject(upDataVO);
|
||||
Integer len = jsonstr.toString().length();
|
||||
upParamVO.setData(upDataVO);
|
||||
upParamVO.setLen(len.toString());
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
socketClient.sentUpgrades(str, ip, socketPort, RequestUtil.getLoginName(), edIndex, devlist);
|
||||
}
|
||||
return "运行成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String closeUpgrades(List<String> devList) {
|
||||
List<DeviceIpRVO> relist = lineMapper.getDevicesIp(devList);
|
||||
if(CollectionUtil.isEmpty(relist)){
|
||||
return "前置机为空";
|
||||
}else {
|
||||
List<String> nodeIp = relist.stream().map(DeviceIpRVO::getIp).distinct().collect(Collectors.toList());
|
||||
for(String ip: nodeIp){
|
||||
List<DeviceIpRVO> devLl= relist.stream().filter(item->item.getIp().equals(ip)).collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(devLl)){
|
||||
return "出错啦";
|
||||
}
|
||||
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
for(DeviceIpRVO devRVO:devLl){
|
||||
JSONObject dev = new JSONObject();
|
||||
dev.put("devIndex",devRVO.getDevIndex());
|
||||
dev.put("devName",devRVO.getDevName());
|
||||
list.add(dev);
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("terminal", list);
|
||||
jsonObject.set("type", 182);
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.set("len", 0);
|
||||
jsonObject1.set("data", jsonObject);
|
||||
socketClient.cancelUp(jsonObject1.toString(),ip,socketPort,devLl.size());
|
||||
}
|
||||
}
|
||||
return "取消命令发送成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String restartDev(List<String> devList) {
|
||||
List<DeviceIpRVO> relist = lineMapper.getDevicesIp(devList);
|
||||
if(CollUtil.isEmpty(relist)){
|
||||
return "前置机为空";
|
||||
}else {
|
||||
List<String> nodeIp = relist.stream().map(DeviceIpRVO::getIp).distinct().collect(Collectors.toList());
|
||||
for(String ip: nodeIp){
|
||||
List<DeviceIpRVO> devLl = relist.stream().filter(item->item.getIp().equals(ip)).collect(Collectors.toList());
|
||||
if(CollUtil.isEmpty(devLl)){
|
||||
return "出错啦";
|
||||
}
|
||||
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
List<String> devIn = new ArrayList<>();
|
||||
for(DeviceIpRVO devRVO:devLl){
|
||||
devIn.add(devRVO.getDevIndex());
|
||||
JSONObject dev = new JSONObject();
|
||||
dev.set("devIndex", devRVO.getDevIndex());
|
||||
dev.set("devName", devRVO.getDevName());
|
||||
list.add(dev);
|
||||
}
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("terminal", list);
|
||||
jsonObject.set("type", 181);
|
||||
jsonObject.set("userIndex", RequestUtil.getUserIndex());
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.set("len", 0);
|
||||
jsonObject1.set("data", jsonObject);
|
||||
|
||||
socketClient.restartDev(jsonObject1.toString(),ip,socketPort,devIn);
|
||||
}
|
||||
}
|
||||
return "命令发送成功";
|
||||
}
|
||||
// @Override
|
||||
// public String sentLine(ConstantValueParam.Constant param) {
|
||||
// try {
|
||||
// //获取根据监测点获取终端信息
|
||||
// UpDevVO upDevVO = lineMapper.getDevInfo(param.getId());
|
||||
// //查询前置ip
|
||||
// String host = lineMapper.getNodeIp(upDevVO.getDevIndex(),0);
|
||||
// //拼接属性
|
||||
// ContValueRVO upParamVO = new ContValueRVO();
|
||||
// ContValueVO valueVO = new ContValueVO();
|
||||
// valueVO.setType(param.getType());
|
||||
// valueVO.setLineid(param.getId());
|
||||
// valueVO.setHander(param.getHander());
|
||||
// JSONObject jsonStr = new JSONObject(valueVO);
|
||||
// Integer len = jsonStr.toString().length();
|
||||
// upParamVO.setLen(len.toString());
|
||||
// upParamVO.setData(valueVO);
|
||||
// JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
// String str = jsonObject.toString();
|
||||
// List<UpDevVO> devList = new ArrayList<>();
|
||||
// devList.add(upDevVO);
|
||||
// return socketClient.sentLine(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
// } catch (Exception e) {
|
||||
// return "获取定值失败";
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String sentLineData(ConstantValueParam.ValueData param) {
|
||||
// try {
|
||||
// //获取根据监测点获取终端信息
|
||||
// UpDevVO upDevVO = lineMapper.getDevInfo(param.getId());
|
||||
// //查询前置ip
|
||||
// String host = lineMapper.getNodeIp(upDevVO.getDevIndex(),0);
|
||||
// ContUpdateValueRVO upParamVO = new ContUpdateValueRVO();
|
||||
// ContUpdateValueVO valueVO = new ContUpdateValueVO();
|
||||
// valueVO.setType(param.getType());
|
||||
// valueVO.setLineid(param.getId());
|
||||
// valueVO.setHander(param.getHander());
|
||||
// float[] intArr;
|
||||
// if (StrUtil.isBlank(param.getInterValue())) {
|
||||
// intArr = new float[0];
|
||||
// } else {
|
||||
// String[] valueArr = param.getInterValue().split(",");
|
||||
// intArr = new float[valueArr.length];
|
||||
// for (int i = 0; i < valueArr.length; i++) {
|
||||
// intArr[i] = Float.parseFloat(valueArr[i]);
|
||||
// }
|
||||
// }
|
||||
// valueVO.setValue(intArr);
|
||||
// JSONObject jsonStr = new JSONObject(valueVO);
|
||||
// Integer len = jsonStr.toString().length();
|
||||
// upParamVO.setLen(len.toString());
|
||||
// upParamVO.setData(valueVO);
|
||||
// JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
// String str = jsonObject.toString();
|
||||
// List<UpDevVO> devList = new ArrayList<>();
|
||||
// devList.add(upDevVO);
|
||||
// return socketClient.sentLine(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
// } catch (Exception e) {
|
||||
// return "运行失败";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String sentDev(ConstantValueParam.Constant param) {
|
||||
// try {
|
||||
// Line line = lineMapper.selectById(param.getId());
|
||||
// UpDevVO upDevVO = new UpDevVO();
|
||||
// upDevVO.setDevIndex(line.getId());
|
||||
// upDevVO.setDevName(line.getName());
|
||||
// String host = lineMapper.getNodeIp(line.getId(),1);
|
||||
// ContValueRVO upParamVO = new ContValueRVO();
|
||||
// ContValueVO valueVO = new ContValueVO();
|
||||
// valueVO.setType(param.getType());
|
||||
// valueVO.setIndex(param.getId());
|
||||
// valueVO.setHander(param.getHander());
|
||||
// JSONObject jsonStr = new JSONObject(valueVO);
|
||||
// Integer len = jsonStr.toString().length();
|
||||
// upParamVO.setLen(len.toString());
|
||||
// upParamVO.setData(valueVO);
|
||||
// JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
// String str = jsonObject.toString();
|
||||
// List<UpDevVO> devList = new ArrayList<>();
|
||||
// devList.add(upDevVO);
|
||||
// return socketClient.sentDZDev(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
// } catch (Exception e) {
|
||||
// return "获取定值失败";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String sentDevData(ConstantValueParam.ValueData param) {
|
||||
// try {
|
||||
// Line line = lineMapper.selectById(param.getId());
|
||||
// UpDevVO upDevVO = new UpDevVO();
|
||||
// upDevVO.setDevIndex(line.getId());
|
||||
// upDevVO.setDevName(line.getName());
|
||||
// String host = lineMapper.getNodeIp(line.getId(),1);
|
||||
// ContUpdateDevValueRVO upParamVO = new ContUpdateDevValueRVO();
|
||||
// ContUpdateDevValueVO valueVO = new ContUpdateDevValueVO();
|
||||
// valueVO.setType(param.getType());
|
||||
// valueVO.setIndex(line.getId());
|
||||
// valueVO.setHander(String.valueOf(param.getHander()));
|
||||
// int[] intArr;
|
||||
// if (StrUtil.isBlank(param.getInterValue())) {
|
||||
// intArr = new int[0];
|
||||
// } else {
|
||||
// String[] valueArr = param.getInterValue().split(",");
|
||||
// intArr = new int[valueArr.length];
|
||||
// for (int i = 0; i < valueArr.length; i++) {
|
||||
// intArr[i] = Integer.parseInt(valueArr[i]);
|
||||
// }
|
||||
// }
|
||||
// valueVO.setInterValue(intArr);
|
||||
// JSONObject jsonStr = new JSONObject(valueVO);
|
||||
// Integer len = jsonStr.toString().length();
|
||||
// upParamVO.setLen(len.toString());
|
||||
// upParamVO.setData(valueVO);
|
||||
// JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
// String str = jsonObject.toString();
|
||||
//
|
||||
// List<UpDevVO> devList = new ArrayList<>();
|
||||
// devList.add(upDevVO);
|
||||
// return socketClient.sentDZDev(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
// } catch (Exception e) {
|
||||
// return "运行失败";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String socketDevProperty(String devID) {
|
||||
// String host = lineMapper.getNodeIp(devID,1);
|
||||
// if(StrUtil.isBlank(host)){
|
||||
// return "前置ip获取失败";
|
||||
// }
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// Map<String,String> map = new HashMap<>();
|
||||
// map.put("type","190");
|
||||
// map.put("index",devID);
|
||||
// map.put("hander","1");
|
||||
// jsonObject.set("data", map);
|
||||
// Integer len = jsonObject.get("data").toString().length();
|
||||
// jsonObject.set("len", len.toString());
|
||||
// socketClient.showProperty(jsonObject.toString(),host,socketPort,RequestUtil.getLoginName());
|
||||
// return "终端性能获取成功";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String socketDevPropertyClose(String devID) {
|
||||
// String host = lineMapper.getNodeIp(devID,1);
|
||||
// try {
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// Map<String, String> map = new HashMap<>();
|
||||
// map.put("type", "190");
|
||||
// map.put("index", devID);
|
||||
// map.put("hander", "0");
|
||||
// jsonObject.set("data", map);
|
||||
// Integer len = jsonObject.get("data").toString().length();
|
||||
// jsonObject.set("len", len.toString());
|
||||
// socketClient.closeDevSocket(jsonObject.toString(),host,socketPort,RequestUtil.getLoginName());
|
||||
// return "执行成功";
|
||||
// }catch (Exception e){
|
||||
// return "执行失败";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String realTimeData(String lineIndex) {
|
||||
// //查询前置ip
|
||||
// String host = lineMapper.getNodeIp(lineIndex,0);
|
||||
// if(StrUtil.isBlank(host)){
|
||||
// return "设备前置机服务器配置异常,请联系管理员";
|
||||
// }else {
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.set("LineId", lineIndex);
|
||||
// jsonObject.set("type", 0);
|
||||
// JSONObject jsonObject1 = new JSONObject();
|
||||
// jsonObject1.set("len",0);
|
||||
// jsonObject1.set("data",jsonObject);
|
||||
// socketClient.realTimeData(jsonObject1.toString(),host,socketPort,lineIndex);
|
||||
// }
|
||||
// return "请求成功";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String heartRealTimeData(String lineIndex) {
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.set("LineId", lineIndex);
|
||||
// jsonObject.set("type", 1);
|
||||
// JSONObject jsonObject1 = new JSONObject();
|
||||
// jsonObject1.set("len", 0);
|
||||
// jsonObject1.set("data", jsonObject);
|
||||
// String host = lineMapper.getNodeIp(lineIndex,0);
|
||||
// socketClient.heartRealData(jsonObject1.toString(),host,socketPort,lineIndex);
|
||||
// return "实时数据心跳请求成功";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String closeRealTimeData(String lineIndex) {
|
||||
// socketClient.closeRealData(lineIndex);
|
||||
// return "关闭实时数据请求成功";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getDevUpgrades(List<String> list, String edIndex) {
|
||||
// List<DeviceIpRVO> resTemlist = new ArrayList<>();
|
||||
//
|
||||
// List<DeviceIpRVO> relist = lineMapper.getDevicesIp(list);
|
||||
// //判断设备版本号
|
||||
// Integer isExit = devVersionMapper.selectCount(new LambdaQueryWrapper<DevVersion>()
|
||||
// .eq(DevVersion::getVersionId,edIndex)
|
||||
// .in(DevVersion::getLineId,list)
|
||||
// .eq(DevVersion::getState,1)
|
||||
// );
|
||||
// if (isExit > 0) {
|
||||
// return "请勿选择相同版本号升级";
|
||||
// }
|
||||
// if (!CollectionUtil.isEmpty(relist)) {
|
||||
// Version version = programVersionService.getById(edIndex);
|
||||
// String series = version.getDevType();
|
||||
// //判断设备是否存在相同型号
|
||||
// for (DeviceIpRVO deviceIpRVO : relist) {
|
||||
// if (!series.equals(deviceIpRVO.getDevSeries())) {
|
||||
// return "当前装置版本系列与目标版本系列不相同";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //判断是否断开
|
||||
// if (relist.stream().filter(w -> w.getComFlag() == 0).findAny().isPresent()) {
|
||||
// return "存在通讯中断设备";
|
||||
// }
|
||||
//
|
||||
//
|
||||
// Set<String> set = new HashSet<>();
|
||||
// for (DeviceIpRVO d : relist) {
|
||||
// set.add(d.getIp());
|
||||
// }
|
||||
// Iterator<String> iterator = set.iterator();
|
||||
// while (iterator.hasNext()) {
|
||||
// List<UpDevVO> devIndex = new ArrayList<>();
|
||||
// DeviceIpRVO deviceIpRVO = new DeviceIpRVO();
|
||||
// String ip = iterator.next();
|
||||
// for (DeviceIpRVO d : relist) {
|
||||
// UpDevVO upDevVO = new UpDevVO();
|
||||
// upDevVO.setDevIndex(d.getDevIndex());
|
||||
// upDevVO.setDevName(d.getDevName());
|
||||
// if (ip.equals(d.getIp())) {
|
||||
// devIndex.add(upDevVO);
|
||||
// }
|
||||
// }
|
||||
// deviceIpRVO.setIp(ip);
|
||||
// deviceIpRVO.setDevlist(devIndex);
|
||||
// resTemlist.add(deviceIpRVO);
|
||||
// }
|
||||
// } else {
|
||||
// return "存在未知错误";
|
||||
// }
|
||||
// for (DeviceIpRVO deviceIpRVO : resTemlist) {
|
||||
// String ip = deviceIpRVO.getIp();
|
||||
// List<UpDevVO> devlist = deviceIpRVO.getDevlist();
|
||||
// UpDataVO upDataVO = new UpDataVO();
|
||||
// UpParamVO upParamVO = new UpParamVO();
|
||||
// upDataVO.setTerminal(devlist);
|
||||
// upDataVO.setType("180");
|
||||
// upDataVO.setEdIndex(edIndex);
|
||||
// upDataVO.setUserIndex(RequestUtil.getUserIndex());
|
||||
// JSONObject jsonstr = new JSONObject(upDataVO);
|
||||
// Integer len = jsonstr.toString().length();
|
||||
// upParamVO.setData(upDataVO);
|
||||
// upParamVO.setLen(len.toString());
|
||||
// JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
// String str = jsonObject.toString();
|
||||
// socketClient.sentUpgrades(str, ip, socketPort, RequestUtil.getLoginName(), edIndex, devlist);
|
||||
// }
|
||||
// return "运行成功";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String closeUpgrades(List<String> devList) {
|
||||
// List<DeviceIpRVO> relist = lineMapper.getDevicesIp(devList);
|
||||
// if(CollectionUtil.isEmpty(relist)){
|
||||
// return "前置机为空";
|
||||
// }else {
|
||||
// List<String> nodeIp = relist.stream().map(DeviceIpRVO::getIp).distinct().collect(Collectors.toList());
|
||||
// for(String ip: nodeIp){
|
||||
// List<DeviceIpRVO> devLl= relist.stream().filter(item->item.getIp().equals(ip)).collect(Collectors.toList());
|
||||
// if(CollectionUtil.isEmpty(devLl)){
|
||||
// return "出错啦";
|
||||
// }
|
||||
//
|
||||
// List<JSONObject> list = new ArrayList<>();
|
||||
// for(DeviceIpRVO devRVO:devLl){
|
||||
// JSONObject dev = new JSONObject();
|
||||
// dev.put("devIndex",devRVO.getDevIndex());
|
||||
// dev.put("devName",devRVO.getDevName());
|
||||
// list.add(dev);
|
||||
// }
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.set("terminal", list);
|
||||
// jsonObject.set("type", 182);
|
||||
// JSONObject jsonObject1 = new JSONObject();
|
||||
// jsonObject1.set("len", 0);
|
||||
// jsonObject1.set("data", jsonObject);
|
||||
// socketClient.cancelUp(jsonObject1.toString(),ip,socketPort,devLl.size());
|
||||
// }
|
||||
// }
|
||||
// return "取消命令发送成功";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String restartDev(List<String> devList) {
|
||||
// List<DeviceIpRVO> relist = lineMapper.getDevicesIp(devList);
|
||||
// if(CollUtil.isEmpty(relist)){
|
||||
// return "前置机为空";
|
||||
// }else {
|
||||
// List<String> nodeIp = relist.stream().map(DeviceIpRVO::getIp).distinct().collect(Collectors.toList());
|
||||
// for(String ip: nodeIp){
|
||||
// List<DeviceIpRVO> devLl = relist.stream().filter(item->item.getIp().equals(ip)).collect(Collectors.toList());
|
||||
// if(CollUtil.isEmpty(devLl)){
|
||||
// return "出错啦";
|
||||
// }
|
||||
//
|
||||
// List<JSONObject> list = new ArrayList<>();
|
||||
// List<String> devIn = new ArrayList<>();
|
||||
// for(DeviceIpRVO devRVO:devLl){
|
||||
// devIn.add(devRVO.getDevIndex());
|
||||
// JSONObject dev = new JSONObject();
|
||||
// dev.set("devIndex", devRVO.getDevIndex());
|
||||
// dev.set("devName", devRVO.getDevName());
|
||||
// list.add(dev);
|
||||
// }
|
||||
//
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.set("terminal", list);
|
||||
// jsonObject.set("type", 181);
|
||||
// jsonObject.set("userIndex", RequestUtil.getUserIndex());
|
||||
// JSONObject jsonObject1 = new JSONObject();
|
||||
// jsonObject1.set("len", 0);
|
||||
// jsonObject1.set("data", jsonObject);
|
||||
//
|
||||
// socketClient.restartDev(jsonObject1.toString(),ip,socketPort,devIn);
|
||||
// }
|
||||
// }
|
||||
// return "命令发送成功";
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck) {
|
||||
|
||||
@@ -1559,7 +1559,8 @@
|
||||
vg.Scale as voltageLevel,
|
||||
voltage.name as volName,
|
||||
lineDetail.Power_Flag powerFlag,
|
||||
lineDetail.Run_Flag lineRunType
|
||||
lineDetail.Run_Flag lineRunType,
|
||||
lineDetail.Obj_Id objId
|
||||
FROM
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
|
||||
@@ -13,10 +13,12 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.common.mapper.SuperDataMapper;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.device.mapper.DevFuctionMapper;
|
||||
import com.njcn.device.device.service.DeviceProcessService;
|
||||
import com.njcn.device.device.service.IDevMealService;
|
||||
import com.njcn.device.device.service.IDevStrategyService;
|
||||
import com.njcn.device.device.service.IDeviceService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
@@ -84,6 +86,7 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
||||
|
||||
private final CldStatisticsFlowMapper cldStatisticsFlowMapper;
|
||||
private final LineService lineService;
|
||||
private final DeviceProcessService deviceProcessService;
|
||||
|
||||
@Override
|
||||
public List<TerminalMaintainVO> getTerminalMainList(TerminalMainQueryParam terminalMainQueryParam) {
|
||||
@@ -205,7 +208,19 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
||||
terminalLogsNew.setObjIndex(device.getId());
|
||||
terminalLogsNew.setTerminalDescribe(sb.toString());
|
||||
terminalLogsNew.setIsPush(0);
|
||||
terminalLogsNew.setOperateType("update");
|
||||
if(device.getRunFlag() == 0&&device1.getRunFlag()!=0){
|
||||
terminalLogsNew.setOperateType(Param.DEL);
|
||||
|
||||
}
|
||||
if(device1.getRunFlag() == 0&&device.getRunFlag()!=0){
|
||||
terminalLogsNew.setOperateType(Param.ADD);
|
||||
//判断device是否绑定进程号;
|
||||
DeviceProcess deviceProcess = new DeviceProcess();
|
||||
deviceProcess.setId(device1.getId());
|
||||
deviceProcess.setProcessNo(1);
|
||||
|
||||
deviceProcessService.saveOrUpdate(deviceProcess);
|
||||
}
|
||||
terminalLogsNew.setLogsType(data.getId());
|
||||
terminalLogsNew.setTerminalType(LineBaseEnum.DEVICE_LEVEL.getCode());
|
||||
terminalLogsNew.setState(DataStateEnum.ENABLE.getCode());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -55,6 +55,8 @@
|
||||
<version>1.1.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--mqtt相关依赖-->
|
||||
<dependency>
|
||||
<groupId>com.github.tocrhz</groupId>
|
||||
<artifactId>mqtt-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
|
||||
@@ -143,7 +143,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
)
|
||||
.ge(StringUtils.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
.le(StringUtils.isNotBlank(deviceInfoParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
|
||||
.orderByDesc(RmpEventDetailPO::getStartTime));
|
||||
.orderByDesc(RmpEventDetailPO::getStartTime).last("limit 100"));
|
||||
EventDetailNew eventDetailNew;
|
||||
for (RmpEventDetailPO eventDetail : eventDetails) {
|
||||
eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetailNew.class);
|
||||
|
||||
@@ -36,6 +36,12 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
<version>2.7.12</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
@@ -32,5 +32,5 @@ public interface CommMonitorEventReportService {
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
String saveStableEventReport(List<String> index, Map<String, AreaLineInfoVO> map);
|
||||
String saveStableEventReport(List<String> index, Map<String, AreaLineInfoVO> map, String fileName);
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveStableEventReport(List<String> eventIndex, Map<String, AreaLineInfoVO> map) {
|
||||
public String saveStableEventReport(List<String> eventIndex, Map<String, AreaLineInfoVO> map, String fileName) {
|
||||
WordUtil wordUtil = new WordUtil();
|
||||
for (String index : eventIndex) {
|
||||
RmpEventDetailPO detail = rmpEventDetailMapper.selectById(index);
|
||||
@@ -709,7 +709,12 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
||||
}
|
||||
try {
|
||||
InputStream inputStream = wordUtil.createReport2(eventIndex);
|
||||
String filePath = fileStorageUtil.uploadStream(inputStream, OssPath.APP_EVENT_REPORT, "暂降事件报告.docx");
|
||||
String filePath;
|
||||
if (Objects.isNull(fileName)) {
|
||||
filePath = fileStorageUtil.uploadStream(inputStream, OssPath.APP_EVENT_REPORT, null);
|
||||
} else {
|
||||
filePath = fileStorageUtil.uploadStreamSpecifyName(inputStream, OssPath.APP_EVENT_REPORT, fileName);
|
||||
}
|
||||
return filePath;
|
||||
} catch (IOException | InvalidFormatException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
@@ -7,7 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||
//import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||
import com.njcn.advance.api.EventCauseFeignClient;
|
||||
import com.njcn.advance.pojo.dto.EventAnalysisDTO;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
@@ -18,6 +18,7 @@ import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.event.common.mapper.RmpEventDetailMapper;
|
||||
import com.njcn.event.common.websocket.WebSocketServer;
|
||||
import com.njcn.event.pojo.vo.SendEventVO;
|
||||
import com.njcn.event.utils.EventUtil;
|
||||
import com.njcn.event.pojo.dto.EventDeatilDTO;
|
||||
@@ -29,7 +30,9 @@ import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
@@ -44,6 +47,7 @@ import java.math.RoundingMode;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -57,11 +61,14 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
||||
|
||||
private final InfluxDbUtils influxDbUtils;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final MqttPublisher publisher;
|
||||
// private final MqttPublisher publisher;
|
||||
|
||||
private final WebSocketServer webSocketServer;
|
||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final DeptLineFeignClient deptLineFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
private final EventCauseFeignClient eventCauseFeignClient;
|
||||
@Override
|
||||
@@ -168,6 +175,7 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
||||
//如果不为空,说明是二次上传波形文件了;
|
||||
String reason,type;
|
||||
if(!StringUtils.isEmpty(rmpEventDetailPO.getWavePath())){
|
||||
try {
|
||||
LineDetailDataVO lineDetailData = lineFeignClient.getLineDetailData(rmpEventDetailPO.getLineId()).getData();
|
||||
String ip = lineDetailData.getIp();
|
||||
EventAnalysisDTO eventAnalysisDTO = new EventAnalysisDTO();
|
||||
@@ -198,7 +206,9 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
||||
}
|
||||
rmpEventDetailPO.setAdvanceReason(advancereason.getId());
|
||||
rmpEventDetailPO.setAdvanceType(advanceType.getId());
|
||||
|
||||
}catch (Exception e){
|
||||
rmpEventDetailPO.setDealFlag(0);
|
||||
}
|
||||
}
|
||||
//默认都是其他
|
||||
// DictData reason = dicDataFeignClient.getDicDataByCode(DicDataEnum.RESON_REST.getCode()).getData();
|
||||
@@ -306,6 +316,9 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
||||
String[] idsArray = deptInfo.getPids().split(",");
|
||||
dept.addAll(Arrays.asList(idsArray));
|
||||
});
|
||||
List<String> deptList = dept.stream().collect(Collectors.toList());
|
||||
|
||||
List<User> data = userFeignClient.getUserInfoByDeptIds(deptList).getData();
|
||||
SendEventVO vo = new SendEventVO();
|
||||
vo.setDeptList(dept);
|
||||
vo.setTime(po.getStartTime());
|
||||
@@ -317,7 +330,10 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
||||
vo.setLineName(lineInfoVOList.get(0).getLineName());
|
||||
vo.setPowerCompany(lineInfoVOList.get(0).getGdName());
|
||||
vo.setSubstation(lineInfoVOList.get(0).getSubName());
|
||||
publisher.send("/sendEvent", PubUtils.obj2json(vo), 1, false);
|
||||
for (User datum : data) {
|
||||
webSocketServer.sendMessageToUser(datum.getId(),PubUtils.obj2json(vo));
|
||||
}
|
||||
// publisher.send("/sendEvent", PubUtils.obj2json(vo), 1, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.event.common.websocket;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/12/13 15:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() {
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通信文本消息和二进制缓存区大小
|
||||
* 避免对接 第三方 报文过大时,Websocket 1009 错误
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Bean
|
||||
public ServletServerContainerFactoryBean createWebSocketContainer() {
|
||||
ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean();
|
||||
// 在此处设置bufferSize
|
||||
container.setMaxTextMessageBufferSize(10240000);
|
||||
container.setMaxBinaryMessageBufferSize(10240000);
|
||||
container.setMaxSessionIdleTimeout(15 * 60000L);
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.njcn.event.common.websocket;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.websocket.*;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/12/13 15:11【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@ServerEndpoint(value = "/event/{userId}")
|
||||
public class WebSocketServer {
|
||||
|
||||
private static final ConcurrentHashMap<String, Session> sessions = new ConcurrentHashMap<>();
|
||||
private static final ConcurrentHashMap<String, Long> lastHeartbeatTime = new ConcurrentHashMap<>();
|
||||
private static final ConcurrentHashMap<String, ScheduledExecutorService> heartbeatExecutors = new ConcurrentHashMap<>();
|
||||
private static final long HEARTBEAT_TIMEOUT = 60; // 60秒超时
|
||||
|
||||
@OnOpen
|
||||
public void onOpen(Session session, @PathParam("userId") String userId) {
|
||||
if (StrUtil.isNotBlank(userId)) {
|
||||
sessions.put(userId, session);
|
||||
lastHeartbeatTime.put(userId, System.currentTimeMillis());
|
||||
sendMessage(session, "连接成功");
|
||||
System.out.println("用户 " + userId + " 已连接");
|
||||
|
||||
// 启动心跳检测
|
||||
startHeartbeat(session, userId);
|
||||
} else {
|
||||
try {
|
||||
session.close(new CloseReason(CloseReason.CloseCodes.VIOLATED_POLICY, "用户ID不能为空"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session, @PathParam("userId") String userId) {
|
||||
if ("alive".equalsIgnoreCase(message)) {
|
||||
// 更新最后心跳时间
|
||||
lastHeartbeatTime.put(userId, System.currentTimeMillis());
|
||||
sendMessage(session, "over");
|
||||
} else {
|
||||
// 处理业务消息
|
||||
System.out.println("收到用户 " + userId + " 的消息: " + message);
|
||||
// TODO: 处理业务逻辑
|
||||
}
|
||||
}
|
||||
|
||||
@OnClose
|
||||
public void onClose(Session session, CloseReason closeReason, @PathParam("userId") String userId) {
|
||||
// 移除用户并取消心跳检测
|
||||
sessions.remove(userId);
|
||||
lastHeartbeatTime.remove(userId);
|
||||
ScheduledExecutorService executor = heartbeatExecutors.remove(userId);
|
||||
if (executor != null) {
|
||||
executor.shutdownNow();
|
||||
}
|
||||
System.out.println("用户 " + userId + " 已断开连接,状态码: " + closeReason.getCloseCode());
|
||||
}
|
||||
|
||||
@OnError
|
||||
public void onError(Session session, Throwable throwable, @PathParam("userId") String userId) {
|
||||
System.out.println("用户 " + userId + " 发生错误: " + throwable.getMessage());
|
||||
try {
|
||||
session.close(new CloseReason(CloseReason.CloseCodes.UNEXPECTED_CONDITION, "发生错误"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendMessageToUser(String userId, String message) {
|
||||
Session session = sessions.get(userId);
|
||||
if (session != null && session.isOpen()) {
|
||||
try {
|
||||
session.getBasicRemote().sendText(message);
|
||||
} catch (IOException e) {
|
||||
System.out.println("发送消息给用户 " + userId + " 失败: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
System.out.println("webSocket用户 " + userId + " 不在线或会话已关闭");
|
||||
}
|
||||
}
|
||||
|
||||
private final Object lock = new Object();
|
||||
|
||||
public void sendMessageToAll(String message) {
|
||||
sessions.forEach((userId, session) -> {
|
||||
System.out.println("给用户推送消息" + userId);
|
||||
if (session.isOpen()) {
|
||||
synchronized (lock) {
|
||||
try {
|
||||
session.getBasicRemote().sendText(message);
|
||||
} catch (IOException e) {
|
||||
System.out.println("发送消息给用户 " + userId + " 失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendMessage(Session session, String message) {
|
||||
try {
|
||||
session.getBasicRemote().sendText(message);
|
||||
} catch (IOException e) {
|
||||
System.out.println("发送消息失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void startHeartbeat(Session session, String userId) {
|
||||
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
||||
heartbeatExecutors.put(userId, executor);
|
||||
|
||||
// 定期检查心跳
|
||||
executor.scheduleAtFixedRate(() -> {
|
||||
long lastTime = lastHeartbeatTime.getOrDefault(userId, 0L);
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
// 如果超过30秒没有收到心跳
|
||||
if (currentTime - lastTime > HEARTBEAT_TIMEOUT * 1000) {
|
||||
try {
|
||||
System.out.println("用户 " + userId + " 心跳超时,关闭连接");
|
||||
session.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, "心跳超时"));
|
||||
} catch (IOException e) {
|
||||
System.out.println("关闭用户 " + userId + " 连接时出错: " + e.getMessage());
|
||||
}
|
||||
executor.shutdown();
|
||||
heartbeatExecutors.remove(userId);
|
||||
}
|
||||
}, 0, 5, TimeUnit.SECONDS); // 每5秒检查一次
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,283 @@
|
||||
#当前服务的基本信息
|
||||
microservice:
|
||||
ename: @artifactId@
|
||||
name: "@name@"
|
||||
version: @version@
|
||||
sentinel:
|
||||
url: @sentinel.url@
|
||||
gateway:
|
||||
url: @gateway.url@
|
||||
server:
|
||||
port: 10215
|
||||
spring:
|
||||
profiles:
|
||||
active: @spring.profiles.active@
|
||||
application:
|
||||
name: @artifactId@
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
#nacos注册中心以及配置中心的指定
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: @service.server.url@
|
||||
server-addr: @nacos.url@
|
||||
username: @nacos.username@
|
||||
password: @nacos.password@
|
||||
namespace: @nacos.namespace@
|
||||
config:
|
||||
server-addr: @nacos.url@
|
||||
username: @nacos.username@
|
||||
password: @nacos.password@
|
||||
namespace: @nacos.namespace@
|
||||
file-extension: yaml
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
refresh: true
|
||||
- data-id: share-config-datasource-db.yaml
|
||||
refresh: true
|
||||
gateway:
|
||||
globalcors:
|
||||
corsConfigurations:
|
||||
'[/**]':
|
||||
allowCredentials: true
|
||||
exposedHeaders: "Content-Disposition,Content-Type,Cache-Control"
|
||||
allowedHeaders: "*"
|
||||
allowedOrigins: "*"
|
||||
allowedMethods: "*"
|
||||
discovery:
|
||||
locator:
|
||||
# 开启自动代理 (自动装载从配置中心serviceId)
|
||||
enabled: true
|
||||
# 服务id为true --> 这样小写服务就可访问了
|
||||
lower-case-service-id: true
|
||||
routes:
|
||||
- id: pqs-auth
|
||||
uri: lb://pqs-auth
|
||||
predicates:
|
||||
- Path=/pqs-auth/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: user-boot
|
||||
uri: lb://user-boot
|
||||
predicates:
|
||||
- Path=/user-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: device-boot
|
||||
uri: lb://device-boot
|
||||
predicates:
|
||||
- Path=/device-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: system-boot
|
||||
uri: lb://system-boot
|
||||
predicates:
|
||||
- Path=/system-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: harmonic-boot
|
||||
uri: lb://harmonic-boot
|
||||
predicates:
|
||||
- Path=/harmonic-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: energy-boot
|
||||
uri: lb://energy-boot
|
||||
predicates:
|
||||
- Path=/energy-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: event-boot
|
||||
uri: lb://event-boot
|
||||
predicates:
|
||||
- Path=/event-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: quality-boot
|
||||
uri: lb://quality-boot
|
||||
predicates:
|
||||
- Path=/quality-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: harmonic-prepare
|
||||
uri: lb://harmonic-prepare
|
||||
predicates:
|
||||
- Path=/harmonic-prepare/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: process-boot
|
||||
uri: lb://process-boot
|
||||
predicates:
|
||||
- Path=/process-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: prepare-boot
|
||||
uri: lb://prepare-boot
|
||||
predicates:
|
||||
- Path=/prepare-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: algorithm-boot
|
||||
uri: lb://algorithm-boot
|
||||
predicates:
|
||||
- Path=/algorithm-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: access-boot
|
||||
uri: lb://access-boot
|
||||
predicates:
|
||||
- Path=/access-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: cs-device-boot
|
||||
uri: lb://cs-device-boot
|
||||
predicates:
|
||||
- Path=/cs-device-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: cs-system-boot
|
||||
uri: lb://cs-system-boot
|
||||
predicates:
|
||||
- Path=/cs-system-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: cs-warn-boot
|
||||
uri: lb://cs-warn-boot
|
||||
predicates:
|
||||
- Path=/cs-warn-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: cs-harmonic-boot
|
||||
uri: lb://cs-harmonic-boot
|
||||
predicates:
|
||||
- Path=/cs-harmonic-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: advance-boot
|
||||
uri: lb://advance-boot
|
||||
predicates:
|
||||
- Path=/advance-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: bpm-boot
|
||||
uri: lb://bpm-boot
|
||||
predicates:
|
||||
- Path=/bpm-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: supervision-boot
|
||||
uri: lb://supervision-boot
|
||||
predicates:
|
||||
- Path=/supervision-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
- id: cs-report-boot
|
||||
uri: lb://cs-report-boot
|
||||
predicates:
|
||||
- Path=/cs-report-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
#河北国网总部调用省侧接口,路径总部统一规定
|
||||
- id: hb_pms_down
|
||||
uri: lb://harmonic-boot
|
||||
predicates:
|
||||
- Path=/IndexAnalysis/**
|
||||
- Path=/pms-tech-powerquality-start/**
|
||||
- id: zl-event-boot
|
||||
uri: lb://zl-event-boot
|
||||
predicates:
|
||||
- Path=/zl-event-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
|
||||
#项目日志的配置
|
||||
logging:
|
||||
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||
level:
|
||||
root: info
|
||||
|
||||
whitelist:
|
||||
urls:
|
||||
- /user-boot/user/generateSm2Key
|
||||
- /user-boot/theme/getTheme
|
||||
- /user-boot/user/updateFirstPassword
|
||||
- /user-boot/appUser/authCode
|
||||
- /user-boot/appUser/register
|
||||
- /user-boot/appUser/resetPsd
|
||||
- /pqs-auth/oauth/logout
|
||||
- /pqs-auth/oauth/token
|
||||
- /pqs-auth/oauth/autoLogin
|
||||
- /pqs-auth/auth/getImgCode
|
||||
- /pqs-auth/oauth/getPublicKey
|
||||
- /pqs-auth/judgeToken/heBei
|
||||
- /pqs-auth/judgeToken/guangZhou
|
||||
|
||||
- /webjars/**
|
||||
- /actuator/**
|
||||
- /doc.html
|
||||
- /swagger-resources/**
|
||||
- /*/v2/api-docs
|
||||
- /favicon.ico
|
||||
- /system-boot/theme/getTheme
|
||||
- /system-boot/image/toStream
|
||||
- /system-boot/file/download
|
||||
- /cs-system-boot/appinfo/queryAppInfoByType
|
||||
- /system-boot/dictType/dictDataCache
|
||||
- /system-boot/file/**
|
||||
- /system-boot/area/**
|
||||
- /bpm-boot/**
|
||||
- /harmonic-boot/comAccess/getComAccessData
|
||||
- /harmonic-boot/harmonic/getHistoryResult
|
||||
- /event-boot/transient/getTransientAnalyseWave
|
||||
# - /**
|
||||
#开始
|
||||
# - /advance-boot/**
|
||||
# - /device-boot/**
|
||||
# - /system-boot/**
|
||||
# - /harmonic-boot/**
|
||||
# - /energy-boot/**
|
||||
# - /event-boot/**
|
||||
# - /quality-boot/**
|
||||
# - /harmonic-prepare/**
|
||||
# - /process-boot/**
|
||||
# - /bpm-boot/**
|
||||
# - /system-boot/**
|
||||
# - /supervision-boot/**
|
||||
# - /user-boot/**
|
||||
# - /harmonic-boot/**
|
||||
# - /cs-device-boot/**
|
||||
#结束
|
||||
- /user-boot/user/listAllUserByDeptId
|
||||
- /IndexAnalysis/**
|
||||
#mqtt:
|
||||
# client-id: @artifactId@${random.value}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataHarmRateVDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataIDMapper;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
import com.njcn.harmonic.mapper.RStatDataHarmRateIDMapper;
|
||||
import com.njcn.harmonic.pojo.param.HarmInHarmParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataHarmrateIDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataHarmrateVDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataIDPO;
|
||||
import com.njcn.harmonic.pojo.vo.HarmInHarmVO;
|
||||
import com.njcn.harmonic.service.HarmInHarmService;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
@@ -21,6 +29,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -41,7 +50,8 @@ public class HarmInHarmServiceImpl implements HarmInHarmService {
|
||||
|
||||
private final IDataIService dataIService;
|
||||
|
||||
|
||||
private final RStatDataHarmRateVDMapper dataHarmRateVDMapper;
|
||||
private final RStatDataIDMapper dataIDMapper;
|
||||
@Override
|
||||
public HarmInHarmVO getHarmInHarmData(HarmInHarmParam harmInHarmParam) {
|
||||
HarmInHarmVO harmInHarmVO = new HarmInHarmVO();
|
||||
@@ -77,33 +87,70 @@ public class HarmInHarmServiceImpl implements HarmInHarmService {
|
||||
List<Float> floatList = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(lineId)) {
|
||||
if (harmState == 0) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmRateV.class);
|
||||
influxQueryWrapper.meanSamePrefixAndSuffix("v_", "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1))
|
||||
.between(DataHarmRateV::getTime, startTime, endTime)
|
||||
.eq(DataHarmRateV::getLineId, lineId)
|
||||
.eq(DataHarmRateV::getValueType, InfluxDBTableConstant.CP95)
|
||||
.ne(DataHarmRateV::getPhaseType, InfluxDBTableConstant.PHASE_TYPE_T);
|
||||
DataHarmRateV dataHarmRateV = dataHarmRateVService.getMeanAllTimesData(influxQueryWrapper);
|
||||
if (Objects.nonNull(dataHarmRateV)) {
|
||||
// InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmRateV.class);
|
||||
// influxQueryWrapper.meanSamePrefixAndSuffix("v_", "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1))
|
||||
// .between(DataHarmRateV::getTime, startTime, endTime)
|
||||
// .eq(DataHarmRateV::getLineId, lineId)
|
||||
// .eq(DataHarmRateV::getValueType, InfluxDBTableConstant.CP95)
|
||||
// .ne(DataHarmRateV::getPhaseType, InfluxDBTableConstant.PHASE_TYPE_T);
|
||||
// DataHarmRateV dataHarmRateV = dataHarmRateVService.getMeanAllTimesData(influxQueryWrapper);
|
||||
// if (Objects.nonNull(dataHarmRateV)) {
|
||||
// for (int i = 2; i < 51; i++) {
|
||||
// floatList.add(PubUtils.getValueByMethodDouble(dataHarmRateV, "getV", i).floatValue());
|
||||
// }
|
||||
// }else {
|
||||
// for (int i = 2; i < 51; i++) {
|
||||
// floatList.add(null);
|
||||
// }
|
||||
// }
|
||||
//转换成查mysql统计数据,分钟数据没有值
|
||||
List<RStatDataHarmrateVDPO> harmV = dataHarmRateVDMapper.selectList(new LambdaQueryWrapper<RStatDataHarmrateVDPO>()
|
||||
.eq(RStatDataHarmrateVDPO::getLineId, lineId)
|
||||
.eq(RStatDataHarmrateVDPO::getValueType,"CP95")
|
||||
.in(RStatDataHarmrateVDPO::getPhaseType, Arrays.asList("A","B","C"))
|
||||
.ge(RStatDataHarmrateVDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(startTime)))
|
||||
.le(RStatDataHarmrateVDPO::getTime, DateUtil.endOfDay(DateUtil.parse(endTime)))
|
||||
);
|
||||
|
||||
if (Objects.nonNull(harmV)) {
|
||||
for (int i = 2; i < 51; i++) {
|
||||
floatList.add(PubUtils.getValueByMethodDouble(dataHarmRateV, "getV", i).floatValue());
|
||||
floatList.add(PubUtils.getValueByMethodDouble(harmV,RStatDataHarmrateVDPO.class, "getV", i).floatValue());
|
||||
}
|
||||
}else {
|
||||
for (int i = 2; i < 51; i++) {
|
||||
floatList.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||
influxQueryWrapper.meanSamePrefixAndSuffix("i_", "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1))
|
||||
.between(DataHarmRateV::getTime, startTime, endTime)
|
||||
.eq(DataHarmRateV::getLineId, lineId)
|
||||
.eq(DataHarmRateV::getValueType, InfluxDBTableConstant.CP95)
|
||||
.ne(DataHarmRateV::getPhaseType, InfluxDBTableConstant.PHASE_TYPE_T);
|
||||
DataI dataI = dataIService.getMeanAllTimesData(influxQueryWrapper);
|
||||
if (Objects.nonNull(dataI)) {
|
||||
// InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||
// influxQueryWrapper.meanSamePrefixAndSuffix("i_", "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1))
|
||||
// .between(DataHarmRateV::getTime, startTime, endTime)
|
||||
// .eq(DataHarmRateV::getLineId, lineId)
|
||||
// .eq(DataHarmRateV::getValueType, InfluxDBTableConstant.CP95)
|
||||
// .ne(DataHarmRateV::getPhaseType, InfluxDBTableConstant.PHASE_TYPE_T);
|
||||
// DataI dataI = dataIService.getMeanAllTimesData(influxQueryWrapper);
|
||||
// if (Objects.nonNull(dataI)) {
|
||||
// for (int i = 2; i < 51; i++) {
|
||||
// floatList.add(PubUtils.getValueByMethodDouble(dataI, "getI", i).floatValue());
|
||||
// }
|
||||
// }else {
|
||||
// for (int i = 2; i < 51; i++) {
|
||||
// floatList.add(null);
|
||||
// }
|
||||
// }
|
||||
|
||||
//转换成查mysql统计数据,分钟数据没有值
|
||||
List<RStatDataIDPO> harmI = dataIDMapper.selectList(new LambdaQueryWrapper<RStatDataIDPO>()
|
||||
.eq(RStatDataIDPO::getLineId, lineId)
|
||||
.eq(RStatDataIDPO::getValueType,"CP95")
|
||||
.in(RStatDataIDPO::getPhaseType, Arrays.asList("A","B","C"))
|
||||
.ge(RStatDataIDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(startTime)))
|
||||
.le(RStatDataIDPO::getTime, DateUtil.endOfDay(DateUtil.parse(endTime)))
|
||||
);
|
||||
if (Objects.nonNull(harmI)) {
|
||||
for (int i = 2; i < 51; i++) {
|
||||
floatList.add(PubUtils.getValueByMethodDouble(dataI, "getI", i).floatValue());
|
||||
floatList.add(PubUtils.getValueByMethodDouble(harmI,RStatDataIDPO.class, "getI", i).floatValue());
|
||||
}
|
||||
}else {
|
||||
for (int i = 2; i < 51; i++) {
|
||||
|
||||
@@ -80,11 +80,11 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>energy-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FrontLogsCleanTaskRunner implements TimerTaskRunner {
|
||||
QueryWrapper<PqFrontLogsChild> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<PqFrontLogs> pqFrontLogsQueryWrapper = new QueryWrapper<>();
|
||||
LocalDate calDate;
|
||||
if(StrUtil.isBlank(date)){
|
||||
if(!StrUtil.isBlank(date)){
|
||||
calDate = LocalDate.parse(date, DatePattern.NORM_DATE_FORMATTER);
|
||||
|
||||
}else {
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:母线算法执行链定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/6 9:35
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class GeneraTrixTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
baseParam.setRepair(false);
|
||||
if(StrUtil.isBlank(date)){
|
||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
}else {
|
||||
baseParam.setDataDate(date);
|
||||
}
|
||||
liteFlowFeignClient.generaTrixExecutor(baseParam);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:母线算法执行链定时任务
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/6 9:35
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class GeneraTrixTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setFullChain(true);
|
||||
// baseParam.setRepair(false);
|
||||
// if(StrUtil.isBlank(date)){
|
||||
// baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
// }else {
|
||||
// baseParam.setDataDate(date);
|
||||
// }
|
||||
// liteFlowFeignClient.generaTrixExecutor(baseParam);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:监测点算法执行链定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/6 9:35
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class MeasurementHourTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
//由于是按小时跑的,前端其他算法都是按天跑的,因此修改参数
|
||||
if(StrUtil.isBlank(date)){
|
||||
baseParam.setRepair(false);
|
||||
baseParam.setDataDate(DateUtil.now());
|
||||
}else {
|
||||
baseParam.setRepair(true);
|
||||
baseParam.setBeginTime(date+ " 00:00:00");
|
||||
baseParam.setEndTime(date+ " 24:00:00");
|
||||
}
|
||||
liteFlowFeignClient.measurementPointExecutorByHour(baseParam);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:监测点算法执行链定时任务
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/6 9:35
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class MeasurementHourTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setFullChain(true);
|
||||
// //由于是按小时跑的,前端其他算法都是按天跑的,因此修改参数
|
||||
// if(StrUtil.isBlank(date)){
|
||||
// baseParam.setRepair(false);
|
||||
// baseParam.setDataDate(DateUtil.now());
|
||||
// }else {
|
||||
// baseParam.setRepair(true);
|
||||
// baseParam.setBeginTime(date+ " 00:00:00");
|
||||
// baseParam.setEndTime(date+ " 24:00:00");
|
||||
// }
|
||||
// liteFlowFeignClient.measurementPointExecutorByHour(baseParam);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -21,8 +20,6 @@ import org.springframework.stereotype.Component;
|
||||
@RequiredArgsConstructor
|
||||
public class MeasurementTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
|
||||
private final LiteFlowAlgorithmFeignClient liteFlowAlgorithmFeignClient;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:监测点算法执行链定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/6 9:35
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class OrgSubStationTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
baseParam.setRepair(false);
|
||||
if(StrUtil.isBlank(date)){
|
||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
}else {
|
||||
baseParam.setDataDate(date);
|
||||
}
|
||||
liteFlowFeignClient.orgSubStationExecutor(baseParam);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:监测点算法执行链定时任务
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/6 9:35
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class OrgSubStationTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setFullChain(true);
|
||||
// baseParam.setRepair(false);
|
||||
// if(StrUtil.isBlank(date)){
|
||||
// baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
// }else {
|
||||
// baseParam.setDataDate(date);
|
||||
// }
|
||||
// liteFlowFeignClient.orgSubStationExecutor(baseParam);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:单位监测点算法执行链定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/6 9:35
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class OrgTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowAlgorithmFeignClient liteFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
baseParam.setRepair(false);
|
||||
if(StrUtil.isBlank(date)){
|
||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
}else {
|
||||
baseParam.setDataDate(date);
|
||||
}
|
||||
liteFlowFeignClient.orgPointExecutor(baseParam);
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.algorithm.pojo.bo.BaseParam;
|
||||
//import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
||||
//import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:单位监测点算法执行链定时任务
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/6 9:35
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class OrgTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final LiteFlowAlgorithmFeignClient liteFlowFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setFullChain(true);
|
||||
// baseParam.setRepair(false);
|
||||
// if(StrUtil.isBlank(date)){
|
||||
// baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
// }else {
|
||||
// baseParam.setDataDate(date);
|
||||
// }
|
||||
// liteFlowFeignClient.orgPointExecutor(baseParam);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:变电站母线算法执行链定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/6 9:35
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class PmsDimTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
baseParam.setRepair(false);
|
||||
if(StrUtil.isBlank(date)){
|
||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
}else {
|
||||
baseParam.setDataDate(date);
|
||||
}
|
||||
liteFlowFeignClient.pmsDimExecutor(baseParam);
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:变电站母线算法执行链定时任务
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/6 9:35
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class PmsDimTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setFullChain(true);
|
||||
// baseParam.setRepair(false);
|
||||
// if(StrUtil.isBlank(date)){
|
||||
// baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
// }else {
|
||||
// baseParam.setDataDate(date);
|
||||
// }
|
||||
// liteFlowFeignClient.pmsDimExecutor(baseParam);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.prepare.harmonic.api.upload.DimBusGlobalFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2024/4/17
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class PmsRunStatisticTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final DimBusGlobalFeignClient dimBusGlobalFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
if(StrUtil.isBlank(date)){
|
||||
date = DateUtil.format(DateUtil.yesterday(),DatePattern.NORM_DATE_PATTERN);
|
||||
}
|
||||
dimBusGlobalFeignClient.runLedgerStatistic(date);
|
||||
dimBusGlobalFeignClient.dimBusUpEveryDay(date);
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
//import com.njcn.prepare.harmonic.api.upload.DimBusGlobalFeignClient;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * pqs
|
||||
// *
|
||||
// * @author cdf
|
||||
// * @date 2024/4/17
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class PmsRunStatisticTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final DimBusGlobalFeignClient dimBusGlobalFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// if(StrUtil.isBlank(date)){
|
||||
// date = DateUtil.format(DateUtil.yesterday(),DatePattern.NORM_DATE_PATTERN);
|
||||
// }
|
||||
// dimBusGlobalFeignClient.runLedgerStatistic(date);
|
||||
// dimBusGlobalFeignClient.dimBusUpEveryDay(date);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,113 +1,113 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.prepare.harmonic.api.newalgorithm.PmsStatisticsSpecialMonitorFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 类的介绍:专项分析-台账统计定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/08 11:23
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PmsStatisticsSpecialMonitorTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final PmsStatisticsSpecialMonitorFeignClient pmsStatisticsSpecialMonitorFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
log.info(LocalDateTime.now()+"专项分析-台账统计调度开始");
|
||||
LineParam lineParam = new LineParam();
|
||||
lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
pmsStatisticsSpecialMonitorFeignClient.pmsStatisticsSpecialMonitorHandler(lineParam);
|
||||
}
|
||||
|
||||
public String prepareTimeDeal(String command) {
|
||||
if (StrUtil.isBlank(command)) {
|
||||
log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
return null;
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
int nowMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
}
|
||||
log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
return sdf.format(calendar.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/9/20
|
||||
*/
|
||||
public void commDefineDate(String command, LineParam lineParam) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String begin;
|
||||
String end;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Date temDate = calendar.getTime();
|
||||
switch (command) {
|
||||
case BizParamConstant.STAT_BIZ_DAY:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_WEEK:
|
||||
begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
break;
|
||||
default:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
}
|
||||
lineParam.setBeginTime(begin);
|
||||
lineParam.setEndTime(end);
|
||||
lineParam.setDataDate(begin.substring(0, 10));
|
||||
}
|
||||
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
//import com.njcn.prepare.harmonic.api.newalgorithm.PmsStatisticsSpecialMonitorFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.Calendar;
|
||||
//import java.util.Date;
|
||||
//import java.util.Objects;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:专项分析-台账统计定时任务
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/08 11:23
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//@Slf4j
|
||||
//public class PmsStatisticsSpecialMonitorTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final PmsStatisticsSpecialMonitorFeignClient pmsStatisticsSpecialMonitorFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// log.info(LocalDateTime.now()+"专项分析-台账统计调度开始");
|
||||
// LineParam lineParam = new LineParam();
|
||||
// lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
// pmsStatisticsSpecialMonitorFeignClient.pmsStatisticsSpecialMonitorHandler(lineParam);
|
||||
// }
|
||||
//
|
||||
// public String prepareTimeDeal(String command) {
|
||||
// if (StrUtil.isBlank(command)) {
|
||||
// log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
// return null;
|
||||
// }
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
// int nowMonth = calendar.get(Calendar.MONTH);
|
||||
// calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
// calendar.set(Calendar.MINUTE, 0);
|
||||
// calendar.set(Calendar.SECOND, 0);
|
||||
// calendar.set(Calendar.MILLISECOND, 0);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
// }
|
||||
// log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
// return sdf.format(calendar.getTime());
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
// *
|
||||
// * @author cdf
|
||||
// * @date 2023/9/20
|
||||
// */
|
||||
// public void commDefineDate(String command, LineParam lineParam) {
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// String begin;
|
||||
// String end;
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// Date temDate = calendar.getTime();
|
||||
// switch (command) {
|
||||
// case BizParamConstant.STAT_BIZ_DAY:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_WEEK:
|
||||
// begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
// end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
// end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
// end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
// end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
// break;
|
||||
// default:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// }
|
||||
// lineParam.setBeginTime(begin);
|
||||
// lineParam.setEndTime(end);
|
||||
// lineParam.setDataDate(begin.substring(0, 10));
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,113 +1,113 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.prepare.harmonic.api.newalgorithm.RMpEmissionFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 类的介绍:发射特性定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/20 13:55
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class RMpEmissionTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final RMpEmissionFeignClient rMpEmissionFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
log.info(LocalDateTime.now()+"发射特性调度开始");
|
||||
LineParam lineParam = new LineParam();
|
||||
lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
rMpEmissionFeignClient.rMpEmissionMHandler(lineParam);
|
||||
}
|
||||
|
||||
public String prepareTimeDeal(String command) {
|
||||
if (StrUtil.isBlank(command)) {
|
||||
log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
return null;
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
int nowMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
}
|
||||
log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
return sdf.format(calendar.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/9/20
|
||||
*/
|
||||
public void commDefineDate(String command, LineParam lineParam) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String begin;
|
||||
String end;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Date temDate = calendar.getTime();
|
||||
switch (command) {
|
||||
case BizParamConstant.STAT_BIZ_DAY:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_WEEK:
|
||||
begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
break;
|
||||
default:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
}
|
||||
lineParam.setBeginTime(begin);
|
||||
lineParam.setEndTime(end);
|
||||
lineParam.setDataDate(begin.substring(0, 10));
|
||||
}
|
||||
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
//import com.njcn.prepare.harmonic.api.newalgorithm.RMpEmissionFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.Calendar;
|
||||
//import java.util.Date;
|
||||
//import java.util.Objects;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:发射特性定时任务
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/20 13:55
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//@Slf4j
|
||||
//public class RMpEmissionTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final RMpEmissionFeignClient rMpEmissionFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// log.info(LocalDateTime.now()+"发射特性调度开始");
|
||||
// LineParam lineParam = new LineParam();
|
||||
// lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
// rMpEmissionFeignClient.rMpEmissionMHandler(lineParam);
|
||||
// }
|
||||
//
|
||||
// public String prepareTimeDeal(String command) {
|
||||
// if (StrUtil.isBlank(command)) {
|
||||
// log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
// return null;
|
||||
// }
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
// int nowMonth = calendar.get(Calendar.MONTH);
|
||||
// calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
// calendar.set(Calendar.MINUTE, 0);
|
||||
// calendar.set(Calendar.SECOND, 0);
|
||||
// calendar.set(Calendar.MILLISECOND, 0);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
// }
|
||||
// log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
// return sdf.format(calendar.getTime());
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
// *
|
||||
// * @author cdf
|
||||
// * @date 2023/9/20
|
||||
// */
|
||||
// public void commDefineDate(String command, LineParam lineParam) {
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// String begin;
|
||||
// String end;
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// Date temDate = calendar.getTime();
|
||||
// switch (command) {
|
||||
// case BizParamConstant.STAT_BIZ_DAY:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_WEEK:
|
||||
// begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
// end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
// end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
// end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
// end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
// break;
|
||||
// default:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// }
|
||||
// lineParam.setBeginTime(begin);
|
||||
// lineParam.setEndTime(end);
|
||||
// lineParam.setDataDate(begin.substring(0, 10));
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,113 +1,113 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.prepare.harmonic.api.newalgorithm.RMpInfluenceFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/20 14:12
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class RMpInfluenceTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final RMpInfluenceFeignClient rMpInfluenceFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
log.info(LocalDateTime.now()+"影响特性调度开始");
|
||||
LineParam lineParam = new LineParam();
|
||||
lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
rMpInfluenceFeignClient.rMpInfluenceMHandler(lineParam);
|
||||
}
|
||||
|
||||
public String prepareTimeDeal(String command) {
|
||||
if (StrUtil.isBlank(command)) {
|
||||
log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
return null;
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
int nowMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
}
|
||||
log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
return sdf.format(calendar.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/9/20
|
||||
*/
|
||||
public void commDefineDate(String command, LineParam lineParam) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String begin;
|
||||
String end;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Date temDate = calendar.getTime();
|
||||
switch (command) {
|
||||
case BizParamConstant.STAT_BIZ_DAY:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_WEEK:
|
||||
begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
break;
|
||||
default:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
}
|
||||
lineParam.setBeginTime(begin);
|
||||
lineParam.setEndTime(end);
|
||||
lineParam.setDataDate(begin.substring(0, 10));
|
||||
}
|
||||
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
//import com.njcn.prepare.harmonic.api.newalgorithm.RMpInfluenceFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.Calendar;
|
||||
//import java.util.Date;
|
||||
//import java.util.Objects;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/20 14:12
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//@Slf4j
|
||||
//public class RMpInfluenceTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final RMpInfluenceFeignClient rMpInfluenceFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// log.info(LocalDateTime.now()+"影响特性调度开始");
|
||||
// LineParam lineParam = new LineParam();
|
||||
// lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
// rMpInfluenceFeignClient.rMpInfluenceMHandler(lineParam);
|
||||
// }
|
||||
//
|
||||
// public String prepareTimeDeal(String command) {
|
||||
// if (StrUtil.isBlank(command)) {
|
||||
// log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
// return null;
|
||||
// }
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
// int nowMonth = calendar.get(Calendar.MONTH);
|
||||
// calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
// calendar.set(Calendar.MINUTE, 0);
|
||||
// calendar.set(Calendar.SECOND, 0);
|
||||
// calendar.set(Calendar.MILLISECOND, 0);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
// }
|
||||
// log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
// return sdf.format(calendar.getTime());
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
// *
|
||||
// * @author cdf
|
||||
// * @date 2023/9/20
|
||||
// */
|
||||
// public void commDefineDate(String command, LineParam lineParam) {
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// String begin;
|
||||
// String end;
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// Date temDate = calendar.getTime();
|
||||
// switch (command) {
|
||||
// case BizParamConstant.STAT_BIZ_DAY:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_WEEK:
|
||||
// begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
// end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
// end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
// end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
// end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
// break;
|
||||
// default:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// }
|
||||
// lineParam.setBeginTime(begin);
|
||||
// lineParam.setEndTime(end);
|
||||
// lineParam.setDataDate(begin.substring(0, 10));
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 每日定时统计河北两级贯通接口主网数据,用于后续定时上送国网
|
||||
* @author cdf
|
||||
* @date 2024/2/22
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class UploadGwOrgAllRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
baseParam.setRepair(false);
|
||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
liteFlowFeignClient.uploadOrgExecutor(baseParam);
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * pqs
|
||||
// * 每日定时统计河北两级贯通接口主网数据,用于后续定时上送国网
|
||||
// * @author cdf
|
||||
// * @date 2024/2/22
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class UploadGwOrgAllRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setFullChain(true);
|
||||
// baseParam.setRepair(false);
|
||||
// baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
// liteFlowFeignClient.uploadOrgExecutor(baseParam);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package com.njcn.system.timer.tasks.energy;
|
||||
|
||||
|
||||
import com.njcn.energy.pojo.api.EleAirStrategyFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AirControllerRunner implements TimerTaskRunner {
|
||||
|
||||
private final EleAirStrategyFeignClient eleAirStrategyFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
eleAirStrategyFeignClient.dealAirStrategyId("close");
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks.energy;
|
||||
//
|
||||
//
|
||||
//import com.njcn.energy.pojo.api.EleAirStrategyFeignClient;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class AirControllerRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final EleAirStrategyFeignClient eleAirStrategyFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// eleAirStrategyFeignClient.dealAirStrategyId("close");
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.njcn.system.timer.tasks.energy;
|
||||
|
||||
import com.njcn.energy.pojo.api.EnergyStatisticFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class EleIntegrityRunner implements TimerTaskRunner {
|
||||
|
||||
private final EnergyStatisticFeignClient energyStatisticFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
energyStatisticFeignClient.eleIntegrityJobHandler();
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks.energy;
|
||||
//
|
||||
//import com.njcn.energy.pojo.api.EnergyStatisticFeignClient;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class EleIntegrityRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final EnergyStatisticFeignClient energyStatisticFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// energyStatisticFeignClient.eleIntegrityJobHandler();
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.njcn.system.timer.tasks.energy;
|
||||
|
||||
import com.njcn.energy.pojo.api.EnergyStatisticFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class EleOnlineRateRunner implements TimerTaskRunner {
|
||||
|
||||
private final EnergyStatisticFeignClient energyStatisticFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
energyStatisticFeignClient.eleOnlineRateJobHandler();
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks.energy;
|
||||
//
|
||||
//import com.njcn.energy.pojo.api.EnergyStatisticFeignClient;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class EleOnlineRateRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final EnergyStatisticFeignClient energyStatisticFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// energyStatisticFeignClient.eleOnlineRateJobHandler();
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package com.njcn.system.timer.tasks.energy;
|
||||
|
||||
|
||||
import com.njcn.energy.pojo.api.EnergyStatisticFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class EnergyStatisticRunner implements TimerTaskRunner {
|
||||
|
||||
private final EnergyStatisticFeignClient energyStatisticFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
|
||||
energyStatisticFeignClient.electricCalJob();
|
||||
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks.energy;
|
||||
//
|
||||
//
|
||||
//import com.njcn.energy.pojo.api.EnergyStatisticFeignClient;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class EnergyStatisticRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final EnergyStatisticFeignClient energyStatisticFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
//
|
||||
// energyStatisticFeignClient.electricCalJob();
|
||||
//
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
package com.njcn.system.timer.tasks.report;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.harmonic.api.ReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.line.CustomReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 自定义报表预处理
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CustomReportRunner implements TimerTaskRunner {
|
||||
|
||||
private final CustomReportFeignClient customReportFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
LineParam lineParam = new LineParam();
|
||||
if(StrUtil.isNotBlank(date)){
|
||||
lineParam.setDataDate(date);
|
||||
}else {
|
||||
DateTime dealDate = DateUtil.yesterday();
|
||||
String end = DateUtil.format(dealDate, DatePattern.NORM_DATE_PATTERN);
|
||||
lineParam.setDataDate(end);
|
||||
}
|
||||
customReportFeignClient.batchReport(lineParam);
|
||||
}
|
||||
}
|
||||
//package com.njcn.system.timer.tasks.report;
|
||||
//
|
||||
//import cn.hutool.core.date.DatePattern;
|
||||
//import cn.hutool.core.date.DateTime;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.harmonic.api.ReportFeignClient;
|
||||
//import com.njcn.prepare.harmonic.api.line.CustomReportFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 自定义报表预处理
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//@Slf4j
|
||||
//public class CustomReportRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final CustomReportFeignClient customReportFeignClient;
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// LineParam lineParam = new LineParam();
|
||||
// if(StrUtil.isNotBlank(date)){
|
||||
// lineParam.setDataDate(date);
|
||||
// }else {
|
||||
// DateTime dealDate = DateUtil.yesterday();
|
||||
// String end = DateUtil.format(dealDate, DatePattern.NORM_DATE_PATTERN);
|
||||
// lineParam.setDataDate(end);
|
||||
// }
|
||||
// customReportFeignClient.batchReport(lineParam);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,113 +1,113 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.prepare.harmonic.api.specialanalysis.SpecialAnalysisFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/20 14:15
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class specialAnalysisIndexOverviewTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final SpecialAnalysisFeignClient specialAnalysisFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
log.info(LocalDateTime.now()+"专项分析-指标总览开始执行");
|
||||
LineParam lineParam = new LineParam();
|
||||
lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
specialAnalysisFeignClient.hanlder(lineParam);
|
||||
}
|
||||
|
||||
public String prepareTimeDeal(String command) {
|
||||
if (StrUtil.isBlank(command)) {
|
||||
log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
return null;
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
int nowMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
}
|
||||
log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
return sdf.format(calendar.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/9/20
|
||||
*/
|
||||
public void commDefineDate(String command, LineParam lineParam) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String begin;
|
||||
String end;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Date temDate = calendar.getTime();
|
||||
switch (command) {
|
||||
case BizParamConstant.STAT_BIZ_DAY:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_WEEK:
|
||||
begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
break;
|
||||
default:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
break;
|
||||
}
|
||||
lineParam.setBeginTime(begin);
|
||||
lineParam.setEndTime(end);
|
||||
lineParam.setDataDate(begin.substring(0, 10));
|
||||
}
|
||||
|
||||
}
|
||||
//package com.njcn.system.timer.tasks;
|
||||
//
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
//import com.njcn.prepare.harmonic.api.specialanalysis.SpecialAnalysisFeignClient;
|
||||
//import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
//import com.njcn.system.timer.TimerTaskRunner;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.Calendar;
|
||||
//import java.util.Date;
|
||||
//import java.util.Objects;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/12/20 14:15
|
||||
// */
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//@Slf4j
|
||||
//public class specialAnalysisIndexOverviewTaskRunner implements TimerTaskRunner {
|
||||
//
|
||||
// private final SpecialAnalysisFeignClient specialAnalysisFeignClient;
|
||||
//
|
||||
// @Override
|
||||
// public void action(String date) {
|
||||
// log.info(LocalDateTime.now()+"专项分析-指标总览开始执行");
|
||||
// LineParam lineParam = new LineParam();
|
||||
// lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// lineParam.setDataDate(this.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
|
||||
// this.commDefineDate(BizParamConstant.STAT_BIZ_MONTH,lineParam);
|
||||
// specialAnalysisFeignClient.hanlder(lineParam);
|
||||
// }
|
||||
//
|
||||
// public String prepareTimeDeal(String command) {
|
||||
// if (StrUtil.isBlank(command)) {
|
||||
// log.error(LocalDateTime.now() + "xxl调度任务参数未设置");
|
||||
// return null;
|
||||
// }
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// if (Objects.equals(BizParamConstant.STAT_BIZ_DAY, command)) {
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_QUARTER, command)) {
|
||||
// int nowMonth = calendar.get(Calendar.MONTH);
|
||||
// calendar.set(Calendar.MONTH, nowMonth - (nowMonth % 3));
|
||||
// calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
// calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
// calendar.set(Calendar.MINUTE, 0);
|
||||
// calendar.set(Calendar.SECOND, 0);
|
||||
// calendar.set(Calendar.MILLISECOND, 0);
|
||||
// } else if (Objects.equals(BizParamConstant.STAT_BIZ_YEAR, command)) {
|
||||
// calendar.set(Calendar.DAY_OF_YEAR, 1);
|
||||
// }
|
||||
// log.info("job调度时间:" + sdf.format(calendar.getTime()));
|
||||
// return sdf.format(calendar.getTime());
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据xxl-job的参数,生成一个任务的起始时间和结束时间
|
||||
// *
|
||||
// * @author cdf
|
||||
// * @date 2023/9/20
|
||||
// */
|
||||
// public void commDefineDate(String command, LineParam lineParam) {
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// String begin;
|
||||
// String end;
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// Date temDate = calendar.getTime();
|
||||
// switch (command) {
|
||||
// case BizParamConstant.STAT_BIZ_DAY:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_WEEK:
|
||||
// begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
// end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
// end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
// end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
// break;
|
||||
// case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
// end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
// break;
|
||||
// default:
|
||||
// begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
// end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
// break;
|
||||
// }
|
||||
// lineParam.setBeginTime(begin);
|
||||
// lineParam.setEndTime(end);
|
||||
// lineParam.setDataDate(begin.substring(0, 10));
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -490,26 +490,28 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
@Override
|
||||
public List<UserVO> getFormalUserList() {
|
||||
List<UserVO> users = new ArrayList<>();
|
||||
Role roleByCode1 = roleService.getRoleByCode(AppRoleEnum.APP_VIP_USER.getCode());
|
||||
Role roleByCode2 = roleService.getRoleByCode(AppRoleEnum.BXS_USER.getCode());
|
||||
Role roleByCode3 = roleService.getRoleByCode(AppRoleEnum.REGULAR_USER_8000.getCode());
|
||||
Role roleByCode4 = roleService.getRoleByCode(AppRoleEnum.REGULAR_USER.getCode());
|
||||
Role roleByCode1 = roleService.getRoleByCode(AppRoleEnum.ENGINEERING_USER.getCode());
|
||||
Role roleByCode2 = roleService.getRoleByCode(AppRoleEnum.MARKET_USER.getCode());
|
||||
List<UserRole> userRoles = userRoleMapper.selectUserRole(
|
||||
Stream.of(roleByCode1.getId()
|
||||
,roleByCode2.getId()
|
||||
,roleByCode3.getId()
|
||||
,roleByCode4.getId()
|
||||
).collect(Collectors.toList()));
|
||||
List<String> collect = userRoles.stream().map(UserRole::getUserId).distinct().collect(Collectors.toList());
|
||||
List<User> users1 = this.listByIds(collect);
|
||||
|
||||
LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(User::getState, Arrays.asList(1,2,4,5))
|
||||
.in(User::getType,Arrays.asList(2,3));
|
||||
List<User> users1 = this.list(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(users1)) {
|
||||
users1.forEach(item->{
|
||||
if (item.getState() == 1) {
|
||||
//剔除工程 营销用户
|
||||
if (collect.contains(item.getId())) {
|
||||
return;
|
||||
}
|
||||
UserVO userVO = new UserVO();
|
||||
userVO.setId(item.getId());
|
||||
userVO.setName(item.getName());
|
||||
users.add(userVO);
|
||||
}
|
||||
});
|
||||
}
|
||||
return users;
|
||||
|
||||
225
pqs.iws
225
pqs.iws
@@ -6,13 +6,11 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="2448d918-1a26-4571-be80-21a8dfa375ac" name="Default" comment="海南bug修改提交">
|
||||
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/BpmApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/BpmApplication.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/job/DeviceComflagTasks.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/job/ScheduledTasks.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/job/ScheduledTasks.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/TerminalServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/TerminalServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/LineWarningServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/LineWarningServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-gateway/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-gateway/src/main/resources/bootstrap.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs-harmonic/harmonic-boot/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pqs-harmonic/harmonic-boot/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs.ipr" beforeDir="false" afterPath="$PROJECT_DIR$/pqs.ipr" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pqs.iws" beforeDir="false" afterPath="$PROJECT_DIR$/pqs.iws" afterDir="false" />
|
||||
</list>
|
||||
@@ -274,9 +272,10 @@
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="localRepository" value="D:\maven3.6.3\repository" />
|
||||
<option name="mavenHome" value="Use Maven wrapper" />
|
||||
<option name="userSettingsFile" value="D:\java\apache-maven-3.3.9\conf\settings.xml" />
|
||||
<option name="customMavenHome" value="D:\program\apache-maven-3.8.1" />
|
||||
<option name="localRepository" value="D:\maven-repository" />
|
||||
<option name="mavenHomeTypeForPersistence" value="CUSTOM" />
|
||||
<option name="userSettingsFile" value="D:\program\apache-maven-3.8.1\conf\settings.xml" />
|
||||
</MavenGeneralSettings>
|
||||
</option>
|
||||
</component>
|
||||
@@ -315,6 +314,9 @@
|
||||
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
|
||||
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 6
|
||||
}</component>
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="-9" />
|
||||
<option name="y" value="-9" />
|
||||
@@ -423,16 +425,49 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"project.structure.last.edited": "Project",
|
||||
"project.structure.proportion": "0.0",
|
||||
"project.structure.side.proportion": "0.0",
|
||||
"settings.editor.selected.configurable": "MavenSettings"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"Maven.common-core [compile].executor": "Run",
|
||||
"Maven.common-core [install].executor": "Run",
|
||||
"Maven.common-huawei [install].executor": "Run",
|
||||
"Maven.common-mq [install].executor": "Run",
|
||||
"Maven.common-oss [clean].executor": "Run",
|
||||
"Maven.common-oss [compile].executor": "Run",
|
||||
"Maven.common-oss [install].executor": "Run",
|
||||
"Maven.common-redis [install].executor": "Run",
|
||||
"Maven.event-boot [compile].executor": "Run",
|
||||
"Maven.event-boot [install].executor": "Run",
|
||||
"Maven.harmonic-boot [clean].executor": "Run",
|
||||
"Maven.harmonic-boot [compile].executor": "Run",
|
||||
"Maven.pqs [clean].executor": "Run",
|
||||
"Maven.pqs [compile].executor": "Run",
|
||||
"Maven.pqs [install].executor": "Run",
|
||||
"Maven.pqs-event [compile].executor": "Run",
|
||||
"RequestMappingsPanelOrder0": "0",
|
||||
"RequestMappingsPanelOrder1": "1",
|
||||
"RequestMappingsPanelWidth0": "75",
|
||||
"RequestMappingsPanelWidth1": "75",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"Spring Boot.AuthApplication.executor": "Debug",
|
||||
"Spring Boot.GatewayMain.executor": "Debug",
|
||||
"Spring Boot.SystemBootMain.executor": "Debug",
|
||||
"Spring Boot.UserBootApplication.executor": "Debug",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"project.structure.last.edited": "Libraries",
|
||||
"project.structure.proportion": "0.15",
|
||||
"project.structure.side.proportion": "0.31609195",
|
||||
"run.configurations.included.in.services": "true",
|
||||
"settings.editor.selected.configurable": "File.Encoding",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="ReactorSettings">
|
||||
<option name="notificationShown" value="true" />
|
||||
</component>
|
||||
@@ -458,6 +493,8 @@
|
||||
<set>
|
||||
<option value="Application" />
|
||||
<option value="JarApplication" />
|
||||
<option value="MicronautRunConfigurationType" />
|
||||
<option value="QuarkusRunConfigurationType" />
|
||||
<option value="SpringBootApplicationConfigurationType" />
|
||||
</set>
|
||||
</option>
|
||||
@@ -470,15 +507,6 @@
|
||||
<option name="HEIGHT" value="300" />
|
||||
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||
</configuration>
|
||||
<configuration default="true" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="DeviceBootApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.njcn.DeviceBootApplication" />
|
||||
<module name="device-boot" />
|
||||
@@ -572,20 +600,48 @@
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="AdvanceBootApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="advance-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.advance.AdvanceBootApplication" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="AuthApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="pqs-auth" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.auth.AuthApplication" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="MANIFEST" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.auth.AuthApplication" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="BpmApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="bpm-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.bpm.BpmApplication" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="DeviceBootApplication (1)" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="device-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.DeviceBootApplication" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="DeviceBootApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="device-boot" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.device.DeviceBootApplication" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="MANIFEST" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.device.DeviceBootApplication" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
@@ -599,9 +655,8 @@
|
||||
</configuration>
|
||||
<configuration name="EventBootApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="event-boot" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.event.EventBootApplication" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="MANIFEST" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.event.EventBootApplication" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
@@ -614,12 +669,11 @@
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="HarmonicBootApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="harmonic-boot" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.harmonic.HarmonicBootApplication" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="harmonic-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.harmonic.HarmonicBootApplication" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
@@ -633,40 +687,74 @@
|
||||
</configuration>
|
||||
<configuration name="JobExecutorApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="job-executor" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.executor.JobExecutorApplication" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="CLASSPATH_FILE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.executor.JobExecutorApplication" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="PrepareApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="prepare-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.prepare.PrepareApplication" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="ProcessApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="process-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.process.ProcessApplication" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="QualityBootApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="quality-boot" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.quality.QualityBootApplication" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="quality-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.quality.QualityBootApplication" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="SupervisionBootMain" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="supervision-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.supervision.SupervisionBootMain" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="SystemBootMain" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="system-boot" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.system.SystemBootMain" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="MANIFEST" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<module name="system-boot" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="MANIFEST" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.system.SystemBootMain" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="UserBootApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="user-boot" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.user.UserBootApplication" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="MANIFEST" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.njcn.user.UserBootApplication" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||
<option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
@@ -677,6 +765,23 @@
|
||||
<item itemvalue="Application.HarmonicBootApplication" />
|
||||
<item itemvalue="Application.EventBootApplication" />
|
||||
<item itemvalue="Application.DeviceBootApplication" />
|
||||
<item itemvalue="Spring Boot.AdvanceBootApplication" />
|
||||
<item itemvalue="Spring Boot.AuthApplication" />
|
||||
<item itemvalue="Spring Boot.BpmApplication" />
|
||||
<item itemvalue="Spring Boot.DeviceBootApplication" />
|
||||
<item itemvalue="Spring Boot.DeviceBootApplication (1)" />
|
||||
<item itemvalue="Spring Boot.EnergyBootApplication" />
|
||||
<item itemvalue="Spring Boot.EventBootApplication" />
|
||||
<item itemvalue="Spring Boot.GatewayMain" />
|
||||
<item itemvalue="Spring Boot.HarmonicBootApplication" />
|
||||
<item itemvalue="Spring Boot.JobAdminApplication" />
|
||||
<item itemvalue="Spring Boot.JobExecutorApplication" />
|
||||
<item itemvalue="Spring Boot.PrepareApplication" />
|
||||
<item itemvalue="Spring Boot.ProcessApplication" />
|
||||
<item itemvalue="Spring Boot.QualityBootApplication" />
|
||||
<item itemvalue="Spring Boot.SupervisionBootMain" />
|
||||
<item itemvalue="Spring Boot.SystemBootMain" />
|
||||
<item itemvalue="Spring Boot.UserBootApplication" />
|
||||
</list>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
@@ -773,6 +878,15 @@
|
||||
<workItem from="1664328876284" duration="428000" />
|
||||
<workItem from="1664329319344" duration="573000" />
|
||||
<workItem from="1664329912185" duration="38768000" />
|
||||
<workItem from="1773642083180" duration="22757000" />
|
||||
<workItem from="1773886549173" duration="3097000" />
|
||||
<workItem from="1773974783783" duration="31292000" />
|
||||
<workItem from="1774856426890" duration="3134000" />
|
||||
<workItem from="1775091589260" duration="166000" />
|
||||
<workItem from="1775091790955" duration="710000" />
|
||||
<workItem from="1775093137399" duration="2418000" />
|
||||
<workItem from="1775543391617" duration="3118000" />
|
||||
<workItem from="1776299986570" duration="1702000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="EventTemplate控制器编写">
|
||||
<created>1663058049505</created>
|
||||
@@ -1072,11 +1186,6 @@
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/pqs-auth/src/main/java/com/njcn/auth/config/AuthorizationServerConfig.java</url>
|
||||
<line>161</line>
|
||||
<option name="timeStamp" value="1" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/pqs-advance/advance-boot/src/main/java/com/njcn/advance/controller/EventRelevantAnalysisController.java</url>
|
||||
<line>85</line>
|
||||
|
||||
Reference in New Issue
Block a user