137 Commits

Author SHA1 Message Date
hzj
99ab77dcf0 暂降原因暂降类型那边没兼容大小写后缀 2026-02-03 13:42:28 +08:00
hzj
c772c9cd81 修改定版bug 2026-02-02 16:36:30 +08:00
cdf
996ec87ea8 适配达梦 2026-02-01 13:53:43 +08:00
hzj
b6eaff3b1e 修改定版bug 2026-01-30 14:58:15 +08:00
hzj
56bf5bb7c9 修改bug 2026-01-30 10:17:13 +08:00
wr
7410d32241 Merge remote-tracking branch 'origin/main' 2026-01-29 14:15:18 +08:00
wr
41ba37b723 河北数据中台业务参数调整 2026-01-29 10:30:13 +08:00
wr
3f77d30cfd 1.监测点异常统计报表调整 2026-01-28 11:26:52 +08:00
cdf
f71f87ced4 一键分配装置前置进程 2026-01-28 10:39:18 +08:00
xy
32295f60c0 报表添加接线方式、一二次值判断 2026-01-28 08:43:04 +08:00
hzj
d2945b0fb2 bug修改 2026-01-27 15:33:15 +08:00
hzj
133766a2c7 bug修改 2026-01-27 13:47:35 +08:00
xy
2a5a5087ad 微调 2026-01-26 19:30:33 +08:00
xy
4edb27d20b Merge remote-tracking branch 'origin/main' 2026-01-26 19:28:47 +08:00
xy
71d6636be0 物联短信发送调整 2026-01-26 19:28:37 +08:00
hzj
8ccdb84ea9 Merge remote-tracking branch 'origin/main' 2026-01-26 15:04:32 +08:00
hzj
5389903ed7 暂态模块bug修改 2026-01-26 15:02:25 +08:00
wr
0684bdf503 Merge remote-tracking branch 'origin/main' 2026-01-26 15:00:34 +08:00
wr
d0b4a1ec71 1.监测点异常统计报表 2026-01-23 10:19:55 +08:00
cdf
764ca4a12a 暂降模块调整 2026-01-22 21:54:52 +08:00
hzj
ca992cadbc Merge remote-tracking branch 'origin/main' 2026-01-21 15:02:56 +08:00
hzj
ed166cf1e0 终端删除后,终端日志记录名称修改 2026-01-21 15:02:47 +08:00
cdf
598fa803a1 谐波模块切换动态数据源 2026-01-20 20:43:35 +08:00
cdf
10050ce418 动态数据源 2026-01-19 22:26:43 +08:00
cdf
cb688ad7ad 动态数据源 2026-01-19 20:48:25 +08:00
xy
f6c4d050da 新建物联mapper文件 2026-01-19 14:02:14 +08:00
hzj
fd6ec7bdf2 word报表bug修改 2026-01-19 13:36:36 +08:00
hzj
ca7f1010b0 ITIC曲线画图区间问题 2026-01-19 09:35:26 +08:00
cdf
97ddd133f0 微调 2026-01-18 12:36:33 +08:00
cdf
735c99e8ac 微调 2026-01-18 12:35:42 +08:00
cdf
9a53399ec9 微调 2026-01-18 10:48:33 +08:00
cdf
f27276624a 微调 2026-01-18 10:47:31 +08:00
cdf
df149a3cc2 微调 2026-01-17 20:56:30 +08:00
cdf
7ca23b9431 暂降监测点报告抽取公共方法 2026-01-17 20:25:03 +08:00
cdf
b27f049c9f 监测点报告抽取公共方法 2026-01-17 13:43:24 +08:00
23c4a78383 日志记录改造由mqtt异步改造为redis list实现,TPS满足:150-200条/秒 2026-01-16 15:14:16 +08:00
hzj
c9301d1f8f 修改暂态报告里持续时间单位 2026-01-16 14:43:58 +08:00
hzj
977a0e7a35 暂降区域统计修改暂态事件统计类型:暂降改成不是录波 2026-01-16 11:19:48 +08:00
hzj
9143ff5b80 暂降统计添加中断类型 2026-01-16 09:17:29 +08:00
xy
0502dc7508 基于云平台系统功能调整 2026-01-14 20:31:58 +08:00
cdf
eb689c9852 bug调整 2026-01-14 11:04:12 +08:00
wr
c576bd3bf7 1.阿里云oss中间件 2026-01-13 16:21:33 +08:00
27bac7288c 1.报告微调 2026-01-12 16:49:42 +08:00
a7c69f7c43 1.暂降报告微调 2026-01-12 10:26:41 +08:00
33ab825497 1.微调 2026-01-12 10:12:37 +08:00
22c8ff3b22 1.稳态监测点报告bug修改 2026-01-09 16:00:57 +08:00
hzj
875d114733 Merge remote-tracking branch 'origin/main' 2026-01-09 15:14:22 +08:00
hzj
bd1fe68060 修复污区图空指针bug 2026-01-09 15:13:55 +08:00
c1d933467e 曲靖表格数据提供 2026-01-09 11:42:17 +08:00
wr
e7daf05670 Merge remote-tracking branch 'origin/main' 2026-01-09 09:39:30 +08:00
wr
e251fc6a1a 1.异常数据界面业务调整
2.解决全景监测点详情跳转台账数据不准确稳
2026-01-09 09:37:14 +08:00
0e7cc360f7 1.稳态区域报告功能微调 2026-01-08 16:51:56 +08:00
e2d3394669 1.稳态区域报告功能微调 2026-01-08 16:36:36 +08:00
b3ab5d2587 1.新增稳态区域报告功能 2026-01-08 13:52:09 +08:00
hzj
ed029139d3 稳态word报告,基波电流基波电压错误,长闪短闪错乱,2-25电压含有率,电流幅值错乱修改 2026-01-08 09:51:35 +08:00
xy
02578546f2 基于云平台系统功能调整 2026-01-07 19:21:21 +08:00
hzj
09e2f329b7 海南bug修改提交 2026-01-07 11:32:03 +08:00
hzj
ee2fae105b 海南bug修改提交 2026-01-07 10:10:59 +08:00
82efce189a 曲靖3层树特殊处理 2026-01-07 08:50:51 +08:00
hzj
be8c14625f 海南bug修改提交 2026-01-05 20:33:45 +08:00
95a571d3c3 Merge remote-tracking branch 'origin/main' 2026-01-05 16:55:53 +08:00
322001150a 1.监测点稳态报表bug修改 2026-01-05 16:55:47 +08:00
hzj
b805bda25b 海南bug修改提交 2026-01-05 11:20:23 +08:00
f592f2b580 1.监测点稳态报告cp95值逻辑调整 2026-01-05 10:45:26 +08:00
wr
184b2b8fad Merge remote-tracking branch 'origin/main' 2026-01-04 14:54:04 +08:00
wr
fe029fcb95 1.异常数据界面业务调整
2.技术监督增加仿真治理方案
2026-01-04 14:50:03 +08:00
hzj
9143466ce7 海南bug修改提交 2025-12-29 15:29:51 +08:00
hzj
9409d57243 海南bug修改提交 2025-12-29 14:26:30 +08:00
63603dee08 海南数据不一致问题处理 2025-12-29 10:34:38 +08:00
wr
e35bbd9b34 Merge remote-tracking branch 'origin/main' 2025-12-29 09:27:20 +08:00
wr
ea2173fff4 增加二级评估用户绑定 2025-12-29 09:27:03 +08:00
faac7953d3 海南数据不一致问题处理 2025-12-26 15:29:33 +08:00
xy
c3cc39973e Merge remote-tracking branch 'origin/main' 2025-12-26 11:24:40 +08:00
xy
6d8bfacd0a 在线监测算法每日更新导致告警单丢失问题 2025-12-26 11:24:22 +08:00
wr
ab5d28e3cb 变电站台账数据调整 2025-12-26 11:23:47 +08:00
wr
2dccb22cf8 Merge remote-tracking branch 'origin/main' 2025-12-26 11:22:51 +08:00
xy
6b0bad6047 微调 2025-12-25 20:44:52 +08:00
9ffbdbdf57 驾驶舱全局处理 2025-12-25 20:39:28 +08:00
wr
778f689b3e 优化异常数据和稳态告警接口信息 2025-12-25 15:32:21 +08:00
hzj
917e3fb2d5 海南bug修改提交 2025-12-23 11:40:18 +08:00
cdf
e0f1e314a4 组件管理加排序 2025-12-23 09:33:18 +08:00
cdf
2f2ed06a35 组件管理加排序 2025-12-22 19:59:25 +08:00
xy
277400670d 微调 2025-12-22 14:11:16 +08:00
xy
a1031109c4 微调 2025-12-22 10:09:15 +08:00
cdf
eeb27c519b sql适配大梦数据库 2025-12-19 16:15:55 +08:00
wr
670eaf7d38 微调 2025-12-19 10:19:59 +08:00
xy
2b79cefad6 微调 2025-12-19 10:18:13 +08:00
xy
212db18835 新增异常数据问题 2025-12-18 22:24:03 +08:00
wr
e9a1c34160 调整异常数据界面业务 2025-12-18 22:22:36 +08:00
wr
fb7a2b7084 调整异常数据界面业务 2025-12-17 19:25:08 +08:00
wr
4b3ec39a11 Merge remote-tracking branch 'origin/main' 2025-12-16 18:25:33 +08:00
wr
2d255a5dd3 微调 2025-12-16 18:23:43 +08:00
hzj
614647d36d Merge remote-tracking branch 'origin/main' 2025-12-16 16:23:57 +08:00
hzj
a899614c89 添加注释 2025-12-16 16:22:53 +08:00
wr
2543f87dd2 Merge remote-tracking branch 'origin/main' 2025-12-16 15:37:53 +08:00
wr
c5074df93d 1.调整台账管理变电站搜索
2.解决优化部分台账信息
2025-12-16 13:57:04 +08:00
24e4c4de37 调整bug 2025-12-16 13:48:59 +08:00
wr
4f70566c65 微调 2025-12-15 19:14:23 +08:00
wr
dc11d34add 微调 2025-12-15 18:20:42 +08:00
xy
9f3bb52d9a 微调 2025-12-15 16:41:23 +08:00
wr
567ba2f56e 微调 2025-12-15 14:33:48 +08:00
wr
371d4efb29 微调 2025-12-15 13:56:14 +08:00
wr
47b08d4797 1.调整全景稳态统计超标监测点占比
2.优化稳态word报告
2025-12-15 13:32:38 +08:00
xy
65805e4f50 微调 2025-12-15 13:25:12 +08:00
xy
41d555121c 添加电网标识字段 2025-12-14 22:28:10 +08:00
wr
4d48b42c98 完善全景详情监测点超标信息 2025-12-14 16:43:17 +08:00
wr
f5e1fac55d 微调 2025-12-14 15:42:55 +08:00
wr
cebda9323e 增加暂态信息搜索,调整全景区域污染值逻辑 2025-12-14 14:24:15 +08:00
xy
d09f1472a9 代码优化 2025-12-14 00:55:49 +08:00
xy
b9696e957d 代码优化 2025-12-13 23:59:26 +08:00
xy
12cfecac7e 敏感用户污染值统计 2025-12-13 20:33:08 +08:00
xy
3a97f01383 地市合格率报错 2025-12-13 11:11:50 +08:00
wr
10273dd2b0 调整全景监测点详情里,监测点超标为只为谐波电压超标 2025-12-13 11:09:23 +08:00
wr
5e8e03cbb1 微调 2025-12-12 17:53:21 +08:00
wr
b103141a54 1.技术监督修改 2025-12-12 17:33:04 +08:00
wr
a6d2d6ed47 1.全景增加技术监督计划调整
2.增加暂态列表信息和监测点评估信息
2025-12-12 15:01:29 +08:00
xy
601a78246e 代码优化 2025-12-12 14:58:35 +08:00
xy
5e7b973d5f 1.稳态告警查询优化 2.在线监测数据异常排查 2025-12-11 15:04:31 +08:00
wr
e89c6a2888 1.全景增加暂态信息和调整告警条件
2.增加暂态列表信息和冀北树污染值条件
2025-12-11 15:02:52 +08:00
xy
2166529b4d Merge remote-tracking branch 'origin/main' 2025-12-10 16:25:57 +08:00
xy
2117e16b61 1.修改全景稳态告警数据不一致问题 2.初步修改在线监测功能 2025-12-10 16:25:38 +08:00
wr
054d5534a8 微调 2025-12-10 16:25:04 +08:00
wr
c03a516931 Merge remote-tracking branch 'origin/main' 2025-12-10 16:22:42 +08:00
wr
0fdc3edb89 1.解决变电站数量不统一问题
2.替换最新污染值
3.解决终端数量不一致问题
2025-12-10 16:19:35 +08:00
a730ad61b1 调整白名单 2025-12-10 15:32:32 +08:00
9b758dc7c9 增加swagger配置 2025-12-10 14:56:01 +08:00
a74dd460d1 Merge remote-tracking branch 'origin/main' 2025-12-10 14:55:48 +08:00
2708aa8b81 增加swagger配置 2025-12-10 14:55:31 +08:00
wr
6d833678a6 微调 2025-12-08 15:08:21 +08:00
xy
be264acd79 功能优化 2025-12-08 15:07:48 +08:00
wr
186d46752c Merge remote-tracking branch 'origin/main' 2025-12-05 15:34:12 +08:00
wr
e03478eeec 终端运行评价,异常数据率 2025-12-05 15:25:10 +08:00
贾同学
0c1bb606d6 feat(user): 支持组件时间标识集合字段 2025-12-03 15:16:31 +08:00
wr
42b619fa56 微调 2025-12-02 16:42:46 +08:00
wr
f0894ca0ed 微调 2025-12-02 16:05:13 +08:00
wr
8a958fa34c Merge remote-tracking branch 'origin/main' 2025-12-02 12:32:21 +08:00
wr
b4e5d0c638 微调 2025-12-01 09:12:29 +08:00
359 changed files with 26997 additions and 11607 deletions

12
pom.xml
View File

@@ -43,7 +43,7 @@
<!-- <middle.server.url>10.95.53.49</middle.server.url>--> <!-- <middle.server.url>10.95.53.49</middle.server.url>-->
<middle.server.url>192.168.1.103</middle.server.url> <middle.server.url>192.168.1.103</middle.server.url>
<!--微服务模块发布地址--> <!--微服务模块发布地址-->
<service.server.url>127.0.0.1</service.server.url> <service.server.url>192.168.2.130</service.server.url>
<!--docker仓库地址--> <!--docker仓库地址-->
<docker.server.url>192.168.1.22</docker.server.url> <docker.server.url>192.168.1.22</docker.server.url>
<!--nacos的ip:port--> <!--nacos的ip:port-->
@@ -53,9 +53,9 @@
<!--nacos的ip:port--> <!--nacos的ip:port-->
<nacos.password>nacos</nacos.password> <nacos.password>nacos</nacos.password>
<!--服务器发布内容为空--> <!--服务器发布内容为空-->
<!-- <nacos.namespace></nacos.namespace>--> <nacos.namespace>hswbpm</nacos.namespace>
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>--> <!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
<nacos.namespace>6fd2d036-f390-46ee-9c9d-d5a5c00e3314</nacos.namespace> <!-- <nacos.namespace>12b467cc-a7e6-411d-8944-090cbfa09dde</nacos.namespace>-->
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>--> <!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
<!-- sentinel:port--> <!-- sentinel:port-->
<sentinel.url>${middle.server.url}:8080</sentinel.url> <sentinel.url>${middle.server.url}:8080</sentinel.url>
@@ -81,6 +81,7 @@
<springcloud.alibaba.version>2.2.7.RELEASE</springcloud.alibaba.version> <springcloud.alibaba.version>2.2.7.RELEASE</springcloud.alibaba.version>
<hutool.version>5.8.11</hutool.version> <hutool.version>5.8.11</hutool.version>
<knife4j.version>3.0.2</knife4j.version> <knife4j.version>3.0.2</knife4j.version>
<postgresql.version>42.3.8</postgresql.version>
<knife4j.aggregation.version>2.0.8</knife4j.aggregation.version> <knife4j.aggregation.version>2.0.8</knife4j.aggregation.version>
<lombok.version>1.18.18</lombok.version> <lombok.version>1.18.18</lombok.version>
<mybatis.version>2.1.3</mybatis.version> <mybatis.version>2.1.3</mybatis.version>
@@ -171,6 +172,11 @@
<artifactId>knife4j-spring-ui</artifactId> <artifactId>knife4j-spring-ui</artifactId>
<version>${knife4j.version}</version> <version>${knife4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
<dependency> <dependency>
<groupId>com.github.xiaoymin</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-aggregation-spring-boot-starter</artifactId> <artifactId>knife4j-aggregation-spring-boot-starter</artifactId>

View File

@@ -83,10 +83,10 @@ public class EventRelevantAnalysisController extends BaseController {
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){ public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
String methodDescribe = getMethodDescribe("queryEventsAssPage"); String methodDescribe = getMethodDescribe("queryEventsAssPage");
String searchValue = baseParam.getSearchValue(); String searchValue = baseParam.getSearchValue();
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX); // Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
if(pattern.matcher(searchValue).find()){ // if(pattern.matcher(searchValue).find()){
throw new BusinessException(ValidMessage.SPECIAL_REGEX); // throw new BusinessException(ValidMessage.SPECIAL_REGEX);
} // }
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam); Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
} }

View File

@@ -565,7 +565,7 @@ public class SecondaryEvaluationServiceImpl implements SecondaryEvaluationServic
unblance.add(evaluationResult); unblance.add(evaluationResult);
evaluationResult = new AssessResultVO.EvaluationResult(); evaluationResult = new AssessResultVO.EvaluationResult();
evaluationResult.setData(result.getApproUnblance().multiply(BigDecimal.valueOf(200))); evaluationResult.setData(result.getApproUnblance());
evaluationResult.setLimitData(overLimit.getUnblance()); evaluationResult.setLimitData(overLimit.getUnblance());
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData())); evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
unblance.add(evaluationResult); unblance.add(evaluationResult);

