From ba0e8b52d07858dd86c989631d20ea88471486ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Thu, 27 Jul 2023 09:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=A5=E5=BF=97=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=8E=92=E5=BA=8F=E8=A7=84=E5=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/middle/processflow/CodeGenerator.java | 14 +++---- .../service/impl/StatisticsServiceImpl.java | 32 ++++++++++------ .../middle/systemlog/vo/SysLogStatisticsVo.java | 2 +- .../hzims-middle/src/main/resources/db/1.0.3.sql | 44 ++++++++++++++++++++++ 4 files changed, 72 insertions(+), 20 deletions(-) create mode 100644 hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java index e7e9f35..f4efe10 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.processflow; +// package com.hnac.hzims.middle.processflow; // // import com.baomidou.mybatisplus.generator.AutoGenerator; // import com.baomidou.mybatisplus.generator.InjectionConfig; @@ -24,7 +24,7 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // // 全局配置 // GlobalConfig gc = new GlobalConfig(); -// String projectPath = System.getProperty("user.dir") + "/hzims-service/ticket"; +// String projectPath = System.getProperty("user.dir") + "/hzims-service/hzims-middle"; // gc.setOutputDir(projectPath + "/src/main/java"); // gc.setAuthor("dfy"); // gc.setOpen(false); @@ -33,7 +33,7 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // // 数据源配置 // DataSourceConfig dsc = new DataSourceConfig(); -// dsc.setUrl("jdbc:mysql://192.168.1.20:3576/dev_hzims_ticket?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"); +// dsc.setUrl("jdbc:mysql://192.168.1.20:3576/dev_hzims_middle?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"); // // dsc.setSchemaName("public"); // dsc.setDriverName("com.mysql.cj.jdbc.Driver"); // dsc.setUsername("root"); @@ -42,8 +42,8 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // // 包配置 // PackageConfig pc = new PackageConfig(); -// pc.setModuleName("p"); -// pc.setParent("com.hnac.hzims.ticket"); +// pc.setModuleName("systemlog"); +// pc.setParent("com.hnac.hzims.middle"); // mpg.setPackageInfo(pc); // // // 自定义配置 @@ -93,9 +93,9 @@ package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.proce // // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!"); // // 写于父类中的公共字段 // // strategy.setSuperEntityColumns("id"); -// strategy.setInclude("hzims_work_ticket_finish"); +// strategy.setInclude("log_options_module_name"); // strategy.setControllerMappingHyphenStyle(true); -// strategy.setTablePrefix("hzims_"); +// // strategy.setTablePrefix("hzims_"); // mpg.setStrategy(strategy); // // mpg.setTemplateEngine(new FreemarkerTemplateEngine()); // mpg.execute(); diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java index 4e1fb0c..94c7d4e 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java @@ -1,11 +1,14 @@ package com.hnac.hzims.middle.systemlog.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; +import com.hnac.hzims.middle.systemlog.entity.LogOptionsModuleName; import com.hnac.hzims.middle.systemlog.entity.Statistics; import com.hnac.hzims.middle.systemlog.mapper.StatisticsMapper; +import com.hnac.hzims.middle.systemlog.service.ILogOptionsModuleNameService; import com.hnac.hzims.middle.systemlog.service.StatisticsService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.middle.systemlog.service.SysLogService; @@ -37,6 +40,8 @@ public class StatisticsServiceImpl extends ServiceImpl moduleNames = Lists.newArrayList("集中监控", - "综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控", - "数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理", - "缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理", - "资产管理", "智能诊断", "生产月报", "告警配置","电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理", - "移动端配置", "水电站管理", "告警配置"); + private int getModuleName(String moduleName) { + // List moduleNames = Lists.newArrayList("集中监控", + // "综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控", + // "数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理", + // "缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理", + // "资产管理", "智能诊断", "生产月报", "告警配置", "电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理", + // "移动端配置", "水电站管理", "告警配置"); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.orderByAsc(LogOptionsModuleName::getSort); + List moduleNames = logOptionsModuleNameService.list(queryWrapper); int result = 0; for (int i = 0; i < moduleNames.size(); i++) { - String name = moduleNames.get(i); - if (name.equals(moduleName)) { - result = i + 1; + LogOptionsModuleName logOptionsModuleName = moduleNames.get(i); + if (logOptionsModuleName.getModuleName().equals(moduleName)) { + result = logOptionsModuleName.getSort(); break; } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java index 943c6e5..cecb7a6 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java @@ -31,7 +31,7 @@ public class SysLogStatisticsVo { private Integer titleCount; /** - * 操作类型统计 + * 操作类型 */ private String moduleName; /** diff --git a/hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql b/hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql new file mode 100644 index 0000000..2e351c5 --- /dev/null +++ b/hzims-service/hzims-middle/src/main/resources/db/1.0.3.sql @@ -0,0 +1,44 @@ +create table log_options_module_name +( + id bigint primary key auto_increment, + module_name varchar(50) null comment '功能模块', + sort int comment '排序', + create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', + update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间', + is_deleted tinyint default 0 null comment '逻辑删除 (0 可用 1 删除)' +); + +insert into log_options_module_name(module_name, sort) +values ('集中监控', 1), + ('综合调度', 2), + ('视频集中监控', 3), + ('实时监控', 4), + ('视频监控', 5), + ('演示大屏', 6), + ('生态监控', 7), + ('数据分析', 9), + ('数据查询', 10), + ('通讯告警统计', 11), + ('气象监测', 12), + ('我的事务', 13), + ('值班管理', 14), + ('缺陷管理', 15), + ('两票管理', 16), + ('巡检管理', 17), + ('日常维护', 18), + ('检修管理', 19), + ('数据填报', 20), + ('安全管理', 21), + ('设备管理', 22), + ('资产管理', 23), + ('智能诊断', 24), + ('生产月报', 25), + ('告警配置', 26), + ('电站安全标准', 27), + ('站点管理', 28), + ('实时画面', 29), + ('资源配置', 30), + ('消息管理', 31), + ('移动端配置', 32), + ('水电站设置', 33), + ('告警配置', 34);