This commit is contained in:
guosongrui
2024-05-22 14:49:19 +08:00
120 changed files with 5646 additions and 326 deletions

View File

@@ -70,5 +70,16 @@
<artifactId>cglib</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.ejml</groupId>
<artifactId>ejml-simple</artifactId>
<version>0.41</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
</dependencies>
</project>

View File

@@ -65,6 +65,12 @@ public enum AdvanceResponseEnum {
EVENT_DATA_MISS("A0102","没有可供参考的暂降数据"),
WIN_DATA_ERROR("A0102","算法校验窗宽超限"),
DATA_ERROR("A0102","算法校验数据长度超限"),
INIT_DATA_ERROR("A0102","算法初始化数据失败"),
USER_HAS_PRODUCT("A0102","当前用户存在生产线"),
PRODUCT_HAS_MACHINE("A0102","当前生产线存在设备"),

View File

@@ -26,9 +26,9 @@ public class CacheQvvrData implements Serializable {
private float[] harmData;
private PDataStruct[] FKdata;
private float[][] fKData;
private HKDataStruct[] HKdata;
private float[][] hKData;
private List<String> names;

View File

@@ -0,0 +1,54 @@
package com.njcn.advance.model.responsibility;
import lombok.Data;
import java.io.Serializable;
@Data
public class QvvrDataEntity implements Serializable {
public static final int MAX_P_NODE= 200; //功率节点个数限制按200个限制
public static final int MAX_P_NUM= 96 * 100; //功率数据按15分钟间隔100天处理
public static final int MAX_HARM_NUM= 1440 * 100; //谐波数据按一分钟间隔100天处理
public static final int MAX_WIN_LEN=96 * 10; //按15分钟算10天
public static final int MIN_WIN_LEN = 4; //按15分钟算1小时
//输入参数
public int calFlag; //计算标志0默认用电压和功率数据计算相关系数和责任1用代入的动态相关系数计算责任
public int harmNum; //谐波数据个数
public int pNum; //功率数据个数
public int pNode; //功率负荷节点数
public int win; //数据窗大小
public int resNum; //代入的责任数据个数
public float harmMk; //谐波电压门槛
public float harmData[]; //谐波数据序列
public float [][] pData; //功率数据序列
public float [][] simData; //动态相关系数数据序列,可作为输入或者输出
public float [][] fKData; //不包含背景动态谐波责任数据序列,可作为输入或者输出
public float [][] hKData; //包含背景动态谐波责任数据序列,可作为输入或者输出
public float [] core; //典则相关系数
public float [] bjCore; //包含背景典则相关系数
//输出结果
public int calOk; //是否计算正确标志置位0表示未计算置位1表示计算完成
public float [] sumFKdata;//不包含背景谐波责任
public float [] sumHKdata;//包含背景谐波责任
public QvvrDataEntity() {
calFlag = 0;
harmData = new float[MAX_HARM_NUM];
pData = new float[MAX_P_NUM][MAX_P_NODE];
simData = new float[MAX_P_NUM][MAX_P_NODE];
fKData = new float[MAX_P_NUM][MAX_P_NODE];
hKData = new float[MAX_P_NUM][MAX_P_NODE+1];
core = new float[MAX_P_NUM];
bjCore = new float[MAX_P_NUM];
sumFKdata = new float[MAX_P_NODE];
sumHKdata = new float[MAX_P_NODE + 1];
}
}

View File

@@ -7,10 +7,10 @@ import java.util.Arrays;
import java.util.List;
public class QvvrStruct extends HIKSDKStructure implements Serializable {
public static final int MAX_P_NODE= 200; //功率节点个数限制按200个限制
public static final int MAX_P_NUM= 96 * 100; //功率数据按15分钟间隔100天处理
public static final int MAX_HARM_NUM= 1440 * 100; //谐波数据按一分钟间隔100天处理
public static final int MAX_WIN_LEN=96 * 10; //按15分钟算10天
public static final int MAX_P_NODE = 200; //功率节点个数限制按200个限制
public static final int MAX_P_NUM = 96 * 100; //功率数据按15分钟间隔100天处理
public static final int MAX_HARM_NUM = 1440 * 100; //谐波数据按一分钟间隔100天处理
public static final int MAX_WIN_LEN = 96 * 10; //按15分钟算10天
public static final int MIN_WIN_LEN = 4; //按15分钟算1小时
@@ -193,8 +193,13 @@ public class QvvrStruct extends HIKSDKStructure implements Serializable {
this.sim_data = sim_data;
}
// @Override
// protected List getFieldOrder() {
// return Arrays.asList(new String[]{"sumFKdata", "sumHKdata"});
// }
@Override
protected List getFieldOrder() {
return Arrays.asList(
"cal_flag", "harm_num", "p_num", "p_node", "win",
"res_num", "harm_mk", "harm_data", "p_data", "sim_data",
"FKdata", "HKdata", "Core", "BjCore", "cal_ok",
"sumFKdata",
"sumHKdata");
}
}

View File

@@ -18,10 +18,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.advance.enums.AdvanceResponseEnum;
import com.njcn.advance.mapper.responsibility.RespDataMapper;
import com.njcn.advance.model.responsibility.CacheQvvrData;
import com.njcn.advance.model.responsibility.HKDataStruct;
import com.njcn.advance.model.responsibility.PDataStruct;
import com.njcn.advance.model.responsibility.QvvrStruct;
import com.njcn.advance.model.responsibility.*;
import com.njcn.advance.pojo.bo.responsibility.*;
import com.njcn.advance.pojo.dto.responsibility.CustomerData;
import com.njcn.advance.pojo.dto.responsibility.CustomerResponsibility;
@@ -31,10 +28,10 @@ import com.njcn.advance.pojo.param.ResponsibilityCalculateParam;
import com.njcn.advance.pojo.param.ResponsibilitySecondCalParam;
import com.njcn.advance.pojo.po.responsibility.RespData;
import com.njcn.advance.pojo.po.responsibility.RespDataResult;
import com.njcn.advance.pojo.po.responsibility.RespUserData;
import com.njcn.advance.service.responsibility.IRespDataResultService;
import com.njcn.advance.service.responsibility.IRespDataService;
import com.njcn.advance.service.responsibility.IRespUserDataService;
import com.njcn.advance.utils.ResponsibilityAlgorithm;
import com.njcn.advance.utils.ResponsibilityCallDllOrSo;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException;
@@ -104,7 +101,7 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
//没有排序参数默认根据sort字段排序没有排序字段的根据updateTime更新时间排序
queryWrapper.orderBy(true, false, "pqs_resp_data.create_time");
}
queryWrapper.between("pqs_resp_data.create_time", queryParam.getSearchBeginTime(), queryParam.getSearchEndTime());
queryWrapper.between("pqs_resp_data.create_time",DateUtil.beginOfDay(DateUtil.parse(queryParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(queryParam.getSearchEndTime())));
}
queryWrapper.eq("pqs_resp_data.state", DataStateEnum.ENABLE.getCode());
Page<RespDataDTO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
@@ -185,69 +182,67 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
names.add(userName);
}
//然后开始组装数据
PDataStruct[] pData = new PDataStruct[QvvrStruct.MAX_P_NUM];
float[][] pData = new float[QvvrDataEntity.MAX_P_NUM][QvvrDataEntity.MAX_P_NODE];
for (int i = 0; i < names.size(); i++) {
//当前某用户测量节点的所有数据
List<UserDataExcel> userDataExcelBodies1 = originalPData.get(names.get(i));
for (int k = 0; k < userDataExcelBodies1.size(); k++) {
PDataStruct pDataStruct = pData[k];
float[] pDataStruct = pData[k];
if (pDataStruct == null) {
pDataStruct = new PDataStruct();
pDataStruct = new float[QvvrDataEntity.MAX_P_NODE];
}
float[] p = pDataStruct.getP();
float[] p = pDataStruct;
p[i] = userDataExcelBodies1.get(k).getWork().floatValue();
pData[k] = pDataStruct;
}
}
//至此功率数据也组装完毕,调用友谊提供的接口
QvvrStruct qvvrStruct = null;
try {
qvvrStruct = new QvvrStruct();
} catch (Exception exception) {
exception.printStackTrace();
}
qvvrStruct.cal_flag = 0;
qvvrStruct.p_node = pNode;
qvvrStruct.p_num = pNum;
qvvrStruct.win = win;
qvvrStruct.harm_num = harmNum;
qvvrStruct.harm_mk = harmMk;
qvvrStruct.p_data = pData;
qvvrStruct.harm_data = respHarmData.getHarmData();
ResponsibilityCallDllOrSo responsibilityCallDllOrSo = new ResponsibilityCallDllOrSo("harm_response");
responsibilityCallDllOrSo.setPath();
ResponsibilityCallDllOrSo.ResponsibilityLibrary responsibilityLibrary = ResponsibilityCallDllOrSo.ResponsibilityLibrary.INSTANTCE;
try {
responsibilityLibrary.harm_response(qvvrStruct);
} catch (Exception exception) {
exception.printStackTrace();
}
QvvrDataEntity qvvrDataEntity = new QvvrDataEntity();
qvvrDataEntity.calFlag = 0;
qvvrDataEntity.pNode = pNode;
qvvrDataEntity.pNum = pNum;
qvvrDataEntity.win = win;
qvvrDataEntity.harmNum = harmNum;
qvvrDataEntity.harmMk = harmMk;
qvvrDataEntity.pData = pData;
qvvrDataEntity.harmData = respHarmData.getHarmData();
// ResponsibilityCallDllOrSo responsibilityCallDllOrSo = new ResponsibilityCallDllOrSo("harm_response");
// responsibilityCallDllOrSo.setPath();
// ResponsibilityCallDllOrSo.ResponsibilityLibrary responsibilityLibrary = ResponsibilityCallDllOrSo.ResponsibilityLibrary.INSTANTCE;
// try {
// responsibilityLibrary.harm_response(qvvrStruct);
// } catch (Exception exception) {
// exception.printStackTrace();
// }
ResponsibilityAlgorithm responsibilityAlgorithm = new ResponsibilityAlgorithm();
qvvrDataEntity = responsibilityAlgorithm.getResponsibilityResult(qvvrDataEntity);
//至此接口调用结束,开始组装动态责任数据和用户责任量化结果
//首先判断cal_ok的标识位是否为1为0表示程序没有计算出结果
if (qvvrStruct.cal_ok == 0) {
if (qvvrDataEntity.calOk == 0) {
throw new BusinessException(AdvanceResponseEnum.RESPONSIBILITY_PARAMETER_ERROR);
}
//没问题后,先玩动态责任数据
CustomerData[] customerDatas = new CustomerData[qvvrStruct.p_node];
PDataStruct[] fKdata/*无背景的动态责任数据*/ = qvvrStruct.getFKdata();
CustomerData[] customerDatas = new CustomerData[qvvrDataEntity.pNode];
float[][] fKdata/*无背景的动态责任数据*/ = qvvrDataEntity.getFKData();
//第一个时间节点是起始时间+win窗口得到的时间
Date sTime = DateUtil.parse(dateStr.get(0).concat(" 00:00:00"), DatePattern.NORM_DATETIME_PATTERN);
Calendar calendar = Calendar.getInstance();
calendar.setTime(sTime);
calendar.add(Calendar.MINUTE, (win - 1) * userIntervalTime);
List<Long> timeDatas = new ArrayList<>();
for (int i = 0; i < qvvrStruct.p_num - qvvrStruct.win; i++) {
for (int i = 0; i < qvvrDataEntity.pNum - qvvrDataEntity.win; i++) {
calendar.add(Calendar.MINUTE, userIntervalTime);
//一个时间点所有的用户数据
PDataStruct fKdatum = fKdata[i];
for (int k = 0; k < qvvrStruct.p_node; k++) {
float[] fKdatum = fKdata[i];
for (int k = 0; k < qvvrDataEntity.pNode; k++) {
CustomerData customerData = customerDatas[k];
if (null == customerData) {
customerData = new CustomerData();
customerData.setCustomerName(names.get(k));
}
List<Float> valueDatas = customerData.getValueDatas();
Float valueTemp = fKdatum.getP()[k];
Float valueTemp = fKdatum[k];
if (valueTemp.isNaN()) {
valueTemp = 0.0f;
}
@@ -273,7 +268,7 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
customerDataTemp.put(name, customerData);
}
//动态数据组装完成后,开始组装责任数据
List<CustomerResponsibility> customerResponsibilities = getCustomerResponsibilityData(names, qvvrStruct.sumFKdata, qvvrStruct.p_node);
List<CustomerResponsibility> customerResponsibilities = getCustomerResponsibilityData(names, qvvrDataEntity.sumFKdata, qvvrDataEntity.pNode);
//根据前十的用户数据,获取这些用户的动态责任数据
List<CustomerData> customerData = new ArrayList<>();
for (CustomerResponsibility customerResponsibility : customerResponsibilities) {
@@ -378,9 +373,10 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
String customerPath = fileStorageUtil.uploadStream(customerStream, OssPath.RESPONSIBILITY_USER_RESULT_DATA, FileUtil.generateFileName("json"));
respDataResult.setUserDetailData(customerPath);
//调用qvvr生成的中间数据
CacheQvvrData cacheQvvrData = new CacheQvvrData(qvvrStruct.getP_node(), qvvrStruct.getHarm_num(), qvvrStruct.getHarm_data(), qvvrStruct.FKdata, qvvrStruct.HKdata, names, userIntervalTime, qvvrStruct.win, userIntervalTime, respHarmData.getHarmTime());
JSONObject cacheQvvrDataDataJson = (JSONObject) JSONObject.toJSON(cacheQvvrData);
InputStream cacheQvvrDataStream = IoUtil.toStream(cacheQvvrDataDataJson.toString(), CharsetUtil.UTF_8);
CacheQvvrData cacheQvvrData = new CacheQvvrData(qvvrDataEntity.getPNode(), qvvrDataEntity.getHarmNum(), qvvrDataEntity.getHarmData(), qvvrDataEntity.fKData, qvvrDataEntity.hKData, names, userIntervalTime, qvvrDataEntity.win, userIntervalTime, respHarmData.getHarmTime());
// JSONObject cacheQvvrDataDataJson = (JSONObject) JSONObject.toJSON(cacheQvvrData);
String cacheJson = PubUtils.obj2json(cacheQvvrData);
InputStream cacheQvvrDataStream = IoUtil.toStream(cacheJson, CharsetUtil.UTF_8);
String cacheQvvrDataPath = fileStorageUtil.uploadStream(cacheQvvrDataStream, OssPath.RESPONSIBILITY_USER_RESULT_DATA, FileUtil.generateFileName("json"));
respDataResult.setQvvrData(cacheQvvrDataPath);
//用户前10数据存储
@@ -422,7 +418,9 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
try {
InputStream fileStream = fileStorageUtil.getFileStream(respDataResultTemp.getQvvrData());
String qvvrDataStr = IoUtil.read(fileStream, CharsetUtil.UTF_8);
cacheQvvrData = JSONObject.parseObject(qvvrDataStr, CacheQvvrData.class);
// cacheQvvrData = JSONObject.parseObject(qvvrDataStr, CacheQvvrData.class);
cacheQvvrData = PubUtils.json2obj(qvvrDataStr,CacheQvvrData.class);
} catch (Exception exception) {
throw new BusinessException(AdvanceResponseEnum.RESP_RESULT_DATA_NOT_FOUND);
}
@@ -443,25 +441,25 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
//间隔中的时间长度
int minus = timeEndIndex - timeStartIndex + 1;
//组装参数
QvvrStruct qvvrStruct = new QvvrStruct();
qvvrStruct.cal_flag = 1;
qvvrStruct.p_node = cacheQvvrData.getPNode();
qvvrStruct.harm_mk = responsibilitySecondCalParam.getLimitValue();
qvvrStruct.win = win;
QvvrDataEntity qvvrDataEntity = new QvvrDataEntity();
qvvrDataEntity.calFlag = 1;
qvvrDataEntity.pNode = cacheQvvrData.getPNode();
qvvrDataEntity.harmMk = responsibilitySecondCalParam.getLimitValue();
qvvrDataEntity.win = win;
int resNum;
PDataStruct[] FKdata = new PDataStruct[9600];
HKDataStruct[] HKdata = new HKDataStruct[9600];
float[][] FKdata = new float[9600][QvvrDataEntity.MAX_P_NODE];
float[][] HKdata = new float[9600][QvvrDataEntity.MAX_P_NODE + 1];
float[] harmData = new float[1440 * 100];
PDataStruct[] fKdataOriginal = cacheQvvrData.getFKdata();
HKDataStruct[] hKdataOriginal = cacheQvvrData.getHKdata();
float[][] fKdataOriginal = cacheQvvrData.getFKData();
float[][] hKdataOriginal = cacheQvvrData.getHKData();
float[] harmDataOriginal = cacheQvvrData.getHarmData();
//如果起始索引与截止索引的差值等于时间轴的长度,则说明用户没有选择限值时间,直接带入全部的原始数据,参与计算即可
if (minus == times.size()) {
qvvrStruct.harm_num = cacheQvvrData.getHarmNum();
qvvrStruct.res_num = cacheQvvrData.getHarmNum() - cacheQvvrData.getWin();
qvvrStruct.setFKdata(cacheQvvrData.getFKdata());
qvvrStruct.setHKdata(cacheQvvrData.getHKdata());
qvvrStruct.harm_data = cacheQvvrData.getHarmData();
qvvrDataEntity.harmNum = cacheQvvrData.getHarmNum();
qvvrDataEntity.resNum = cacheQvvrData.getHarmNum() - cacheQvvrData.getWin();
qvvrDataEntity.setFKData(cacheQvvrData.getFKData());
qvvrDataEntity.setHKData(cacheQvvrData.getHKData());
qvvrDataEntity.harmData = cacheQvvrData.getHarmData();
} else {
if (win == 4) {
//当窗口为4时,两个时间限制范围在最小公倍数为15时最起码有5个有效时间点在最小公倍数为30时最起码有3个有效时间点
@@ -497,33 +495,39 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
} else {
throw new BusinessException(AdvanceResponseEnum.CALCULATE_INTERVAL_ERROR);
}
qvvrStruct.res_num = resNum;
qvvrStruct.harm_num = minus;
qvvrDataEntity.resNum = resNum;
qvvrDataEntity.harmNum = minus;
//因为限值时间实际是含头含尾的所以harmNum需要索引差值+1
for (int i = timeStartIndex; i <= timeEndIndex; i++) {
harmData[i - timeStartIndex] = harmDataOriginal[i];
}
qvvrStruct.harm_data = harmData;
qvvrDataEntity.harmData = harmData;
//FKData与HKData的值则等于resNum
for (int i = timeStartIndex; i < timeStartIndex + resNum; i++) {
FKdata[i - timeStartIndex] = fKdataOriginal[i];
HKdata[i - timeStartIndex] = hKdataOriginal[i];
}
qvvrStruct.setFKdata(FKdata);
qvvrStruct.setHKdata(HKdata);
qvvrDataEntity.setFKData(FKdata);
qvvrDataEntity.setHKData(HKdata);
}
ResponsibilityCallDllOrSo responsibilityCallDllOrSo = new ResponsibilityCallDllOrSo("harm_response");
responsibilityCallDllOrSo.setPath();
ResponsibilityCallDllOrSo.ResponsibilityLibrary responsibilityLibrary = ResponsibilityCallDllOrSo.ResponsibilityLibrary.INSTANTCE;
responsibilityLibrary.harm_response(qvvrStruct);
if (qvvrStruct.cal_ok == 0) {
// ResponsibilityCallDllOrSo responsibilityCallDllOrSo = new ResponsibilityCallDllOrSo("harm_response");
// responsibilityCallDllOrSo.setPath();
// ResponsibilityCallDllOrSo.ResponsibilityLibrary responsibilityLibrary = ResponsibilityCallDllOrSo.ResponsibilityLibrary.INSTANTCE;
// responsibilityLibrary.harm_response(qvvrStruct);
// if (qvvrStruct.cal_ok == 0) {
// throw new BusinessException(AdvanceResponseEnum.RESPONSIBILITY_PARAMETER_ERROR);
// }
ResponsibilityAlgorithm responsibilityAlgorithm = new ResponsibilityAlgorithm();
qvvrDataEntity = responsibilityAlgorithm.getResponsibilityResult(qvvrDataEntity);
if (qvvrDataEntity.calOk == 0) {
throw new BusinessException(AdvanceResponseEnum.RESPONSIBILITY_PARAMETER_ERROR);
}
//没问题后,先玩动态责任数据
List<String> names = cacheQvvrData.getNames();
CustomerData[] customerDatas = new CustomerData[qvvrStruct.p_node];
PDataStruct[] fKdata/*无背景的动态责任数据*/ = qvvrStruct.getFKdata();
CustomerData[] customerDatas = new CustomerData[qvvrDataEntity.pNode];
float[][] fKdata/*无背景的动态责任数据*/ = qvvrDataEntity.getFKData();
//第一个时间节点是起始时间+win窗口得到的时间
Date sTime = new Date();
sTime.setTime(times.get(timeStartIndex));
@@ -531,18 +535,18 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
calendar.setTime(sTime);
calendar.add(Calendar.MINUTE, (win - 1) * minMultiple);
List<Long> timeDatas = new ArrayList<>();
for (int i = 0; i < qvvrStruct.harm_num - qvvrStruct.win; i++) {
for (int i = 0; i < qvvrDataEntity.harmNum - qvvrDataEntity.win; i++) {
calendar.add(Calendar.MINUTE, minMultiple);
//一个时间点所有的用户数据
PDataStruct fKdatum = fKdata[i];
for (int k = 0; k < qvvrStruct.p_node; k++) {
float[] fKdatum = fKdata[i];
for (int k = 0; k < qvvrDataEntity.pNode; k++) {
CustomerData customerData = customerDatas[k];
if (null == customerData) {
customerData = new CustomerData();
customerData.setCustomerName(names.get(k));
}
List<Float> valueDatas = customerData.getValueDatas();
Float valueTemp = fKdatum.getP()[k];
Float valueTemp = fKdatum[k];
if (valueTemp.isNaN()) {
valueTemp = 0.0f;
}
@@ -568,8 +572,8 @@ public class RespDataServiceImpl extends ServiceImpl<RespDataMapper, RespData> i
customerDataTemp.put(name, customerData);
}
//调用程序接口后,首先组装责任量化结果
float[] sumFKdata = qvvrStruct.sumFKdata;
List<CustomerResponsibility> customerResponsibilities = getCustomerResponsibilityData(names, sumFKdata, qvvrStruct.p_node);
float[] sumFKdata = qvvrDataEntity.sumFKdata;
List<CustomerResponsibility> customerResponsibilities = getCustomerResponsibilityData(names, sumFKdata, qvvrDataEntity.pNode);
//根据前十的用户数据,获取这些用户的动态责任数据
List<CustomerData> customerData = new ArrayList<>();

View File

@@ -0,0 +1,765 @@
package com.njcn.advance.utils;
import cn.hutool.core.bean.BeanUtil;
import com.njcn.advance.enums.AdvanceResponseEnum;
import com.njcn.advance.model.responsibility.QvvrDataEntity;
import com.njcn.common.pojo.exception.BusinessException;
import org.apache.commons.math3.linear.*;
import org.ejml.data.DMatrixRMaj;
import org.ejml.dense.row.CommonOps_DDRM;
import org.ejml.dense.row.factory.DecompositionFactory_DDRM;
import org.ejml.interfaces.decomposition.EigenDecomposition_F64;
import org.ejml.simple.SimpleMatrix;
import java.util.Arrays;
/**
* 责任量化的算法细节:
* 此代码用以计算刻度不等两序列之间的动态相关系数与动态谐波责任指标;
* 随机数生成器生成原始谐波U数据一维数组长度为LL生成原始负荷PE数据二维数组长度为TL宽度为P表示P个负荷公司
* 只能识别 U数据长度 为PE数据长度的 JIANGE倍也即无法自动判别时间间隔需人为定义
* Width用以控制动态相关系数的计算窗宽
* 使用<Eigen>库中函数进行矩阵构造与计算;
* 最终的到结果为向量Core为动态典则相关系数
* 矩阵simCor为剥离背景后的动态相关系数其中每列为每一用户负荷
* 矩阵HKdata为使用simCor计算的动态谐波责任指标其中每列为每一用户负荷
* 向量sumHKdata为超限额的谐波时不同用户的长时谐波责任指标
* 函数说明cov(a,b)计算协方差;
* SXXa,width计算长度为width序列的方差矩阵
* SXYa,b,width计算长度为width两序列的协方差矩阵
* TransCancor(Ma,Vb,width)计算长度为width的矩阵a与向量b的典则相关系数
* SlideCanCor(a,b,width)计算a与b的在 窗宽 width下 的动态典则相关系数;
* SlideCor(a,b,slidecancor,width)计算a,b,在窗宽 width 下 典则相关剥离背景后的动态相关系数。
*
* 算法很多代码没有注释这些代码翻译的友谊的C代码不清楚实际逻辑
*/
public class ResponsibilityAlgorithm {
static int P = 21;
static int TL = 671;
static int LL = 3355;
static int JIANGE = 5;
static int wdith = 96;
static float XIANE = 0;
static int RES_NUM = 0;
static QvvrDataEntity qvvrResult;
public QvvrDataEntity getResponsibilityResult(QvvrDataEntity qvvrParam) {
int i, j;
if (qvvrParam != null) {
// 计算责任
harm_res(qvvrParam.calFlag, qvvrParam);
// 输出结果
qvvrParam.calOk = qvvrResult.calOk;
if (qvvrParam.calOk == 1) {
// 长时越限谐波责任
for (i = 0; i < qvvrParam.pNode; i++)
qvvrParam.sumFKdata[i] = qvvrResult.sumFKdata[i];
for (i = 0; i < (qvvrParam.pNode + 1); i++)
qvvrParam.sumHKdata[i] = qvvrResult.sumHKdata[i];
// 如果是原始功率数据和谐波数据代入计算,将动态相关系数和动态谐波责任输出
if (qvvrParam.calFlag == 0) {
qvvrParam.resNum = qvvrResult.resNum;
for (i = 0; i < qvvrResult.resNum; i++) {
qvvrParam.core[i] = qvvrResult.core[i];
qvvrParam.bjCore[i] = qvvrResult.bjCore[i];
for (j = 0; j < qvvrParam.pNode; j++) {
qvvrParam.fKData[i][j] = qvvrResult.fKData[i][j];
qvvrParam.simData[i][j] = qvvrResult.simData[i][j];
}
for (j = 0; j < (qvvrParam.pNode + 1); j++)
qvvrParam.hKData[i][j] = qvvrResult.hKData[i][j];
}
}
}
}
return qvvrParam;
}
public static int harm_res(int calFlag, QvvrDataEntity qvvrParam) {
if (calFlag == 0) {
harm_res_all(qvvrParam);
} else if (calFlag == 1) {
harm_res_part(qvvrParam);
}
return 0;
}
static int harm_res_part(QvvrDataEntity qvvrParam) {
int ret = 0;
//缓冲大小初始化
ret = data_init_part(qvvrParam);
if (ret != 0) {
qvvrResult.calOk = 0;
// System.out.printf("data init err,exit\r\n");
throw new BusinessException(AdvanceResponseEnum.DATA_ERROR);
}
int colK = P + 1;
RealMatrix HKdata = MatrixUtils.createRealMatrix(RES_NUM, colK);
for (int i = 0; i < P + 1; i++) {
for (int j = 0; j < RES_NUM; j++) {
HKdata.setEntry(j, i, qvvrResult.hKData[j][i]);
}
}
RealVector Udata = new ArrayRealVector(TL);
for (int j = 0; j < TL; j++) {
Udata.setEntry(j, qvvrResult.harmData[j]);
}
float[] arrHKsum = SumHK(HKdata, Udata, wdith, colK, TL);
RealVector sumHKdata = new ArrayRealVector(colK);
for (int i = 0; i < colK; i++) {
sumHKdata.setEntry(i, 0);
}
float sum_hk = 0;
for (int i = 0; i < colK; i++) {
sumHKdata.setEntry(i, arrHKsum[i]);
sum_hk += sumHKdata.getEntry(i);
qvvrResult.sumHKdata[i] = (float) sumHKdata.getEntry(i);
}
RealMatrix FKdata = MatrixUtils.createRealMatrix(RES_NUM, P);
for (int i = 0; i < P; i++) {
for (int j = 0; j < RES_NUM; j++) {
FKdata.setEntry(j, i, qvvrResult.fKData[j][i]);
}
}
colK = P;
arrHKsum = SumHK(FKdata, Udata, wdith, colK, TL);
RealVector sumFKdata = new ArrayRealVector(colK);
for (int i = 0; i < colK; i++) {
sumFKdata.setEntry(i, 0);
}
float sum_fk = 0;
for (int i = 0; i < colK; i++) {
sumFKdata.setEntry(i, arrHKsum[i]);
sum_fk += sumFKdata.getEntry(i);
qvvrResult.sumFKdata[i] = (float) sumFKdata.getEntry(i);
}
qvvrResult.calOk = 1;
return 0;
}
static int data_init_part(QvvrDataEntity qvvrParam) {
qvvrResult = new QvvrDataEntity();
//输入数据处理
BeanUtil.copyProperties(qvvrParam, qvvrResult);
// if ((qvvrResult.resNum + qvvrResult.win) != qvvrResult.harmNum) {
// System.out.printf("数据未对齐...\r\n");
// return -1;
// }
RES_NUM = qvvrResult.resNum;
P = qvvrResult.pNode;
TL = qvvrResult.win + qvvrResult.resNum;
wdith = qvvrResult.win;
XIANE = qvvrResult.harmMk;
if ((wdith < QvvrDataEntity.MIN_WIN_LEN) || (wdith > QvvrDataEntity.MAX_WIN_LEN)) {
System.out.printf("窗宽超限...\r\n");
throw new BusinessException(AdvanceResponseEnum.WIN_DATA_ERROR);
}
if ((P > QvvrDataEntity.MAX_P_NODE) || (TL > QvvrDataEntity.MAX_P_NUM)) {
System.out.printf("数据长度超限...\r\n");
throw new BusinessException(AdvanceResponseEnum.DATA_ERROR);
}
for (int i = 0; i < RES_NUM; i++) {
for (int j = 0; j < P; j++) {
qvvrResult.fKData[i][j] = qvvrParam.fKData[i][j];
}
for (int j = 0; j < P + 1; j++) {
qvvrResult.hKData[i][j] = qvvrParam.hKData[i][j];
}
}
// 复制 qvvrParam
for (int i = 0; i < TL; i++) {
qvvrResult.harmData[i] = qvvrParam.harmData[i];
}
return 0;
}
static int harm_res_all(QvvrDataEntity qvvrParam) {
int ret = 0;
//缓冲大小初始化
ret = data_init_all(qvvrParam);
if (ret != 0) {
qvvrResult.calOk = 0;
System.out.printf("data init err,exit\r\n");
throw new BusinessException(AdvanceResponseEnum.INIT_DATA_ERROR);
}
//测试数据申请空间
float[][] a = new float[TL][];
for (int i = 0; i < TL; i++) {
a[i] = new float[P];
}
float[] b = new float[LL];
float[] u = new float[TL];
for (int i = 0; i < TL; i++) {
for (int j = 0; j < P; j++) {
a[i][j] = qvvrResult.pData[i][j];
}
}
for (int i = 0; i < LL; i++) {
b[i] = qvvrResult.harmData[i];
}
for (int i = 0; i < LL; i += JIANGE) {
float tempt = 0.0f;
for (int j = 0; j < JIANGE; j++) {
tempt += b[i + j];
}
b[i] = tempt / JIANGE;
}
int width = wdith;
int slcorlength = TL - width;
//剥离背景谐波后的动态相关系数计算
//数据格式转换
// 创建矩阵Pdata并复制数据
double[][] PdataArray = new double[TL][P];
for (int i = 0; i < TL; i++) {
for (int j = 0; j < P; j++) {
PdataArray[i][j] = a[i][j];
}
}
RealMatrix Pdata = new Array2DRowRealMatrix(PdataArray);
// 创建向量Udata并复制数据
double[] UdataArray = new double[TL];
for (int i = 0; i < TL; i++) {
UdataArray[i] = b[i * JIANGE];
}
RealVector Udata = new ArrayRealVector(UdataArray);
for (int i = 0; i < TL; i++) {
u[i] = (float) UdataArray[i];
}
//动态典则相关系数数组获得 并转化为向量
float[] cancorrelation = SlideCanCor(a, u, width, P, TL);
RealVector Core = new ArrayRealVector(slcorlength);
RealVector bjCore = new ArrayRealVector(slcorlength);
for (int i = 0; i < slcorlength; i++) {
Core.setEntry(i, cancorrelation[i]);
qvvrResult.core[i] = (float) Core.getEntry(i);
}
for (int i = 0; i < slcorlength; i++) {
bjCore.setEntry(i, 1 - cancorrelation[i]);
qvvrResult.bjCore[i] = (float) bjCore.getEntry(i);
}
float[] y = new float[TL];
float[] xe = new float[TL];
float[] slidecor;
RealVector temptPe = new ArrayRealVector(TL);
RealVector temptU = new ArrayRealVector(TL);
RealMatrix simCor = new Array2DRowRealMatrix(slcorlength, P);
// 格式转换
temptU = Udata.getSubVector(0, TL);
for (int m = 0; m < TL; m++) {
y[m] = (float) temptU.getEntry(m);
}
// 格式转换、计算系数、格式转换
for (int i = 0; i < P; i++) {
temptPe = Pdata.getColumnVector(i);
for (int m = 0; m < TL; m++) {
xe[m] = (float) temptPe.getEntry(m);
}
slidecor = slideCor(xe, y, cancorrelation, width, TL); // 计算每个用户负荷与用户谐波的动态相关系数
for (int j = 0; j < slcorlength; j++) {
simCor.setEntry(j, i, slidecor[j]);
qvvrResult.simData[j][i] = (float) simCor.getEntry(j, i);
}
}
//动态谐波责任指标计算
//EK计算用于后续计算FK不含背景的用户责任指标、HK包含背景的用户责任指标
//float **EKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
//for (int i = 0; i < TL; i++)
//EKarr[i] = (float *)malloc(TL * sizeof(float));
float[][] EKarr;
EKarr = dyEKCom(simCor, Pdata, width, P, TL);
RealMatrix EKdata = MatrixUtils.createRealMatrix(slcorlength, P);
for (int i = 0; i < slcorlength; i++) {
for (int j = 0; j < P; j++) {
EKdata.setEntry(i, j, EKarr[i][j]);
}
}
//不含背景的用户谐波责任指标
//float **FKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
//for (int i = 0; i < TL; i++)
//FKarr[i] = (float *)malloc(TL * sizeof(float));
float[][] FKarr;
FKarr = DyFKCom(EKdata, width, P, TL);
RealMatrix FKdata = MatrixUtils.createRealMatrix(slcorlength, P);
for (int i = 0; i < slcorlength; i++) {
for (int j = 0; j < P; j++) {
FKdata.setEntry(i, j, FKarr[i][j]);
}
}
qvvrResult.fKData=FKarr;
//包含背景的谐波责任指标
//float **HKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
//for (int i = 0; i < TL; i++)
//HKarr[i] = (float *)malloc(TL * sizeof(float));
float[][] HKarr;
HKarr = DyHKCom(bjCore, EKdata, width, P, TL);
RealMatrix HKdata = MatrixUtils.createRealMatrix(slcorlength, (P + 1));
for (int i = 0; i < slcorlength; i++) {
for (int j = 0; j < (P + 1); j++) {
HKdata.setEntry(i, j, HKarr[i][j]);
qvvrResult.hKData[i][j] = (float) HKdata.getEntry(i, j);
}
}
qvvrResult.resNum = slcorlength;
//超限额长时谐波责任指标计算
float[] arrHKsum = new float[TL];
int colK = P + 1;//FKdata时为P
arrHKsum = SumHK(HKdata, Udata, width, colK, TL);//可更改FKdata表示为不包含背景时的长时责任划分
RealVector sumHKdata = new ArrayRealVector(colK);
for (int i = 0; i < colK; i++) {
sumHKdata.setEntry(i, 0);
}
float sum_hk = 0;
for (int i = 0; i < colK; i++) {
sumHKdata.setEntry(i, arrHKsum[i]);
sum_hk += sumHKdata.getEntry(i);
qvvrResult.sumHKdata[i] = (float) sumHKdata.getEntry(i);
}
colK = P;//FKdata时为P
arrHKsum = SumHK(FKdata, Udata, width, colK, TL);//可更改FKdata表示为不包含背景时的长时责任划分
RealVector sumFKdata = new ArrayRealVector(colK);
for (int i = 0; i < colK; i++) {
sumFKdata.setEntry(i, 0);
}
float sum_fk = 0;
for (int i = 0; i < colK; i++) {
sumFKdata.setEntry(i, arrHKsum[i]);
sum_fk += sumFKdata.getEntry(i);
qvvrResult.sumFKdata[i] = (float) sumHKdata.getEntry(i);
}
//结果输出
qvvrResult.calOk = 1;
return 0;
}
static int data_init_all(QvvrDataEntity qvvrParam) {
qvvrResult = new QvvrDataEntity();
//输入数据处理
BeanUtil.copyProperties(qvvrParam, qvvrResult);
P = qvvrResult.pNode;
TL = qvvrResult.pNum;
LL = qvvrResult.harmNum;
JIANGE = qvvrResult.harmNum / qvvrResult.pNum;
wdith = qvvrResult.win;
XIANE = qvvrResult.harmMk;
if ((JIANGE * TL != LL) || (JIANGE < 1)) {
return -1;
}
if ((wdith < QvvrDataEntity.MIN_WIN_LEN) || (wdith > QvvrDataEntity.MAX_WIN_LEN)) {
// System.out.printf("窗宽超限...\r\n");
throw new BusinessException(AdvanceResponseEnum.EVENT_DATA_MISS);
}
// if (TL < (2 * wdith)) {
// System.out.printf("窗宽和数据长度不匹配...\r\n");
// return -1;
// }
if ((P > QvvrDataEntity.MAX_P_NODE) || (TL > QvvrDataEntity.MAX_P_NUM) || (LL > QvvrDataEntity.MAX_HARM_NUM)) {
System.out.printf("数据长度超限...\r\n");
throw new BusinessException(AdvanceResponseEnum.EVENT_DATA_MISS);
}
float[][] clone = new float[qvvrParam.getPData().length][];
for (int i = 0; i < qvvrParam.getPData().length; i++) {
clone[i] = Arrays.copyOf(qvvrParam.getPData()[i], qvvrParam.getPData()[i].length);
}
qvvrResult.setPData(clone);
for (int i = 0; i < LL; i++) {
qvvrResult.getHarmData()[i] = qvvrParam.getHarmData()[i];
}
//System.out.printf("win = %d\r\n",wdith);
return 0;
}
public static float[] SlideCanCor(float[][] x, float[] y, int width, int p_num, int tl_num) {
int slcorlength = tl_num - width;
float[][] a = new float[width][p_num];
for (int i = 0; i < width; i++) {
a[i] = new float[p_num];
}
float[] b = new float[width];
float[][] sxxmatrix = new float[p_num][p_num];
for (int i = 0; i < p_num; i++) {
sxxmatrix[i] = new float[p_num];
}
float[] sxymatrix = new float[tl_num];
float[] x1 = new float[tl_num];
float[] x2 = new float[tl_num];
float[] x3 = new float[tl_num];
float[][] xx = new float[width][p_num];
for (int i = 0; i < width; i++) {
xx[i] = new float[p_num];
}
float[] yy = new float[width];
RealMatrix Pdata = new Array2DRowRealMatrix(tl_num, p_num);
RealVector Udata = new ArrayRealVector(tl_num);
for (int i = 0; i < tl_num; i++) {
for (int j = 0; j < p_num; j++) {
Pdata.setEntry(i, j, x[i][j]);
}
Udata.setEntry(i, y[i]);
}
RealMatrix temptP = new Array2DRowRealMatrix(width, p_num);
RealVector temptU = new ArrayRealVector(width);
float[] slideCancor = new float[tl_num];
for (int i = 0; i < slcorlength; i++) {
temptU = Udata.getSubVector(i, width);
temptP = Pdata.getSubMatrix(i, i + width - 1, 0, p_num - 1);
slideCancor[i] = TransCancor(temptP, temptU, width, p_num, tl_num, sxxmatrix, sxymatrix, x1, x2, x3, xx, yy);
}
return slideCancor;
}
public static float TransCancor(RealMatrix a, RealVector b, int width, int p_num, int tl_num,
float[][] sxxMatrix, float[] sxyMatrix, float[] x1, float[] x2,
float[] x3, float[][] x, float[] y) {
float syymatrix;
for (int i = 0; i < width; i++) {
for (int j = 0; j < p_num; j++) {
x[i][j] = (float) a.getEntry(i, j);
}
y[i] = (float) b.getEntry(i);
}
// 假设的SXX函数需要根据实际实现来调整
sxxMatrix = SXX(x, width, p_num, tl_num, sxxMatrix, x1, x2);
syymatrix = cov(y, y, width); // 假设的COV函数需要根据实际实现来调整
if (syymatrix == 0) {
syymatrix = 0.00001F;
}
// 假设的SXY函数需要根据实际实现来调整
sxyMatrix = SXY(x, y, width, p_num, tl_num, sxyMatrix, x3);
//
// RealMatrix A = MatrixUtils.createRealMatrix(p_num, p_num);
// RealMatrix invSXX = MatrixUtils.createRealMatrix(p_num, p_num);
// RealMatrix I = MatrixUtils.createRealIdentityMatrix(p_num); // I is an identity matrix
//
// // 二维数组转为矩阵
// for (int i = 0; i < p_num; i++) {
// for (int j = 0; j < p_num; j++) {
// A.setEntry(i, j, sxxMatrix[i][j]);
// }
// }
//
// // 使用 LU 分解方法计算矩阵 invSXX
// invSXX = new LUDecomposition(A).getSolver().solve(I);
// 创建 p_num × p_num 的矩阵 A
SimpleMatrix A = new SimpleMatrix(p_num, p_num);
// 创建 p_num × p_num 的逆矩阵 invSXX
SimpleMatrix invSXX = new SimpleMatrix(p_num, p_num);
// 创建 p_num × p_num 的单位矩阵 I
SimpleMatrix I = SimpleMatrix.identity(p_num);
// 二维数组转为矩阵 A
for (int i = 0; i < p_num; i++) {
for (int j = 0; j < p_num; j++) {
A.set(i, j, sxxMatrix[i][j]);
}
}
// 使用 LU 分解方法计算矩阵 invSXX
invSXX = A.invert().mult(I);
// 创建长度为 p_num 的向量 sXYMa_Eigen
DMatrixRMaj sXYMa_Eigen = new DMatrixRMaj(p_num, 1);
for (int i = 0; i < p_num; i++) {
sXYMa_Eigen.set(i, 0, sxyMatrix[i]);
}
// 计算 Umatrix
DMatrixRMaj Umatrix = new DMatrixRMaj(p_num, p_num);
CommonOps_DDRM.multOuter(sXYMa_Eigen, Umatrix); // 外积
CommonOps_DDRM.divide(Umatrix, syymatrix); // 矩阵按标量除法
CommonOps_DDRM.divide(Umatrix, syymatrix); // 再次按标量除法
// 计算特征值
EigenDecomposition_F64<DMatrixRMaj> eigenDecomposition = DecompositionFactory_DDRM.eig(p_num, false);
eigenDecomposition.decompose(Umatrix);
float corrMax = 0;
for (int i = 0; i < p_num; i++) {
float absCorr = (float) Math.abs(eigenDecomposition.getEigenvalue(i).getReal());
if (absCorr > corrMax) {
corrMax = absCorr;
}
}
float cancor = (float) Math.sqrt(corrMax);
if (cancor >= 1) {
cancor = 1;
}
return cancor;
}
public static float[][] SXX(float[][] x, int width, int p_num, int tl_num, float[][] sxxmatrix, float[] x1, float[] x2) {
int i, j, m;
for (i = 0; i < p_num; i++) {
for (j = 0; j < p_num; j++) {
for (m = 0; m < width; m++) {
x1[m] = x[m][i];
x2[m] = x[m][j];
}
sxxmatrix[i][j] = cov(x1, x2, width);
}
}
return sxxmatrix;
}
public static float[] SXY(float[][] x, float[] y, int width, int p_num, int tl_num, float[] sxymatrix, float[] x1) {
int i, m;
for (i = 0; i < p_num; i++) {
for (m = 0; m < width; m++) {
x1[m] = x[m][i];
}
sxymatrix[i] = cov(x1, y, width);
}
return sxymatrix;
}
public static float cov(float[] x, float[] y, int width) {
float d1, d2, d3, d4;
float mx, my;
float cov;
int i;
int xlength = width;
int ylength = width;
d1 = d2 = d3 = d4 = mx = my = 0.0f;
for (i = 0; i < xlength; i++) {
mx += x[i];
my += y[i];
}
mx = mx / xlength;
my = my / ylength;
for (i = 0; i < xlength; i++) {
d1 += (x[i] - mx) * (y[i] - my);
}
cov = d1 / (xlength - 1);
return cov;
}
public static float[] slideCor(float[] x, float[] y, float[] slidecor, int width, int tlNum) {
int slcorLength = tlNum - width;
float[] slcor = new float[tlNum]; // 注意调整数组大小根据实际需要
// 动态相关系数
for (int i = 0; i < slcorLength; i++) {
float[] temptp = new float[width];
float[] temptq = new float[width];
for (int j = 0; j < width; j++) {
temptp[j] = x[i + j];
temptq[j] = y[i + j] * slidecor[i];
}
slcor[i] = pearCor(temptq, temptp, width);
}
return slcor;
}
public static float pearCor(float[] x, float[] y, int count) {
float d1 = 0, d2 = 0, d3 = 0, d4 = 0;
float mx = 0, my = 0;
float result = 0;
// 计算x和y的平均值
for (int i = 0; i < count; i++) {
mx += x[i];
my += y[i];
}
mx /= count;
my /= count;
// 计算相关系数的数据组成部分
for (int i = 0; i < count; i++) {
d1 += (x[i] - mx) * (y[i] - my);
d2 += (x[i] - mx) * (x[i] - mx);
d3 += (y[i] - my) * (y[i] - my);
}
d4 = (float) Math.sqrt(d2 * d3);
if (d4 == 0) {
// 除数为0时相关系数为0
result = 0;
} else {
result = d1 / d4;
}
return result;
}
private static float[][] dyEKCom(RealMatrix Dydata, RealMatrix Pdata, int width, int p_num, int tl_num) {
int slg = tl_num - width;
RealMatrix AKdata = MatrixUtils.createRealMatrix(slg, p_num);
RealMatrix SumP = MatrixUtils.createRealMatrix(slg, 1);
RealMatrix EKdata = MatrixUtils.createRealMatrix(slg, p_num);
for (int i = 0; i < slg; i++) {
SumP.setEntry(i, 0, 0);
for (int j = 0; j < p_num; j++) {
float sumPValue = (float) (SumP.getEntry(i, 0) + Pdata.getEntry(i, j));
SumP.setEntry(i, 0, sumPValue);
}
for (int j = 0; j < p_num; j++) {
float AKdataValue = (float) (Dydata.getEntry(i, j) * (Pdata.getEntry(i, j) / SumP.getEntry(i, 0)));
AKdata.setEntry(i, j, AKdataValue);
}
}
for (int i = 0; i < slg; i++) {
float maxdata = Float.MIN_VALUE;
float mindata = Float.MAX_VALUE;
for (int j = 0; j < p_num; j++) {
maxdata = Math.max(maxdata, (float) AKdata.getEntry(i, j));
mindata = Math.min(mindata, (float) AKdata.getEntry(i, j));
}
for (int j = 0; j < p_num; j++) {
EKdata.setEntry(i, j, (AKdata.getEntry(i, j) - mindata) / (maxdata - mindata));
}
}
float[][] arrEK = new float[slg][p_num];
for (int i = 0; i < slg; i++) {
for (int j = 0; j < p_num; j++) {
arrEK[i][j] = (float) EKdata.getEntry(i, j);
}
}
return arrEK;
}
private static float[][] DyFKCom(RealMatrix EKdata, int width, int p_num, int tl_num) {
int slg = tl_num - width;
RealMatrix FKdata = MatrixUtils.createRealMatrix(slg, p_num);
ArrayRealVector SumEK = new ArrayRealVector(slg);
for (int i = 0; i < slg; i++) {
SumEK.setEntry(i, 0);
for (int j = 0; j < p_num; j++) {
float sumEKValue = (float) (SumEK.getEntry(i) + EKdata.getEntry(i, j));
SumEK.setEntry(i, sumEKValue);
}
for (int j = 0; j < p_num; j++) {
float FKdataValue = (float) (EKdata.getEntry(i, j) / SumEK.getEntry(i));
FKdata.setEntry(i, j, FKdataValue);
}
}
float[][] arrFK = new float[tl_num][p_num];
for (int i = 0; i < slg; i++) {
for (int j = 0; j < p_num; j++) {
arrFK[i][j] = (float) FKdata.getEntry(i, j);
}
}
return arrFK;
}
private static float[][] DyHKCom(RealVector cancordata, RealMatrix EKdata, int width, int p_num, int tl_num) {
int slg = tl_num - width;
RealMatrix HKdata = MatrixUtils.createRealMatrix(slg, p_num + 1);
RealMatrix newEK = MatrixUtils.createRealMatrix(slg, p_num + 1);
ArrayRealVector SumEK = new ArrayRealVector(slg);
for (int i = 0; i < slg; i++) {
for (int j = 0; j < p_num; j++) {
newEK.setEntry(i, j, EKdata.getEntry(i, j));
}
newEK.setEntry(i, p_num, cancordata.getEntry(i));
}
for (int i = 0; i < slg; i++) {
SumEK.setEntry(i, 0);
for (int j = 0; j < p_num + 1; j++) {
float sumEKValue = (float) (SumEK.getEntry(i) + newEK.getEntry(i, j));
SumEK.setEntry(i, sumEKValue);
}
for (int j = 0; j < p_num + 1; j++) {
float HKdataValue = (float) (newEK.getEntry(i, j) / SumEK.getEntry(i));
HKdata.setEntry(i, j, HKdataValue);
}
}
float[][] arrHK = new float[tl_num][p_num + 1];
for (int i = 0; i < slg; i++) {
for (int j = 0; j < p_num + 1; j++) {
arrHK[i][j] = (float) HKdata.getEntry(i, j);
}
}
return arrHK;
}
private static float[] SumHK(RealMatrix HKdata, RealVector Udata, int width, int colK, int tl_num) {
int P1 = colK;
RealVector HKSum = new ArrayRealVector(P1);
int slg = tl_num - width;
int coutt = 0;
for (int j = 0; j < P1; j++) {
HKSum.setEntry(j, 0);
coutt = 0;
for (int i = 0; i < slg; i++) {
if (Udata.getEntry(i) > XIANE) {
float HKdataEntry = (float) HKdata.getEntry(i, j);
HKSum.setEntry(j, HKSum.getEntry(j) + HKdataEntry);
coutt++;
}
}
}
float[] arrHKsum = new float[P1];
for (int i = 0; i < P1; i++) {
arrHKsum[i] = 0;
}
for (int i = 0; i < P1; i++) {
if (coutt > 0) {
arrHKsum[i] = (float) (100 * (HKSum.getEntry(i) / coutt));
}
}
return arrHKsum;
}
}

View File

@@ -27,7 +27,7 @@ public class BpmFormParam implements Serializable {
* 状态
*/
@ApiModelProperty("表单状态")
@NotBlank(message = "表单状态不能为空")
// @NotBlank(message = "表单状态不能为空")
private Integer status;
/**
@@ -42,7 +42,7 @@ public class BpmFormParam implements Serializable {
*
*/
@ApiModelProperty("表单项的数组-JSON 字符串的数组")
@NotBlank(message = "表单项的数组不能为空")
// @NotBlank(message = "表单项的数组不能为空")
private List<String> fields;
/**

View File

@@ -98,7 +98,7 @@ public class BpmModelController extends BaseController {
}
@GetMapping("/getById")
@Operation(summary = "获得模型")
@ApiOperation("根据id获取模型")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@Parameter(name = "id", description = "编号", required = true)
public HttpResult<BpmModelRespVO> getById(String id) {
@@ -111,7 +111,6 @@ public class BpmModelController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, BpmModelConvert.INSTANCE.buildModel(model, bpmnBytes), methodDescribe);
}
@Operation(summary = "新建模型")
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@PostMapping("/add")
@ApiOperation("新建模型")
@@ -146,7 +145,7 @@ public class BpmModelController extends BaseController {
@PostMapping("/deploy")
@Operation(summary = "部署模型")
@ApiOperation("部署模型")
@Parameter(name = "id", description = "编号", required = true)
public HttpResult<Boolean> deployModel(String id) {
String methodDescribe = getMethodDescribe("deployModel");
@@ -164,7 +163,7 @@ public class BpmModelController extends BaseController {
// }
//
@GetMapping("/delete")
@Operation(summary = "删除模型")
@ApiOperation("删除模型")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public HttpResult<Boolean> deleteModel(String id) {
String methodDescribe = getMethodDescribe("deleteModel");

View File

@@ -33,6 +33,7 @@ import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.RequestUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
@@ -202,4 +203,14 @@ public class BpmProcessInstanceController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, instanceId, methodDescribe);
}
@ApiOperation(value = "删除流程实例(会删除已经审核的流程慎用)")
@GetMapping(value = "/deleteInstance")
public HttpResult delete(@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceIds) {
String methodDescribe = getMethodDescribe("delete");
processInstanceService.delete(instanceIds,"测试删除");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
}
}

View File

@@ -0,0 +1,27 @@
package com.njcn.bpm.listener.business;
import com.njcn.bpm.listener.BpmProcessInstanceStatusEvent;
import com.njcn.bpm.listener.BpmProcessInstanceStatusEventListener;
import com.njcn.supervision.api.TempLineDebugFeignClient;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class BpmTempLineDebugStatusListener extends BpmProcessInstanceStatusEventListener {
@Resource
private TempLineDebugFeignClient tempLineDebugFeignClient;
@Override
protected String getProcessDefinitionKey() {
return "temp_line_debug";
}
@Override
protected void onEvent(BpmProcessInstanceStatusEvent event) {
tempLineDebugFeignClient.updateStatus(event.getBusinessKey(), event.getStatus());
}
}

View File

@@ -16,7 +16,7 @@ public class BpmTempLineStatusListener extends BpmProcessInstanceStatusEventList
@Override
protected String getProcessDefinitionKey() {
return "temp_line_info_add";
return "line_info_add";
}
@Override

View File

@@ -0,0 +1,28 @@
package com.njcn.bpm.listener.business;
import com.njcn.bpm.listener.BpmProcessInstanceStatusEvent;
import com.njcn.bpm.listener.BpmProcessInstanceStatusEventListener;
import com.njcn.supervision.api.UserReportFeignClient;
import com.njcn.supervision.api.UserReportNormalFeignClient;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class BpmUserReportNormalStatusListener extends BpmProcessInstanceStatusEventListener {
@Resource
private UserReportNormalFeignClient userReportNormalFeignClient;
@Override
protected String getProcessDefinitionKey() {
return "user_go_net";
}
@Override
protected void onEvent(BpmProcessInstanceStatusEvent event) {
userReportNormalFeignClient.updateUserReportNormalStatus(event.getBusinessKey(), event.getStatus());
}
}

View File

@@ -0,0 +1,27 @@
package com.njcn.bpm.listener.business;
import com.njcn.bpm.listener.BpmProcessInstanceStatusEvent;
import com.njcn.bpm.listener.BpmProcessInstanceStatusEventListener;
import com.njcn.supervision.api.UserReportNormalFeignClient;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class BpmUserReportNormalTreatStatusListener extends BpmProcessInstanceStatusEventListener {
@Resource
private UserReportNormalFeignClient userReportNormalFeignClient;
@Override
protected String getProcessDefinitionKey() {
return "user_treat_check";
}
@Override
protected void onEvent(BpmProcessInstanceStatusEvent event) {
userReportNormalFeignClient.updateUserReportNormalStatus(event.getBusinessKey(), event.getStatus());
}
}

View File

@@ -146,4 +146,11 @@ public interface IBpmProcessInstanceService {
*/
void updateProcessInstanceReject(String id, String reason);
/**
* 用于测试过程删除流程,正式环境慎用
* @author cdf
* @date 2024/5/20
*/
void delete(String id, String reason);
}

View File

@@ -316,8 +316,35 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, BpmProcessInstanceStatusEnum.REJECT.getStatus()));
}
private void deleteProcessInstance(String id, String reason) {
public void deleteProcessInstance(String id, String reason) {
runtimeService.deleteProcessInstance(id, reason);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String instanceId, String deleteReason) {
// 查询历史数据
HistoricProcessInstance historicProcessInstance = getHistoricProcessInstanceById(instanceId);
if (historicProcessInstance.getEndTime() != null) {
historyService.deleteHistoricProcessInstance(historicProcessInstance.getId());
return;
}
// 删除流程实例
runtimeService.deleteProcessInstance(instanceId, deleteReason);
// 删除历史流程实例
historyService.deleteHistoricProcessInstance(instanceId);
}
public HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId) {
HistoricProcessInstance historicProcessInstance =
historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
if (Objects.isNull(historicProcessInstance)) {
throw new BusinessException("流程实例不存在: " + processInstanceId);
}
return historicProcessInstance;
}
}

View File

@@ -21,7 +21,7 @@ public class GenerateCode {
private static final String TARGET_DIR = "D://code";
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/bpm";
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqsinfo_jb";
// private static final String DB_URL = "jdbc:oracle:thin:@192.168.1.170:1521:pqsbase";
private static final String USERNAME = "root";
@@ -30,9 +30,9 @@ public class GenerateCode {
public static void main(String[] args) {
List<Module> modules = Stream.of(
new Module("hongawen", "com.njcn.bpm", "", Stream.of(
"bpm_sign"
).collect(Collectors.toList()), "")
new Module("hongawen", "com.njcn.supervision", "leaflet", Stream.of(
"supervision_warning_leaflet"
).collect(Collectors.toList()), "supervision_")
).collect(Collectors.toList());
generateJavaFile(modules);
}

View File

@@ -34,7 +34,7 @@ import java.util.stream.Stream;
@Slf4j
public class XssRequestWrapper extends HttpServletRequestWrapper {
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml"};
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields"};
public XssRequestWrapper(HttpServletRequest request) {

View File

@@ -1,8 +1,10 @@
package com.njcn.device.biz.pojo.param;
import com.njcn.web.constant.ValidMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
@@ -30,6 +32,13 @@ public class DeptGetLineParam {
private Boolean monitorStateRunning=true;
@ApiModelProperty(name = "isUpToGrid",value = "0.非送国网 1.需要送国网的")
private Integer isUpToGrid;
private Integer isUpToGrid;
/**
* 0-电网侧
* 1-非电网侧
*/
@ApiModelProperty("电网侧标识")
@Range(min = 0, max = 2, message = "电网侧标识" + ValidMessage.PARAM_FORMAT_ERROR)
private Integer powerFlag;
}

View File

@@ -21,10 +21,10 @@ public class GridDiagramVO {
private List<?> gwInfo;
@ApiModelProperty(name = "data", value = "总信息")
private Double data;
private List<Double> data;
@ApiModelProperty(name = "gwData", value = "国网总信息")
private Double gwData;
private List<Double> gwData;
@Data
public static class LineStatistics {
@ApiModelProperty(name = "orgId", value = "单位id")
@@ -138,4 +138,48 @@ public class GridDiagramVO {
@ApiModelProperty(name = "onLineRate", value = "数据在线率")
private Float onLineRate;
}
@Data
public static class AreaData {
@ApiModelProperty(name = "orgId", value = "单位id")
private String orgId;
@ApiModelProperty(name = "orgName", value = "单位名称")
private String orgName;
@ApiModelProperty(name = "lineNum", value = "监测点个数")
private Integer lineNum;
@ApiModelProperty(name = "lineList", value = "监测点集合")
private List<String> lineList;
@ApiModelProperty(name = "onlineNum", value = "在线监测点个数")
private Integer onlineNum;
@ApiModelProperty(name = "onlineList", value = "在线监测点集合")
private List<String> onlineList;
@ApiModelProperty(name = "alarm", value = "告警监测点个数")
private Integer alarm;
@ApiModelProperty(name = "onLineNumList", value = "告警监测点信息")
private List<String> alarmList;
@ApiModelProperty(name = "subNum", value = "变电站个数")
private Integer subNum;
@ApiModelProperty(name = "alarmSubNum", value = "告警变电站数量")
private Integer alarmSubNum;
@ApiModelProperty(name = "alarmSubList", value = "告警变电站监测点数量")
private List<String> alarmSubList;
@ApiModelProperty(name = "deviceNum", value = "终端个数")
private Integer deviceNum;
@ApiModelProperty(name = "onDevice", value = "在线终端数量")
private Integer onDevice;
}
}

View File

@@ -55,6 +55,7 @@ public class GridDiagramController extends BaseController {
@ApiOperation("变电站趋势分析")
public HttpResult<Map<String, Long>> getGridDiagramSubTendency(@RequestBody GridDiagramParam param){
String methodDescribe = getMethodDescribe("getGridDiagramSubTendency");
param.getDeviceInfoParam().setPowerFlag(0);
Map<String, Long> gridDiagramDevTendency = gridDiagramService.getGridDiagramDevTendency(param,3);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevTendency, methodDescribe);
}

View File

@@ -76,7 +76,7 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
List<TerminalGetBase> orgSubStationGet(@Param("list")List<Integer> devType);
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType);
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType,@Param("powerFlag")Integer powerFlag);
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("runFlag")List<Integer> runFlag,@Param("dataType")List<Integer> dataType);

View File

@@ -110,10 +110,14 @@
inner join pq_substation sub on sub.id = substation.id
where device.Dev_Model = 1
and point.state = 1
and device.Run_Flag = 0
and device.Dev_Data_Type in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="powerFlag!=null ">
and lineDetail.Power_Flag = #{powerFlag}
</if>
</select>
<select id="getLineIdByDeptIds" resultType="string">
select

View File

@@ -47,41 +47,41 @@
linedetail.Short_Capacity as shortCapacity,
linedetail.Dev_Capacity as devCapacity,
linedetail.Deal_Capacity as dealCapacity,
over.Freq_Dev as freqDev,
over.Voltage_Dev as voltageDev,
over.Uvoltage_Dev as uvoltageDev,
over.Ubalance as ubalance,
over.I_Neg as iNeg,
over.Flicker as flicker,
over.Uaberrance as uaberrance,
over.Uharm_3 as oddHarm,
over.Uharm_2 as evenHarm,
over.Iharm_2 as iharm2,
over.Iharm_3 as iharm3,
over.Iharm_4 as iharm4,
over.Iharm_5 as iharm5,
over.Iharm_6 as iharm6,
over.Iharm_7 as iharm7,
over.Iharm_8 as iharm8,
over.Iharm_9 as iharm9,
over.Iharm_10 as iharm10,
over.Iharm_11 as iharm11,
over.Iharm_12 as iharm12,
over.Iharm_13 as iharm13,
over.Iharm_14 as iharm14,
over.Iharm_15 as iharm15,
over.Iharm_16 as iharm16,
over.Iharm_17 as iharm17,
over.Iharm_18 as iharm18,
over.Iharm_19 as iharm19,
over.Iharm_20 as iharm20,
over.Iharm_21 as iharm21,
over.Iharm_22 as iharm22,
over.Iharm_23 as iharm23,
over.Iharm_24 as iharm24,
over.Iharm_25 as iharm25,
over.InUharm_1 as inUharm,
over.InUharm_16 as inUharm16
overlimit.Freq_Dev as freqDev,
overlimit.Voltage_Dev as voltageDev,
overlimit.Uvoltage_Dev as uvoltageDev,
overlimit.Ubalance as ubalance,
overlimit.I_Neg as iNeg,
overlimit.Flicker as flicker,
overlimit.Uaberrance as uaberrance,
overlimit.Uharm_3 as oddHarm,
overlimit.Uharm_2 as evenHarm,
overlimit.Iharm_2 as iharm2,
overlimit.Iharm_3 as iharm3,
overlimit.Iharm_4 as iharm4,
overlimit.Iharm_5 as iharm5,
overlimit.Iharm_6 as iharm6,
overlimit.Iharm_7 as iharm7,
overlimit.Iharm_8 as iharm8,
overlimit.Iharm_9 as iharm9,
overlimit.Iharm_10 as iharm10,
overlimit.Iharm_11 as iharm11,
overlimit.Iharm_12 as iharm12,
overlimit.Iharm_13 as iharm13,
overlimit.Iharm_14 as iharm14,
overlimit.Iharm_15 as iharm15,
overlimit.Iharm_16 as iharm16,
overlimit.Iharm_17 as iharm17,
overlimit.Iharm_18 as iharm18,
overlimit.Iharm_19 as iharm19,
overlimit.Iharm_20 as iharm20,
overlimit.Iharm_21 as iharm21,
overlimit.Iharm_22 as iharm22,
overlimit.Iharm_23 as iharm23,
overlimit.Iharm_24 as iharm24,
overlimit.Iharm_25 as iharm25,
overlimit.InUharm_1 as inUharm,
overlimit.InUharm_16 as inUharm16
FROM pq_line line
INNER JOIN pq_line vol ON vol.Id = line.Pid
INNER JOIN pq_line dev ON dev.Id = vol.Pid
@@ -89,7 +89,7 @@
INNER JOIN pq_line gd ON gd.Id = sub.Pid
INNER JOIN pq_line areaId ON areaId.Id = gd.Pid
INNER JOIN sys_area area ON area.Id = areaId.NAME
INNER JOIN pq_overlimit over ON over.Id = line.Id
INNER JOIN pq_overlimit overlimit ON overlimit.Id = line.Id
INNER JOIN pq_voltage voltage ON voltage.Id = vol.Id
INNER JOIN sys_dict_data scaleId ON scaleId.Id = voltage.Scale
INNER JOIN pq_device device ON device.Id = dev.Id

View File

@@ -107,7 +107,7 @@ public interface DeptLineService extends IService<DeptLine> {
Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devType);
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType);
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag);
List<SubGetBase> getSubStationList(SubstationParam substationParam);

View File

@@ -221,7 +221,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
public List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam) {
List<DeptGetSubStationDTO.Info> result = new ArrayList<>();
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()));
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()),deptGetLineParam.getPowerFlag());
Map<String, List<TerminalGetBase.Extend>> orgSub = anExtends.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
Map<String, String> deptNameMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
temDept.forEach(item -> {

View File

@@ -122,8 +122,8 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
}
@Override
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType) {
return deptLineMapper.orgSubStationInfoGet(devType);
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag) {
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag);
}
@Override