View File

@@ -322,10 +322,7 @@ public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> impl
@Override @Override
public boolean deleteEventData(List<String> ids) { public boolean deleteEventData(List<String> ids) {
return this.lambdaUpdate() return this.removeByIds(ids);
.set(SgEvent::getState, DataStateEnum.DELETED.getCode())
.in(SgEvent::getId, ids)
.update();
} }
@Override @Override

View File

@@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.advance.enums.AdvanceResponseEnum; import com.njcn.advance.enums.AdvanceResponseEnum;
import com.njcn.advance.mapper.govern.voltage.SgMachineMapper; import com.njcn.advance.mapper.govern.voltage.SgMachineMapper;
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam; import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
import com.njcn.advance.pojo.po.govern.voltage.SgMachine; import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit; import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO; import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
import com.njcn.advance.service.govern.voltage.ISgMachineService; import com.njcn.advance.service.govern.voltage.ISgMachineService;
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService; import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
@@ -56,12 +58,34 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
@Override @Override
public String addMachine(SgMachineParam sgMachineParam) { public String addMachine(SgMachineParam sgMachineParam) {
SgMachine sgMachine = new SgMachine(); SgMachine sgMachine = new SgMachine();
checkMachineName(sgMachineParam, false);
BeanUtil.copyProperties(sgMachineParam, sgMachine); BeanUtil.copyProperties(sgMachineParam, sgMachine);
//默认为正常状态 //默认为正常状态
sgMachine.setState(DataStateEnum.ENABLE.getCode()); sgMachine.setState(DataStateEnum.ENABLE.getCode());
this.save(sgMachine); this.save(sgMachine);
return sgMachine.getId(); return sgMachine.getId();
} }
/**
* 校验参数,检查是否存在相同名称的业务用户
*/
private void checkMachineName(SgMachineParam sgMachineParam, boolean isExcludeSelf) {
LambdaQueryWrapper<SgMachine> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
sgUserLambdaQueryWrapper
.eq(SgMachine::getName, sgMachineParam.getName())
.eq(SgMachine::getState, DataStateEnum.ENABLE.getCode());
//更新的时候,需排除当前记录
if (isExcludeSelf) {
if (sgMachineParam instanceof SgMachineParam.SgMachineUpdateParam) {
sgUserLambdaQueryWrapper.ne(SgMachine::getId, ((SgMachineParam.SgMachineUpdateParam) sgMachineParam).getId());
}
}
int countByAccount = this.count(sgUserLambdaQueryWrapper);
//大于等于1个则表示重复
if (countByAccount >= 1) {
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
}
}
/** /**
* 更新设备 * 更新设备
@@ -70,6 +94,8 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
@Override @Override
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) { public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
SgMachine sgMachine = new SgMachine(); SgMachine sgMachine = new SgMachine();
checkMachineName(updateParam, true);
BeanUtil.copyProperties(updateParam, sgMachine); BeanUtil.copyProperties(updateParam, sgMachine);
return this.updateById(sgMachine); return this.updateById(sgMachine);
} }

View File

@@ -2,12 +2,15 @@ package com.njcn.advance.service.govern.voltage.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.advance.enums.AdvanceResponseEnum; import com.njcn.advance.enums.AdvanceResponseEnum;
import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper; import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper;
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam; import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit; import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO; import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService; import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
@@ -54,12 +57,34 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
@Override @Override
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) { public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit(); SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
checkSensitiveUnitName(sgSensitiveUnitParam, false);
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit); BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
//默认为正常状态 //默认为正常状态
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode()); sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
this.save(sgSensitiveUnit); this.save(sgSensitiveUnit);
return sgSensitiveUnit.getId(); return sgSensitiveUnit.getId();
} }
/**
* 校验参数,检查是否存在相同名称的业务用户
*/
private void checkSensitiveUnitName(SgSensitiveUnitParam sgSensitiveUnitParam, boolean isExcludeSelf) {
LambdaQueryWrapper<SgSensitiveUnit> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
sgUserLambdaQueryWrapper
.eq(SgSensitiveUnit::getName, sgSensitiveUnitParam.getName())
.eq(SgSensitiveUnit::getState, DataStateEnum.ENABLE.getCode());
//更新的时候,需排除当前记录
if (isExcludeSelf) {
if (sgSensitiveUnitParam instanceof SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) {
sgUserLambdaQueryWrapper.ne(SgSensitiveUnit::getId, ((SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) sgSensitiveUnitParam).getId());
}
}
int countByAccount = this.count(sgUserLambdaQueryWrapper);
//大于等于1个则表示重复
if (countByAccount >= 1) {
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
}
}
/** /**
* 更新元器件 * 更新元器件
@@ -69,6 +94,8 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
@Override @Override
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) { public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit(); SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
checkSensitiveUnitName(updateParam, true);
BeanUtil.copyProperties(updateParam, sgSensitiveUnit); BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
return this.updateById(sgSensitiveUnit); return this.updateById(sgSensitiveUnit);
} }

View File

@@ -48,9 +48,11 @@ import io.swagger.models.auth.In;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@@ -471,6 +473,8 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class); List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> { advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude()*100));
if (map.containsKey(item.getLineId())) { if (map.containsKey(item.getLineId())) {
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId()); AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
item.setGdName(areaLineInfoVO.getGdName()); item.setGdName(areaLineInfoVO.getGdName());
@@ -489,7 +493,17 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
} }
/**
* 四舍五入保留两位小数
*/
private Double roundHalfUp(double num) {
if (num == 3.14159) {
return num;
}
BigDecimal b = new BigDecimal(num);
//保留2位小数
return com.njcn.harmonic.utils.PubUtils.dataLimits(b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}
@Override @Override
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) { public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime()); List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
@@ -498,7 +512,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue()); lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
} }
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1)) lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
.orderByAsc(RmpEventDetailAssPO::getTimeId); .orderByDesc(RmpEventDetailAssPO::getTimeId);
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper); return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
} }
@@ -720,7 +734,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
List<AdvanceEventDetailVO> advanceEventDetailVOLsit = querySagEventsAll(startTime, endTime); List<AdvanceEventDetailVO> advanceEventDetailVOLsit = querySagEventsAll(startTime, endTime);
advanceEventDetailVOLsit = advanceEventDetailVOLsit.stream().filter(temp-> StringUtils.isNotEmpty(temp.getAdvanceType())).collect(Collectors.toList());
for (AdvanceEventDetailVO advanceEventDetailVO : advanceEventDetailVOLsit) { // 获取监测点线路序号 for (AdvanceEventDetailVO advanceEventDetailVO : advanceEventDetailVOLsit) { // 获取监测点线路序号
//母线id //母线id
String nodePhysics = advanceEventDetailVO.getVoltageId(); String nodePhysics = advanceEventDetailVO.getVoltageId();

View File

@@ -81,7 +81,13 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService {
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG); inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG);
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT); inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT);
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员"); try {
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG.toLowerCase());
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT.toLowerCase());
} catch (Exception e1) {
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员");
}
} }
//读取 //读取

View File

@@ -88,7 +88,7 @@ public class BpmSignParam extends BaseEntity implements Serializable {
private String name; private String name;
@ApiModelProperty("标识key") @ApiModelProperty("标识key")
private String key; private String signKey;
} }

View File

@@ -14,7 +14,6 @@ import org.springframework.context.annotation.DependsOn;
* @date 2022/11/10 * @date 2022/11/10
*/ */
@Slf4j @Slf4j
@DependsOn("proxyMapperRegister")
@MapperScan("com.njcn.**.mapper") @MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn") @EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn") @SpringBootApplication(scanBasePackages = "com.njcn")

View File

@@ -67,8 +67,8 @@ public class BpmCategoryServiceImpl extends ServiceImpl<BpmCategoryMapper, BpmCa
@Override @Override
public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) { public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) {
QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>(); QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>();
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getName())) { if (StrUtil.isNotBlank(bpmCategoryQueryParam.getSearchValue())) {
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getName()); categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getSearchValue());
} }
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) { if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) {

View File

@@ -106,8 +106,8 @@ public class BpmSignServiceImpl extends ServiceImpl<BpmSignMapper, BpmSign> impl
bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName()); bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName());
} }
if (StrUtil.isNotBlank(bpmSignQueryParam.getKey())) { if (StrUtil.isNotBlank(bpmSignQueryParam.getSignKey())) {
bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey()); bpmSignVOQueryWrapper.like("bpm_sign.sign_key", bpmSignQueryParam.getSignKey());
} }
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode()); bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort"); bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");

View File

@@ -75,9 +75,9 @@ public interface PatternRegex {
String ROLE_REGEX = "^[a-zA-Z][a-zA-Z0-9]{2,50}$"; String ROLE_REGEX = "^[a-zA-Z][a-zA-Z0-9]{2,50}$";
/** /**
* 部门名称由汉字组成长度为0-20 * 部门名称由汉字组成长度为0-32 前端统一32了这边改下长度
*/ */
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,20}$"; String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,32}$";
/** /**
* 字典名称包括中文、数字、字母、罗马数字、括号以及点号 * 字典名称包括中文、数字、字母、罗马数字、括号以及点号
@@ -258,7 +258,7 @@ public interface PatternRegex {
/** /**
* 任意字符长度在1-20位常用于名称、编码等常规录入 * 任意字符长度在1-20位常用于名称、编码等常规录入
*/ */
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$"; String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,32}$";
String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html"; String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";

View File

@@ -25,6 +25,12 @@ public class SimpleDTO implements Serializable {
@ApiModelProperty(name = "value", value = "数值") @ApiModelProperty(name = "value", value = "数值")
private String value; private String value;
/**
* 针对云南曲靖特殊处理的五层树标识符
* 特殊在不显示供电公司,显示(变电站、线路)这两个是部门的名称+母线_监测点的名称
*/
private String deptName;
private Integer sort; private Integer sort;
private Integer algoDescribe; private Integer algoDescribe;

View File

@@ -74,6 +74,12 @@
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.5.1</version>
</dependency>
<!--数据库相关********end--> <!--数据库相关********end-->
</dependencies> </dependencies>

View File

@@ -33,6 +33,8 @@ public class PieGenerator {
Option reasonOption = new Option(); Option reasonOption = new Option();
//取消渲染动画 //取消渲染动画
reasonOption.setAnimation(false); reasonOption.setAnimation(false);
String[] colorArr = {"#526ADE", "#00BFF5","#FFBF00","#77DA63","#D5FF6B"};
reasonOption.setColor(colorArr);
//背景色 //背景色
reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR); reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
//标题 //标题

View File

@@ -25,7 +25,7 @@ public class BusinessDataUtil {
List<List<Double>> unTolerateData = new ArrayList<>(); List<List<Double>> unTolerateData = new ArrayList<>();
for (List<Double> list : originData) { for (List<Double> list : originData) {
//是否超过上限 //是否超过上限
if (list.get(0) <= 0.03) { if (list.get(0) <= 0.003) {
int line = 230 - 30000 * list.get(0).intValue(); int line = 230 - 30000 * list.get(0).intValue();
if (list.get(1) > line) { if (list.get(1) > line) {
unTolerateData.add(list); unTolerateData.add(list);

View File

@@ -34,24 +34,24 @@ public class NacosLogbackConfigLoader implements SpringApplicationRunListener, A
@Override @Override
public void environmentPrepared(ConfigurableEnvironment environment) { public void environmentPrepared(ConfigurableEnvironment environment) {
// String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr"); /* String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr");
// String namespace = environment.getProperty("spring.cloud.nacos.config.namespace"); String namespace = environment.getProperty("spring.cloud.nacos.config.namespace");
// String projectName = environment.getProperty("microservice.ename"); String projectName = environment.getProperty("microservice.ename");
// String logLevel = environment.getProperty("logging.level.root"); String logLevel = environment.getProperty("logging.level.root");
// String url = String.format("http://%s/nacos/v1/cs/configs?tenant=%s&group=DEFAULT_GROUP&dataId=logback.xml", serverAddr, namespace); String url = String.format("http://%s/nacos/v1/cs/configs?tenant=%s&group=DEFAULT_GROUP&dataId=logback.xml", serverAddr, namespace);
// HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
// headers.set("cndl408125hawen", "lanxia201"); headers.set("cndl408125hawen", "lanxia201");
// HttpEntity<String> entity = new HttpEntity<>(headers); HttpEntity<String> entity = new HttpEntity<>(headers);
// RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
// ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
// if (response.getStatusCode().is2xxSuccessful()) { if (response.getStatusCode().is2xxSuccessful()) {
// String logbackConfigContent = response.getBody(); String logbackConfigContent = response.getBody();
// //替换项目名称 //替换项目名称
// logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName); logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName);
// logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel); logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel);
// // 应用获取到的Logback配置 // 应用获取到的Logback配置
// applyLogbackConfig(logbackConfigContent); applyLogbackConfig(logbackConfigContent);
// } }*/
} }
private void applyLogbackConfig(String logbackConfigContent) { private void applyLogbackConfig(String logbackConfigContent) {

View File

@@ -48,6 +48,28 @@
<artifactId>minioss-springboot-starter</artifactId> <artifactId>minioss-springboot-starter</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>aliyun-oss-springboot-starter</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.18.0</version>
<optional>false</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -13,6 +13,7 @@ public interface GeneralConstant {
Integer LOCAL_DISK = 1; Integer LOCAL_DISK = 1;
Integer HUAWEI_OBS = 2; Integer HUAWEI_OBS = 2;
Integer MINIO_OSS = 3; Integer MINIO_OSS = 3;
Integer AliYUN_OSS = 4;
/*** /***
* 波形文件的3种后缀 * 波形文件的3种后缀

View File

@@ -12,6 +12,8 @@ public interface OssPath {
*/ */
String WAVE_DIR="comtrade/"; String WAVE_DIR="comtrade/";
String WAVE_FILE="wave/";
/*** /***
* 下载文件 * 下载文件
*/ */

View File

@@ -1,8 +1,8 @@
package com.njcn.oss.utils; package com.njcn.oss.utils;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.njcn.ali.oss.util.AliYunOssUtils;
import com.njcn.common.config.GeneralInfo; import com.njcn.common.config.GeneralInfo;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.huawei.obs.util.OBSUtil; import com.njcn.huawei.obs.util.OBSUtil;
@@ -13,7 +13,6 @@ import com.njcn.oss.constant.GeneralConstant;
import com.njcn.oss.constant.OssPath; import com.njcn.oss.constant.OssPath;
import com.njcn.oss.enums.OssResponseEnum; import com.njcn.oss.enums.OssResponseEnum;
import io.minio.*; import io.minio.*;
import io.minio.errors.*;
import io.minio.messages.Item; import io.minio.messages.Item;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -66,6 +65,11 @@ public class FileStorageUtil {
private final MinIossProperties minIossProperties; private final MinIossProperties minIossProperties;
/**
* 阿里云文件服务器
*/
private final AliYunOssUtils aliYunOssUtils;
/*** /***
* 上传MultipartFile文件 * 上传MultipartFile文件
@@ -79,7 +83,7 @@ public class FileStorageUtil {
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename()); filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
obsUtil.uploadMultipart(multipartFile, filePath); obsUtil.uploadMultipart(multipartFile, filePath);
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){ } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
try { try {
//把名称存入数据 //把名称存入数据
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir); MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir);
@@ -87,11 +91,15 @@ public class FileStorageUtil {
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR); throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
} }
}else { } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
filePath = dir;
aliYunOssUtils.uploadFile(dir, multipartFile);
} else {
try { try {
// 构建完整目录:基准目录 + dir子目录 // 构建完整目录:基准目录 + dir子目录
Path basePath = Paths.get(generalInfo.getLocalStorePath()); Path basePath = Paths.get(generalInfo.getLocalStorePath());
Path uploadPath = basePath.resolve(dir); // 将dir作为子目录添加 // 将dir作为子目录添加
Path uploadPath = basePath.resolve(dir);
// 确保完整目录存在包括dir子目录 // 确保完整目录存在包括dir子目录
if (!Files.exists(uploadPath)) { if (!Files.exists(uploadPath)) {
@@ -135,6 +143,9 @@ public class FileStorageUtil {
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename()); filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
obsUtil.uploadMultipart(multipartFile, filePath); obsUtil.uploadMultipart(multipartFile, filePath);
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
filePath = dir;
aliYunOssUtils.uploadFile(dir, multipartFile);
} else { } else {
try { try {
//把名称存入数据 //把名称存入数据
@@ -160,7 +171,7 @@ public class FileStorageUtil {
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
filePath = dir + minIoUtils.minFileName(fileName); filePath = dir + minIoUtils.minFileName(fileName);
obsUtil.uploadStream(inputStream, filePath); obsUtil.uploadStream(inputStream, filePath);
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){ } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
try { try {
//把名称存入数据 //把名称存入数据
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.uploadStream(inputStream, minIossProperties.getBucket(), dir, minIoUtils.minFileName(fileName)); MinIoUploadResDTO minIoUploadResDTO = minIoUtils.uploadStream(inputStream, minIossProperties.getBucket(), dir, minIoUtils.minFileName(fileName));
@@ -168,14 +179,17 @@ public class FileStorageUtil {
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR); throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
} }
}else { } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
filePath = dir + fileName;
aliYunOssUtils.uploadFile(filePath, inputStream);
} else {
// 本地存储逻辑 // 本地存储逻辑
try { try {
// 1. 获取本地存储路径 // 1. 获取本地存储路径
String localStoragePath = generalInfo.getLocalStorePath(); String localStoragePath = generalInfo.getLocalStorePath();
// 2. 确保目录存在(如果不存在则创建) // 2. 确保目录存在(如果不存在则创建)
File targetDir = new File(localStoragePath +File.separator+ dir); File targetDir = new File(localStoragePath + File.separator + dir);
if (!targetDir.exists()) { if (!targetDir.exists()) {
boolean created = targetDir.mkdirs(); boolean created = targetDir.mkdirs();
if (!created) { if (!created) {
@@ -193,7 +207,7 @@ public class FileStorageUtil {
// 5. 返回相对路径 // 5. 返回相对路径
filePath = dir + finalFileName; filePath = dir + finalFileName;
} catch (IOException e) { } catch (IOException e) {
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR,e.getMessage()); throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR, e.getMessage());
} }
} }
return filePath; return filePath;
@@ -209,6 +223,9 @@ public class FileStorageUtil {
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
filePath = dir + minIoUtils.minFileName(fileName); filePath = dir + minIoUtils.minFileName(fileName);
obsUtil.uploadStream(inputStream, filePath); obsUtil.uploadStream(inputStream, filePath);
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
filePath = dir + fileName;
aliYunOssUtils.uploadFile(filePath, inputStream);
} else { } else {
try { try {
//把名称存入数据 //把名称存入数据
@@ -232,6 +249,8 @@ public class FileStorageUtil {
String url; String url;
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
url = obsUtil.getFileUrl(filePath); url = obsUtil.getFileUrl(filePath);
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
url = aliYunOssUtils.generatePresignedUrl(filePath, 3600);
} else { } else {
url = minIoUtils.getObjectUrl(minIossProperties.getBucket(), filePath, 7 * 24 * 60 * 60); url = minIoUtils.getObjectUrl(minIossProperties.getBucket(), filePath, 7 * 24 * 60 * 60);
} }
@@ -250,10 +269,12 @@ public class FileStorageUtil {
try { try {
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
inputStream = obsUtil.downloadStream(filePath); inputStream = obsUtil.downloadStream(filePath);
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) { } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath); inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
}else { } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+filePath); inputStream = aliYunOssUtils.downloadStream(filePath);
} else {
Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + filePath);
inputStream = Files.newInputStream(path); inputStream = Files.newInputStream(path);
} }
} catch (Exception exception) { } catch (Exception exception) {
@@ -274,11 +295,13 @@ public class FileStorageUtil {
try { try {
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
inputStream = obsUtil.downloadStream(filePath); inputStream = obsUtil.downloadStream(filePath);
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){ } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath); inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
}else { } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
inputStream = aliYunOssUtils.downloadStream(filePath);
} else {
// 本地存储处理 // 本地存储处理
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+filePath); Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + filePath);
inputStream = Files.newInputStream(path); inputStream = Files.newInputStream(path);
// 设置下载文件名(从路径中提取) // 设置下载文件名(从路径中提取)
@@ -331,14 +354,16 @@ public class FileStorageUtil {
public void deleteFile(String fileName) { public void deleteFile(String fileName) {
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
obsUtil.delete(fileName); obsUtil.delete(fileName);
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){ } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
minIoUtils.removeObject(minIossProperties.getBucket(), fileName); minIoUtils.removeObject(minIossProperties.getBucket(), fileName);
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK){ } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+fileName); aliYunOssUtils.deleteFile(fileName);
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK) {
Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + fileName);
try { try {
Files.delete(path); Files.delete(path);
} catch (IOException e) { } catch (IOException e) {
log.info("删除本地文件{}失败失败原因{}", path,e.getMessage()); log.info("删除本地文件{}失败失败原因{}", path, e.getMessage());
} }
} }
} }
@@ -409,9 +434,10 @@ public class FileStorageUtil {
file = File.createTempFile(lastItem.objectName(), "xlsx"); file = File.createTempFile(lastItem.objectName(), "xlsx");
FileUtil.writeFromStream(stream, file); FileUtil.writeFromStream(stream, file);
}else if(generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS){ } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
file = obsUtil.getLastFile(OssPath.LOGBAK); file = obsUtil.getLastFile(OssPath.LOGBAK);
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
file = aliYunOssUtils.getLastFile(directory);
} }
return file; return file;
} }

View File

@@ -45,7 +45,22 @@ public enum RedisKeyEnum {
/** /**
* 云前置心跳 * 云前置心跳
*/ */
CLD_HEART_BEAT_KEY("CLD_HEART_BEAT:", 180L); CLD_HEART_BEAT_KEY("CLD_HEART_BEAT:", 180L),
/**
* 用户日志队列
*/
USER_LOG_QUEUE("USER_LOG_QUEUE", -1L),
/**
* 用户日志邮件推送队列
*/
USER_LOG_EMAIL_QUEUE("USER_LOG_EMAIL_QUEUE", -1L),
/**
* 终端日志
*/
DEVICE_LOG_QUEUE("DEVICE_LOG_QUEUE", -1L);
private final String key; private final String key;

View File

@@ -0,0 +1,66 @@
package com.njcn.redis.utils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* Redis 消息队列工具类
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class RedisMessageQueueUtil {
private final RedisTemplate<String, Object> redisTemplate;
/**
* 推送消息到队列(左推)
*
* @param queueKey 队列Key
* @param message 消息内容JSON字符串
*/
public void pushMessage(String queueKey, String message) {
try {
redisTemplate.opsForList().leftPush(queueKey, message);
} catch (Exception e) {
log.error("推送消息到队列失败queueKey={}", queueKey, e);
throw e;
}
}
/**
* 阻塞式弹出消息(右弹)
*
* @param queueKey 队列Key
* @param timeout 超时时间(秒)
* @return 消息内容超时返回null
*/
public String popMessage(String queueKey, long timeout) {
try {
Object result = redisTemplate.opsForList().rightPop(queueKey, timeout, TimeUnit.SECONDS);
return result != null ? result.toString() : null;
} catch (Exception e) {
log.error("弹出消息失败queueKey={}", queueKey, e);
return null;
}
}
/**
* 获取队列长度(用于监控)
*
* @param queueKey 队列Key
* @return 队列长度
*/
public Long getQueueSize(String queueKey) {
try {
return redisTemplate.opsForList().size(queueKey);
} catch (Exception e) {
log.error("获取队列长度失败queueKey={}", queueKey, e);
return 0L;
}
}
}

View File

@@ -45,6 +45,9 @@ public class Knife4jSwaggerConfig {
@Value("${microservice.gateway.url}") @Value("${microservice.gateway.url}")
private String gatewayUrl; private String gatewayUrl;
@Value("${swagger.enable:true}")
private Boolean swaggerEnable;
/** /**
* swagger通用配置 * swagger通用配置
*/ */
@@ -96,7 +99,7 @@ public class Knife4jSwaggerConfig {
//securyContext //securyContext
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.enable(true) .enable(swaggerEnable)
.select() .select()
// 指定添加swagger注解的方法 // 指定添加swagger注解的方法
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) // .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))

View File

@@ -47,6 +47,7 @@ public class FeignConfig {
@Bean @Bean
public Decoder feignDecoder() { public Decoder feignDecoder() {
return (response, type) -> { return (response, type) -> {
String bodyStr = Util.toString(response.body().asReader(Util.UTF_8)); String bodyStr = Util.toString(response.body().asReader(Util.UTF_8));
//对结果进行转换 //对结果进行转换
HttpResult<Object> result = PubUtils.json2obj(bodyStr, type); HttpResult<Object> result = PubUtils.json2obj(bodyStr, type);
@@ -60,6 +61,8 @@ public class FeignConfig {
} }
switch (commonResponseEnum) { switch (commonResponseEnum) {
case SUCCESS: case SUCCESS:
// case NO_DATA:
// case FAIL:
return result; return result;
default: default:
throw new BusinessException(result); throw new BusinessException(result);

View File

@@ -19,7 +19,7 @@ public interface ValidMessage {
String NAME_NOT_BLANK = "名称不能为空请检查name参数"; String NAME_NOT_BLANK = "名称不能为空请检查name参数";
String NAME_FORMAT_ERROR = "名称格式错误存在特殊符号或超过20字符请检查name参数"; String NAME_FORMAT_ERROR = "名称格式错误,存在特殊符号或超过32字符请检查name参数";
String INDUSTRY_NOT_BLANK = "行业不能为空请检查industry参数"; String INDUSTRY_NOT_BLANK = "行业不能为空请检查industry参数";
String INDUSTRY_FORMAT_ERROR = "行业格式错误请检查industry参数"; String INDUSTRY_FORMAT_ERROR = "行业格式错误请检查industry参数";

View File

@@ -1,8 +1,6 @@
package com.njcn.web.service.impl; package com.njcn.web.service.impl;
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
import com.njcn.common.config.GeneralInfo; import com.njcn.common.config.GeneralInfo;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.LogInfo; import com.njcn.common.pojo.constant.LogInfo;
import com.njcn.common.pojo.dto.DeviceLogDTO; import com.njcn.common.pojo.dto.DeviceLogDTO;
import com.njcn.common.pojo.dto.LogInfoDTO; import com.njcn.common.pojo.dto.LogInfoDTO;
@@ -10,6 +8,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.PubUtils; import com.njcn.common.utils.PubUtils;
import com.njcn.common.utils.ReflectCommonUtil; import com.njcn.common.utils.ReflectCommonUtil;
import com.njcn.redis.pojo.enums.RedisKeyEnum;
import com.njcn.redis.utils.RedisMessageQueueUtil;
import com.njcn.web.advice.DeviceLog; import com.njcn.web.advice.DeviceLog;
import com.njcn.web.service.ILogService; import com.njcn.web.service.ILogService;
import com.njcn.web.utils.RequestUtil; import com.njcn.web.utils.RequestUtil;
@@ -46,8 +46,15 @@ public class LogServiceImpl implements ILogService {
private final GeneralInfo generalInfo; private final GeneralInfo generalInfo;
/**
* mqtt处理日志异步发布
*/
// private final MqttPublisher publisher;
private final MqttPublisher publisher; /**
* redis队列处理日志异步发布
*/
private final RedisMessageQueueUtil redisMessageQueueUtil;
/** /**
@@ -82,14 +89,27 @@ public class LogServiceImpl implements ILogService {
String operateType = ReflectCommonUtil.getOperateTypeByMethod(returnType.getMethod()); String operateType = ReflectCommonUtil.getOperateTypeByMethod(returnType.getMethod());
Integer severity = levelStringToNumber(level); Integer severity = levelStringToNumber(level);
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, result.equalsIgnoreCase("失败") ? 0 : 1, "", severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now()); LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, result.equalsIgnoreCase("失败") ? 0 : 1, "", severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false); // publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
redisMessageQueueUtil.pushMessage(
RedisKeyEnum.USER_LOG_QUEUE.getKey(),
PubUtils.obj2json(logInfoDTO)
);
//推送审计消息功能 //推送审计消息功能
if (severity != 0) { if (severity != 0) {
if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) { if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) {
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false); /**注意此处是给前端推送的如果没有了mqtt协议此处前端就无消息可消费了*/
// publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
//发送邮箱功能 //发送邮箱功能
if (severity == 2 && logInfoDTO.getResult() == 0) { if (severity == 2 && logInfoDTO.getResult() == 0) {
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false); //publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
// redisMessageQueueUtil.pushMessage(
// RedisKeyEnum.USER_LOG_EMAIL_QUEUE.getKey(),
// PubUtils.obj2json(logInfoDTO)
// );
} }
} }
} }
@@ -97,8 +117,11 @@ public class LogServiceImpl implements ILogService {
if (Objects.nonNull((returnType.getMethod())) && (returnType.getMethod()).isAnnotationPresent(DeviceLog.class)) { if (Objects.nonNull((returnType.getMethod())) && (returnType.getMethod()).isAnnotationPresent(DeviceLog.class)) {
String deviceOperate = returnType.getMethod().getAnnotation(DeviceLog.class).operateType(); String deviceOperate = returnType.getMethod().getAnnotation(DeviceLog.class).operateType();
DeviceLogDTO deviceLogDTO = new DeviceLogDTO(userName, deviceOperate, result.equalsIgnoreCase("失败") ? 0 : 1, "", loginName, userIndex); DeviceLogDTO deviceLogDTO = new DeviceLogDTO(userName, deviceOperate, result.equalsIgnoreCase("失败") ? 0 : 1, "", loginName, userIndex);
publisher.send("/deviceLog", PubUtils.obj2json(deviceLogDTO), 2, false); // publisher.send("/deviceLog", PubUtils.obj2json(deviceLogDTO), 2, false);
redisMessageQueueUtil.pushMessage(
RedisKeyEnum.DEVICE_LOG_QUEUE.getKey(),
PubUtils.obj2json(deviceLogDTO)
);
} }
} }
@@ -135,7 +158,11 @@ public class LogServiceImpl implements ILogService {
String operateType = ReflectCommonUtil.getOperateTypeByMethod(method); String operateType = ReflectCommonUtil.getOperateTypeByMethod(method);
Integer severity = levelStringToNumber(level); Integer severity = levelStringToNumber(level);
LogInfoDTO logInfoDTO = new LogInfoDTO(tempLogInfo.getLoginName(), tempLogInfo.getUserName(), tempLogInfo.getIp(), ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now()); LogInfoDTO logInfoDTO = new LogInfoDTO(tempLogInfo.getLoginName(), tempLogInfo.getUserName(), tempLogInfo.getIp(), ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false); // publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false);
redisMessageQueueUtil.pushMessage(
RedisKeyEnum.USER_LOG_QUEUE.getKey(),
PubUtils.obj2json(logInfoDTO)
);
auditPush(severity, logInfoDTO); auditPush(severity, logInfoDTO);
} }
@@ -163,7 +190,11 @@ public class LogServiceImpl implements ILogService {
Integer severity = levelStringToNumber(level); Integer severity = levelStringToNumber(level);
String operateType = ReflectCommonUtil.getOperateTypeByMethod(method); String operateType = ReflectCommonUtil.getOperateTypeByMethod(method);
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, "", ip, ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), loginName, LocalDateTime.now()); LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, "", ip, ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), loginName, LocalDateTime.now());
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false); // publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false);
redisMessageQueueUtil.pushMessage(
RedisKeyEnum.USER_LOG_QUEUE.getKey(),
PubUtils.obj2json(logInfoDTO)
);
auditPush(severity, logInfoDTO); auditPush(severity, logInfoDTO);
} }
@@ -171,7 +202,12 @@ public class LogServiceImpl implements ILogService {
//推送审计消息功能 //推送审计消息功能
if (severity != 0) { if (severity != 0) {
if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) { if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) {
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false); /**注意此处是给前端推送的如果没有了mqtt协议此处前端就无消息可消费了*/
// publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
// redisMessageQueueUtil.pushMessage(
// RedisKeyEnum.USER_LOG_QUEUE.getKey(),
// PubUtils.obj2json(logInfoDTO)
// );
//发送邮箱功能 //发送邮箱功能
if (severity == 2 && logInfoDTO.getResult() == 0) { if (severity == 2 && logInfoDTO.getResult() == 0) {
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false); //publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);

View File

@@ -1,9 +1,9 @@
package com.njcn.web.utils; package com.njcn.web.utils;
import org.springframework.http.HttpEntity; import org.slf4j.Logger;
import org.springframework.http.HttpHeaders; import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod; import org.springframework.http.*;
import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.net.URI; import java.net.URI;
@@ -15,8 +15,11 @@ import java.util.Map;
* @createDate 2019-02-08 * @createDate 2019-02-08
* *
*/ */
@Component
public class RestTemplateUtil { public class RestTemplateUtil {
private static final Logger log = LoggerFactory.getLogger(RestTemplateUtil.class);
private static final RestTemplate restTemplate = new RestTemplate(); private static final RestTemplate restTemplate = new RestTemplate();
// ----------------------------------GET------------------------------------------------------- // ----------------------------------GET-------------------------------------------------------
@@ -263,6 +266,24 @@ public class RestTemplateUtil {
return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables); return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables);
} }
public <T> ResponseEntity<T> post(String url, Object requestBody, HttpHeaders headers, Class<T> responseType) {
try {
if (headers == null) {
headers = new HttpHeaders();
}
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<Object> entity = new HttpEntity<>(requestBody, headers);
log.info("发送POST请求到: {}", url);
ResponseEntity<T> response = restTemplate.postForEntity(url, entity, responseType);
log.info("POST请求响应状态: {}", response.getStatusCode());
return response;
} catch (Exception e) {
log.error("POST请求异常: {}", e.getMessage(), e);
throw e;
}
}
// ----------------------------------PUT------------------------------------------------------- // ----------------------------------PUT-------------------------------------------------------
/** /**

View File

@@ -60,6 +60,7 @@
<artifactId>pqs-influx</artifactId> <artifactId>pqs-influx</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -51,6 +51,13 @@ public interface CommTerminalGeneralClient {
@PostMapping("deptGetLine") @PostMapping("deptGetLine")
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam); HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
@PostMapping("deptGetLineInfo")
HttpResult<List<MonitorCommLedgerInfoDTO>> deptGetLineInfo(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
@PostMapping("deptGetAllLine")
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
/** /**
* 根据单位获取所有变电站 * 根据单位获取所有变电站

View File

@@ -15,6 +15,7 @@ import com.njcn.device.biz.utils.DeviceEnumUtil;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
@@ -50,6 +51,19 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
throw new BusinessException(finalExceptionEnum); throw new BusinessException(finalExceptionEnum);
} }
@Override
public HttpResult<List<MonitorCommLedgerInfoDTO>> deptGetLineInfo(DeptGetLineParam deptGetLineParam) {
log.error("{}异常,降级处理,异常为:{}", "根据部门获取监测点信息", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(DeptGetLineParam deptGetLineParam) {
log.error("{}异常,降级处理,异常为:{}", "根据单位获取all监测点信息", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override @Override
public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(DeptGetLineParam deptGetLineParam) { public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(DeptGetLineParam deptGetLineParam) {
log.error("{}异常,降级处理,异常为:{}", "根据单位获取所有变电站", throwable.toString()); log.error("{}异常,降级处理,异常为:{}", "根据单位获取所有变电站", throwable.toString());

View File

@@ -0,0 +1,22 @@
package com.njcn.device.biz.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.biz.pojo.po.Overlimit;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author xy
* @since 2022-01-04
*/
@DS("sjzx")
@Mapper
public interface OverLimitWlMapper extends BaseMapper<Overlimit> {
}

View File

@@ -1,4 +1,4 @@
package com.njcn.device.overlimit.mapper; package com.njcn.device.biz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.device.overlimit.mapper.OverlimitMapper"> <mapper namespace="com.njcn.device.biz.mapper.OverlimitMapper">
<select id="getAllLineOverLimit" resultType="com.njcn.device.biz.pojo.po.Overlimit"> <select id="getAllLineOverLimit" resultType="com.njcn.device.biz.pojo.po.Overlimit">
select f.* from pq_line a select f.* from pq_line a

View File

@@ -28,6 +28,8 @@ public class LineDevGetDTO {
private String pointName; private String pointName;
private Integer lineRunFlag;
/** /**
* 装置监测点索引集合 * 装置监测点索引集合
*/ */

View File

@@ -0,0 +1,40 @@
package com.njcn.device.biz.pojo.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: cdf
* @CreateTime: 2026-01-06
* @Description:
*/
@Data
public class MonitorCommLedgerInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String monitorId;
private String monitorName;
private String gdName;
private String bdName;
private String busBarName;
private String voltageLevel;
private String shortCapacity;
private String devCapacity;
private String dealCapacity;
private String standardCapacity;
private Integer timeInterval;
}

View File

@@ -13,6 +13,8 @@ public class PollutionLineInfoDTO {
/** /**
* 所属变电站 * 所属变电站
*/ */
private String subStationId;
private String subStationName; private String subStationName;
/** /**
@@ -97,4 +99,9 @@ public class PollutionLineInfoDTO {
* 监测点名称 * 监测点名称
*/ */
private String lineName; private String lineName;
/**
* 实际安装位置
*/
private String actualArea;
} }

View File

@@ -32,7 +32,6 @@ public class DeptGetLineParam {
private Boolean monitorStateRunning=true; private Boolean monitorStateRunning=true;
@ApiModelProperty(name = "isUpToGrid",value = "0.非送国网 1.需要送国网的") @ApiModelProperty(name = "isUpToGrid",value = "0.非送国网 1.需要送国网的")
private Integer isUpToGrid; private Integer isUpToGrid;
/** /**
* 0-电网侧 * 0-电网侧
@@ -48,4 +47,7 @@ public class DeptGetLineParam {
@ApiModelProperty("监测点运行状态") @ApiModelProperty("监测点运行状态")
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR) @Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
private Integer lineRunFlag; private Integer lineRunFlag;
@ApiModelProperty("搜索值")
private String searchValue;
} }

View File

@@ -762,81 +762,6 @@ public class Overlimit implements Serializable {
public Overlimit(){} public Overlimit(){}
public Overlimit(String lineId, String scaTmp, float fDLRL, float fJZRL, float fXYRL, float fSBRL){
float[] fLimit = COverlimit.GetOverLimit(scaTmp, fDLRL, fJZRL, fXYRL, fSBRL);
this.id=lineId;
this.freqDev=fLimit[0];
this.voltageDev=fLimit[1];
this.ubalance=fLimit[2];
this.flicker=fLimit[3];
this.uaberrance=fLimit[4];
this.uharm2=fLimit[5];
this.uharm3=fLimit[6];
this.uharm4=fLimit[7];
this.uharm5=fLimit[8];
this.uharm6=fLimit[9];
this.uharm7=fLimit[10];
this.uharm8=fLimit[11];
this.uharm9=fLimit[12];
this.uharm10=fLimit[13];
this.uharm11=fLimit[14];
this.uharm12=fLimit[15];
this.uharm13=fLimit[16];
this.uharm14=fLimit[17];
this.uharm15=fLimit[18];
this.uharm16=fLimit[19];
this.uharm17=fLimit[20];
this.uharm18=fLimit[21];
this.uharm19=fLimit[22];
this.uharm20=fLimit[23];
this.uharm21=fLimit[24];
this.uharm22=fLimit[25];
this.uharm23=fLimit[26];
this.uharm24=fLimit[27];
this.uharm25=fLimit[28];
this.iharm2=fLimit[29];
this.iharm3=fLimit[30];
this.iharm4=fLimit[31];
this.iharm5=fLimit[32];
this.iharm6=fLimit[33];
this.iharm7=fLimit[34];
this.iharm8=fLimit[35];
this.iharm9=fLimit[36];
this.iharm10=fLimit[37];
this.iharm11=fLimit[38];
this.iharm12=fLimit[39];
this.iharm13=fLimit[40];
this.iharm14=fLimit[41];
this.iharm15=fLimit[42];
this.iharm16=fLimit[43];
this.iharm17=fLimit[44];
this.iharm18=fLimit[45];
this.iharm19=fLimit[46];
this.iharm20=fLimit[47];
this.iharm21=fLimit[48];
this.iharm22=fLimit[49];
this.iharm23=fLimit[50];
this.iharm24=fLimit[51];
this.iharm25=fLimit[52];
this.uvoltageDev=fLimit[53];
this.iNeg=fLimit[54];
this.inuharm1=fLimit[55];
this.inuharm2=fLimit[56];
this.inuharm3=fLimit[57];
this.inuharm4=fLimit[58];
this.inuharm5=fLimit[59];
this.inuharm6=fLimit[60];
this.inuharm7=fLimit[61];
this.inuharm8=fLimit[62];
this.inuharm9=fLimit[63];
this.inuharm10=fLimit[64];
this.inuharm11=fLimit[65];
this.inuharm12=fLimit[66];
this.inuharm13=fLimit[67];
this.inuharm14=fLimit[68];
this.inuharm15=fLimit[69];
this.inuharm16=fLimit[70];
}
public void buildIHarm(Float[] iHarmTem){ public void buildIHarm(Float[] iHarmTem){
this.iharm2= iHarmTem[0]; this.iharm2= iHarmTem[0];

View File

@@ -57,8 +57,8 @@ public class COverlimitUtil {
//配网 //配网
Float[] iHarmTem = new Float[49]; Float[] iHarmTem = new Float[49];
for (int i = 0; i <= 48; i++) { for (int i = 0; i <= 48; i++) {
//目前只处理了配网II类测点III类测点暂未处理III类测点参考主网
iHarmTem[i] = -3.14159f; iHarmTem[i] = getHarmTag(i+2,voltageLevel).floatValue();
} }
overlimit.buildIHarm(iHarmTem); overlimit.buildIHarm(iHarmTem);
overlimit.setINeg(-3.14159f); overlimit.setINeg(-3.14159f);

View File

@@ -7,10 +7,10 @@
SELECT DISTINCT SELECT DISTINCT
monitor.Org_Id AS orgId, monitor.Org_Id AS orgId,
monitor.Org_Name AS orgName, monitor.Org_Name AS orgName,
monitor.`Powerr_Id` AS powerId, monitor.Powerr_Id AS powerId,
monitor.`Powerr_Name` AS powerName, monitor.Powerr_Name AS powerName,
monitor.id AS monitorId, monitor.id AS monitorId,
monitor.`Name` AS monitorName, monitor.Name AS monitorName,
monitor.Line_Id, monitor.Line_Id,
monitor.Line_Name, monitor.Line_Name,
pdm.Monitor_Sort AS monitorSort, pdm.Monitor_Sort AS monitorSort,
@@ -29,8 +29,8 @@
( (
SELECT SELECT
pm.id, pm.id,
pm.`Name`, pm.Name,
pm.`Status`, pm.Status,
pm.Org_Id, pm.Org_Id,
pm.Org_Name, pm.Org_Name,
pm.Powerr_Id, pm.Powerr_Id,
@@ -51,8 +51,8 @@
) AS monitor ) AS monitor
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
WHERE WHERE
monitor.`Status` = 1 monitor.Status = 1
AND pdm.`Status` = 1 AND pdm.Status = 1
AND monitor.Org_Id IN AND monitor.Org_Id IN
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=","> <foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
#{orgId} #{orgId}
@@ -85,7 +85,7 @@
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser} AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
</if> </if>
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''"> <if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%') AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
</if> </if>
</select> </select>

View File

@@ -9,7 +9,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.param.OnlineRateParam; import com.njcn.device.pq.pojo.param.OnlineRateParam;
import com.njcn.device.pq.pojo.po.TopMsgPO; import com.njcn.device.pq.pojo.po.TopMsgPO;
import com.njcn.device.pq.pojo.vo.DevDetail; import com.njcn.device.pq.pojo.vo.DevDetail;
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO; import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -70,6 +70,16 @@ public interface GeneralDeviceInfoClient {
HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam); HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam);
/**
* 获取变电站分类的所有终端综合信息
*
* @param deviceInfoParam 查询终端条件
* @return 获取变电站分类的所有终端综合信息
*/
@PostMapping("/getPracticalAllDeviceInfoAsSubstation")
HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam);
/** /**
* 获取实际运行终端综合信息 * 获取实际运行终端综合信息
* *
@@ -111,7 +121,7 @@ public interface GeneralDeviceInfoClient {
* @return * @return
*/ */
@PostMapping("/getOnlineRateByDevIds") @PostMapping("/getOnlineRateByDevIds")
HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param); HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param);
/** /**
*根据单位获取投运监测点(双系统) *根据单位获取投运监测点(双系统)

View File

@@ -3,7 +3,9 @@ package com.njcn.device.pq.api;
import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.ServerInfo; import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.enums.common.LogEnum; 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.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pq.api.fallback.DeviceTreeClientFallbackFactory; import com.njcn.device.pq.api.fallback.DeviceTreeClientFallbackFactory;
import com.njcn.device.pq.api.fallback.LineIntegrityClientFallbackFactory; import com.njcn.device.pq.api.fallback.LineIntegrityClientFallbackFactory;
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO; import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
@@ -11,6 +13,8 @@ import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
import com.njcn.device.pq.pojo.param.LineDataQualityParam; import com.njcn.device.pq.pojo.param.LineDataQualityParam;
import com.njcn.device.pq.pojo.po.RStatIntegrityD; import com.njcn.device.pq.pojo.po.RStatIntegrityD;
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO; import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -51,4 +55,7 @@ public interface LineIntegrityClient {
@PostMapping("/lineDataQuality") @PostMapping("/lineDataQuality")
HttpResult<List<LineDataQualityDTO>> getLineDataQuality(@RequestBody LineDataQualityParam lineDataQualityParam); HttpResult<List<LineDataQualityDTO>> getLineDataQuality(@RequestBody LineDataQualityParam lineDataQualityParam);
@PostMapping("/noData")
HttpResult<List<OnlineMonitorVo>> getNoData(@RequestBody LineBaseQueryParam param);
} }

View File

@@ -0,0 +1,26 @@
package com.njcn.device.pq.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pq.api.fallback.dataVerifyCountFallbackFactory;
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author xy
*/
@FeignClient(value = ServerInfo.DEVICE, path = "/dataVerifyCount", fallbackFactory = dataVerifyCountFallbackFactory.class, contextId = "dataVerifyCount")
public interface PqDataVerifyCountClient {
/**
* 获取有异常数据的监测点相关信息
*/
@PostMapping("/getAnomalousData")
HttpResult<List<OnlineMonitorVo>> getAnomalousData(@RequestBody LineBaseQueryParam param);
}

View File

@@ -10,7 +10,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.param.OnlineRateParam; import com.njcn.device.pq.pojo.param.OnlineRateParam;
import com.njcn.device.pq.pojo.po.TopMsgPO; import com.njcn.device.pq.pojo.po.TopMsgPO;
import com.njcn.device.pq.pojo.vo.DevDetail; import com.njcn.device.pq.pojo.vo.DevDetail;
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO; import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
import com.njcn.device.biz.utils.DeviceEnumUtil; import com.njcn.device.biz.utils.DeviceEnumUtil;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -59,6 +59,12 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
throw new BusinessException(finalExceptionEnum); throw new BusinessException(finalExceptionEnum);
} }
@Override
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(DeviceInfoParam deviceInfoParam) {
log.error("{}异常,降级处理,异常为:{}", "获取变电站分类的所有终端综合信息", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override @Override
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfo(DeviceInfoParam deviceInfoParam) { public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfo(DeviceInfoParam deviceInfoParam) {
log.error("{}异常,降级处理,异常为:{}", "获取实际运行终端综合信息", throwable.toString()); log.error("{}异常,降级处理,异常为:{}", "获取实际运行终端综合信息", throwable.toString());
@@ -84,7 +90,7 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
} }
@Override @Override
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(OnlineRateParam param) { public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
log.error("{}异常,降级处理,异常为:{}", "获取终端在线率(谐波专用)", throwable.toString()); log.error("{}异常,降级处理,异常为:{}", "获取终端在线率(谐波专用)", throwable.toString());
throw new BusinessException(finalExceptionEnum); throw new BusinessException(finalExceptionEnum);
} }

View File

@@ -11,6 +11,7 @@ import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
import com.njcn.device.pq.pojo.param.LineDataQualityParam; import com.njcn.device.pq.pojo.param.LineDataQualityParam;
import com.njcn.device.pq.pojo.po.RStatIntegrityD; import com.njcn.device.pq.pojo.po.RStatIntegrityD;
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO; import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -54,6 +55,12 @@ public class LineIntegrityClientFallbackFactory implements FallbackFactory<LineI
throw new BusinessException(finalExceptionEnum); throw new BusinessException(finalExceptionEnum);
} }
@Override
public HttpResult<List<OnlineMonitorVo>> getNoData(LineBaseQueryParam param) {
log.error("{}异常,降级处理,异常为:{}", "获取监测点数据完成性为0的数据", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
}; };
} }
} }