View File

@@ -74,7 +74,7 @@ public class RunManageServiceImpl implements RunManageService {
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, runManageParam.getRunFlag(), Stream.of(1).collect(Collectors.toList()));
List<String> lineIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getLineIndexes().stream()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(lineIndexes)) {
return deviceMapper.getRunManageList(lineIndexes, runManageParam.getComFlag(), runManageParam.getSearchValue());
return deviceMapper.getRunManageList(lineIndexes, runManageParam.getComFlag(), Objects.isNull(runManageParam.getSearchValue())?null:runManageParam.getSearchValue());
} else {
return new ArrayList<>();
}

View File

@@ -300,13 +300,12 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
List<String> lineAllIds = collect.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
List<String> gwLineAllIds = collect.stream().filter(x->1==x.getIsUpToGrid()).map(LineDevGetDTO::getPointId).collect(Collectors.toList());
List<RmpEventDetailPO> list = this.list(new LambdaQueryWrapper<RmpEventDetailPO>()
List<RmpEventDetailPO> list1 = this.list(new LambdaQueryWrapper<RmpEventDetailPO>()
.in(CollUtil.isNotEmpty(lineAllIds), RmpEventDetailPO::getMeasurementPointId, lineAllIds)
.in(CollUtil.isNotEmpty(param.getIds()), RmpEventDetailPO::getEventType, param.getIds())
.ge(StrUtil.isNotBlank(param.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
.le(StrUtil.isNotBlank(param.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
);
List<RmpEventDetailPO> list =list1.stream().filter(x->param.getIds().contains(x.getEventType())).collect(Collectors.toList());
Map<String, DeptGetChildrenMoreDTO> deptLineMap = deptGetChildrenMoreDTOS.stream().collect(Collectors.toMap(DeptGetChildrenMoreDTO::getUnitId, Function.identity()));
GridDiagramVO.LineStatistics lineStatistics;
@@ -330,9 +329,8 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
gwInfo.add(gwLineStatistics);
}
}
gridDiagramVO.setData(setData(gridDiagramVO, lineAllIds, list));
gridDiagramVO.setGwData(setData(gridDiagramVO, gwLineAllIds, list));
setData(gridDiagramVO, gwLineAllIds, list);
gridDiagramVO.setData(setData(lineAllIds, list1));
gridDiagramVO.setGwData(setData(gwLineAllIds, list1));
gridDiagramVO.setInfo(info);
gridDiagramVO.setGwInfo(gwInfo);
return gridDiagramVO;
@@ -395,16 +393,29 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
}
private Double setData(GridDiagramVO gridDiagramVO, List<String> gwLineAllIds, List<RmpEventDetailPO> list) {
List<Double> asGwDouble = list.stream()
private List<Double> setData(List<String> gwLineAllIds, List<RmpEventDetailPO> list) {
List<Double> info=new ArrayList<>();
long count90 = list.stream()
.filter(x -> ObjectUtil.isNotNull(x.getSeverity()))
.filter(x -> gwLineAllIds.contains(x.getMeasurementPointId()))
.map(RmpEventDetailPO::getSeverity).collect(Collectors.toList());
if(CollUtil.isNotEmpty(asGwDouble)){
return asGwDouble.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
}else{
return 0.0;
.filter(x -> 0.9 < x.getFeatureAmplitude())
.map(RmpEventDetailPO::getFeatureAmplitude).count();
long count50 = list.stream()
.filter(x -> ObjectUtil.isNotNull(x.getSeverity()))
.filter(x -> gwLineAllIds.contains(x.getMeasurementPointId()))
.filter(x -> 0.5 < x.getFeatureAmplitude())
.map(RmpEventDetailPO::getFeatureAmplitude).count();
if(count90>0){
info.add(NumberUtil.round(count90*100.0/list.size(),2).doubleValue());
}else {
info.add(0.0);
}
if(count50>0){
info.add(NumberUtil.round(count50*100.0/list.size(),2).doubleValue());
}else {
info.add(0.0);
}
return info;
}
/**

View File

@@ -1,8 +1,10 @@
package com.njcn.harmonic.pojo.param;
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.web.constant.ValidMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import java.util.List;
@@ -27,4 +29,11 @@ public class StatSubstationBizBaseParam extends StatisticsBizBaseParam {
@ApiModelProperty("页面尺寸")
private Integer pageSize;
/**
* 0-电网侧
* 1-非电网侧
*/
@ApiModelProperty("电网侧标识")
@Range(min = 0, max = 2, message = "电网侧标识" + ValidMessage.PARAM_FORMAT_ERROR)
private Integer powerFlag;
}

View File

@@ -0,0 +1,59 @@
package com.njcn.harmonic.pojo.vo;
import lombok.Data;
@Data
public class RStatLimitTargetVO {
/**
* 监测点ID合格率的变电站/装置/母线/线路序号
*/
private String lineId;
/**
* 频率偏差越限次数
*/
private Integer flickerAllTime=0;
/**
* 电压偏差越限次数
*/
private Integer freqDevOvertime=0;
/**
* 电压不平衡度越限次数
*/
private Integer voltageDevOvertime=0;
/**
* 闪变越限次数
*/
private Integer ubalanceOvertime=0;
/**
* 电压谐波畸变率越限次数
*/
private Integer uaberranceOvertime=0;
/**
* 负序电流限值次数
*/
private Integer iNegOvertime=0;
/**
* 电压谐波含有率越限次数
*/
private Integer uharmOvertime=0;
/**
* 电流谐波幅值越限次数
*/
private Integer iharmOvertime=0;
/**
* 间谐波电压限值次数
*/
private Integer inuharmOvertime=0;
}

View File

@@ -19,6 +19,9 @@ public class AssessVo implements Serializable {
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("地市code")
private String code;
@ApiModelProperty("评估分数")
private Float score = 3.14159f;

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pq.pojo.dto.PollutionGridDiagramDTO;
@@ -11,7 +12,9 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.param.GridDiagramParam;
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
import com.njcn.harmonic.service.IRMpTargetWarnDService;
import com.njcn.harmonic.service.IRStatLimitTargetDService;
import com.njcn.harmonic.service.PollutionSubstationService;
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
import com.njcn.web.controller.BaseController;
@@ -40,6 +43,9 @@ public class GridDiagramHarmController extends BaseController {
private final IRMpTargetWarnDService irMpTargetWarnDService;
private final PollutionSubstationService pollutionSubstationService;
private final RStatLimitService rStatLimitService;
private final IRStatLimitTargetDService targetDService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getSubLineGiveAnAlarm")
@@ -84,4 +90,24 @@ public class GridDiagramHarmController extends BaseController {
List<GridDiagramVO.LineData> gridDiagramDevData = rStatLimitService.getGridDiagramLineData(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevData, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getGridDiagramAreaData")
@ApiOperation("区域基本信息(监测点,终端,变电站等)")
public HttpResult<List<GridDiagramVO.AreaData>> getGridDiagramAreaData(@RequestBody DeviceInfoParam.BusinessParam param) {
String methodDescribe = getMethodDescribe("getGridDiagramAreaData");
List<GridDiagramVO.AreaData> gridDiagramDevData = rStatLimitService.getGridDiagramAreaData(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevData, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getGridDiagramTargetData")
@ApiOperation("监测点告警越线天数详细信息")
public HttpResult<RStatLimitTargetVO> getGridDiagramTargetData(@RequestBody StatisticsBizBaseParam param) {
String methodDescribe = getMethodDescribe("getGridDiagramTargetData");
RStatLimitTargetVO gridDiagramDevData = targetDService.getGridDiagramTargetData(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevData, methodDescribe);
}
}

View File

@@ -31,4 +31,9 @@ public interface RStatDataVDMapper extends BaseMapper<RStatDataVD> {
*/
List<RStatDataVD> getVthd(@Param("list") List<String> lineList, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 获取三相电压不平衡度
*/
List<RStatDataVD> getUnbalance(@Param("list") List<String> lineList, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

View File

@@ -2,6 +2,7 @@ package com.njcn.harmonic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -59,4 +60,8 @@ public interface RStatLimitTargetDMapper extends BaseMapper<RStatLimitTargetDPO>
List<RStatLimitTargetDPO> getSumTarget(@Param("ids") List<String> ids,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
RStatLimitTargetVO getSumTargetDetails(@Param("ids") List<String> ids,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
}

View File

@@ -63,4 +63,24 @@
`time`,line_id
</select>
<select id="getUnbalance" resultType="com.njcn.harmonic.pojo.po.RStatDataVD">
select
`time` time,
line_id lineId,
avg(v_unbalance) vUnbalance
from
r_stat_data_v_d
where
`time` between #{startTime} and #{endTime}
and phasic_type = 'T'
and value_type = 'CP95'
and line_id IN
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and quality_flag = 0
group by
`time`,line_id
</select>
</mapper>

View File

@@ -237,7 +237,7 @@
from (
SELECT
my_index,
sum( all_time ) AS allCount
sum( all_time )+sum( flicker_all_time )AS allCount
FROM
r_stat_limit_target_d
<where>
@@ -282,4 +282,93 @@
group by
my_index
</select>
<select id="getSumTargetDetails" resultType="com.njcn.harmonic.pojo.vo.RStatLimitTargetVO">
SELECT
my_index AS lineId,
SUM( all_time ) AS allTime,
SUM( flicker_overtime ) AS flickerOvertime,
SUM( flicker_all_time ) AS flickerAllTime,
SUM( freq_dev_overtime ) AS freqDevOvertime,
SUM( voltage_dev_overtime ) AS voltageDevOvertime,
SUM( ubalance_overtime ) AS ubalanceOvertime,
SUM( uaberrance_overtime ) AS uaberranceOvertime,
SUM( i_neg_overtime ) AS iNegOvertime,
sum(if((uharm_2_overtime+
uharm_3_overtime+
uharm_4_overtime+
uharm_5_overtime+
uharm_6_overtime+
uharm_7_overtime+
uharm_8_overtime+
uharm_9_overtime+
uharm_10_overtime+
uharm_11_overtime+
uharm_12_overtime+
uharm_13_overtime+
uharm_14_overtime+
uharm_15_overtime+
uharm_16_overtime+
uharm_17_overtime+
uharm_18_overtime+
uharm_19_overtime+
uharm_20_overtime+
uharm_21_overtime+
uharm_22_overtime+
uharm_23_overtime+
uharm_24_overtime+
uharm_25_overtime)>0,1,0))as uharmOvertime,
sum(if((iharm_2_overtime+
iharm_3_overtime+
iharm_4_overtime+
iharm_5_overtime+
iharm_6_overtime+
iharm_7_overtime+
iharm_8_overtime+
iharm_9_overtime+
iharm_10_overtime+
iharm_11_overtime+
iharm_12_overtime+
iharm_13_overtime+
iharm_14_overtime+
iharm_15_overtime+
iharm_16_overtime+
iharm_17_overtime+
iharm_18_overtime+
iharm_19_overtime+
iharm_20_overtime+
iharm_21_overtime+
iharm_22_overtime+
iharm_23_overtime+
iharm_24_overtime+
iharm_25_overtime)>0,1,0)) as iharmOvertime,
sum(if((inuharm_1_overtime+
inuharm_2_overtime+
inuharm_3_overtime+
inuharm_4_overtime+
inuharm_5_overtime+
inuharm_6_overtime+
inuharm_7_overtime+
inuharm_8_overtime+
inuharm_9_overtime+
inuharm_10_overtime+
inuharm_11_overtime+
inuharm_12_overtime+
inuharm_13_overtime+
inuharm_14_overtime+
inuharm_15_overtime+
inuharm_16_overtime)>0,1,0)) as inuharmOvertime
FROM
r_stat_limit_target_d
<where>
and time_id between #{startTime} and #{endTime}
<if test=" ids != null and ids.size > 0">
AND my_index IN
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
#{item}
</foreach>
</if>
</where>
GROUP BY
my_index
</select>
</mapper>

View File

@@ -1,8 +1,10 @@
package com.njcn.harmonic.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
import java.util.List;
@@ -23,4 +25,11 @@ public interface IRStatLimitTargetDService extends IService<RStatLimitTargetDPO>
*/
List<String> getLinesTarget(StatSubstationBizBaseParam param);
/**
* 根据监测点查询一个月各指标越线超标天数
* @param param
* @return
*/
RStatLimitTargetVO getGridDiagramTargetData(StatisticsBizBaseParam param);
}

View File

@@ -91,6 +91,7 @@ public class GridServiceImpl implements IGridService {
if (lineDetailMap.containsKey(item.getArea())) {
AssessVo assessVo = new AssessVo();
assessVo.setName(item.getName());
assessVo.setCode(item.getCode());
List<String> ll = lineDetailMap.get(item.getArea()).stream().map(LineDetail::getId).collect(Collectors.toList());
List<PQSComAssesPO> deptAssessList = assesList.stream().filter(it->ll.contains(it.getLineId())).collect(Collectors.toList());
List<PqsComasses> communicateList = BeanUtil.copyToList(deptAssessList,PqsComasses.class);
@@ -310,6 +311,7 @@ public class GridServiceImpl implements IGridService {
List<RStatDataVD> list2 = getList2(lineList,param.getStartTime(),param.getEndTime());
List<RStatDataVD> list3 = getList3(lineList,param.getStartTime(),param.getEndTime());
List<RStatDataPltDPO> list4 = getList4(lineList,param.getStartTime(),param.getEndTime());
List<RStatDataVD> list5 = getList5(lineList,param.getStartTime(),param.getEndTime());
if (CollUtil.isNotEmpty(list1)) {
List<Double> d = list1.stream().map(o->o.getFreqDev().doubleValue()).collect(Collectors.toList());
double avg = d.stream().collect(Collectors.averagingDouble(x->x));
@@ -328,7 +330,7 @@ public class GridServiceImpl implements IGridService {
vo3.setAvg(PubUtils.doubleRound(2,avg));
vo3.setSd(targetSd(d,avg));
}
if (CollUtil.isNotEmpty(list1)) {
if (CollUtil.isNotEmpty(list5)) {
List<Double> d = list1.stream().map(o -> o.getVUnbalance().doubleValue()).collect(Collectors.toList());
double avg = d.stream().collect(Collectors.averagingDouble(x -> x));
vo4.setAvg(PubUtils.doubleRound(2,avg));
@@ -545,7 +547,7 @@ public class GridServiceImpl implements IGridService {
}
/**
* 获取监测点频率偏差 T相最大值\获取监测点三相电压不平衡度 T相最大值
* 获取监测点频率偏差 T相最大值
*/
public List<RStatDataVD> getList1(List<String> lineList, String startTime, String endTime) {
return statDataVDMapper.getFreqDev(lineList,startTime,endTime);
@@ -572,6 +574,13 @@ public class GridServiceImpl implements IGridService {
return statDataPltDMapper.getPlt(lineList,startTime,endTime);
}
/**
* 获取监测点三相电压不平衡度 T相 CP95
*/
public List<RStatDataVD> getList5(List<String> lineList, String startTime, String endTime) {
return statDataVDMapper.getUnbalance(lineList,startTime,endTime);
}
/**
* 计算标准差
*/

View File

@@ -91,7 +91,6 @@ public class HistoryResultServiceImpl implements HistoryResultService {
private final DicDataFeignClient dicDataFeignClient;
@Override
public List<HistoryDataResultVO> getHistoryResult(HistoryParam historyParam) {
List<HistoryDataResultVO> historyDataResultVOList = new ArrayList<>();
@@ -195,16 +194,16 @@ public class HistoryResultServiceImpl implements HistoryResultService {
historyDataResultVO.setValue(objectListData);
} else {
//按时间分组
Map<Instant,List<HarmonicHistoryData>> map = harmonicHistoryDataList.stream().collect(Collectors.groupingBy(HarmonicHistoryData::getTime,TreeMap::new, Collectors.toList()));
Map<Instant, List<HarmonicHistoryData>> map = harmonicHistoryDataList.stream().collect(Collectors.groupingBy(HarmonicHistoryData::getTime, TreeMap::new, Collectors.toList()));
Float maxI = null;
Float minI = null;
for (Map.Entry<Instant, List<HarmonicHistoryData>> entry : map.entrySet()) {
List<HarmonicHistoryData> val = entry.getValue();
Object[] objects = {PubUtils.instantToDate(entry.getKey()),0,0,0};
Object[] objects = {PubUtils.instantToDate(entry.getKey()), 0, 0, 0};
//需要保证val的长度为3
if(val.size()!=3){
for(int i =0;i<3-val.size();i++){
if (val.size() != 3) {
for (int i = 0; i < 3 - val.size(); i++) {
HarmonicHistoryData tem = new HarmonicHistoryData();
tem.setAValue(0f);
val.add(tem);
@@ -215,7 +214,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
if (InfluxDBTableConstant.PHASE_TYPE_A.equalsIgnoreCase(harmonicHistoryData.getPhasicType())) {
BigDecimal a = BigDecimal.valueOf(harmonicHistoryData.getAValue()).setScale(4, RoundingMode.HALF_UP);
objects[1] =a;
objects[1] = a;
maxI = max(maxI, a.floatValue());
minI = min(minI, a.floatValue());
@@ -237,7 +236,8 @@ public class HistoryResultServiceImpl implements HistoryResultService {
objectListData.add(list);
};
}
;
//下面代码稳定后可删除
/* List<HarmonicHistoryData> aList = harmonicHistoryDataList.stream()
@@ -336,21 +336,21 @@ public class HistoryResultServiceImpl implements HistoryResultService {
}
private Float max(Float ding,Float a){
if(Objects.isNull(ding)){
private Float max(Float ding, Float a) {
if (Objects.isNull(ding)) {
ding = a;
}
if(a>ding){
if (a > ding) {
ding = a;
}
return ding;
}
private Float min(Float ding,Float a){
if(Objects.isNull(ding)){
private Float min(Float ding, Float a) {
if (Objects.isNull(ding)) {
ding = a;
}
if(a<ding){
if (a < ding) {
ding = a;
}
return ding;
@@ -369,12 +369,12 @@ public class HistoryResultServiceImpl implements HistoryResultService {
LineDevGetDTO lineDetailDataVO = commTerminalGeneralClient.getMonitorDetail(lineId).getData();
//获取限值
Overlimit overlimit = commTerminalGeneralClient.getOverLimitData(lineId).getData();
if(Objects.isNull(overlimit)){
if (Objects.isNull(overlimit)) {
//对配网没有限值的统一处理
DictData dictData = dicDataFeignClient.getDicDataById(lineDetailDataVO.getVoltageLevel()).getData();
float voltageLevel = Float.parseFloat(dictData.getValue());
float shortVal = COverlimitUtil.getDlCapByVoltageLevel(voltageLevel);
overlimit = COverlimitUtil.globalAssemble(voltageLevel,10f,10f,shortVal,1,1);
overlimit = COverlimitUtil.globalAssemble(voltageLevel, 10f, 10f, shortVal, 1, 1);
}
@@ -939,7 +939,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
if (Integer.parseInt(normHistoryParam.getTargetCode()) != 60 || Integer.parseInt(normHistoryParam.getTargetCode()) != 61 || Integer.parseInt(normHistoryParam.getTargetCode()) != 62) {
stringBuilder.append(" and ").append(InfluxDBTableConstant.VALUE_TYPE + "='").append(valueTypeName).append("'");
}
if(StrUtil.isNotBlank(phasicType)){
if (StrUtil.isNotBlank(phasicType)) {
stringBuilder.append(" and ").append("phasic_type ='").append(phasicType).append("'");
}
@@ -1160,6 +1160,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
throw new BusinessException(HarmonicResponseEnum.NO_DATA);
}
//最新两条数据的间隔与监测点查出的间隔做对比,返回一个合理的间隔
historyData = historyData.stream().filter(Objects::nonNull).collect(Collectors.toList());
int lineInterval = getInterval(lineDetailData.getInterval(), PubUtils.instantToDate(historyData.get(historyData.size() - 1).getTime()), PubUtils.instantToDate(historyData.get(historyData.size() - 2).getTime()));
historyData = dealHistoryData(historyData, lineInterval);
if (CollectionUtils.isEmpty(historyData)) {

View File

@@ -659,6 +659,7 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
public GridDiagramVO getPollutionAlarmData(StatSubstationBizBaseParam param) {
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
deptGetLineParam.setDeptId(param.getId());
deptGetLineParam.setPowerFlag(0);
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
//获取全部变电站信息
List<SubGetBase> collect = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).collect(Collectors.toList());
@@ -739,6 +740,7 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
map.put("I",dicDataFeignClient.getDicDataByCode(DicDataEnum.I_ALL.getCode()).getData().getId());
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
deptGetLineParam.setDeptId(param.getId());
deptGetLineParam.setPowerFlag(0);
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
//获取全部变电站信息
List<SubGetBase> collect = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).collect(Collectors.toList());
@@ -777,6 +779,7 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
@Override
public List<List<String>> getPollutionAlarmList(GridDiagramParam param) {
List<List<String>> info = new ArrayList<>();
param.getDeviceInfoParam().setPowerFlag(0);
List<GeneralDeviceDTO> data = generalDeviceInfoClient.getPracticalRunDeviceInfo(param.getDeviceInfoParam()).getData();
List<String> subIds = data.stream().flatMap(x -> x.getSubIndexes().stream()).collect(Collectors.toList());
List<RStatPollutionSubstationM> substationMlist = pollutionSubstationMMapper.selectList(new LambdaQueryWrapper<RStatPollutionSubstationM>()

View File

@@ -2,19 +2,19 @@ package com.njcn.harmonic.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
import com.njcn.device.biz.pojo.dto.DeptGetSubStationDTO;
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
import com.njcn.device.biz.pojo.dto.SubGetBase;
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
import com.njcn.device.pq.api.LineIntegrityClient;
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
import com.njcn.harmonic.mapper.RMpTargetWarnDMapper;
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
import com.njcn.harmonic.pojo.po.RMpTargetWarnDPO;
import com.njcn.harmonic.service.IRMpTargetWarnDService;
import com.njcn.harmonic.service.IRStatLimitTargetDService;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum;
@@ -46,7 +46,8 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
private final DeptFeignClient deptFeignClient;
private final DicDataFeignClient dicDataFeignClient;
private final CommTerminalGeneralClient commTerminalGeneralClient;
private final IRStatLimitTargetDService targetDService;
private final LineIntegrityClient lineIntegrityClient;
@Override
public GridDiagramVO getSubLineGiveAnAlarm(StatSubstationBizBaseParam param) {
//获取电压等级
@@ -69,20 +70,28 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
List<Dept> data = deptFeignClient.getDirectSonSelf(param.getId()).getData();
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
deptGetLineParam.setDeptId(param.getId());
deptGetLineParam.setPowerFlag(0);
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
List<String> lineIDS = deptGetChildrenMoreDTOS.stream()
.flatMap(x -> x.getStationIds().stream().flatMap(l -> l.getUnitChildrenList().stream()))
.collect(Collectors.toList());
//根据r_stat_limit_target_d来判断是否告警allTime flicker_overtime
List<RMpTargetWarnDPO> list = this.list(new QueryWrapper<RMpTargetWarnDPO>()
.select("measurement_point_id,sum(is_warn) as isWarn")
.in(CollUtil.isNotEmpty(lineIDS), "measurement_point_id", lineIDS)
.ge(StrUtil.isNotBlank(param.getStartTime()), "data_date", DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
.le(StrUtil.isNotBlank(param.getEndTime()), "data_date", DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
.groupBy("measurement_point_id")
);
List<String> integrityList =new ArrayList<>();
//根据r_stat_limit_target_d来判断是否告警allTime flicker_overtime
List<String> linesTarget=new ArrayList<>();
if(CollUtil.isNotEmpty(lineIDS)){
StatSubstationBizBaseParam baseParam=new StatSubstationBizBaseParam();
baseParam.setIds(lineIDS);
baseParam.setStartTime(DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())).toString());
baseParam.setEndTime(DateUtil.endOfDay(DateUtil.parse(param.getEndTime())).toString());
linesTarget.addAll(targetDService.getLinesTarget(baseParam));
List<RStatIntegrityD> integrityDS = lineIntegrityClient.getIntegrityByLineIds(lineIDS,
DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())).toString(),
DateUtil.endOfDay(DateUtil.parse(param.getEndTime())).toString()).getData();
integrityList.addAll(integrityDS.stream().filter(x->0==x.getIntegrityData()).map(RStatIntegrityD::getLineIndex).collect(Collectors.toList()));
}
Map<String, DeptGetSubStationDTO.Info> deptLineMap = deptGetChildrenMoreDTOS.stream().collect(Collectors.toMap(DeptGetSubStationDTO.Info::getUnitId, Function.identity()));
@@ -99,7 +108,7 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
List<SubGetBase> subBaseList = deptLineMap.get(datum.getId()).getStationIds();
List<GridDiagramVO.StatisticsData> statisticsData = new ArrayList<>();
List<GridDiagramVO.StatisticsData> gwStatisticsData = new ArrayList<>();
getSubStationStatisticsData(statisticsData, gwStatisticsData, subBaseList, voltageIds, list);
getSubStationStatisticsData(statisticsData, gwStatisticsData, subBaseList, voltageIds, linesTarget,integrityList);
lineStatistics.setData(statisticsData);
gwLineStatistics.setData(gwStatisticsData);
@@ -116,7 +125,8 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
List<GridDiagramVO.StatisticsData> gwStatisticsData,
List<SubGetBase> subBaseList,
List<String> voltageIds,
List<RMpTargetWarnDPO> list
List<String> list,
List<String> integrityList
) {
GridDiagramVO.StatisticsData data;
for (String voltageId : voltageIds) {
@@ -143,8 +153,10 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
} else {
line.addAll(x.getGwUnitChildrenList());
}
List<String> collect = list.stream().filter(d -> line.contains(d.getMeasurementPointId()))
.filter(d -> d.getIsWarn() > 0).map(RMpTargetWarnDPO::getMeasurementPointId).collect(Collectors.toList());
List<String> collect=new ArrayList<>();
collect.addAll(list.stream().filter(d -> line.contains(d)).collect(Collectors.toList()));
collect.addAll(integrityList.stream().filter(d -> line.contains(d)).collect(Collectors.toList()));
if (CollUtil.isNotEmpty(collect)) {
num.getAndIncrement();
alarm.addAll(collect);
@@ -152,7 +164,7 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
});
data.setNumTwo(num.get());
data.setNumTwoList(alarm);
data.setNumTwoList(alarm.stream().distinct().collect(Collectors.toList()));
if (i == 0) {
statisticsData.add(data);
} else {
@@ -172,16 +184,18 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
List<String> alarm = new ArrayList<>();
subBaseList.stream().forEach(x -> {
List<String> line = x.getUnitChildrenList();
List<String> alarmList = list.stream().filter(d -> line.contains(d.getMeasurementPointId()))
.filter(d -> d.getIsWarn() > 0).map(RMpTargetWarnDPO::getMeasurementPointId).collect(Collectors.toList());
List<String> alarmList=new ArrayList<>();
alarmList.addAll(list.stream().filter(d -> line.contains(d)).collect(Collectors.toList()));
alarmList.addAll(integrityList.stream().filter(d -> line.contains(d)).collect(Collectors.toList()));
if (CollUtil.isNotEmpty(alarmList)) {
num.getAndIncrement();
alarm.addAll(alarmList);
alarm.addAll(alarmList.stream().distinct().collect(Collectors.toList()));
}
});
data.setNumTwo(num.get());
data.setNumTwoList(alarm);
statisticsData.add(data);
//国网监测点
data = new GridDiagramVO.StatisticsData();
data.setNumOne(subBaseList.stream()
.filter(x -> 1 == x.getIsUpToGrid())
@@ -195,11 +209,12 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
List<String> gwAlarm = new ArrayList<>();
subBaseList.stream().filter(x -> 1 == x.getIsUpToGrid()).forEach(x -> {
List<String> line = x.getGwUnitChildrenList();
List<String> alarmList = list.stream().filter(d -> line.contains(d.getMeasurementPointId()))
.filter(d -> d.getIsWarn() > 0).map(RMpTargetWarnDPO::getMeasurementPointId).collect(Collectors.toList());
List<String> alarmList=new ArrayList<>();
alarmList.addAll(list.stream().filter(d -> line.contains(d)).collect(Collectors.toList()));
alarmList.addAll(integrityList.stream().filter(d -> line.contains(d)).collect(Collectors.toList()));
if (CollUtil.isNotEmpty(alarmList)) {
gwNum.getAndIncrement();
gwAlarm.addAll(alarmList);
gwAlarm.addAll(alarmList.stream().distinct().collect(Collectors.toList()));
}
});
data.setNumTwo(gwNum.get());

View File

@@ -1,12 +1,16 @@
package com.njcn.harmonic.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.harmonic.mapper.RStatLimitTargetDMapper;
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
import com.njcn.harmonic.service.IRStatLimitTargetDService;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
@@ -24,4 +28,11 @@ public class RStatLimitTargetDServiceImpl extends ServiceImpl<RStatLimitTargetDM
public List<String> getLinesTarget(StatSubstationBizBaseParam param) {
return this.baseMapper.getLinesTarget(param.getIds(),param.getStartTime(),param.getEndTime());
}
@Override
public RStatLimitTargetVO getGridDiagramTargetData(StatisticsBizBaseParam param) {
return this.baseMapper.getSumTargetDetails(Arrays.asList(param.getId()),
DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())).toString(),
DateUtil.endOfDay(DateUtil.parse(param.getEndTime())).toString());
}
}

View File

@@ -26,4 +26,11 @@ public interface RStatLimitService {
List<RStatLimitTargetDPO> monitorIdsGetLimitTargetInfo(String date, List<String> monitorIds);
List<GridDiagramVO.LineData> getGridDiagramLineData(DeviceInfoParam.BusinessParam deviceInfoParam);
/**
* 区域基本信息(监测点,终端,变电站等)
* @param param
* @return
*/
List<GridDiagramVO.AreaData> getGridDiagramAreaData(DeviceInfoParam.BusinessParam param);
}

View File

@@ -7,21 +7,23 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
import com.njcn.device.biz.pojo.dto.DeptGetSubStationDTO;
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
import com.njcn.device.pq.api.LineIntegrityClient;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.param.OnlineRateParam;
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
import com.njcn.device.pq.pojo.vo.TerminalTree;
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
import com.njcn.harmonic.mapper.RStatLimitTargetDMapper;
import com.njcn.harmonic.mapper.RStatLimitTargetMapper;
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
import com.njcn.harmonic.service.IRStatLimitTargetDService;
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
import com.njcn.system.pojo.enums.StatisticsEnum;
import lombok.RequiredArgsConstructor;
@@ -30,8 +32,10 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* pqs
@@ -47,6 +51,10 @@ public class RStatLimitServiceImpl implements RStatLimitService {
private final RStatLimitTargetDMapper rStatLimitTargetDMapper;
private final GeneralDeviceInfoClient generalDeviceInfoClient;
private final LineIntegrityClient lineIntegrityClient;
private final IRStatLimitTargetDService targetDService;
private final CommTerminalGeneralClient commTerminalGeneralClient;
@Override
public List<RStatLimitRateDPO> monitorIdsGetLimitRateInfo(String date, List<String> monitorIds) {
@@ -137,6 +145,87 @@ public class RStatLimitServiceImpl implements RStatLimitService {
return info;
}
@Override
public List<GridDiagramVO.AreaData> getGridDiagramAreaData(DeviceInfoParam.BusinessParam param) {
List<GridDiagramVO.AreaData> info = new ArrayList<>();
GridDiagramVO.AreaData areaData ;
//监测点总数
List<GeneralDeviceDTO> data = generalDeviceInfoClient.getPracticalAllDeviceInfoAsDept(param).getData();
//在线
List<GeneralDeviceDTO> onData = generalDeviceInfoClient.getPracticalRunDeviceInfo(param).getData();
Map<String, GeneralDeviceDTO> onMap = onData.stream().collect(Collectors.toMap(GeneralDeviceDTO::getIndex, Function.identity()));
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
deptGetLineParam.setDeptId(param.getDeptIndex());
deptGetLineParam.setPowerFlag(0);
//变电站公共方法
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
Map<String, DeptGetSubStationDTO.Info> deptLineMap = deptGetChildrenMoreDTOS.stream().collect(Collectors.toMap(DeptGetSubStationDTO.Info::getUnitId, Function.identity()));
List<String> line = data.stream().flatMap(x -> x.getLineIndexes().stream()).distinct().collect(Collectors.toList());
StatSubstationBizBaseParam baseParam=new StatSubstationBizBaseParam();
baseParam.setIds(line);
baseParam.setStartTime(DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())).toString());
baseParam.setEndTime(DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())).toString());
List<String> linesTarget=targetDService.getLinesTarget(baseParam);
List<RStatIntegrityD> integrityDS = lineIntegrityClient.getIntegrityByLineIds(line,
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())).toString(),
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())).toString()).getData();
List<String> integrityDS0 = integrityDS.stream().filter(x -> 0 == x.getIntegrityData()).map(RStatIntegrityD::getLineIndex).collect(Collectors.toList());
for (GeneralDeviceDTO datum : data) {
areaData = new GridDiagramVO.AreaData();
areaData.setOrgId(datum.getIndex());
areaData.setOrgName(datum.getName());
areaData.setLineNum(datum.getLineIndexes().size());
areaData.setLineList(datum.getLineIndexes());
areaData.setDeviceNum(datum.getDeviceIndexes().size());
if(onMap.containsKey(datum.getIndex())){
GeneralDeviceDTO dto = onMap.get(datum.getIndex());
areaData.setOnlineNum(dto.getLineIndexes().size());
areaData.setOnlineList(dto.getLineIndexes());
areaData.setOnDevice(dto.getDeviceIndexes().size());
if (deptLineMap.containsKey(datum.getIndex())) {
DeptGetSubStationDTO.Info deptSub = deptLineMap.get(datum.getIndex());
areaData.setSubNum(deptSub.getStationIds().size());
AtomicLong num = new AtomicLong();
List<String> alarm = new ArrayList<>();
deptSub.getStationIds().stream().forEach(x -> {
List<String> lineIds = new ArrayList<>();
//0全部 1国网
if (ObjectUtil.isNull(param.getMonitorFlag())) {
lineIds.addAll(x.getUnitChildrenList());
} else {
if (0 == param.getMonitorFlag()) {
lineIds.addAll(x.getUnitChildrenList());
}else {
lineIds.addAll(x.getGwUnitChildrenList());
}
}
List<String> collect = new ArrayList<>();
collect.addAll(linesTarget.stream().filter(d -> lineIds.contains(d)).collect(Collectors.toList()));
collect.addAll(integrityDS0.stream().filter(d -> lineIds.contains(d)).collect(Collectors.toList()));
if (CollUtil.isNotEmpty(collect)) {
num.getAndIncrement();
alarm.addAll(collect);
}
});
areaData.setAlarmSubNum(Math.toIntExact(num.get()));
areaData.setAlarmSubList(alarm.stream().distinct().collect(Collectors.toList()));
}
List<String> lineAlarm = new ArrayList<>();
lineAlarm.addAll(linesTarget.stream().filter(d -> datum.getLineIndexes().contains(d)).collect(Collectors.toList()));
lineAlarm.addAll(integrityDS0.stream().filter(d -> datum.getLineIndexes().contains(d)).collect(Collectors.toList()));
areaData.setAlarm(lineAlarm.stream().distinct().collect(Collectors.toList()).size());
areaData.setAlarmList(lineAlarm.stream().distinct().collect(Collectors.toList()));
}
info.add(areaData);
}
return info;
}
private void onLineAndIntegrity(List<String> lineIds, List<RStatIntegrityD> onIntegrityByIds, List<String> devIds, List<RStatOnlinerateVO> onlineRateByDevIds,List<RStatLimitTargetDPO> limitTargetList, GridDiagramVO.LineData lineData) {
//监测完整率
List<RStatIntegrityD> integrityDS = onIntegrityByIds.stream().filter(x -> lineIds.contains(x.getLineIndex())).collect(Collectors.toList());

View File

@@ -3,6 +3,7 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.line;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjUtil;
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.njcn.common.utils.HarmonicTimesUtil;
import com.njcn.harmonic.pojo.po.day.*;
@@ -19,7 +20,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -113,7 +113,10 @@ public class DayDataServiceImpl implements DayDataService {
RStatDataVDPO po1 = new RStatDataVDPO();
BeanUtils.copyProperties(item, po1);
po1.setTime(LocalDate.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER));
//todo 此数据质量标记为influxdb查询得出,数据转换时未做数据异常判断,因前置那边未做判断,系统先做判断拦截,后期前置应该加判断
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
//fixme 因现场数据异常,先处理频率偏差、电压偏差、电压总谐波畸变率、三相电压不平衡度、长时闪变异常数据拦截
po1.setQualityFlag(DataAnomalyDetectio(po1,null));
dataVPOList.add(po1);
DayV dayV = new DayV();
BeanUtils.copyProperties(item, dayV);
@@ -580,6 +583,7 @@ public class DayDataServiceImpl implements DayDataService {
BeanUtils.copyProperties(item, po1);
po1.setTime(LocalDate.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER));
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
po1.setQualityFlag(DataAnomalyDetectio(null,po1));
dataPltPOList.add(po1);
DayPlt dayPlt = new DayPlt();
@@ -1864,4 +1868,23 @@ public class DayDataServiceImpl implements DayDataService {
result.addAll(result4);
return result;
}
public Integer DataAnomalyDetectio(RStatDataVDPO po1, RStatDataPltDPO po2) {
int result = 0;
if (ObjUtil.isNotNull(po1)) {
if (Math.abs(po1.getFreqDev()) > 7.5
|| Math.abs(po1.getVlDev()) > 20
|| Math.abs(po1.getVuDev()) > 20
|| po1.getVThd() > 30
|| po1.getVUnbalance() > 40) {
result = 1;
}
}
if (ObjUtil.isNotNull(po2)) {
if (po2.getPlt() > 20) {
result = 1;
}
}
return result;
}
}

View File

@@ -0,0 +1,22 @@
package com.njcn.supervision.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.fallback.SupervisionPlanFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 流程实例 Api 接口
*
* @author hongawen
*/
@FeignClient(value = ServerInfo.SUPERVISION, path = "/superPlan", fallbackFactory = SupervisionPlanFeignClientFallbackFactory.class)
public interface SupervisionPlanFeignClient {
@GetMapping("/updateStatus")
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
}

View File

@@ -0,0 +1,22 @@
package com.njcn.supervision.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.fallback.TempLineDebugFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 流程实例 Api 接口
*
* @author 芋道源码
*/
@FeignClient(value = ServerInfo.SUPERVISION, path = "/tempLinedebug", fallbackFactory = TempLineDebugFeignClientFallbackFactory.class)
public interface TempLineDebugFeignClient {
@GetMapping("/updateStatus")
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
}

View File

@@ -0,0 +1,22 @@
package com.njcn.supervision.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.fallback.UserReportNoramlFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 流程实例 Api 接口
*
* @author hongawen
*/
@FeignClient(value = ServerInfo.SUPERVISION, path = "/userReportNormal", fallbackFactory = UserReportNoramlFeignClientFallbackFactory.class)
public interface UserReportNormalFeignClient {
@GetMapping("/updateUserReportNormalStatus")
HttpResult<Object> updateUserReportNormalStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
}

View File

@@ -0,0 +1,37 @@
package com.njcn.supervision.api.fallback;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.SupervisionPlanFeignClient;
import com.njcn.supervision.utils.SupervisionEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author denghuajun
* @version 1.0.0
* @date 2022/3/16
*/
@Slf4j
@Component
public class SupervisionPlanFeignClientFallbackFactory implements FallbackFactory<SupervisionPlanFeignClient> {
@Override
public SupervisionPlanFeignClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new SupervisionPlanFeignClient() {
@Override
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
log.error("{}异常,降级处理,异常为:{}", "更新退运装置数据流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -0,0 +1,37 @@
package com.njcn.supervision.api.fallback;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.TempLineDebugFeignClient;
import com.njcn.supervision.utils.SupervisionEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author denghuajun
* @version 1.0.0
* @date 2022/3/16
*/
@Slf4j
@Component
public class TempLineDebugFeignClientFallbackFactory implements FallbackFactory<TempLineDebugFeignClient> {
@Override
public TempLineDebugFeignClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new TempLineDebugFeignClient() {
@Override
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
log.error("{}异常,降级处理,异常为:{}", "更新流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -0,0 +1,37 @@
package com.njcn.supervision.api.fallback;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.UserReportNormalFeignClient;
import com.njcn.supervision.utils.SupervisionEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author denghuajun
* @version 1.0.0
* @date 2022/3/16
*/
@Slf4j
@Component
public class UserReportNoramlFeignClientFallbackFactory implements FallbackFactory<UserReportNormalFeignClient> {
@Override
public UserReportNormalFeignClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new UserReportNormalFeignClient() {
@Override
public HttpResult<Object> updateUserReportNormalStatus(String businessKey, Integer status) {
log.error("{}异常,降级处理,异常为:{}", "更新用户数据流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -13,7 +13,8 @@ public enum FlowStatusEnum {
AUDIT(1, "审批中"),
APPROVE(2, "审批通过"),
OPPOSE(3, "审批不通过"),
CANCEL(4, "已取消");
CANCEL(4, "已取消"),
NO_FEEDBACK(5, "未反馈");
private final Integer code;

View File

@@ -0,0 +1,19 @@
package com.njcn.supervision.enums;
import lombok.Getter;
@Getter
public enum LeafletTypeEnum {
WARNING(1, "预警单"),
ALARM(2, "告警单");
private final Integer code;
private final String name;
LeafletTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
}

View File

@@ -0,0 +1,21 @@
package com.njcn.supervision.enums;
import lombok.Getter;
@Getter
public enum ProblemTypeEnum {
PLAN(1, "技术监督计划"),
ONLINE(2, "在线监测超标问题"),
USER(3, "用户投诉问题"),
SITE_TEST(4, "现场测试超标问题");
private final Integer code;
private final String name;
ProblemTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
}

View File

@@ -0,0 +1,65 @@
package com.njcn.supervision.pojo.param.device;
import com.njcn.db.bo.BaseEntity;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
/**
*
* Description:
* Date: 2024/5/17 15:26【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SupervisionTempLineDebugParam extends BaseEntity {
private String id;
/**
* 调试原因
*/
@ApiModelProperty(value="调试原因")
private String reason;
/**
* 流程实例的编号
*/
@ApiModelProperty(value="流程实例的编号")
private String processInstanceId;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
@ApiModelProperty(value="1:审批中2审批通过3审批不通过4已取消")
private Integer status;
/**
* 状态0-删除 1-正常
*/
@ApiModelProperty(value="状态0-删除 1-正常")
private Integer state;
@ApiModelProperty("发起人自选审批人 Map")
private Map<String, List<String>> startUserSelectAssignees;
@Data
@EqualsAndHashCode(callSuper = true)
public static class SupervisionTempLineDebugQuery extends BaseParam {
@ApiModelProperty(value = "填报部门")
private String orgId;
private List<Integer> statueList;
}
}

View File

@@ -239,5 +239,7 @@ public class SupervisionTempLineReportParam {
@ApiModelProperty(value = "填报部门")
private String orgId;
private List<Integer> statueList;
}
}

View File

@@ -0,0 +1,118 @@
package com.njcn.supervision.pojo.param.leaflet;
import com.njcn.db.bo.BaseEntity;
import com.njcn.supervision.pojo.param.device.QuitRunningDeviceParam;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* <p>
* 预告警单表
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarningLeafletParam extends BaseEntity implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 预告警单名称
*/
@ApiModelProperty(value = "设备编号")
private String leafletName;
/**
* 预告警编号,目前阶段不做配置
*/
@ApiModelProperty(value = "设备编号")
private String leafletNo;
/**
* 1技术监督管理2在线监测超标问题3用户投诉4现场测试超标
*/
@ApiModelProperty(value = "设备编号")
private Integer problemType;
/**
* 对应问题源ID用于查询详细信息
*/
@ApiModelProperty(value = "设备编号")
private String problemId;
/**
* 单子类型1预警单2告警单
*/
@ApiModelProperty(value = "设备编号")
private Integer leafletType;
/**
* 1:审批中2审批通过3审批不通过4已取消5待反馈
*/
@ApiModelProperty(value = "设备编号")
private Integer status;
/**
* 流程实例的编号
*/
@ApiModelProperty(value = "设备编号")
private String processInstanceId;
/**
* 问题详细描述
*/
@ApiModelProperty(value = "问题详细描述")
private String issueDetail;
@Data
@EqualsAndHashCode(callSuper = true)
public static class WarningLeafletUpdateParam extends WarningLeafletParam {
@ApiModelProperty("id")
@NotBlank(message = "索引不能为空")
private String Id;
/**
* 采取措施
*/
@ApiModelProperty(value = "采取措施")
@NotBlank(message = "采取措施不能为空")
private String takeStep;
/**
* 处理成效报告
*/
@ApiModelProperty(value = "处理成效报告")
@NotBlank(message = "处理成效报告不能为空")
private String reportPath;
}
/**
* 分页查询实体
*/
@Data
@EqualsAndHashCode(callSuper = true)
public static class WarningLeafletQueryParam extends BaseParam {
}
}

View File

@@ -0,0 +1,168 @@
package com.njcn.supervision.pojo.param.plan;
import com.njcn.web.pojo.annotation.DateTimeStrValid;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* <p>
*
* </p>
*
* @author hongawen
* @since 2023-06-21
*/
@Data
public class SupervisionPlanParam extends BaseParam {
/**
* 计划名称
*/
@ApiModelProperty(value = "计划名称",required = true)
@NotBlank(message = "计划名称不可为空")
private String workPlanName;
/**
* 监督单位
*/
@ApiModelProperty(value = "监督单位",required = true)
@NotBlank(message = "监督单位不可为空")
private String supvOrgId;
/**
* 计划编制人id
*/
@NotBlank(message = "计划编制人不可为空")
private String planUserId;
/**
* 监督类型
*/
@ApiModelProperty(value = "监督类型",required = true)
@NotBlank(message = "监督类型不可为空")
private String supvType;
/**
* 监督阶段
*/
@ApiModelProperty(value = "监督阶段",required = true)
@NotBlank(message = "监督阶段不可为空")
private String supvStage;
/**
* 计划监督时间
*/
@ApiModelProperty(value = "计划监督时间",required = true)
@NotNull(message = "计划监督时间不可为空")
private String planSupvDate;
/**
* 监督对象名称
*/
@ApiModelProperty(value = "监督对象名称")
private String supvObjName;
/**
* 监督对象类型
*/
@ApiModelProperty(value = "对象类型")
private String supvObjType;
/**
* 监督对象电压等级
*/
@ApiModelProperty(value = "对象电压等级")
private String objVoltageLevel;
/**
* 关联电站
*/
@ApiModelProperty(value = "关联电站")
private String substationName;
@ApiModelProperty(value = "关联电站电压等级")
private String substationVoltageLevel;
@ApiModelProperty(value = "监督对象属性")
private String objType;
@ApiModelProperty(value = "监督对象属性名称")
private String objTypeName;
@ApiModelProperty(value = "监督对象协议容量(MVA)")
private Double objCapacity;
/**
* 计划执行开始时间
*/
@ApiModelProperty(value = "计划执行开始时间",required = true)
@DateTimeStrValid(format = "yyyy-MM-dd HH:mm:ss",message = "计划执行开始时间格式有误")
private String effectStartTime;
/**
* 计划执行结束时间
*/
@ApiModelProperty(value = "计划执行结束时间",required = true)
@DateTimeStrValid(format = "yyyy-MM-dd HH:mm:ss",message = "计划执行结束时间格式有误")
private String effectEndTime;
/**
* 报告出具时间
*/
@ApiModelProperty(value = "报告出具时间",required = true)
@DateTimeStrValid(message = "报告出具时间格式有误",format = "yyyy-MM-dd HH:mm:ss")
private String reportIssueTime;
/**
* 电能质量问题发生时间
*/
@ApiModelProperty(value = "电能质量问题发生时间",required = true)
@DateTimeStrValid(message = "电能质量问题发生时间格式有误",format = "yyyy-MM-dd HH:mm:ss")
private String problemOcTime;
/**
* 备注
*/
@ApiModelProperty(value = "备注(其他要求)")
private String otherRemark;
/**
* 计划编制单位id
*/
@ApiModelProperty(value = "计划编制单位id")
@NotBlank(message = "计划编制单位id不可为空")
private String planOrgId;
@ApiModelProperty(value = "实施状态")
private String effectStatus;
@ApiModelProperty(value = "实施人")
private String effectUserId;
@ApiModelProperty(value = "计划状态")
private String planStatus;
@EqualsAndHashCode(callSuper = true)
@Data
public static class UpdateSupvPlanParam extends SupervisionPlanParam{
@ApiModelProperty(value = "索引",required = true)
@NotBlank(message = "计划索引不可为空")
private String planId;
@ApiModelProperty("其他要求")
private String otherRemarkHis;
@ApiModelProperty("调整原因")
private String applyCommentHis;
}
}

View File

@@ -0,0 +1,157 @@
package com.njcn.supervision.pojo.param.plan;
import com.njcn.web.pojo.annotation.DateTimeStrValid;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* <p>
*
* </p>
*
* @author hongawen
* @since 2023-06-21
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SupervisopnProblemParam extends BaseParam {
/**
* 关联计划表
*/
@ApiModelProperty(value = "关联计划表id",required = true)
@NotBlank(message = "关联计划表不可为空")
private String planId;
/**
* 责任单位id取ISC平台上的组织id
*/
@ApiModelProperty(value = "责任单位id取ISC平台上的组织id",required = true)
@NotBlank(message = "责任单位id不可为空")
private String dutyOrgId;
/**
* 监测点类型 ,仅供电电压监督计划必填
*/
@ApiModelProperty(value = "监测点类型 ,仅供电电压监督计划必填")
private String monitorType;
/**
* 整改时间
*/
@ApiModelProperty(value = "整改时间",required = true)
private String rectificationTime;
/**
* 计划整改时间
*/
@ApiModelProperty(value = "计划整改时间",required = true)
@NotNull(message = "计划整改时间不可为空")
private String planRectificationTime;
/**
* 是否发布预告警
*/
@ApiModelProperty(value = "是否发布预告警",required = true)
@NotNull(message = "是否发布预告警不可为空")
private Integer ifReleaseWarning;
/**
* 问题描述
*/
@ApiModelProperty(value = "问题简要描述")
@NotBlank(message = "问题简要描述不可为空")
private String simpleProblemDesc;
/**
* 监督标准序号
*/
@ApiModelProperty(value = "监督标准序号")
@NotBlank(message = "监督标准序号不可为空")
private String supvStandardSort;
/**
* 问题描述
*/
@ApiModelProperty(value = "问题描述")
@NotBlank(message = "问题描述不可为空")
private String problemDesc;
/**
* 监督标准
*/
@ApiModelProperty(value = "监督标准",required = true)
@NotBlank(message = "监督标准不可为空")
private String supvStandard;
/**
* 标准出处
*/
@ApiModelProperty(value = "标准出处",required = true)
@NotBlank(message = "标准出处不可为空")
private String supvResouce;
/**
* 问题等级 01 一般02 较大
*/
@ApiModelProperty(value = "问题等级",required = true)
@NotBlank(message = "问题等级不可为空")
private String problemLevel;
/**
* 定级依据
*/
@ApiModelProperty(value = "定级依据",required = true)
@NotBlank(message = "定级依据不可为空")
private String problemLevelReason;
/**
* 问题类型
*/
@ApiModelProperty(value = "问题类型",required = true)
@NotBlank(message = "问题类型不可为空")
private String problemType;
@ApiModelProperty(value = "备注")
private String remark;
/**
* 整改方案
*/
@ApiModelProperty(value = "整改方案",required = true)
@NotBlank(message = "整改方案不可为空")
private String rectificationProgramme;
@ApiModelProperty(value = "整改措施")
private String rectificationMeasure;
/**
* 整改情况01已整改02未整改
*/
@ApiModelProperty(value = "整改情况",required = true)
@NotBlank(message = "整改情况不可为空")
private String rectificationStatus;
@NotBlank(message = "问题发现时间")
@DateTimeStrValid(format="yyyy-MM-dd HH:mm:ss",message = "问题发现时间格式有误")
private String discoveryTime;
@EqualsAndHashCode(callSuper = true)
@Data
public static class UpdateSupvProblemParam extends SupervisopnProblemParam{
@ApiModelProperty(value = "索引",required = true)
@NotBlank(message = "问题索引不可为空")
private String problemId;
}
}

View File

@@ -0,0 +1,58 @@
package com.njcn.supervision.pojo.param.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Map;
/**
* <p>
* 干扰源用户常态化管理
* </p>
*
* @author hongawen
* @since 2024-05-17
*/
@Getter
@Setter
public class UserReportNormalParam extends BaseParam {
private static final long serialVersionUID = 1L;
private String id;
/**
* 关联干扰源用户表
*/
private String userReportId;
/**
* 类型0方案审查 1治理工程
*/
private Integer type;
/**
* 报告存放路径
*/
private String reportUrl;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
private String status;
@ApiModelProperty("发起人自选审批人 Map")
private Map<String, List<String>> startUserSelectAssignees;
}

View File

@@ -0,0 +1,56 @@
package com.njcn.supervision.pojo.po.device;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* Description:
* Date: 2024/5/17 15:26【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "supervision_temp_line_debug")
public class SupervisionTempLineDebugPO extends BaseEntity {
@TableId(value = "id", type = IdType.INPUT)
private String id;
/**
* 调试原因
*/
@TableField(value = "reason")
@ApiModelProperty(value="调试原因")
private String reason;
/**
* 流程实例的编号
*/
@TableField(value = "process_instance_id")
@ApiModelProperty(value="流程实例的编号")
private String processInstanceId;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
@TableField(value = "`status`")
@ApiModelProperty(value="1:审批中2审批通过3审批不通过4已取消")
private Integer status;
/**
* 状态0-删除 1-正常
*/
@TableField(value = "`State`")
@ApiModelProperty(value="状态0-删除 1-正常")
private Integer state;
}

View File

@@ -0,0 +1,63 @@
package com.njcn.supervision.pojo.po.device;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
*
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
@Getter
@Setter
@TableName("supervision_temp_line_run_test")
public class SupervisionTempLineRunTest extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
/**
* 流程实例的编号
*/
private String processInstanceId;
/**
* 在线率
*/
private Float onlineRate;
/**
* 数据完整性
*/
private Float integrityRate;
/**
* 数据符合性
*/
private Float suitRate;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
private Integer status;
/**
* 状态0-删除 1-正常
*/
private Integer state;
/**
* 0:未试运行 1试运行中 2.试运行成功 3.试运行异常
*/
private Integer testRunState;
}

View File

@@ -0,0 +1,90 @@
package com.njcn.supervision.pojo.po.leaflet;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 预告警单表
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
@Data
@TableName("supervision_warning_leaflet")
public class WarningLeaflet extends BaseEntity implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 预告警单
*/
private String id;
/**
* 预告警单名称
*/
private String leafletName;
/**
* 预告警编号,目前阶段不做配置
*/
private String leafletNo;
/**
* 1技术监督管理2在线监测超标问题3用户投诉4现场测试超标
*/
private Integer problemType;
/**
* 对应问题源ID用于查询详细信息
*/
private String problemId;
/**
* 单子类型1预警单2告警单
*/
private Integer leafletType;
/**
* 1:审批中2审批通过3审批不通过4已取消5待反馈
*/
private Integer status;
/**
* 流程实例的编号
*/
private String processInstanceId;
/**
* 问题详细描述
*/
private String issueDetail;
/**
* 采取措施
*/
private String takeStep;
/**
* 处理成效报告
*/
private String reportPath;
/**
* 状态0-删除 1-正常
*/
private Integer state;
}

View File

@@ -0,0 +1,236 @@
package com.njcn.supervision.pojo.po.plan;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
/**
*
* Description:
* Date: 2024/5/20 17:49【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "supervision_plan")
public class SupervisionPlanPO extends BaseEntity {
@TableId(value = "plan_Id", type = IdType.ASSIGN_UUID)
private String planId;
@TableField(exist = false)
private String provinceId;
@TableField(exist = false)
private String provinceName;
@TableField(exist = false)
private String cityId;
@TableField(exist = false)
private String cityName;
@TableField(exist = false)
private String countyId;
@TableField(exist = false)
private String countyName;
@TableField(exist = false)
private String supvObjId;
@TableField(exist = false)
private String objVoltageLevelName;
/**
* 计划名称
*/
@TableField(value = "work_plan_name")
private String workPlanName;
/**
* 监督类型
*/
@TableField(value = "supv_Type")
private String supvType;
/**
* 监督阶段
*/
@TableField(value = "supv_Stage")
private String supvStage;
/**
* 监督单位
*/
@TableField(value = "supv_Org_Id")
private String supvOrgId;
/**
* 计划编制人id
*/
@TableField(value = "plan_User_Id")
private String planUserId;
/**
* 计划编制单位id
*/
@TableField(value = "plan_Org_Id")
private String planOrgId;
/**
* 备注
*/
@TableField(value = "other_Remark")
private String otherRemark;
/**
* 计划执行开始时间
*/
@TableField(value = "effect_Start_Time")
private LocalDateTime effectStartTime;
/**
* 计划执行结束时间
*/
@TableField(value = "effect_End_Time")
private LocalDateTime effectEndTime;
/**
* 实施状态
*/
@TableField(value = "effect_Status")
private String effectStatus;
/**
* 计划监督时间
*/
@TableField(value = "plan_Supv_Date")
private LocalDateTime planSupvDate;
/**
* 对象类型
*/
@TableField(value = "supv_Obj_Type")
private String supvObjType;
/**
* 监督对象名称
*/
@TableField(value = "supv_Obj_Name")
private String supvObjName;
/**
* 对象电压等级
*/
@TableField(value = "obj_Voltage_Level")
private String objVoltageLevel;
/**
* 关联电站
*/
@TableField(value = "substation_Name")
private String substationName;
/**
* 关联电站电压等级
*/
@TableField(value = "substation_Voltage_Level")
private String substationVoltageLevel;
/**
* 监督对象属性 01 在运站 02 新(改、扩)建站,仅新能源场站监督计划必填
*/
@TableField(value = "obj_Type")
private String objType;
/**
* 监督对象属性名称 仅新能源场站监督计划必填
*/
@TableField(value = "obj_Type_Name")
private String objTypeName;
/**
* 监督对象协议容量(MVA) 新能源场站、敏感用户监督计划必填
*/
@TableField(value = "obj_Capacity")
private Double objCapacity;
/**
* 报告出具时间
*/
@TableField(value = "report_Issue_Time")
private LocalDateTime reportIssueTime;
/**
* 电能质量问题发生时间
*/
@TableField(value = "problem_Oc_Time")
private LocalDateTime problemOcTime;
/**
* 删除标识 0否1是
*/
@TableField(value = "delete_Flag")
private String deleteFlag;
/**
* 计划状态 1新建2变更 3取消
*/
@TableField(value = "plan_Status")
private String planStatus;
/**
* 删除时间
*/
@TableField(value = "delete_Time")
private LocalDateTime deleteTime;
/**
* 实施人id
*/
@TableField(value = "effect_User_Id")
private String effectUserId;
/**
* 实施人姓名
*/
@TableField(value = "effect_User_Name")
private String effectUserName;
/**
* 0.未上送 1.上送 2.取消上送 3.待重新上送
*/
@TableField(value = "is_upload_head")
private Integer isUploadHead;
/**
* 流程实例的编号
*/
@TableField(value = "process_instance_id")
private String processInstanceId;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
@TableField(value = "`status`")
private Integer status;
/**
* 状态0-删除 1-正常
*/
@TableField(value = "`State`")
private Integer state;
}

View File

@@ -0,0 +1,159 @@
package com.njcn.supervision.pojo.po.plan;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
/**
*
* Description:
* Date: 2024/5/20 19:50【需求编号】
*
* @author clam
* @version V1.0.0
*/
@ApiModel(description="")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "supervision_problem")
public class SupervisionProblemPO extends BaseEntity {
@TableId(value = "problem_Id", type = IdType.ASSIGN_UUID)
private String problemId;
/**
* 关联计划表
*/
@TableField(value = "plan_id")
private String planId;
/**
* 所属网省id
*/
@TableField(exist = false)
private String provinceId;
/**
* 责任单位id取ISC平台上的组织id
*/
@TableField(value = "duty_Org_Id")
private String dutyOrgId;
@TableField(exist = false)
private String dutyOrgName;
/**
* 监测点类型 ,仅供电电压监督计划必填
*/
@TableField(value = "monitor_Type")
private String monitorType;
/**
* 整改时间
*/
@TableField(value = "rectification_Time")
private LocalDateTime rectificationTime;
/**
* 计划整改时间
*/
@TableField(value = "plan_Rectification_Time")
private LocalDateTime planRectificationTime;
/**
* 是否发布预告警
*/
@TableField(value = "if_Release_Warning")
private Boolean ifReleaseWarning;
@TableField(value = "problem_Desc")
private String problemDesc;
/**
* 问题描述
*/
@TableField(value = "simple_Problem_Desc")
private String simpleProblemDesc;
@TableField(value = "supv_Standard_Sort")
private String supvStandardSort;
/**
* 监督标准
*/
@TableField(value = "supv_Standard")
private String supvStandard;
/**
* 标准出处
*/
@TableField(value = "supv_Resouce")
private String supvResouce;
/**
* 问题等级 01 一般02 较大
*/
@TableField(value = "problem_Level")
private String problemLevel;
/**
* 定级依据
*/
@TableField(value = "problem_Level_Reason")
private String problemLevelReason;
/**
* 问题类型
*/
@TableField(value = "problem_Type")
private String problemType;
/**
* 整改方案
*/
@TableField(value = "rectification_Programme")
private String rectificationProgramme;
/**
* 整改措施
*/
@TableField(value = "rectification_Measure")
private String rectificationMeasure;
/**
* 整改情况, 01已整改02未整改
*/
@TableField(value = "rectification_Status")
private String rectificationStatus;
/**
* 是否上送国网 0.未上送 1.上送
*/
@TableField(value = "is_Upload_Head")
private Boolean isUploadHead;
/**
* 问题发现时间
*/
@TableField(value = "discovery_Time")
private LocalDateTime discoveryTime;
@TableField(value = "remark")
private String remark;
@TableField(exist = false)
private String attachmentName;
@TableField(exist = false)
private String attachmentNameTwo;
}

View File

@@ -79,6 +79,14 @@ public class SupervisionGeneralSurveyPlanDetailPO extends BaseEntity {
@TableField(value = "is_survey")
@ApiModelProperty(value="是否实现监测(0:否 1:是)")
private Integer isSurvey;
/**
* 存在问题的普测变电站是否发起告警单01
*/
@TableField(value = "initiate_warning_flag")
@ApiModelProperty(value="是否发起告警单")
private Integer initiateWarningFlag;
/**
* 状态0-删除 1-正常
*/

View File

@@ -0,0 +1,51 @@
package com.njcn.supervision.pojo.po.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 干扰源用户常态化管理
* </p>
*
* @author hongawen
* @since 2024-05-17
*/
@Getter
@Setter
@TableName("supervision_user_report_normal")
public class UserReportNormalPO extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
/**
* 关联干扰源用户表
*/
private String userReportId;
/**
* 类型0方案审查 1治理工程
*/
private Boolean type;
/**
* 报告存放路径
*/
private String reportUrl;
private String processInstanceId;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
private Integer status;
private Integer state;
}

View File

@@ -0,0 +1,32 @@
package com.njcn.supervision.pojo.vo.device;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
/**
* Description:
* Date: 2024/5/20 10:32【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class SupervisionTempLineDebugVO extends BaseEntity {
private String id;
private String lineId;
private String lineName;
private String userName;
private String connectedBus;
private String monitoringTerminalCode;
private String monitoringTerminalName;
private String powerSubstationName;
private String reason;
private String processInstanceId;
private Integer status;
/**
* 0:未试运行 1试运行中 2.试运行成功 3.试运行异常
*/
private Integer testRunState;
}

View File

@@ -215,6 +215,14 @@ public class SupervisionTempLineReportVO {
@ApiModelProperty(value="电压偏差下限")
private Float voltageDeviationLowerLimit;
/**
* 流程实例的编号
*/
@ApiModelProperty(value = "流程实例的编号")
private String processInstanceId;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/

View File

@@ -0,0 +1,78 @@
package com.njcn.supervision.pojo.vo.leaflet;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
* 预告警单表
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
@Data
public class WarningLeafletVO extends BaseEntity implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 预告警单
*/
private String id;
/**
* 预告警单名称
*/
private String leafletName;
/**
* 预告警编号,目前阶段不做配置
*/
private String leafletNo;
/**
* 1技术监督管理2在线监测超标问题3用户投诉4现场测试超标
*/
private Integer problemType;
/**
* 对应问题源ID用于查询详细信息
*/
private String problemId;
/**
* 单子类型1预警单2告警单
*/
private Integer leafletType;
/**
* 1:审批中2审批通过3审批不通过4已取消5待反馈
*/
private Integer status;
/**
* 采取措施
*/
private String takeStep;
/**
* 处理成效报告
*/
private String reportPath;
/**
* 流程实例的编号
*/
private String processInstanceId;
/**
* 问题详细描述
*/
private String issueDetail;
}

View File

@@ -0,0 +1,183 @@
package com.njcn.supervision.pojo.vo.plan;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* pqs
*
* @author cdf
* @date 2023/6/25
*/
@Data
public class SupervisionPlanVO {
@ApiModelProperty(value = "索引",required = true)
private String planId;
/**
* 计划名称
*/
@ApiModelProperty(value = "计划名称",required = true)
private String workPlanName;
/**
* 监督单位
*/
@ApiModelProperty(value = "监督单位",required = true)
private String supvOrgId;
@ApiModelProperty(value = "监督单位名称",required = true)
private String supvOrgName;
/**
* 计划编制单位id
*/
@ApiModelProperty(value = "计划编制单位id")
private String planOrgId;
/**
* 计划编制单位名字
*/
@ApiModelProperty(value = "计划编制单位名字")
private String planOrgName;
private String planUserId;
private String planUserName;
/**
* 监督类型
*/
@ApiModelProperty(value = "监督类型",required = true)
private String supvType;
/**
* 监督阶段
*/
@ApiModelProperty(value = "监督阶段",required = true)
private String supvStage;
/**
* 计划监督时间
*/
@ApiModelProperty(value = "计划监督时间",required = true)
@JsonFormat(pattern = "yyyy-MM")
private String planSupvDate;
/**
* 监督对象名称
*/
@ApiModelProperty(value = "监督对象名称")
private String supvObjName;
/**
* 对象类型
*/
@ApiModelProperty(value = "对象类型")
private String supvObjType;
/**
* 对象电压等级
*/
@ApiModelProperty(value = "对象电压等级")
private String objVoltageLevel;
/**
* 关联电站
*/
@ApiModelProperty(value = "关联电站")
private String substationName;
@ApiModelProperty(value = "关联电站电压等级")
private String substationVoltageLevel;
@ApiModelProperty(value = "监督对象属性")
private String objType;
@ApiModelProperty(value = "监督对象属性名称")
private String objTypeName;
@ApiModelProperty(value = "监督对象协议容量(MVA)")
private Double objCapacity;
/**
* 计划执行开始时间
*/
@ApiModelProperty(value = "计划执行开始时间",required = true)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime effectStartTime;
/**
* 计划执行结束时间
*/
@ApiModelProperty(value = "计划执行结束时间",required = true)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime effectEndTime;
/**
* 报告出具时间
*/
@ApiModelProperty(value = "报告出具时间",required = true)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime reportIssueTime;
/**
* 电能质量问题发生时间
*/
@ApiModelProperty(value = "电能质量问题发生时间",required = true)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime problemOcTime;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String otherRemark;
@ApiModelProperty(value = "省部门")
private String province;
@ApiModelProperty(value = "市部门")
private String city;
@ApiModelProperty(value = "县部门")
private String county;
@ApiModelProperty(value = "附件名称")
private String attachmentName;
/**
* 0.未上送 1.上送 2.取消上送
*/
@ApiModelProperty(value = "0.未上送 1.上送 2.取消上送")
private Integer isUploadHead;
private String createBy;
private String updateBy;
/**
* 实施状态
*/
private String effectStatus;
/**
* 实施人id
*/
private String effectUserId;
/**
* 实施人姓名
*/
private String effectUserName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@ApiModelProperty(value = "计划状态")
private String planStatus;
}

View File

@@ -0,0 +1,117 @@
package com.njcn.supervision.pojo.vo.survey;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
/**
*
* Description:
* Date: 2024/5/13 18:35【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class SupervisionGeneralSurveyPlanDetailVO extends BaseEntity {
/**
* 普测计划编号
*/
@MppMultiId(value = "plan_no")
private String planNo;
@ApiModelProperty(value="单位Id")
private String orgNo;
@ApiModelProperty(value="单位名称")
private String orgName;
/**
* 普测计划名称
*/
@ApiModelProperty(value="普测计划名称")
private String planName;
/**
* 计划生成时间
*/
@ApiModelProperty(value="计划生成时间")
private LocalDate planCreateTime;
/**
* 计划开始时间
*/
@ApiModelProperty(value="计划开始时间")
private LocalDate planStartTime;
/**
* 计划结束时间
*/
@ApiModelProperty(value="计划结束时间")
private LocalDate planEndTime;
/**
* 实际完成时间
*/
@ApiModelProperty(value="实际完成时间")
private LocalDate planComplateTime;
/**
* 计划负责人
*/
@ApiModelProperty(value="计划负责人")
private String leader;
/**
* 变电站ID
*/
@MppMultiId(value = "sub_id")
private String subId;
/**
* 变电站名称
*/
@TableField(value = "sub_name")
@ApiModelProperty(value="变电站名称")
private String subName;
/**
* 变电站电压等级
*/
@TableField(value = "voltage_level")
@ApiModelProperty(value="变电站电压等级")
private String voltageLevel;
/**
* 是否生成问题(0:否 1:是)
*/
@TableField(value = "is_problem")
@ApiModelProperty(value="是否生成问题(0:否 1:是)")
private Integer isProblem;
/**
* 文件路径
*/
@ApiModelProperty(value="文件路径")
private String filePath;
/**
* 是否发起告警单
*/
@ApiModelProperty(value="是否发起告警单")
private Integer initiateWarningFlag;
}

View File

@@ -12,6 +12,7 @@ import com.njcn.supervision.pojo.po.user.UserReportSensitivePO;
import com.njcn.supervision.pojo.po.user.UserReportSubstationPO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -33,6 +34,9 @@ public class UserReportVO {
@ApiModelProperty(value = "填报人")
private String reporter;
@ApiModelProperty(value = "填报人名称")
private String reporterName;
/**
* 填报日期
*/
@@ -141,4 +145,18 @@ public class UserReportVO {
private UserReportSensitivePO userReportSensitivePO;
private UserReportSubstationPO userReportSubstationPO;
@Data
@EqualsAndHashCode(callSuper = true)
public static class UserReportGoNetVO extends UserReportVO{
/**
* 入网评估报告和治理报告的文件路径名
*/
@ApiModelProperty(value = "入网评估报告和治理报告的文件路径名")
private String otherReport;
private String userReportId;
}
}

View File

@@ -120,4 +120,5 @@ public class DeVReportManageController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
}
}

View File

@@ -0,0 +1,27 @@
package com.njcn.supervision.controller.device;
import com.njcn.supervision.service.device.ISupervisionTempLineRunTestService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.web.controller.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author cdf
* @since 2024-05-21
*/
@RestController
@RequestMapping("/supervisionTempLineRunTest")
@RequiredArgsConstructor
public class SupervisionTempLineRunTestController extends BaseController {
private final ISupervisionTempLineRunTestService iSupervisionTempLineRunTestService;
}

View File

@@ -59,6 +59,15 @@ public class TempLineController extends BaseController {
Page<SupervisionTempLineReportVO> out = supervisionTempLineReportService.getTempLineReport(supervisionTempLineReportQuery);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getDetail")
@ApiOperation("查询详情")
public HttpResult<SupervisionTempLineReportVO> getDetailTempLine(@RequestParam("id") String id) {
String methodDescribe = getMethodDescribe("getDetailTempLine");
SupervisionTempLineReportVO out = supervisionTempLineReportService.getDetailTempLine(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@GetMapping("/updateStatus")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@Operation(summary = "更改表单状态")

View File

@@ -0,0 +1,100 @@
package com.njcn.supervision.controller.device;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
import com.njcn.supervision.service.device.SupervisionTempLineDebugPOService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* 干扰源用户管理
*
* @author qijian
* @version 1.0.0
* @createTime 2022/11/11 - 9:20
*/
@Slf4j
@RestController
@RequestMapping("/tempLinedebug")
@Api(tags = "临时监测点调试管理")
@AllArgsConstructor
public class TempLineDebugController extends BaseController {
private final SupervisionTempLineDebugPOService supervisionTempLineDebugPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
@PostMapping("/add")
@ApiOperation("新增临时监测点调试管理")
@ApiImplicitParam(name = "supervisionTempLineReportParam", value = "实体参数", required = true)
public HttpResult<String> addTempLineDebug(@RequestBody @Validated SupervisionTempLineDebugParam supervisionTempLineReportParam){
String methodDescribe = getMethodDescribe("addTempLineDebug");
String tempLineId = supervisionTempLineDebugPOService.addTempLineDebug(supervisionTempLineReportParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, tempLineId, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/list")
@ApiOperation("查询联调监测点")
@ApiImplicitParam(name = "supervisionTempLineDebugQuery", value = "参数", required = true)
public HttpResult<Page<SupervisionTempLineDebugVO>> getTempLineDeug(@RequestBody @Validated SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery) {
String methodDescribe = getMethodDescribe("getTempLineDeug");
Page<SupervisionTempLineDebugVO> out = supervisionTempLineDebugPOService.getTempLineDeug(supervisionTempLineDebugQuery);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/pageHasDebug")
@ApiOperation("查询已完成联调监测点")
@ApiImplicitParam(name = "supervisionTempLineDebugQuery", value = "参数", required = true)
public HttpResult<Page<SupervisionTempLineDebugVO>> pageHasDebug(@RequestBody @Validated SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery) {
String methodDescribe = getMethodDescribe("pageHasDebug");
Page<SupervisionTempLineDebugVO> out = supervisionTempLineDebugPOService.pageHasDebug(supervisionTempLineDebugQuery);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getDetail")
@ApiOperation("查询详情")
public HttpResult<SupervisionTempLineDebugVO> getDetailTempLine(@RequestParam("id") String id) {
String methodDescribe = getMethodDescribe("getDetailTempLine");
SupervisionTempLineDebugVO out = supervisionTempLineDebugPOService.getDetailTempLineDebug(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@GetMapping("/updateStatus")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@Operation(summary = "更改表单状态")
public HttpResult<Object> updateStatus(String businessKey,Integer status) {
String methodDescribe = getMethodDescribe("updateStatus");
supervisionTempLineDebugPOService.updateStatus(businessKey,status);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
//
// @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
// @PostMapping("/cancel")
// @ApiOperation("取消设备录入")
// @ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true)
// public HttpResult<String> cancelTempLineReport(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) {
// String methodDescribe = getMethodDescribe("cancelTempLineReport");
// String id = supervisionTempLineReportService.cancelTempLineReport(cancelReqVO);
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
// }
}

View File

@@ -0,0 +1,65 @@
package com.njcn.supervision.controller.leaflet;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.web.controller.BaseController;
/**
* <p>
* 预告警单表 前端控制器
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
@RestController
@RequestMapping("/warningLeaflet")
@Slf4j
@Api(tags = "预告警单表")
@AllArgsConstructor
public class WarningLeafletController extends BaseController {
private final IWarningLeafletService warningLeafletService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/warningPageData")
@ApiOperation("分页查询当前用户能看到的预警单数据")
@ApiImplicitParam(name = "warningLeafletQueryParam", value = "参数", required = true)
public HttpResult<Page<WarningLeafletVO>> warningPageData(@RequestBody @Validated WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) {
String methodDescribe = getMethodDescribe("warningPageData");
Page<WarningLeafletVO> out = warningLeafletService.warningPageData(warningLeafletQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/alarmPageData")
@ApiOperation("分页查询当前用户能看到的告警单数据")
@ApiImplicitParam(name = "warningLeafletQueryParam", value = "参数", required = true)
public HttpResult<Page<WarningLeafletVO>> alarmPageData(@RequestBody @Validated WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) {
String methodDescribe = getMethodDescribe("alarmPageData");
Page<WarningLeafletVO> out = warningLeafletService.alarmPageData(warningLeafletQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
}

View File

@@ -0,0 +1,87 @@
package com.njcn.supervision.controller.plan;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.param.plan.SupervisionPlanParam;
import com.njcn.supervision.pojo.vo.plan.SupervisionPlanVO;
import com.njcn.supervision.service.plan.SupervisionPlanPOService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* 干扰源用户管理
*
* @author qijian
* @version 1.0.0
* @createTime 2022/11/11 - 9:20
*/
@Slf4j
@RestController
@RequestMapping("/superPlan")
@Api(tags = "技术监督计划")
@AllArgsConstructor
public class SupervisionPlanController extends BaseController {
private final SupervisionPlanPOService supervisionPlanPOService;
@PostMapping("addPlan")
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@ApiOperation("新增技术监督计划")
@ApiImplicitParam(name = "supvPlanParam",value = "请求体",required = true)
public HttpResult<Object> addPlan(@RequestBody @Validated SupervisionPlanParam supvPlanParam){
String methodDescribe = getMethodDescribe("addPlan");
String id = supervisionPlanPOService.addPlan(supvPlanParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
}
@PostMapping("pagePlan")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("分页查询监督计划")
@ApiImplicitParam(name = "supvPlanParam",value = "请求体",required = true)
public HttpResult<Page<SupervisionPlanVO>> pagePlan(@RequestBody SupervisionPlanParam supvPlanParam){
String methodDescribe = getMethodDescribe("pagePlan");
Page<SupervisionPlanVO> page = supervisionPlanPOService.pagePlan(supvPlanParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/initiateAudit")
@ApiOperation("发起审核")
public HttpResult<String> initiateAudit(@RequestParam("id") String id) {
String methodDescribe = getMethodDescribe("initiateAudit");
String processId = supervisionPlanPOService.initiateAudit(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, processId, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getDetail")
@ApiOperation("查询详情")
public HttpResult<SupervisionPlanVO> getDetailPlan(@RequestParam("id") String id) {
String methodDescribe = getMethodDescribe("getDetailPlan");
SupervisionPlanVO out = supervisionPlanPOService.getDetailPlan(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@GetMapping("/updateStatus")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@Operation(summary = "更改表单状态")
public HttpResult<Object> updateStatus(String businessKey,Integer status) {
String methodDescribe = getMethodDescribe("updateStatus");
supervisionPlanPOService.updateStatus(businessKey,status);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
}

View File

@@ -0,0 +1,71 @@
package com.njcn.supervision.controller.plan;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.param.plan.SupervisopnProblemParam;
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
import com.njcn.supervision.service.plan.SupervisionProblemPOService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 干扰源用户管理
*
* @author qijian
* @version 1.0.0
* @createTime 2022/11/11 - 9:20
*/
@Slf4j
@RestController
@RequestMapping("/superProblem")
@Api(tags = "技术监督计划问题")
@AllArgsConstructor
public class SupervisionProblemController extends BaseController {
private final SupervisionProblemPOService supervisionProblemPOService;
@PostMapping("addProblem")
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@ApiOperation("新增技术监督问题")
@ApiImplicitParam(name = "supvProblemParam",value = "请求体",required = true)
public HttpResult<Object> addProblem(@RequestBody @Validated SupervisopnProblemParam supvProblemParam){
String methodDescribe = getMethodDescribe("addProblem");
supervisionProblemPOService.addProblem(supvProblemParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@PostMapping("pageProblem")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("分页查询监督问题")
@ApiImplicitParam(name = "supvProblemParam",value = "请求体",required = true)
public HttpResult<Page<SupervisionProblemPO>> pageProblem(@RequestBody SupervisopnProblemParam supvProblemParam){
String methodDescribe = getMethodDescribe("pageProblem");
if(StrUtil.isBlank(supvProblemParam.getPlanId())){
throw new BusinessException("监督计划索引不可为空");
}
Page<SupervisionProblemPO> page = supervisionProblemPOService.pageProblem(supvProblemParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -10,6 +10,7 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO;
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO;
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanPOService;
import com.njcn.web.controller.BaseController;
@@ -25,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 干扰源用户管理
* 谐波普测计划
*
* @author qijian
* @version 1.0.0
@@ -64,7 +65,6 @@ public class GeneralSurveyController extends BaseController {
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/removeSurvey")
@ApiOperation("移除普测计划")
@@ -112,7 +112,7 @@ public class GeneralSurveyController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
@PostMapping("/cancel")
@ApiOperation("取消普测计划")
@ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true)
@@ -123,4 +123,25 @@ public class GeneralSurveyController extends BaseController {
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/pageProblemSubstationBySurvey")
@ApiOperation("分页查询当前用户能看到的普测计划中存在超标问题")
@ApiImplicitParam(name = "generalSurveyPlanQueryParam", value = "参数", required = true)
public HttpResult<Page<SupervisionGeneralSurveyPlanDetailVO>> getPageProblemSubstationBySurvey(@RequestBody @Validated SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam ){
String methodDescribe = getMethodDescribe("pageProblemSubstationBySurvey");
Page<SupervisionGeneralSurveyPlanDetailVO> out = supervisionGeneralSurveyPlanPOService.pageProblemSubstationBySurvey(generalSurveyPlanQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/initiateWarningLeaflet")
@ApiOperation("针对有问题的现场测试发起告警单")
public HttpResult<Boolean> initiateWarningLeaflet(@RequestParam("id") String id,@RequestParam("subId") String subId){
String methodDescribe = getMethodDescribe("initiateWarningLeaflet");
supervisionGeneralSurveyPlanPOService.initiateWarningLeaflet(id,subId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Boolean.TRUE, methodDescribe);
}
}

View File

@@ -0,0 +1,77 @@
package com.njcn.supervision.controller.user;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.param.user.UserReportNormalParam;
import com.njcn.supervision.pojo.vo.user.UserReportVO;
import com.njcn.supervision.service.user.IUserReportNormalService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 干扰源用户常态化管理 前端控制器
* </p>
*
* @author hongawen
* @since 2024-05-17
*/
@RestController
@RequestMapping("userReportNormal")
@RequiredArgsConstructor
public class UserReportNormalController extends BaseController {
private final IUserReportNormalService iUserReportNormalService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
@PostMapping("/addUserReportNormal")
@ApiOperation("新增干扰源常态化管理")
@ApiImplicitParam(name = "userReportNormalParam", value = "实体参数", required = true)
public HttpResult<String> addUserReport(@RequestBody @Validated UserReportNormalParam userReportNormalParam){
String methodDescribe = getMethodDescribe("addUserReport");
String userReportId = iUserReportNormalService.addUserNormal(userReportNormalParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportId, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/userReportGoNetPage")
@ApiOperation("分页查询干扰源常态化页面")
@ApiImplicitParam(name = "userReportNormalParam", value = "实体参数", required = true)
public HttpResult<Page<UserReportVO.UserReportGoNetVO>> userReportGoNetPage(@RequestBody @Validated UserReportNormalParam userReportNormalParam){
String methodDescribe = getMethodDescribe("userReportGoNetPage");
Page<UserReportVO.UserReportGoNetVO> userReportId = iUserReportNormalService.userReportGoNetPage(userReportNormalParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportId, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/userReportGoNetById")
@ApiOperation("查询干扰源常态化详情")
public HttpResult<UserReportVO.UserReportGoNetVO> userReportGoNetById(@RequestParam("id")String id){
String methodDescribe = getMethodDescribe("userReportGoNetById");
UserReportVO.UserReportGoNetVO userReport = iUserReportNormalService.userReportGoNetById(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReport, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
@GetMapping("/updateUserReportNormalStatus")
@ApiOperation("修改业务审核状态")
public HttpResult<Object> updateUserReportNormalStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status){
String methodDescribe = getMethodDescribe("updateUserReportNormalStatus");
iUserReportNormalService.updateUserReportNormalStatus(businessKey,status);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
}
}

View File

@@ -0,0 +1,24 @@
package com.njcn.supervision.mapper.device;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
import org.apache.ibatis.annotations.Param;
/**
*
* Description:
* Date: 2024/5/17 15:26【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface SupervisionTempLineDebugPOMapper extends BaseMapper<SupervisionTempLineDebugPO> {
Page<SupervisionTempLineDebugVO> page(@Param("page")Page<Object> objectPage, @Param("ew") QueryWrapper<SupervisionDevMainReportVO> queryWrapper);
Page<SupervisionTempLineDebugVO> pageHasDebug(@Param("page")Page<Object> objectPage, @Param("ew") QueryWrapper<SupervisionDevMainReportVO> queryWrapper);
}

View File

@@ -0,0 +1,17 @@
package com.njcn.supervision.mapper.device;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTest;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
public interface SupervisionTempLineRunTestMapper extends BaseMapper<SupervisionTempLineRunTest> {
}

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO">
<!--@mbg.generated-->
<!--@Table supervision_temp_line_debug-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="process_instance_id" jdbcType="VARCHAR" property="processInstanceId" />
<result column="status" jdbcType="BIT" property="status" />
<result column="Create_By" jdbcType="CHAR" property="createBy" />
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="State" jdbcType="BIT" property="state" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, reason, process_instance_id, `status`, Create_By, Create_Time, Update_By, Update_Time,
`State`
</sql>
<select id="page" resultType="com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO">
SELECT
supervision_temp_line_report.id id,
supervision_temp_line_report.line_id lineId,
supervision_temp_line_report.line_name lineName,
supervision_temp_line_debug.reason reason,
supervision_temp_line_debug.process_instance_id process_instanceId,
supervision_temp_line_debug.`status` `Status`
FROM
supervision_temp_line_report left
JOIN supervision_temp_line_debug ON supervision_temp_line_report.id = supervision_temp_line_debug.id
where supervision_temp_line_report.`status`=2
and ${ew.sqlSegment}
</select>
<select id="pageHasDebug" resultType="com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO">
SELECT
supervision_temp_line_report.id id,
supervision_temp_line_report.user_name,
supervision_temp_line_report.connected_bus,
supervision_temp_line_report.monitoring_terminal_code,
supervision_temp_line_report.monitoring_terminal_name,
supervision_temp_line_report.Power_Substation_Name,
supervision_temp_line_report.line_id lineId,
supervision_temp_line_report.line_name lineName,
supervision_temp_line_debug.reason reason,
supervision_temp_line_run_test.process_instance_id process_instanceId,
supervision_temp_line_run_test.`status` `Status`,
IFNULL(supervision_temp_line_run_test.`test_run_state`,0) `testRunState`
FROM
supervision_temp_line_debug
inner JOIN supervision_temp_line_report ON supervision_temp_line_report.id = supervision_temp_line_debug.id
left join supervision_temp_line_run_test on supervision_temp_line_debug.id = supervision_temp_line_run_test.id
where supervision_temp_line_debug.`status`=2
and ${ew.sqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.supervision.device.mapper.SupervisionTempLineRunTestMapper">
</mapper>

View File

@@ -0,0 +1,23 @@
package com.njcn.supervision.mapper.leaflet;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* 预告警单表 Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
public interface WarningLeafletMapper extends BaseMapper<WarningLeaflet> {
Page<WarningLeafletVO> warningPageData(Page<Object> objectPage, @Param("ew") QueryWrapper<WarningLeafletVO> warningLeafletVOQueryWrapper);
Page<WarningLeafletVO> alarmPageData(Page<Object> objectPage, @Param("ew") QueryWrapper<WarningLeafletVO> warningLeafletVOQueryWrapper);
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.supervision.mapper.leaflet.WarningLeafletMapper">
<select id="warningPageData" resultType="WarningLeafletVO">
SELECT supervision_warning_leaflet.*
FROM supervision_warning_leaflet supervision_warning_leaflet
WHERE ${ew.sqlSegment}
</select>
<select id="alarmPageData" resultType="WarningLeafletVO">
SELECT supervision_warning_leaflet.*
FROM supervision_warning_leaflet supervision_warning_leaflet
WHERE ${ew.sqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,15 @@
package com.njcn.supervision.mapper.plan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.supervision.pojo.po.plan.SupervisionPlanPO;
/**
*
* Description:
* Date: 2024/5/20 17:49【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface SupervisionPlanPOMapper extends BaseMapper<SupervisionPlanPO> {
}

View File

@@ -0,0 +1,15 @@
package com.njcn.supervision.mapper.plan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
/**
*
* Description:
* Date: 2024/5/20 19:50【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface SupervisionProblemPOMapper extends BaseMapper<SupervisionProblemPO> {
}

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.supervision.mapper.plan.SupervisionPlanPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.supervision.pojo.po.plan.SupervisionPlanPO">
<!--@mbg.generated-->
<!--@Table supervision_plan-->
<id column="plan_Id" jdbcType="CHAR" property="planId" />
<result column="work_plan_name" jdbcType="VARCHAR" property="workPlanName" />
<result column="supv_Type" jdbcType="CHAR" property="supvType" />
<result column="supv_Stage" jdbcType="CHAR" property="supvStage" />
<result column="supv_Org_Id" jdbcType="CHAR" property="supvOrgId" />
<result column="plan_User_Id" jdbcType="CHAR" property="planUserId" />
<result column="plan_Org_Id" jdbcType="CHAR" property="planOrgId" />
<result column="other_Remark" jdbcType="VARCHAR" property="otherRemark" />
<result column="effect_Start_Time" jdbcType="TIMESTAMP" property="effectStartTime" />
<result column="effect_End_Time" jdbcType="TIMESTAMP" property="effectEndTime" />
<result column="effect_Status" jdbcType="CHAR" property="effectStatus" />
<result column="plan_Supv_Date" jdbcType="TIMESTAMP" property="planSupvDate" />
<result column="supv_Obj_Type" jdbcType="CHAR" property="supvObjType" />
<result column="supv_Obj_Name" jdbcType="VARCHAR" property="supvObjName" />
<result column="obj_Voltage_Level" jdbcType="CHAR" property="objVoltageLevel" />
<result column="substation_Name" jdbcType="CHAR" property="substationName" />
<result column="substation_Voltage_Level" jdbcType="CHAR" property="substationVoltageLevel" />
<result column="obj_Type" jdbcType="VARCHAR" property="objType" />
<result column="obj_Type_Name" jdbcType="VARCHAR" property="objTypeName" />
<result column="obj_Capacity" jdbcType="DOUBLE" property="objCapacity" />
<result column="report_Issue_Time" jdbcType="TIMESTAMP" property="reportIssueTime" />
<result column="problem_Oc_Time" jdbcType="TIMESTAMP" property="problemOcTime" />
<result column="delete_Flag" jdbcType="CHAR" property="deleteFlag" />
<result column="plan_Status" jdbcType="CHAR" property="planStatus" />
<result column="delete_Time" jdbcType="TIMESTAMP" property="deleteTime" />
<result column="effect_User_Id" jdbcType="CHAR" property="effectUserId" />
<result column="effect_User_Name" jdbcType="CHAR" property="effectUserName" />
<result column="is_upload_head" jdbcType="BIT" property="isUploadHead" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="CHAR" property="createBy" />
<result column="update_by" jdbcType="CHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
plan_Id, work_plan_name, supv_Type, supv_Stage, supv_Org_Id, plan_User_Id, plan_Org_Id,
other_Remark, effect_Start_Time, effect_End_Time, effect_Status, plan_Supv_Date,
supv_Obj_Type, supv_Obj_Name, obj_Voltage_Level, substation_Name, substation_Voltage_Level,
obj_Type, obj_Type_Name, obj_Capacity, report_Issue_Time, problem_Oc_Time, delete_Flag,
plan_Status, delete_Time, effect_User_Id, effect_User_Name, is_upload_head, create_time,
create_by, update_by, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.supervision.mapper.plan.SupervisionProblemPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.supervision.pojo.po.plan.SupervisionProblemPO">
<!--@mbg.generated-->
<!--@Table supervision_problem-->
<id column="problem_Id" jdbcType="CHAR" property="problemId" />
<result column="plan_id" jdbcType="CHAR" property="planId" />
<result column="duty_Org_Id" jdbcType="CHAR" property="dutyOrgId" />
<result column="monitor_Type" jdbcType="CHAR" property="monitorType" />
<result column="rectification_Time" jdbcType="TIMESTAMP" property="rectificationTime" />
<result column="plan_Rectification_Time" jdbcType="TIMESTAMP" property="planRectificationTime" />
<result column="if_Release_Warning" jdbcType="BIT" property="ifReleaseWarning" />
<result column="problem_Desc" jdbcType="VARCHAR" property="problemDesc" />
<result column="simple_Problem_Desc" jdbcType="VARCHAR" property="simpleProblemDesc" />
<result column="supv_Standard_Sort" jdbcType="VARCHAR" property="supvStandardSort" />
<result column="supv_Standard" jdbcType="VARCHAR" property="supvStandard" />
<result column="supv_Resouce" jdbcType="VARCHAR" property="supvResouce" />
<result column="problem_Level" jdbcType="VARCHAR" property="problemLevel" />
<result column="problem_Level_Reason" jdbcType="VARCHAR" property="problemLevelReason" />
<result column="problem_Type" jdbcType="VARCHAR" property="problemType" />
<result column="rectification_Programme" jdbcType="VARCHAR" property="rectificationProgramme" />
<result column="rectification_Measure" jdbcType="VARCHAR" property="rectificationMeasure" />
<result column="rectification_Status" jdbcType="VARCHAR" property="rectificationStatus" />
<result column="is_Upload_Head" jdbcType="BIT" property="isUploadHead" />
<result column="discovery_Time" jdbcType="TIMESTAMP" property="discoveryTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
problem_Id, plan_id, duty_Org_Id, monitor_Type, rectification_Time, plan_Rectification_Time,
if_Release_Warning, problem_Desc, simple_Problem_Desc, supv_Standard_Sort, supv_Standard,
supv_Resouce, problem_Level, problem_Level_Reason, problem_Type, rectification_Programme,
rectification_Measure, rectification_Status, is_Upload_Head, discovery_Time, remark,
create_by, update_by, create_time, update_time
</sql>
</mapper>

View File

@@ -4,11 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO;
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
import org.apache.ibatis.annotations.Param;
/**
*
* Description:
* Date: 2024/5/13 18:35【需求编号】
*
@@ -17,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
*/
public interface SupervisionGeneralSurveyPlanPOMapper extends BaseMapper<SupervisionGeneralSurveyPlanPO> {
Page<SupervisionGeneralSurveyPlanVO> page(Page<Object> objectPage, @Param("ew") QueryWrapper<SupervisionGeneralSurveyPlanVO> queryWrapper);
Page<SupervisionGeneralSurveyPlanDetailVO> pageProblemSubstationBySurvey(Page<Object> objectPage, @Param("ew") QueryWrapper<SupervisionGeneralSurveyPlanDetailVO> supervisionGeneralSurveyPlanDetailVOQueryWrapper);
}

View File

@@ -4,26 +4,26 @@
<resultMap id="BaseResultMap" type="com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO">
<!--@mbg.generated-->
<!--@Table supervision_general_survey_plan-->
<id column="plan_no" jdbcType="VARCHAR" property="planNo" />
<result column="org_no" jdbcType="VARCHAR" property="orgNo" />
<result column="plan_name" jdbcType="VARCHAR" property="planName" />
<result column="plan_create_time" jdbcType="DATE" property="planCreateTime" />
<result column="plan_start_time" jdbcType="DATE" property="planStartTime" />
<result column="plan_end_time" jdbcType="DATE" property="planEndTime" />
<result column="plan_complate_time" jdbcType="DATE" property="planComplateTime" />
<result column="leader" jdbcType="VARCHAR" property="leader" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="is_file_upload" jdbcType="TINYINT" property="isFileUpload" />
<result column="file_count" jdbcType="INTEGER" property="fileCount" />
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="process_instance_id" jdbcType="VARCHAR" property="processInstanceId" />
<result column="upload_time" jdbcType="DATE" property="uploadTime" />
<result column="Create_By" jdbcType="CHAR" property="createBy" />
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="State" jdbcType="BIT" property="state" />
<id column="plan_no" jdbcType="VARCHAR" property="planNo"/>
<result column="org_no" jdbcType="VARCHAR" property="orgNo"/>
<result column="plan_name" jdbcType="VARCHAR" property="planName"/>
<result column="plan_create_time" jdbcType="DATE" property="planCreateTime"/>
<result column="plan_start_time" jdbcType="DATE" property="planStartTime"/>
<result column="plan_end_time" jdbcType="DATE" property="planEndTime"/>
<result column="plan_complate_time" jdbcType="DATE" property="planComplateTime"/>
<result column="leader" jdbcType="VARCHAR" property="leader"/>
<result column="status" jdbcType="TINYINT" property="status"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="is_file_upload" jdbcType="TINYINT" property="isFileUpload"/>
<result column="file_count" jdbcType="INTEGER" property="fileCount"/>
<result column="file_path" jdbcType="VARCHAR" property="filePath"/>
<result column="process_instance_id" jdbcType="VARCHAR" property="processInstanceId"/>
<result column="upload_time" jdbcType="DATE" property="uploadTime"/>
<result column="Create_By" jdbcType="CHAR" property="createBy"/>
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="Update_By" jdbcType="CHAR" property="updateBy"/>
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="State" jdbcType="BIT" property="state"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
@@ -33,9 +33,27 @@
</sql>
<select id="page" resultType="com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO">
SELECT
*
SELECT *
FROM supervision_general_survey_plan supervision_general_survey_plan
WHERE ${ew.sqlSegment}
</select>
<!--查询现场测试有问题的数据-->
<select id="pageProblemSubstationBySurvey"
resultType="SupervisionGeneralSurveyPlanDetailVO">
SELECT supervision_general_survey_plan_detail.*,
supervision_general_survey_plan.org_no,
supervision_general_survey_plan.plan_name,
supervision_general_survey_plan.plan_create_time,
supervision_general_survey_plan.plan_start_time,
supervision_general_survey_plan.plan_end_time,
supervision_general_survey_plan.plan_complate_time,
supervision_general_survey_plan.leader,
supervision_general_survey_plan.file_path
FROM supervision_general_survey_plan_detail supervision_general_survey_plan_detail
left join
supervision_general_survey_plan supervision_general_survey_plan
on supervision_general_survey_plan_detail.plan_no = supervision_general_survey_plan.plan_no
WHERE ${ew.sqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,17 @@
package com.njcn.supervision.mapper.user;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.supervision.pojo.po.user.UserReportNormalPO;
/**
* <p>
* 干扰源用户常态化管理 Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-05-17
*/
public interface UserReportNormalMapper extends BaseMapper<UserReportNormalPO> {
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.supervision.device.mapper.UserReportNormalMapper">
</mapper>

View File

@@ -0,0 +1,17 @@
package com.njcn.supervision.service.device;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTest;
/**
* <p>
* 服务类
* </p>
*
* @author hongawen
* @since 2024-05-21
*/
public interface ISupervisionTempLineRunTestService extends IService<SupervisionTempLineRunTest> {
}

View File

@@ -0,0 +1,28 @@
package com.njcn.supervision.service.device;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
/**
* Description:
* Date: 2024/5/17 15:26【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface SupervisionTempLineDebugPOService extends IService<SupervisionTempLineDebugPO> {
String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam);
Page<SupervisionTempLineDebugVO> getTempLineDeug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery);
Page<SupervisionTempLineDebugVO> pageHasDebug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery);
SupervisionTempLineDebugVO getDetailTempLineDebug(String id);
void updateStatus(String businessKey, Integer status);
}

View File

@@ -25,4 +25,6 @@ public interface SupervisionTempLineReportService extends IService<SupervisionTe
void updateStatus(String businessKey, Integer status);
String cancelTempLineReport(BpmProcessInstanceCancelParam cancelReqVO);
SupervisionTempLineReportVO getDetailTempLine(String id);
}

Some files were not shown because too many files have changed in this diff Show More