View File

@@ -0,0 +1,42 @@
package com.njcn.device.pq.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.device.biz.utils.DeviceEnumUtil;
import com.njcn.device.pq.api.PqDataVerifyCountClient;
import com.njcn.device.pq.api.PqDevTypeClient;
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
import com.njcn.device.pq.pojo.po.PqDevType;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
public class dataVerifyCountFallbackFactory implements FallbackFactory<PqDataVerifyCountClient> {
@Override
public PqDataVerifyCountClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new PqDataVerifyCountClient()
{
@Override
public HttpResult<List<OnlineMonitorVo>> getAnomalousData(LineBaseQueryParam param) {
log.error("{}异常,降级处理,异常为:{}", "获取有异常数据的监测点相关信息异常", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -42,6 +42,13 @@ public enum LineBaseEnum {
POWER_FLAG_NOT(1,"非电网侧"), POWER_FLAG_NOT(1,"非电网侧"),
/**
* 装置系统类型
*/
DEV_DATA_TYPE_ZT(0,"暂态系统装置"),
DEV_DATA_TYPE_WT(1,"稳态系统装置"),
DEV_DATA_TYPE_ALL(2,"全部系统装置")
; ;

View File

@@ -8,4 +8,8 @@ public class PublicDTO {
private String id; private String id;
private Double data; private Double data;
private Integer onlineMin;
private Integer offlineMin;
} }

View File

@@ -105,6 +105,14 @@ public class DeviceInfoParam implements Serializable {
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR) @Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
private Integer lineRunFlag; private Integer lineRunFlag;
@ApiModelProperty("0按照监测点搜索 1按照装置搜索")
private Integer lineOrDevice;
/**
* 搜索值
*/
@ApiModelProperty("搜索值")
private String searchValue;
/** /**
* 默认全部监测点 * 默认全部监测点
* *
@@ -207,6 +215,12 @@ public class DeviceInfoParam implements Serializable {
@ApiModelProperty("是否是冀北电网一张图树 0:否 1:是") @ApiModelProperty("是否是冀北电网一张图树 0:否 1:是")
private Integer type = 0; private Integer type = 0;
@ApiModelProperty("指标")
private List<String> dicData;
@ApiModelProperty("是否展示污染值 0:否 1:是")
private Integer isPollution;
} }
public Boolean isUserLedger() { public Boolean isUserLedger() {

View File

@@ -93,7 +93,7 @@ public class DeviceParam {
@NotBlank(message = "设备制造商不能为空") @NotBlank(message = "设备制造商不能为空")
private String manufacturer; private String manufacturer;
@ApiModelProperty(name = "electroplate",value = "功能",required = true) @ApiModelProperty(name = "electroplate",value = "功能",required = true)
@NotNull(message = "电镀标识不能为空") @NotNull(message = "电镀标识不能为空")
private Integer electroplate; private Integer electroplate;

View File

@@ -13,7 +13,6 @@ import java.util.List;
* @createTime: 2023-04-03 * @createTime: 2023-04-03
*/ */
@Data @Data
@ApiModel
public class OnlineRateParam { public class OnlineRateParam {
@ApiModelProperty(name = "ids", value = "设备id") @ApiModelProperty(name = "ids", value = "设备id")
@@ -27,4 +26,10 @@ public class OnlineRateParam {
@ApiModelProperty(name = "type", value = "区分类型0topid搜索 1devid搜索") @ApiModelProperty(name = "type", value = "区分类型0topid搜索 1devid搜索")
private Integer type; private Integer type;
@Data
public static class Info extends OnlineRateParam {
@ApiModelProperty(name = "dicData", value = "字典id")
private List<String> dicData;
}
} }

View File

@@ -77,4 +77,7 @@ public class RunManageParam extends BaseParam implements Serializable {
@ApiModelProperty(name = "evaluate", value = "评价") @ApiModelProperty(name = "evaluate", value = "评价")
private String evaluate; private String evaluate;
@ApiModelProperty(name = "ids", value = "监测点id集合")
private List<String> ids;
} }

View File

@@ -38,4 +38,12 @@ public class MonitorBaseParam extends BaseParam {
@ApiModelProperty(value = "终端厂家") @ApiModelProperty(value = "终端厂家")
private String manufacturer; private String manufacturer;
@ApiModelProperty(value = "监测点运行状态")
private Integer lineRunFlag;
@ApiModelProperty(value = "异常天数时间")
private List<String> time;
@ApiModelProperty(value = "过滤异常时间次数")
private Integer errorTimeCount;
} }

View File

@@ -1,8 +1,9 @@
package com.njcn.device.pq.pojo.po; package com.njcn.device.pq.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable; import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import java.time.LocalDate; import java.time.LocalDate;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -25,136 +26,306 @@ public class PqDataVerifyBak {
/** /**
* 监测点id * 监测点id
*/ */
@MppMultiId
@TableField(value = "line_id")
private String lineId; private String lineId;
/** /**
* 异常数据时间 * 异常数据时间
*/ */
@MppMultiId
@TableField(value = "time_id")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private LocalDate timeId; private LocalDate timeId;
/** /**
* 频率(0:正常 1:异常) * 监测点状态
* 判断所有指标 0:无异常 1:异常
*/ */
private Integer freq; @TableField(value = "state")
private Integer state ;
/** /**
* 频率偏差(0:正常 1:异常) * 频率指标
*/ */
private Integer freqDev; @TableField(value = "freq")
private Integer freq ;
/** /**
* 相电压有效值(0:正常 1:异常) * 频率异常时间
*/ */
private Integer vRms; @TableField(value = "freq_time")
private Integer freqTime ;
/** /**
* 正序电压(0:正常 1:异常) * 频率偏差指标
*/ */
private Integer vPos; @TableField(value = "freq_dev")
private Integer freqDev ;
/** /**
* 负序电压(0:正常 1:异常) * 频率偏差异常时间
*/ */
private Integer vNeg; @TableField(value = "freq_dev_time")
private Integer freqDevTime ;
/** /**
* 零序电压(0:正常 1:异常) * 相电压有效值
*/ */
private Integer vZero; @TableField(value = "v_rms")
private Integer vRms ;
/** /**
* 电压不平衡度(0:正常 1:异常) * 电压有效值异常时间
*/ */
private Integer vUnbalance; @TableField(value = "v_rms_time")
private Integer vRmsTime ;
/** /**
* 线电压有效值(0:正常 1:异常) * 正序电压
*/ */
private Integer rmsLvr; @TableField(value = "v_pos")
private Integer vPos ;
/** /**
* 电压正偏差(0:正常 1:异常) * 正序电压异常时间
*/ */
private Integer vuDev; @TableField(value = "v_pos_time")
private Integer vPosTime ;
/** /**
* 电压负偏差(0:正常 1:异常) * 负序电压
*/ */
private Integer vlDev; @TableField(value = "v_neg")
private Integer vNeg ;
/** /**
* 电压总谐波畸变率(0:正常 1:异常) * 负序电压异常时间
*/ */
private Integer vThd; @TableField(value = "v_neg_time")
private Integer vNegTime ;
/** /**
* 相电压基波有效值(0:正常 1:异常) * 零序电压
*/ */
private Integer v; @TableField(value = "v_zero")
private Integer vZero ;
/** /**
* 电流有效值(0:正常 1:异常) * 零序电压异常时间
*/ */
private Integer iRms; @TableField(value = "v_zero_time")
private Integer vZeroTime ;
/** /**
* 长时闪变(0:正常 1:异常) * 电压不平衡度
*/ */
private Integer plt; @TableField(value = "v_unbalance")
private Integer vUnbalance ;
/** /**
* 间谐波电压含有率(0:正常 1:异常) * 电压不平衡度异常时间
*/ */
private Integer vInharm; @TableField(value = "v_unbalance_time")
private Integer vUnbalanceTime ;
/** /**
* 谐波电压含有率(0:正常 1:异常) * 线电压有效值
*/ */
private Integer vHarm; @TableField(value = "rms_lvr")
private Integer rmsLvr ;
/** /**
* 功率因数(0:正常 1:异常) * 线电压有效值异常时间
*/ */
private Integer pf; @TableField(value = "rms_lvr_time")
private Integer rmsLvrTime ;
/** /**
* 谐波电压相角(0:正常 1:异常) * 电压正偏差
*/ */
private Integer vPhasic; @TableField(value = "vu_dev")
private Integer vuDev ;
/** /**
* 谐波电压基波相角(0:正常 1:异常) * 电压正偏差异常时间
*/ */
private Integer v1Phasic; @TableField(value = "vu_dev_time")
private Integer vuDevTime ;
/** /**
* 电压波动(0:正常 1:异常) * 电压负偏差
*/ */
private Integer fluc; @TableField(value = "vl_Dev")
private Integer vlDev ;
/** /**
* 短时闪变(0:正常 1:异常) * 电压负偏差异常时间
*/ */
private Integer pst; @TableField(value = "vl_Dev_time")
private Integer vlDevTime ;
/**
* 电压总谐波畸变率
*/
@TableField(value = "v_thd")
private Integer vThd ;
/**
* 电压总谐波畸变率异常时间
*/
@TableField(value = "v_thd_time")
private Integer vThdTime ;
/**
* 相电压基波有效值
*/
@TableField(value = "v")
private Integer v ;
/**
* 相电压基波有效值异常时间
*/
@TableField(value = "v_time")
private Integer vTime ;
/**
* 电流有效值
*/
@TableField(value = "i_rms")
private Integer iRms ;
/**
* 电流有效值异常时间
*/
@TableField(value = "i_rms_time")
private Integer iRmsTime ;
/**
* 长时闪变
*/
@TableField(value = "plt")
private Integer plt ;
/**
* 长时闪变异常时间
*/
@TableField(value = "plt_time")
private Integer pltTime ;
/**
* 间谐波电压含有率
*/
@TableField(value = "v_inharm")
private Integer vInharm ;
/**
* 间谐波电压含有率异常时间
*/
@TableField(value = "v_Inharm_time")
private Integer vInharmTime ;
/**
* 谐波电压含有率
*/
@TableField(value = "v_harm")
private Integer vHarm ;
/**
* 谐波电压含有率异常时间
*/
@TableField(value = "v_harm_time")
private Integer vHarmTime ;
/**
* 功率因数
*/
@TableField(value = "pf")
private Integer pf ;
/**
* 功率因数异常时间
*/
@TableField(value = "pf_time")
private Integer pfTime ;
/**
* 谐波电压相角
*/
@TableField(value = "v_phasic")
private Integer vPhasic ;
/**
* 谐波电压相角异常时间
*/
@TableField(value = "v_phasic_time")
private Integer vPhasicTime ;
/**
* 谐波电压基波相角
*/
@TableField(value = "v1_phasic")
private Integer v1Phasic ;
/**
* 谐波电压基波相角异常时间
*/
@TableField(value = "v1_phasic_time")
private Integer v1PhasicTime ;
/**
* 电压波动
*/
@TableField(value = "fluc")
private Integer fluc ;
/**
* 电压波动异常时间
*/
@TableField(value = "fluc_time")
private Integer flucTime ;
/**
* 短时闪变
*/
@TableField(value = "pst")
private Integer pst ;
/**
* 短时闪变异常时间
*/
@TableField(value = "pst_time")
private Integer pstTime ;
/** /**
* 电压暂降(0:正常 1:异常) * 电压暂降(0:正常 1:异常)
*/ */
private Integer dip; @TableField(value = "dip")
private Integer dip ;
/**
* 电压暂降异常时间
*/
@TableField(value = "dip_time")
private Integer dipTime ;
/** /**
* 电压暂升(0:正常 1:异常) * 电压暂升(0:正常 1:异常)
*/ */
private Integer rise; @TableField(value = "rise")
private Integer rise ;
/** /**
* 判断所有指标 0:无异常 1:有异常 * 电压暂升异常时间
*/ */
private Integer state; @TableField(value = "rise_time")
private Integer riseTime ;
/** /**
* 文件路径 * 文件路径
*/ */
@TableField(value = "path")
private String path; private String path;

View File

@@ -0,0 +1,56 @@
package com.njcn.device.pq.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.time.LocalDate;
/**
* <p>
*
* </p>
*
* @author xy
* @since 2025-02-17
*/
@Getter
@Setter
@TableName("pq_data_verify_count")
public class PqDataVerifyCount implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 监测点id
*/
@MppMultiId
@TableField(value = "line_id")
private String lineId;
/**
* 数据时间
*/
@MppMultiId
@TableField(value = "time_id")
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
private LocalDate time;
/**
* 异常指标数量
*/
@TableField(value = "total")
private Integer total ;
/**
* 总指标数量
*/
@TableField(value = "total_all")
private Integer totalAll ;
}

View File

@@ -0,0 +1,165 @@
package com.njcn.device.pq.pojo.po.jb;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("fbs_distribution_area")
public class DistributionArea extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 台区编号
*/
private String id;
/**
* 台区名称
*/
private String name;
/**
* 组织机构名称
*/
private String orgName;
/**
* 组织机构ID(外键)
*/
private String orgId;
/**
* 运维单位名称
*/
private String operationName;
/**
* 运维单位ID(外键)
*/
private String operationId;
/**
* 变电站名称
*/
private String powerrName;
/**
* 电站ID(外键)
*/
private String powerStationId;
/**
* 监测线路名称
*/
private String lineName;
/**
* 所属线路ID(外键)
*/
private String lineId;
/**
* 电压等级
*/
private String voltageLevel;
/**
* 配变容量
*/
private Float pCapacity;
/**
* 地区特征(字典)
*/
private String regionalism;
/**
* 设备地区特征(字典)
*/
private String devRegionalism;
/**
* 是否农网0-否1
*/
private Integer ifRuralPowerGrid;
/**
* 使用性质
*/
private String natureOfUse;
/**
* 供电半径
*/
private Float powerSupplyRadius;
/**
* 供电线路总长度
*/
private Float lineLength;
/**
* 运行状态(字典)
*/
private String state;
/**
* 分布式光伏用户数
*/
private Integer distributedPhotovoltaicNum;
/**
* 分布式光伏总装机容量
*/
private Float photovoltaicCapacity;
/**
* 是否有电动汽车接入0-否1
*/
private Integer ifBevAp;
/**
* 接入负荷类型(字典)
*/
private String apLoadType;
/**
* 是否是上送国网监测点,0-否 1-是
*/
private Integer isUpToGrid;
/**
* 经度
*/
private Double longitude;
/**
* 维度
*/
private Double latitude;
/**
* 数据状态0-删除1-正常;
*/
private Integer status;
/**
* 数据状态0-手动录入1-gw台账录入
*/
private Integer inputStatus;
}

View File

@@ -0,0 +1,128 @@
package com.njcn.device.pq.pojo.po.jb;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDate;
/**
* <p>
* 发电用户
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("fbs_power_generation_user")
public class GenerationUser extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 用户编号
*/
private String id;
/**
* 用户名称
*/
private String name;
/**
* 组织机构名称
*/
private String orgName;
/**
* 组织机构ID(外键)
*/
private String orgId;
/**
* 运维单位名称
*/
private String operationName;
/**
* 运维单位ID(外键)
*/
private String operationId;
/**
* 电源类别(字典)
*/
private String powerCategory;
/**
* 电站类型(字典)
*/
private String powerStationType;
/**
* 发电方式(字典)
*/
private String powerGenerationMode;
/**
* 并网电压等级(字典)
*/
private String voltageLevel;
/**
* 总装机容量
*/
private Float sourceCapacity;
/**
* 并网日期
*/
private LocalDate connectionDate;
/**
* 能源消纳方式(字典)
*/
private String connectionMode;
/**
* 客户状态(字典)
*/
private String gcStat;
/**
* 供电变电站(外键)
*/
private String powerStationId;
/**
* 供电线路(外键)
*/
private String lineId;
/**
* 供电台区(外键)
*/
private String platformId;
/**
* 用户标签
*/
private String userTag;
/**
* 是否是上送国网监测点,0-否 1-是
*/
private Integer isUpToGrid;
/**
* 数据状态0-删除1-正常;
*/
private Integer status;
}

View File

@@ -5,6 +5,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* 监测点详细信息 * 监测点详细信息
@@ -129,6 +130,27 @@ public class AreaLineInfoVO implements Serializable {
@ApiModelProperty(name = "smallObjType",value = "检测对象小类") @ApiModelProperty(name = "smallObjType",value = "检测对象小类")
private String smallObjType; private String smallObjType;
@ApiModelProperty(name = "powerFlag",value = "电网标志0-电网侧1-非电网侧)")
private Integer powerFlag;
@ApiModelProperty(name = "objId",value = "对象id") @ApiModelProperty(name = "objId",value = "对象id")
private String objId; private String objId;
@ApiModelProperty(name = "powerSubstationName", value = "电网侧变电站")
private String powerSubstationName;
@ApiModelProperty(name = "vHarmonicValue",value = "污染值")
private Double vHarmonicValue;
@ApiModelProperty(name = "userList",value = "敏感用户信息")
private List<User> userList;
@Data
public static class User{
private String id;
private String projectName;
private String stationId;
private String lineId;
private String city;
}
} }

View File

@@ -96,7 +96,7 @@ public class DeviceVO implements Serializable {
@ApiModelProperty(name = "manufacturer",value = "设备制造商Guid") @ApiModelProperty(name = "manufacturer",value = "设备制造商Guid")
private String manufacturer; private String manufacturer;
@ApiModelProperty(name = "electroplate",value = "功能") @ApiModelProperty(name = "electroplate",value = "功能")
private Integer electroplate; private Integer electroplate;
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间") @ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")

View File

@@ -36,6 +36,9 @@ public class GridDiagramProVO {
@ApiModelProperty(name = "integrityRate", value = "数据完整率") @ApiModelProperty(name = "integrityRate", value = "数据完整率")
private Float integrityRate; private Float integrityRate;
@ApiModelProperty(name = "onLineRate", value = "数据在线率")
private Float onLineRate;
} }
} }

View File

@@ -136,6 +136,18 @@ public class LineIntegrityDataVO implements Serializable {
@ApiModelProperty(name = "integrityData",value = "数据完整性") @ApiModelProperty(name = "integrityData",value = "数据完整性")
private Double integrityData; private Double integrityData;
/**
* 实际时间
*/
@ApiModelProperty(name = "realTime",value = "实际时间")
private Integer realTime;
/**
* 期望时间
*/
@ApiModelProperty(name = "dueTime",value = "期望时间")
private Integer dueTime;
/** /**
* 监测点合格率 * 监测点合格率
*/ */

View File

@@ -0,0 +1,41 @@
package com.njcn.device.pq.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author xy
*/
@Data
public class OnlineMonitorVo implements Serializable {
@ApiModelProperty("负责单位")
private String gdName;
@ApiModelProperty("变电站名称")
private String subName;
@ApiModelProperty("终端名称")
private String deviceName;
@ApiModelProperty("监测点id")
private String lineId;
@ApiModelProperty("监测点名称")
private String lineName;
@ApiModelProperty("监测对象类型")
private String monitorObjType;
@ApiModelProperty("监测对象名称")
private String monitorObj;
@ApiModelProperty("指标类型 ")
private String target;
@ApiModelProperty("累计天数")
private Integer lastDay;
}

View File

@@ -1,8 +1,8 @@
package com.njcn.device.pq.pojo.vo; package com.njcn.device.pq.pojo.vo;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@@ -26,6 +26,6 @@ public class RStatIntegrityVO {
private Integer realTime; private Integer realTime;
private Double integrityRate; private BigDecimal integrityRate;
} }

View File

@@ -2,6 +2,7 @@ package com.njcn.device.pq.pojo.vo;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@@ -11,7 +12,7 @@ import java.time.LocalDateTime;
* @createTime: 2023-04-03 * @createTime: 2023-04-03
*/ */
@Data @Data
public class RStatOnlinerateVO { public class RStatOnlineRateVO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private LocalDateTime timeId; private LocalDateTime timeId;
@@ -22,5 +23,5 @@ public class RStatOnlinerateVO {
private Integer offlineMin; private Integer offlineMin;
private Float onlineRate; private BigDecimal onlineRate;
} }

View File

@@ -77,6 +77,18 @@ public class TerminalOnlineRateDataVO implements Serializable {
@ApiModelProperty(name = "onlineRate",value = "在线率") @ApiModelProperty(name = "onlineRate",value = "在线率")
private Double onlineRate; private Double onlineRate;
/**
* 在线分钟数
*/
@ApiModelProperty(name = "onlineMin",value = "在线分钟数")
private Integer onlineMin;
/**
* 离线分钟数
*/
@ApiModelProperty(name = "offlineMin",value = "离线分钟数")
private Integer offlineMin;
/** /**
* 最新数据时间 * 最新数据时间
*/ */

View File

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@@ -23,7 +24,7 @@ public class DeviceOnlineRate {
private Integer belowNum; private Integer belowNum;
@ApiModelProperty("总终端在线率") @ApiModelProperty("总终端在线率")
private String totalOnlineRate; private BigDecimal totalOnlineRate;
@ApiModelProperty("统计信息") @ApiModelProperty("统计信息")
List<CitDetail> citDetailList; List<CitDetail> citDetailList;
@@ -41,7 +42,7 @@ public class DeviceOnlineRate {
private Integer citBelowNum; private Integer citBelowNum;
@ApiModelProperty("总终端在线率") @ApiModelProperty("总终端在线率")
private String citTotalOnlineRate; private BigDecimal citTotalOnlineRate;
@ApiModelProperty("统计信息") @ApiModelProperty("统计信息")
List<?> detailList; List<?> detailList;
@@ -82,7 +83,7 @@ public class DeviceOnlineRate {
private LocalDateTime timeID; private LocalDateTime timeID;
@ApiModelProperty("在线率") @ApiModelProperty("在线率")
private String onlineRate; private BigDecimal onlineRate;
} }
@Data @Data
@@ -123,7 +124,7 @@ public class DeviceOnlineRate {
private LocalDateTime latestTime; private LocalDateTime latestTime;
@ApiModelProperty("数据完整性") @ApiModelProperty("数据完整性")
private Double integrity; private BigDecimal integrity;
} }
} }

View File

@@ -0,0 +1,225 @@
package com.njcn.device.pq.pojo.vo.dataClean;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* @version 1.0.0
* @author: chenchao
* @date: 2022/07/18 11:04
*/
@Getter
@Setter
@EqualsAndHashCode
public class DataVerifyExcel implements Serializable {
private String lineId;
@ColumnWidth(20)
@ExcelProperty(value = "供电公司")
@Excel(name = "供电公司")
private String city;
@ColumnWidth(20)
@ExcelProperty(value = "所属变电站")
@Excel(name = "所属变电站")
private String stationName;
@ColumnWidth(20)
@ExcelProperty(value = "终端名称")
@Excel(name = "终端名称")
private String devName;
@ColumnWidth(20)
@ExcelProperty(value = "监测点名称")
@Excel(name = "监测点名称")
private String lineName;
@ColumnWidth(20)
@ExcelProperty(value = "IP")
@Excel(name = "IP")
private String ip;
@ColumnWidth(20)
@ExcelProperty(value = "干扰源类型")
@Excel(name = "干扰源类型")
private String loadType;
@ColumnWidth(20)
@ExcelProperty(value = "监测对象名称")
@Excel(name = "监测对象名称")
private String objName;
@ColumnWidth(20)
@ExcelProperty(value = "电网侧变电站")
@Excel(name = "电网侧变电站")
private String powerSubstationName;
@ColumnWidth(20)
@ExcelProperty(value = "厂商")
@Excel(name = "厂商")
private String manufacturer;
@ColumnWidth(20)
@ExcelProperty(value = "总指标异常时间")
@Excel(name = "总指标异常时间")
private Integer allTime;
@ColumnWidth(20)
@ExcelProperty(value = "频率")
@Excel(name = "频率")
private Integer freqTime;
@ColumnWidth(20)
@ExcelProperty(value = "频率偏差")
@Excel(name = "频率偏差")
private Integer freqDevTime;
@ColumnWidth(20)
@ExcelProperty(value = "相电压有效值")
@Excel(name = "相电压有效值")
private Integer vRmsTime;
@ColumnWidth(20)
@ExcelProperty(value = "正序电压")
@Excel(name = "正序电压")
private Integer vPosTime;
@ColumnWidth(20)
@ExcelProperty(value = "负序电压")
@Excel(name = "负序电压")
private Integer vNegTime;
@ColumnWidth(20)
@ExcelProperty(value = "零序电压")
@Excel(name = "零序电压")
private Integer vZeroTime;
@ColumnWidth(20)
@ExcelProperty(value = "电压不平衡度")
@Excel(name = "电压不平衡度")
private Integer vUnbalanceTime;
@ColumnWidth(20)
@ExcelProperty(value = "线电压有效值")
@Excel(name = "线电压有效值")
private Integer rmsLvrTime;
@ColumnWidth(20)
@ExcelProperty(value = "电压正偏差")
@Excel(name = "电压正偏差")
private Integer vuDevTime;
@ColumnWidth(20)
@ExcelProperty(value = "电压负偏差")
@Excel(name = "电压负偏差")
private Integer vlDevTime;
@ColumnWidth(25)
@ExcelProperty(value = "电压总谐波畸变率")
@Excel(name = "电压总谐波畸变率")
private Integer vThdTime;
@ColumnWidth(25)
@ExcelProperty(value = "相电压基波有效值")
@Excel(name = "相电压基波有效值")
private Integer vTime;
@ColumnWidth(20)
@ExcelProperty(value = "电流有效值")
@Excel(name = "电流有效值")
private Integer iRmsTime;
@ColumnWidth(20)
@ExcelProperty(value = "长时闪变")
@Excel(name = "长时闪变")
private Integer pltTime;
@ColumnWidth(25)
@ExcelProperty(value = "间谐波电压含有率")
@Excel(name = "间谐波电压含有率")
private Integer vInharmTime;
@ColumnWidth(25)
@ExcelProperty(value = "谐波电压含有率")
@Excel(name = "谐波电压含有率")
private Integer vHarmTime;
@ColumnWidth(20)
@ExcelProperty(value = "功率因数")
@Excel(name = "功率因数")
private Integer pfTime;
@ColumnWidth(20)
@ExcelProperty(value = "谐波电压相角")
@Excel(name = "谐波电压相角")
private Integer vPhasicTime;
@ColumnWidth(20)
@ExcelProperty(value = "谐波电压基波相角")
@Excel(name = "谐波电压基波相角")
private Integer v1PhasicTime;
@ColumnWidth(20)
@ExcelProperty(value = "电压波动")
@Excel(name = "电压波动")
private Integer flucTime;
@ColumnWidth(20)
@ExcelProperty(value = "短时闪变")
@Excel(name = "短时闪变")
private Integer pstTime;
@ColumnWidth(20)
@ExcelProperty(value = "电压暂降")
@Excel(name = "电压暂降")
private Integer dipTime;
@ColumnWidth(20)
@ExcelProperty(value = "电压暂升")
@Excel(name = "电压暂升")
private Integer riseTime;
// 字段名 ↔ Excel列名 映射
public static final Map<String, String> FIELD_COLUMN_MAP = new HashMap<>();
static {
// 按代码中字段顺序整理,确保一一对应
FIELD_COLUMN_MAP.put("freqTime", "频率");
FIELD_COLUMN_MAP.put("freqDevTime", "频率偏差");
FIELD_COLUMN_MAP.put("vRmsTime", "相电压有效值");
FIELD_COLUMN_MAP.put("vPosTime", "正序电压");
FIELD_COLUMN_MAP.put("vNegTime", "负序电压");
FIELD_COLUMN_MAP.put("vZeroTime", "零序电压");
FIELD_COLUMN_MAP.put("vUnbalanceTime", "电压不平衡度");
FIELD_COLUMN_MAP.put("rmsLvrTime", "线电压有效值");
FIELD_COLUMN_MAP.put("vuDevTime", "电压正偏差");
FIELD_COLUMN_MAP.put("vlDevTime", "电压负偏差");
FIELD_COLUMN_MAP.put("vThdTime", "电压总谐波畸变率");
FIELD_COLUMN_MAP.put("vTime", "相电压基波有效值");
FIELD_COLUMN_MAP.put("iRmsTime", "电流有效值");
FIELD_COLUMN_MAP.put("pltTime", "长时闪变");
FIELD_COLUMN_MAP.put("vInharmTime", "间谐波电压含有率");
FIELD_COLUMN_MAP.put("vHarmTime", "谐波电压含有率");
FIELD_COLUMN_MAP.put("pfTime", "功率因数");
FIELD_COLUMN_MAP.put("vPhasicTime", "谐波电压相角");
FIELD_COLUMN_MAP.put("v1PhasicTime", "谐波电压基波相角");
FIELD_COLUMN_MAP.put("flucTime", "电压波动");
FIELD_COLUMN_MAP.put("pstTime", "短时闪变");
FIELD_COLUMN_MAP.put("dipTime", "电压暂降");
FIELD_COLUMN_MAP.put("riseTime", "电压暂升");
}
}

View File

@@ -1,7 +1,10 @@
package com.njcn.device.pq.pojo.vo.dataClean; package com.njcn.device.pq.pojo.vo.dataClean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @Author: cdf * @Author: cdf
* @CreateTime: 2025-03-31 * @CreateTime: 2025-03-31
@@ -14,6 +17,8 @@ public class DetailAbnormalVO {
private String date; private String date;
private List<TimeAndTargetKey> dateTargetList;
private String monitorName; private String monitorName;
private String bdName; private String bdName;
@@ -24,7 +29,13 @@ public class DetailAbnormalVO {
private String targetKey; private String targetKey;
@Data
public static class TimeAndTargetKey {
private String date;
private List<VerifyTargetVO> targetKeys;
}
/** /**
* 异常实体 * 异常实体
*/ */
@@ -55,6 +66,23 @@ public class DetailAbnormalVO {
} }
@Data
public static class DetailAbnormalCountVO {
private Integer timeSum;
private Integer errCount;
private List<DetailAbnormalInnerVO> time;
}
@Data
public static class DetailLimitCountVO {
private Integer timeSum;
private Integer errCount;
private List<DetailLimitInnerVO> time;
}
@Data @Data
public static class DetailLimitInnerVO{ public static class DetailLimitInnerVO{
@@ -78,4 +106,96 @@ public class DetailAbnormalVO {
//限值 //限值
private float overLimitValue; private float overLimitValue;
} }
@Data
public static class Assess {
/**
* 频率偏差
*/
@ApiModelProperty("频率偏差")
private Double freqData = 3.14159;
@ApiModelProperty("频率偏差限值")
private Float freqLimit = 3.14159F;
/**
* 电压闪变
*/
@ApiModelProperty("电压闪变")
private Double flickerData = 3.14159;
@ApiModelProperty("电压闪变限值")
private Float flickerLimit = 3.14159F;
/**
* 电压偏差上
*/
@ApiModelProperty("电压上偏差")
private Double vDevData = 3.14159;
@ApiModelProperty("电压上偏差限值")
private Float vDevLimit = 3.14159F;
/**
* 电压偏差下
*/
@ApiModelProperty("电压下偏差")
private Double uDevData = 3.14159;
@ApiModelProperty("电压下偏差限值")
private Float uDevLimit = 3.14159F;
/**
* 三相电压不平衡度
*/
@ApiModelProperty("三相电压不平衡度")
private Double unbalanceData = 3.14159;
@ApiModelProperty("三相电压不平衡度限值")
private Float unbalanceLimit = 3.14159F;
/**
* 总谐波畸变率
*/
@ApiModelProperty("总谐波畸变率")
private Double uaberranceData = 3.14159;
@ApiModelProperty("总谐波畸变率限值")
private Float uaberranceLimit = 3.14159F;
/**
* 负序电流限值天数
*/
@ApiModelProperty("负序电流")
private Double iNegData= 3.14159;
@ApiModelProperty("负序电流限值")
private Float iNegLimit= 3.14159F;
/**
* 谐波电压越限天数
*/
@ApiModelProperty("谐波电压")
private Double uharmData = 3.14159;
@ApiModelProperty("谐波电压限值")
private Float uharmLimit= 3.14159F;
/**
* 谐波电流越限天数
*/
@ApiModelProperty("谐波电流")
private Double iharmData = 3.14159;
@ApiModelProperty("谐波电流限值")
private Float iharmLimit= 3.14159F;
/**
* 间谐波限值天数
*/
@ApiModelProperty("间谐波电压")
private Double inuharmData = 3.14159;
@ApiModelProperty("间谐波电压限值")
private Float inuharmLimit= 3.14159F;
}
} }

View File

@@ -13,10 +13,10 @@ public class PowerQualityIndicatorsVO {
@ApiModelProperty(name = "monitorId",value = "监测点id") @ApiModelProperty(name = "monitorId",value = "监测点id")
private String monitorId; private String monitorId;
//监测点名称
@ApiModelProperty(name = "monitorName",value = "监测点名称") @ApiModelProperty(name = "monitorName",value = "监测点名称")
private String monitorName; private String monitorName;
//所属终端名称
@ApiModelProperty(name = "devName",value = "所属终端名称") @ApiModelProperty(name = "devName",value = "所属终端名称")
private String devName; private String devName;
@@ -25,23 +25,25 @@ public class PowerQualityIndicatorsVO {
@ApiModelProperty(name = "manufacturer",value = "所属厂商") @ApiModelProperty(name = "manufacturer",value = "所属厂商")
private String manufacturer; private String manufacturer;
//所属电站
@ApiModelProperty(name = "stationName",value = "所属电站") @ApiModelProperty(name = "stationName",value = "所属电站")
private String stationName; private String stationName;
//监测对象类型
@ApiModelProperty(name = "objType",value = "监测对象类型") @ApiModelProperty(name = "objType",value = "监测对象类型")
private String objType; private String objType;
//监测对象名称
@ApiModelProperty(name = "objName",value = "监测对象名称") @ApiModelProperty(name = "objName",value = "监测对象名称")
private String objName; private String objName;
//电压等级
@ApiModelProperty(name = "voltageLevel",value = "电压等级") @ApiModelProperty(name = "voltageLevel",value = "电压等级")
private String voltageLevel; private String voltageLevel;
//异常天数
@ApiModelProperty(name = "abnormalDay",value = "异常天数") @ApiModelProperty(name = "abnormalDay",value = "异常天数")
private Integer abnormalDay; private Integer abnormalDay;
//严重度
@ApiModelProperty(name = "severity",value = "严重度") @ApiModelProperty(name = "severity",value = "严重度")
private Integer severity; private Integer severity;
@ApiModelProperty("地市")
private String city;
} }

View File

@@ -0,0 +1,206 @@
package com.njcn.device.pq.utils;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
import com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel;
import org.apache.poi.ss.usermodel.Sheet;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.*;
/**
* 修复版按数据量动态排序Excel列解决列挤在一行的问题
* 关键改动:表头构建方式 + 列宽匹配逻辑
*/
public class FixedDynamicExcelExport {
public static void main(String[] args) throws Exception {
// 1. 模拟测试数据(相电压数据量最多,频率次之,频率偏差最少)
List<DataVerifyExcel> dataList = EasyExcel.read("F:\\usr\\response.xlsx")
.head(DataVerifyExcel.class)
.doReadAllSync();
// 2. 导出Excel替换为你的本地路径比如桌面
dataList.sort(Comparator.comparing((DataVerifyExcel item) -> item.getCity() + "_" + item.getStationName()+"_"+item.getDevName())
.thenComparing(DataVerifyExcel::getAllTime, Comparator.reverseOrder())
);
exportExcelByDataSize(dataList, "D:/dynamic_excel_fixed.xlsx");
System.out.println("导出完成!打开桌面的「测试导出.xlsx」查看效果");
}
/**
* 核心方法按数据量排序导出Excel
*/
public static void exportExcelByDataSize(List<DataVerifyExcel> dataList, String outputPath) throws Exception {
// 步骤1统计每个字段的有效数据量
Map<String, Integer> fieldCount = countValidData(dataList);
// 步骤2按数据量降序排序字段名
List<String> sortedFields = sortFields(fieldCount);
// 步骤3构建正确的动态表头
List<List<String>> head = buildCorrectHead(sortedFields);
// 步骤4构建对应顺序的行数据
List<List<Object>> data = buildRowData(dataList, sortedFields);
// 步骤5导出Excel含列宽设置
try (FileOutputStream out = new FileOutputStream(outputPath)) {
EasyExcel.write(out)
.head(head)
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(20))
.registerWriteHandler(new FreezeHeaderHandler()) // 用修复后的表头
.sheet("数据统计")
.doWrite(data);
}
}
public static void exportExcelByDataSize(List<DataVerifyExcel> dataList, OutputStream outputStream) {
// 步骤1统计每个字段的有效数据量
Map<String, Integer> fieldCount = countValidData(dataList);
// 步骤2按数据量降序排序字段名
List<String> sortedFields = sortFields(fieldCount);
// 步骤3构建正确的动态表头
List<List<String>> head = buildCorrectHead(sortedFields);
// 步骤4构建对应顺序的行数据
List<List<Object>> data = buildRowData(dataList, sortedFields);
// 步骤5导出Excel含列宽设置
EasyExcel.write(outputStream)
.head(head)
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(20))
.registerWriteHandler(new FreezeHeaderHandler()) // 用修复后的表头
.sheet("数据统计")
.doWrite(data);
}
public static class FreezeHeaderHandler implements SheetWriteHandler {
@Override
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
// 表格创建前无需操作
}
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
Sheet sheet = writeSheetHolder.getSheet();
// freezePane(c, r)c=冻结列数r=冻结行数这里r=1表示冻结第1行表头c=0表示不冻结列
// 比如 freezePane(1, 1) 表示冻结第一列+第一行
sheet.createFreezePane(0, 1);
}
}
// ★ 修复点1构建正确的表头每个列名独立成List
private static List<List<String>> buildCorrectHead(List<String> allFields) {
List<List<String>> head = new ArrayList<>();
head.add(Collections.singletonList("供电公司"));
head.add(Collections.singletonList("所属变电站"));
head.add(Collections.singletonList("终端名称"));
head.add(Collections.singletonList("监测点名称"));
head.add(Collections.singletonList("IP"));
head.add(Collections.singletonList("干扰源类型"));
head.add(Collections.singletonList("监测对象名称"));
head.add(Collections.singletonList("电网侧变电站"));
head.add(Collections.singletonList("厂商"));
head.add(Collections.singletonList("总指标异常时间"));
List<String> sortedFields = allFields.subList(10, allFields.size());
for (String field : sortedFields) {
// 每个列名单独封装成ListEasyExcel才能识别为不同列
head.add(Collections.singletonList(DataVerifyExcel.FIELD_COLUMN_MAP.get(field)));
}
return head;
}
// 统计有效数据量(无改动,保留)
private static Map<String, Integer> countValidData(List<DataVerifyExcel> dataList) {
// 1. 初始化计数字典反射自动提取所有Time结尾的Integer字段初始值0
Map<String, Integer> countMap = initCountMap();
// 2. 判空,避免空指针异常
if (dataList == null || dataList.isEmpty()) {
return countMap;
}
// 3. 获取DataStatistic类的所有字段
Field[] fields = DataVerifyExcel.class.getDeclaredFields();
try {
// 4. 遍历每个数据对象
for (DataVerifyExcel data : dataList) {
// 5. 遍历每个字段,累加数值
for (Field field : fields) {
// 过滤条件Integer类型 + 以Time结尾
if (field.getType() == Integer.class && field.getName().endsWith("Time") ) {
if(!field.getName().equals("allTime")){
// 设置可访问私有字段
field.setAccessible(true);
// 获取当前对象的该字段值
Integer value = (Integer) field.get(data);
// 非空则累加
if (value != null) {
String fieldName = field.getName();
countMap.put(fieldName, countMap.get(fieldName) + value);
}
}
}
}
}
} catch (IllegalAccessException e) {
// 捕获反射访问异常,便于排查问题
throw new RuntimeException("统计字段时反射访问失败", e);
}
return countMap;
}
// 反射初始化计数字典(复用之前的逻辑)
private static Map<String, Integer> initCountMap() {
Map<String, Integer> countMap = new HashMap<>();
Field[] fields = DataVerifyExcel.class.getDeclaredFields();
for (Field field : fields) {
if (field.getType() == Integer.class && field.getName().endsWith("Time")) {
if(!field.getName().equals("allTime")){
countMap.put(field.getName(), 0);
}
}
}
return countMap;
}
// 按数据量排序字段(无改动,保留)
private static List<String> sortFields(Map<String, Integer> fieldCount) {
List<String> fields = new ArrayList<>(fieldCount.keySet());
fields.sort((f1, f2) -> fieldCount.get(f2) - fieldCount.get(f1)); // 降序
List<String> fieldAlls=new ArrayList<>();
fieldAlls.add("city");
fieldAlls.add("stationName");
fieldAlls.add("devName");
fieldAlls.add("lineName");
fieldAlls.add("ip");
fieldAlls.add("loadType");
fieldAlls.add("objName");
fieldAlls.add("powerSubstationName");
fieldAlls.add("manufacturer");
fieldAlls.add("allTime");
fieldAlls.addAll(fields);
return fieldAlls;
}
// 构建行数据(无改动,保留)
private static List<List<Object>> buildRowData(List<DataVerifyExcel> dataList, List<String> sortedFields) {
List<List<Object>> rows = new ArrayList<>();
for (DataVerifyExcel data : dataList) {
List<Object> row = new ArrayList<>();
for (String field : sortedFields) {
try {
Field f = DataVerifyExcel.class.getDeclaredField(field);
f.setAccessible(true);
row.add(f.get(data));
} catch (Exception e) {
throw new RuntimeException("导出异常数据转换异常:"+e);
}
}
rows.add(row);
}
return rows;
}
}

View File

@@ -15,6 +15,7 @@ import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import com.njcn.device.line.mapper.LineMapper; import com.njcn.device.line.mapper.LineMapper;
import com.njcn.device.line.service.LineService; import com.njcn.device.line.service.LineService;
import com.njcn.device.line.mapper.LineDetailMapper; import com.njcn.device.line.mapper.LineDetailMapper;
import com.njcn.device.biz.pojo.dto.MonitorCommLedgerInfoDTO;
import com.njcn.device.pq.service.CommTerminalService; import com.njcn.device.pq.service.CommTerminalService;
import com.njcn.device.pq.service.IPqsDeviceUnitService; import com.njcn.device.pq.service.IPqsDeviceUnitService;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
@@ -109,8 +110,34 @@ public class CommTerminalController extends BaseController {
} }
/**
* 根据部门id获取部门监测点台账信息
* @param deptGetLineParam
* @return
*/
@PostMapping("deptGetLineInfo")
@ApiOperation("根据部门id获取部门监测点台账信息")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
public HttpResult<List<MonitorCommLedgerInfoDTO>> deptGetLineInfo(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
String methodDescribe = getMethodDescribe("deptGetLineInfo");
List<MonitorCommLedgerInfoDTO> result = commTerminalService.deptGetLineInfo(deptGetLineParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
@PostMapping("deptGetAllLine")
@ApiOperation("根据单位获取监测点信息(all line)")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
public HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
TimeInterval timer = new TimeInterval();
String methodDescribe = getMethodDescribe("deptGetLine");
List<DeptGetChildrenMoreDTO> result = commTerminalService.deptGetAllLine(deptGetLineParam);
log.info("运行时长" + timer.intervalSecond());
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
/** /**
* 根据单位获取所有变电站 * 根据单位获取所有变电站
* @author cdf * @author cdf

View File

@@ -16,18 +16,18 @@ import com.njcn.device.pq.service.IPqDataVerifyBakService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
* <p> * <p>
* 异常数据功能 * 异常数据功能
* </p> * </p>
* *
* @author cdf * @author cdf
@@ -50,7 +50,7 @@ public class DataVerifyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitorVerifyData") @PostMapping("/getMonitorVerifyData")
@ApiOperation("异常-获取异常数据主页面") @ApiOperation("异常-获取异常数据主页面")
public HttpResult<VerifyMonitorVO> getMonitorVerifyData(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<VerifyMonitorVO> getMonitorVerifyData(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("getMonitorVerifyData"); String methodDescribe = getMethodDescribe("getMonitorVerifyData");
VerifyMonitorVO verifyMonitorVO = iPqDataVerifyBakService.getMonitorVerifyData(monitorBaseParam); VerifyMonitorVO verifyMonitorVO = iPqDataVerifyBakService.getMonitorVerifyData(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
@@ -59,7 +59,7 @@ public class DataVerifyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitorVerifyDay") @PostMapping("/getMonitorVerifyDay")
@ApiOperation("异常-更新按钮-获取异常数据列表") @ApiOperation("异常-更新按钮-获取异常数据列表")
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorVerifyDay(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorVerifyDay(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("getMonitorVerifyDay"); String methodDescribe = getMethodDescribe("getMonitorVerifyDay");
List<PowerQualityIndicatorsVO> list = iPqDataVerifyBakService.getMonitorVerifyDay(monitorBaseParam); List<PowerQualityIndicatorsVO> list = iPqDataVerifyBakService.getMonitorVerifyDay(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
@@ -72,35 +72,33 @@ public class DataVerifyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/monitorAbnormalTable") @PostMapping("/monitorAbnormalTable")
@ApiOperation("异常-弹框-获取异常监测点列表") @ApiOperation("异常-弹框-获取异常监测点列表")
public HttpResult<List<DetailAbnormalVO>> monitorAbnormalTable(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<List<DetailAbnormalVO>> monitorAbnormalTable(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("monitorAbnormalDetail"); String methodDescribe = getMethodDescribe("monitorAbnormalDetail");
List<DetailAbnormalVO> page = iPqDataVerifyBakService.monitorAbnormalTable(monitorBaseParam); List<DetailAbnormalVO> page = iPqDataVerifyBakService.monitorAbnormalTable(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
} }
/** /**
* 获取稳态告警监测点相关信息 * 获取稳态告警监测点相关信息
*/ */
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/monitorAbnormalTableDetail") @PostMapping("/monitorAbnormalTableDetail")
@ApiOperation("弹框-获取异常监测点列表详情") @ApiOperation("弹框-获取异常监测点列表详情")
public HttpResult<List<DetailAbnormalVO.DetailAbnormalInnerVO>> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<DetailAbnormalVO.DetailAbnormalCountVO> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail"); String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail");
List<DetailAbnormalVO.DetailAbnormalInnerVO> list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam); DetailAbnormalVO.DetailAbnormalCountVO list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }
/** /**
* 获取稳态告警数据 * 获取稳态告警数据
*/ */
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitorLimitData") @PostMapping("/getMonitorLimitData")
@ApiOperation("获取稳态告警数据") @ApiOperation("获取稳态告警数据")
public HttpResult<VerifyMonitorVO> getMonitorLimitData(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<VerifyMonitorVO> getMonitorLimitData(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("getMonitorLimitData"); String methodDescribe = getMethodDescribe("getMonitorLimitData");
VerifyMonitorVO verifyMonitorVO = iDataVerifyService.getMonitorLimitData(monitorBaseParam); VerifyMonitorVO verifyMonitorVO = iDataVerifyService.getMonitorLimitData(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
@@ -109,7 +107,7 @@ public class DataVerifyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitorLimitDataDay") @PostMapping("/getMonitorLimitDataDay")
@ApiOperation("更新按钮-获取稳态告警数据") @ApiOperation("更新按钮-获取稳态告警数据")
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorLimitDataDay(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorLimitDataDay(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("getMonitorLimitDataDay"); String methodDescribe = getMethodDescribe("getMonitorLimitDataDay");
List<PowerQualityIndicatorsVO> verifyMonitorVO = iDataVerifyService.getMonitorLimitDataDay(monitorBaseParam); List<PowerQualityIndicatorsVO> verifyMonitorVO = iDataVerifyService.getMonitorLimitDataDay(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
@@ -121,7 +119,7 @@ public class DataVerifyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/monitorLimitTable") @PostMapping("/monitorLimitTable")
@ApiOperation("弹框-获取稳态告警监测点列表") @ApiOperation("弹框-获取稳态告警监测点列表")
public HttpResult<List<DetailAbnormalVO>> monitorLimitTable(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<List<DetailAbnormalVO>> monitorLimitTable(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("monitorLimitTable"); String methodDescribe = getMethodDescribe("monitorLimitTable");
List<DetailAbnormalVO> list = iDataVerifyService.monitorLimitTable(monitorBaseParam); List<DetailAbnormalVO> list = iDataVerifyService.monitorLimitTable(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
@@ -134,12 +132,32 @@ public class DataVerifyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/monitorLimitTableDetail") @PostMapping("/monitorLimitTableDetail")
@ApiOperation("弹框-获取稳态告警监测点列表详情") @ApiOperation("弹框-获取稳态告警监测点列表详情")
public HttpResult<List<DetailAbnormalVO.DetailLimitInnerVO>> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<DetailAbnormalVO.DetailLimitCountVO> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("monitorLimitTableDetail"); String methodDescribe = getMethodDescribe("monitorLimitTableDetail");
List<DetailAbnormalVO.DetailLimitInnerVO> list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam); DetailAbnormalVO.DetailLimitCountVO list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/limitTableDetail")
@ApiOperation("监测点评价")
public HttpResult<DetailAbnormalVO.Assess> limitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("limitTableDetail");
DetailAbnormalVO.Assess list = iDataVerifyService.limitTableDetail(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/dataVerifyExcel")
@ApiOperation(value = "导出异常监测点列表", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
iPqDataVerifyBakService.dataVerifyExcel(response, monitorBaseParam);
}
} }

View File

@@ -168,10 +168,10 @@ public class DeptLineController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/getAllData") @PostMapping("/getAllData")
@ApiOperation("获取部门监测点表所有数据") @ApiOperation("获取部门监测点表数据(仅查询在运监测点)")
public HttpResult<List<DeptLine>> getAllData() { public HttpResult<List<DeptLine>> getAllData() {
String methodDescribe = getMethodDescribe("getAllData"); String methodDescribe = getMethodDescribe("getAllData");
List<DeptLine> list = deptLineMapper.selectList(null); List<DeptLine> list = deptLineMapper.getOnlineMonitor();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }
} }

View File

@@ -81,6 +81,7 @@ public class DeviceRunEvaluateController extends BaseController {
@ApiOperation("终端评价列表(冀北)") @ApiOperation("终端评价列表(冀北)")
public HttpResult<List<DeviceRunEvaluateVO.Detail>> getRunEvaluateInfo(@RequestBody DeviceInfoParam.BusinessParam businessParam) { public HttpResult<List<DeviceRunEvaluateVO.Detail>> getRunEvaluateInfo(@RequestBody DeviceInfoParam.BusinessParam businessParam) {
String methodDescribe = getMethodDescribe("getRunEvaluateInfo"); String methodDescribe = getMethodDescribe("getRunEvaluateInfo");
businessParam.setLineOrDevice(1);
List<DeviceRunEvaluateVO.Detail> runEvaluate = deviceRunEvaluateService.getRunEvaluate(businessParam); List<DeviceRunEvaluateVO.Detail> runEvaluate = deviceRunEvaluateService.getRunEvaluate(businessParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runEvaluate, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runEvaluate, methodDescribe);
} }

View File

@@ -136,6 +136,22 @@ public class GeneralDeviceInfoController extends BaseController {
} }
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getPracticalAllDeviceInfoAsSubstation")
@ApiOperation("获取按变电站分类的所有终端综合信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
})
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
String methodDescribe = getMethodDescribe("getPracticalAllDeviceInfoAsSubstation");
List<GeneralDeviceDTO> substationDeviceInfos = generalDeviceService.getDeviceInfoAsSubstation(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
if (CollectionUtil.isEmpty(substationDeviceInfos)) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new ArrayList<>(), methodDescribe);
} else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, substationDeviceInfos, methodDescribe);
}
}
/** /**
* 获取实际运行终端综合信息 * 获取实际运行终端综合信息
*/ */
@@ -269,9 +285,9 @@ public class GeneralDeviceInfoController extends BaseController {
@PostMapping("/getOnlineRateByDevIds") @PostMapping("/getOnlineRateByDevIds")
@ApiOperation("终端在线率(谐波专用)") @ApiOperation("终端在线率(谐波专用)")
@ApiImplicitParam(name = "param", value = "参数实体", required = true) @ApiImplicitParam(name = "param", value = "参数实体", required = true)
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) { public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds"); String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
List<RStatOnlinerateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param); List<RStatOnlineRateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe);
} }

View File

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

View File

@@ -16,6 +16,7 @@ import com.njcn.device.pq.pojo.param.LineDataQualityParam;
import com.njcn.device.pq.pojo.param.LineIntegrityDataParam; import com.njcn.device.pq.pojo.param.LineIntegrityDataParam;
import com.njcn.device.pq.pojo.po.RStatIntegrityD; import com.njcn.device.pq.pojo.po.RStatIntegrityD;
import com.njcn.device.pq.pojo.vo.LineIntegrityDataVO; import com.njcn.device.pq.pojo.vo.LineIntegrityDataVO;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate; import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
import com.njcn.device.pq.service.IRStatIntegrityDService; import com.njcn.device.pq.service.IRStatIntegrityDService;
import com.njcn.device.pq.service.LineIntegrityDataService; import com.njcn.device.pq.service.LineIntegrityDataService;
@@ -153,9 +154,20 @@ public class LineIntegrityDataController extends BaseController {
@ApiOperation("监测点数据完整性(冀北)") @ApiOperation("监测点数据完整性(冀北)")
@ApiImplicitParam(name = "param", value = "参数实体", required = true) @ApiImplicitParam(name = "param", value = "参数实体", required = true)
public HttpResult<DeviceOnlineRate> getData(@RequestBody DeviceInfoParam.BusinessParam param) { public HttpResult<DeviceOnlineRate> getData(@RequestBody DeviceInfoParam.BusinessParam param) {
param.setLineOrDevice(0);
String methodDescribe = getMethodDescribe("getData"); String methodDescribe = getMethodDescribe("getData");
DeviceOnlineRate rate = irStatIntegrityDService.getData(param); DeviceOnlineRate rate = irStatIntegrityDService.getData(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/noData")
@ApiOperation("监测点数据完整性为0的数据(冀北)")
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
public HttpResult<List<OnlineMonitorVo>> getNoData(@RequestBody LineBaseQueryParam param) {
String methodDescribe = getMethodDescribe("getNoData");
List<OnlineMonitorVo> rate = irStatIntegrityDService.getNoData(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
}
} }

View File

@@ -0,0 +1,52 @@
package com.njcn.device.pq.controller;
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.device.pq.pojo.param.LineBaseQueryParam;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import com.njcn.device.pq.service.IPqDataVerifyCountService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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 java.util.List;
/**
* <p>
* 异常数据功能
* </p>
*
* @author xy
* @since 2025-12-10
*/
@RestController
@RequestMapping("/dataVerifyCount")
@RequiredArgsConstructor
@Api(tags = "异常数据数量统计")
public class PqDataVerifyCountController extends BaseController {
private final IPqDataVerifyCountService pqDataVerifyCountService;
/**
* 获取有异常数据的监测点相关信息
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getAnomalousData")
@ApiOperation("异常-获取异常数据主页面")
public HttpResult<List<OnlineMonitorVo>> getAnomalousData(@RequestBody LineBaseQueryParam param){
String methodDescribe = getMethodDescribe("getMonitorVerifyData");
List<OnlineMonitorVo> list = pqDataVerifyCountService.getAnomalousData(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
}

View File

@@ -6,13 +6,11 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper; import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
import com.njcn.device.pq.pojo.param.OnlineRateParam; import com.njcn.device.pq.pojo.param.OnlineRateParam;
import com.njcn.device.pq.pojo.param.TerminalOnlineRateDataParam; import com.njcn.device.pq.pojo.param.TerminalOnlineRateDataParam;
import com.njcn.device.pq.pojo.vo.OnlineRateCensusVO; import com.njcn.device.pq.pojo.vo.OnlineRateCensusVO;
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO; import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
import com.njcn.device.pq.pojo.vo.TerminalOnlineRateDataVO; import com.njcn.device.pq.pojo.vo.TerminalOnlineRateDataVO;
import com.njcn.device.pq.service.TerminalOnlineRateDataService; import com.njcn.device.pq.service.TerminalOnlineRateDataService;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
@@ -80,9 +78,9 @@ public class TerminalOnlineRateDataController extends BaseController {
@PostMapping("/getOnlineRateByDevIds") @PostMapping("/getOnlineRateByDevIds")
@ApiOperation("终端在线率(谐波专用)") @ApiOperation("终端在线率(谐波专用)")
@ApiImplicitParam(name = "param", value = "参数实体", required = true) @ApiImplicitParam(name = "param", value = "参数实体", required = true)
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) { public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds"); String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
List<RStatOnlinerateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param); List<RStatOnlineRateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe);
} }

View File

@@ -0,0 +1,121 @@
package com.njcn.device.pq.controller.jb;
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.common.utils.LogUtil;
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.param.TaiZhangParam;
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
import com.njcn.device.pq.service.IPowerDistributionAreaService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 台区信息增删改查
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
@Slf4j
@RestController
@RequestMapping("/distributionArea")
@Api(tags = "台账-台区信息")
@RequiredArgsConstructor
@Validated
public class PmsPowerDistributionAreaController extends BaseController {
private final IPowerDistributionAreaService powerDistributionAreaService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("getPowerDistributionAreaList")
@ApiOperation("分页查询台区所有信息")
@ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true)
public HttpResult<Page<DistributionArea>> getList(@RequestBody TaiZhangParam baseParam){
String methodDescribe = getMethodDescribe("getList");
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
Page<DistributionArea> res = powerDistributionAreaService.getList(baseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe);
}
/**
* 新增台区信息
* @author hany
* @date 2022/10/26
*/
@PostMapping("/addPowerDistributionArea")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType=OperateType.ADD)
@ApiOperation("新增台区信息")
@ApiImplicitParam(name = "newParam", value = "模板实体", required = true)
@TerminalOperationLogDesc(value = "新增台区信息",module = 3)
public HttpResult<Object> add(@RequestBody @Validated PowerDistributionareaParam newParam){
String methodDescribe = getMethodDescribe("add");
boolean result = powerDistributionAreaService.add(newParam);
if (result) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
}
/**
* 修改台区信息
* @author hany
* @date 2022/10/26
*/
@PostMapping("/updatePowerDistributionArea")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
@ApiOperation("修改台区信息")
@ApiImplicitParam(name = "UpdateParam", value = "更新实体", required = true)
@TerminalOperationLogDesc(value = "修改台区信息",module = 3)
public HttpResult<Object> update(@RequestBody @Validated PowerDistributionareaParam UpdateParam){
String methodDescribe = getMethodDescribe("update");
boolean result = powerDistributionAreaService.update(UpdateParam);
if (result) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
}
/**
* 删除台区信息
* @param ids id
* @author hany
* @date 2022/10/26
*/
@PostMapping("/deletePowerDistributionArea")
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
@ApiOperation("删除台区信息")
@ApiImplicitParam(name = "ids", value = "ID索引", required = true)
@TerminalOperationLogDesc(value = "删除台区信息",module = 3)
public HttpResult<Object> delete(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delete");
boolean result = powerDistributionAreaService.delete(ids);
if(result){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
}
}

View File

@@ -0,0 +1,100 @@
package com.njcn.device.pq.controller.jb;
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.device.pms.annotation.TerminalOperationLogDesc;
import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
import com.njcn.device.pq.service.IPowerGenerationUserService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.Api;
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.*;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
@RestController
@RequestMapping("/generationUser")
@Api(tags = "台账-发电用户")
@RequiredArgsConstructor
public class PmsPowerGenerationUserController extends BaseController {
private final IPowerGenerationUserService iPowerGenerationUserService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/addPowerGenerationUser")
@ApiOperation("新增发电用户")
@ApiImplicitParam(name = "powerGenerationUserParam", value = "发电用户实体", required = true)
@TerminalOperationLogDesc(value = "新增发电用户",module = 4)
public HttpResult<Boolean> addPowerGenerationUser(@RequestBody @Validated PowerGenerationUserParam powerGenerationUserParam) {
String methodDescribe = getMethodDescribe("addPowerGenerationUser");
boolean result = iPowerGenerationUserService.addPowerGenerationUser(powerGenerationUserParam);
if(result){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
@PostMapping("/updatePowerGenerationUser")
@ApiOperation("修改发电用户")
@ApiImplicitParam(name = "powerGenerationUserParam", value = "发电用户实体", required = true)
@TerminalOperationLogDesc(value = "修改发电用户",module = 4)
public HttpResult<Boolean> updatePowerGenerationUser(@RequestBody @Validated PowerGenerationUserParam powerGenerationUserParam) {
String methodDescribe = getMethodDescribe("updatePowerGenerationUser");
boolean result = iPowerGenerationUserService.updatePowerGenerationUser(powerGenerationUserParam);
if(result){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
@DeleteMapping("/delPowerGenerationUser")
@ApiOperation("删除发电用户")
@ApiImplicitParam(name = "powerGenerationUserIds", value = "发电用户ids", required = true)
@TerminalOperationLogDesc(value = "删除发电用户",module = 4)
public HttpResult<Boolean> delPowerGenerationUser(@RequestBody @NotEmpty(message = "发电用户id不可为空") List<String> powerGenerationUserIds) {
String methodDescribe = getMethodDescribe("delPowerGenerationUser");
boolean result = iPowerGenerationUserService.delPowerGenerationUser(powerGenerationUserIds);
if(result){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getPowerGenerationUserPageList")
@ApiOperation("分页获取发电用户列表")
@ApiImplicitParam(name = "baseParam", value = "基本查询体", required = true)
public HttpResult<Page<GenerationUser>> getPowerGenerationUserPageList(@RequestBody BaseParam baseParam) {
String methodDescribe = getMethodDescribe("getPowerGenerationUserPageList");
Page<GenerationUser> result = iPowerGenerationUserService.getPowerGenerationUserPageList(baseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
}

View File

@@ -0,0 +1,19 @@
package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
/**
* <p>
* Mapper 台区
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
public interface PowerDistributionAreaMapper extends BaseMapper<DistributionArea> {
}

View File

@@ -0,0 +1,19 @@
package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
/**
* <p>
* Mapper 台区
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
public interface PowerGenerationUserMapper extends BaseMapper<GenerationUser> {
}

View File

@@ -1,7 +1,12 @@
package com.njcn.device.pq.mapper; package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
import com.njcn.device.pq.pojo.po.PqDataVerifyBak; import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
import com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p> * <p>
@@ -13,4 +18,5 @@ import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
*/ */
public interface PqDataVerifyBakMapper extends BaseMapper<PqDataVerifyBak> { public interface PqDataVerifyBakMapper extends BaseMapper<PqDataVerifyBak> {
List<DataVerifyExcel> selectDataVerifySum(@Param("param") MonitorBaseParam monitorBaseParam);
} }

View File

@@ -0,0 +1,25 @@
package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pq.pojo.param.OnlineRateParam;
import com.njcn.device.pq.pojo.po.PqDataVerifyCount;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author cdf
* @since 2025-06-10
*/
public interface PqDataVerifyCountMapper extends BaseMapper<PqDataVerifyCount> {
List<PqDataVerifyCount> selectSumVerify(@Param("param") OnlineRateParam param);
List<OnlineMonitorVo> getAnomalousData(@Param("lineIds")List<String> lineIds, @Param("startTime")String startTime, @Param("endTime")String endTime);
}

View File

@@ -4,7 +4,7 @@ package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pq.pojo.param.OnlineRateParam; import com.njcn.device.pq.pojo.param.OnlineRateParam;
import com.njcn.device.pq.pojo.po.RStatOnlinerateD; import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO; import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@@ -26,7 +26,7 @@ public interface RStatOnlinerateDMapper extends BaseMapper<RStatOnlinerateD> {
* @param param * @param param
* @return List<OnlineRate> * @return List<OnlineRate>
*/ */
List<RStatOnlinerateVO> getOnlineRateByDevIds(@Param("param") OnlineRateParam param); List<RStatOnlineRateVO> getOnlineRateByDevIds(@Param("param") OnlineRateParam param);
/** /**
* @Description: 根据终端id集合获取总终端在线lv * @Description: 根据终端id集合获取总终端在线lv

View File

@@ -0,0 +1,83 @@
<?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.device.pq.mapper.PqDataVerifyBakMapper">
<select id="selectDataVerifySum" resultType="com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel">
SELECT
*
FROM
(select
line_id AS lineId,
(
sum( freq_time ) +
sum( freq_Dev_time ) +
sum( v_Rms_time )+
sum( v_Pos_time ) +
sum( v_Neg_time )+
sum( v_Zero_time )+
sum( v_Unbalance_time )+
sum( rms_Lvr_time ) +
sum( vu_Dev_time ) +
sum( vl_Dev_time ) +
sum( v_Thd_time ) +
sum( v_time ) +
sum( i_Rms_time ) +
sum( plt_time ) +
sum( v_Inharm_time ) +
sum( v_Harm_time )+
sum( pf_time ) +
sum( v_Phasic_time ) +
sum( v1_Phasic_time ) +
sum( fluc_time )+
sum( pst_time ) +
sum( dip_time ) +
sum( rise_time )
) allTime,
sum( freq_time ) AS freqTime,
sum( freq_Dev_time ) AS freqDevTime,
sum( v_Rms_time ) AS vRmsTime,
sum( v_Pos_time ) AS vPosTime,
sum( v_Neg_time ) AS vNegTime,
sum( v_Zero_time ) AS vZeroTime,
sum( v_Unbalance_time ) AS vUnbalanceTime,
sum( rms_Lvr_time ) AS rmsLvrTime,
sum( vu_Dev_time ) AS vuDevTime,
sum( vl_Dev_time ) AS vlDevTime,
sum( v_Thd_time ) AS vThdTime,
sum( v_time ) AS vTime,
sum( i_Rms_time ) AS iRmsTime,
sum( plt_time ) AS pltTime,
sum( v_Inharm_time ) AS vInharmTime,
sum( v_Harm_time ) AS vHarmTime,
sum( pf_time ) AS pfTime,
sum( v_Phasic_time ) AS vPhasicTime,
sum( v1_Phasic_time ) AS v1PhasicTime,
sum( fluc_time ) AS flucTime,
sum( pst_time ) AS pstTime,
sum( dip_time ) AS dipTime,
sum( rise_time ) AS riseTime
from
pq_data_verify_bak
<where>
state = 1
<if test="param.monitorIds != null and param.monitorIds.size > 0">
AND line_id IN
<foreach collection='param.monitorIds' item='item' index="index" open='(' separator=',' close=')'>
#{item}
</foreach>
</if>
<if test="param.searchBeginTime != null and param.searchBeginTime !=''">
AND time_id >= #{param.searchBeginTime}
</if>
<if test="param.searchEndTime != null and param.searchEndTime != ''">
AND time_id &lt;= #{param.searchEndTime}
</if>
</where>
GROUP BY line_id
) a
WHERE
allTime >0
</select>
</mapper>

View File

@@ -0,0 +1,70 @@
<?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.device.pq.mapper.PqDataVerifyCountMapper">
<select id="selectSumVerify" resultType="com.njcn.device.pq.pojo.po.PqDataVerifyCount">
SELECT
line_id AS lineId,
SUM(total) AS total,
SUM(total_all) AS totalAll
FROM
pq_data_verify_count
<where>
<if test="param!=null and param.ids != null and param.ids.size > 0">
AND line_id IN
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
#{item}
</foreach>
</if>
<if test=" param.startTime != null and param.startTime !=''">
AND time_id >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND time_id &lt;= #{param.endTime}
</if>
</where>
group by line_id ;
</select>
<select id="getAnomalousData" resultType="OnlineMonitorVo">
SELECT DISTINCT
t6.Name gdName,
t5.Name subName,
t4.Name deviceName,
t1.Line_Id lineId,
t2.Name lineName,
t8.Name monitorObjType,
t7.Obj_Name monitorObj,
"异常数据" as target,
count(t1.time_id) lastDay
FROM
pq_data_verify_count t1
left join pq_line t2 on t1.Line_Id = t2.Id
left join pq_line t3 on t2.Pid = t3.Id
left join pq_line t4 on t3.Pid = t4.Id
left join pq_line t5 on t4.Pid = t5.Id
left join pq_line t6 on t5.Pid = t6.Id
left join pq_line_detail t7 on t1.Line_Id = t7.Id
left join sys_dict_data t8 on t7.Load_Type = t8.Id
WHERE
t1.total > 0
<if test="lineIds!=null and lineIds.size > 0">
and Line_Id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test=" startTime != null and startTime !=''">
and time_id >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and time_id &lt;= #{endTime}
</if>
GROUP BY
Line_Id
order by lastDay desc
</select>
</mapper>

View File

@@ -15,6 +15,7 @@
STATUS = 1 STATUS = 1
</select> </select>
<select id="sortTransformer" resultType="java.lang.Integer"> <select id="sortTransformer" resultType="java.lang.Integer">
select IFNULL(max(pqs_transformer.sort),0) from pqs_transformer order by update_time desc select IFNULL(max(pqs_transformer.sort),0) from pqs_transformer
<!-- order by update_time desc-->
</select> </select>
</mapper> </mapper>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.device.pq.mapper.RStatOnlinerateDMapper"> <mapper namespace="com.njcn.device.pq.mapper.RStatOnlinerateDMapper">
<select id="getOnlineRateByDevIds" resultType="com.njcn.device.pq.pojo.vo.RStatOnlinerateVO"> <select id="getOnlineRateByDevIds" resultType="com.njcn.device.pq.pojo.vo.RStatOnlineRateVO">
select select
dev_index, dev_index,
sum(online_min) as onlineMin, sum(online_min) as onlineMin,

View File

@@ -176,7 +176,6 @@
<select id="getDevOnlineByDevIds" resultType="TerminalOnlineRateData"> <select id="getDevOnlineByDevIds" resultType="TerminalOnlineRateData">
select select
dev_index devId, dev_index devId,
avg(online_min/(online_min+offline_min))*100 onlineRate,
sum(online_min) onlineMin, sum(online_min) onlineMin,
sum(offline_min) offlineMin sum(offline_min) offlineMin
from r_stat_onlinerate_d from r_stat_onlinerate_d

View File

@@ -381,7 +381,7 @@
line.LEVEL, line.LEVEL,
line.sort, line.sort,
line.pids, line.pids,
CONCAT(voltage.name, '_', line.name, '(',device.`Name`,')') name, CONCAT(voltage.name, '_', line.name, '(',device.Name,')') name,
comFlag.Com_Flag, comFlag.Com_Flag,
detail.pt_type, detail.pt_type,
detail.obj_id detail.obj_id

View File

@@ -3,8 +3,8 @@ package com.njcn.device.pq.service;
import com.njcn.device.biz.pojo.dto.*; import com.njcn.device.biz.pojo.dto.*;
import com.njcn.device.biz.pojo.param.DeptGetLineParam; import com.njcn.device.biz.pojo.param.DeptGetLineParam;
import com.njcn.device.biz.pojo.param.SubstationParam; import com.njcn.device.biz.pojo.param.SubstationParam;
import com.njcn.device.biz.pojo.dto.MonitorCommLedgerInfoDTO;
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam; import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -40,11 +40,13 @@ public interface CommTerminalService {
*/ */
List<DeptGetChildrenMoreDTO> deptGetLine(DeptGetLineParam deptGetLineParam); List<DeptGetChildrenMoreDTO> deptGetLine(DeptGetLineParam deptGetLineParam);
List<MonitorCommLedgerInfoDTO> deptGetLineInfo(DeptGetLineParam deptGetLineParam);
List<DeptGetChildrenMoreDTO> deptGetAllLine(DeptGetLineParam deptGetLineParam);
List<LineDevGetDTO> deptGetLineByIdList(List<String> monitorIds); List<LineDevGetDTO> deptGetLineByIdList(List<String> monitorIds);
/** /**
* 根据单位获取所有变电站 * 根据单位获取所有变电站
* @author cdf * @author cdf

View File

@@ -41,7 +41,8 @@ public interface IDataVerifyService extends IService<DataVerify> {
List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam); List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam);
List<DetailAbnormalVO.DetailLimitInnerVO> monitorLimitTableDetail(MonitorBaseParam monitorBaseParam); DetailAbnormalVO.DetailLimitCountVO monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam);
} }

View File

@@ -0,0 +1,46 @@
package com.njcn.device.pq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.param.TaiZhangParam;
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
public interface IPowerDistributionAreaService extends IService<DistributionArea> {
/**
* 分页查询所有
* @return
*/
Page<DistributionArea> getList(TaiZhangParam baseParam);
/**
* 新增
*/
boolean add(PowerDistributionareaParam newParam);
/**
* 修改
* @param
*/
boolean update(PowerDistributionareaParam updateParam);
/**
* 删除
* @param ids ids
*/
boolean delete(List<String> ids);
}

View File

@@ -0,0 +1,63 @@
package com.njcn.device.pq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
import com.njcn.device.pms.pojo.param.TaiZhangParam;
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
import com.njcn.device.pms.pojo.vo.PowerGenerationUserVO;
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
import com.njcn.web.pojo.param.BaseParam;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author hongawen
* @since 2022-10-14
*/
public interface IPowerGenerationUserService extends IService<GenerationUser> {
/**
* 新增发电用户
* @author cdf
* @date 2022/10/25
* @param powerGenerationUserParam 发电用户
* @return boolean
*/
boolean addPowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam);
/**
* 修改发电用户
* @author cdf
* @date 2022/10/25
* @param powerGenerationUserParam 发电用户
* @return boolean
*/
boolean updatePowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam);
/**
* 删除发电用户
* @author cdf
* @date 2022/10/25
* @param powerGenerationUserIds 发电用户
* @return boolean
*/
boolean delPowerGenerationUser(List<String> powerGenerationUserIds);
/**
* 分页查询发电用户列表
* @author cdf
* @date 2022/10/25
* @param baseParam 基础参数
* @return boolean
*/
Page<GenerationUser> getPowerGenerationUserPageList(BaseParam baseParam);
}

View File

@@ -7,6 +7,8 @@ import com.njcn.device.pq.pojo.vo.dataClean.DetailAbnormalVO;
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO; import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO; import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
@@ -27,10 +29,9 @@ public interface IPqDataVerifyBakService extends IService<PqDataVerifyBak> {
List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam); List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam);
DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException;
} }

View File

@@ -0,0 +1,26 @@
package com.njcn.device.pq.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
import com.njcn.device.pq.pojo.param.OnlineRateParam;
import com.njcn.device.pq.pojo.po.PqDataVerifyCount;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author cdf
* @since 2025-06-10
*/
public interface IPqDataVerifyCountService extends IService<PqDataVerifyCount> {
List<PqDataVerifyCount> getSumVerify( OnlineRateParam param);
List<OnlineMonitorVo> getAnomalousData(LineBaseQueryParam par);
}

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