|
|
@ -1,11 +1,14 @@ |
|
|
|
package com.hnac.hzims.middle.systemlog.service.impl; |
|
|
|
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.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
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.entity.Statistics; |
|
|
|
import com.hnac.hzims.middle.systemlog.mapper.StatisticsMapper; |
|
|
|
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.hnac.hzims.middle.systemlog.service.StatisticsService; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.hnac.hzims.middle.systemlog.service.SysLogService; |
|
|
|
import com.hnac.hzims.middle.systemlog.service.SysLogService; |
|
|
@ -37,6 +40,8 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private SysLogService sysLogService; |
|
|
|
private SysLogService sysLogService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ILogOptionsModuleNameService logOptionsModuleNameService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 保存统计的数据 |
|
|
|
* 保存统计的数据 |
|
|
@ -60,13 +65,13 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist |
|
|
|
//如果为空保存数据,如果不为空更新数据
|
|
|
|
//如果为空保存数据,如果不为空更新数据
|
|
|
|
if (statistics == null) { |
|
|
|
if (statistics == null) { |
|
|
|
statistics = new Statistics(); |
|
|
|
statistics = new Statistics(); |
|
|
|
statistics.setSort(getModuleName(sysLogStatisticsVo.getModuleName())); |
|
|
|
statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName())); |
|
|
|
statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime()); |
|
|
|
statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime()); |
|
|
|
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); |
|
|
|
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); |
|
|
|
statistics.setModuleName(sysLogStatisticsVo.getModuleName()); |
|
|
|
statistics.setModuleName(sysLogStatisticsVo.getModuleName()); |
|
|
|
this.save(statistics); |
|
|
|
this.save(statistics); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
statistics.setSort(getModuleName(sysLogStatisticsVo.getModuleName())); |
|
|
|
statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName())); |
|
|
|
statistics.setModuleName(sysLogStatisticsVo.getModuleName()); |
|
|
|
statistics.setModuleName(sysLogStatisticsVo.getModuleName()); |
|
|
|
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); |
|
|
|
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount()); |
|
|
|
this.updateById(statistics); |
|
|
|
this.updateById(statistics); |
|
|
@ -111,18 +116,21 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 排序 |
|
|
|
* 排序 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static int getModuleName(String moduleName) { |
|
|
|
private int getModuleName(String moduleName) { |
|
|
|
List<String> moduleNames = Lists.newArrayList("集中监控", |
|
|
|
// List<String> moduleNames = Lists.newArrayList("集中监控",
|
|
|
|
"综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控", |
|
|
|
// "综合调度", "视频集中监控", "实时监控", "视频监控", "演示大屏", "生态监控",
|
|
|
|
"数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理", |
|
|
|
// "数据分析", "数据查询", "通讯告警统计", "气象监测", "我的事务", "值班管理",
|
|
|
|
"缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理", |
|
|
|
// "缺陷管理", "两票管理", "巡检管理", "日常维护", "检修管理", "数据填报", "安全管理", "设备管理",
|
|
|
|
"资产管理", "智能诊断", "生产月报", "告警配置","电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理", |
|
|
|
// "资产管理", "智能诊断", "生产月报", "告警配置", "电站安全标准", "站点管理", "实时画面", "资源配置", "消息管理",
|
|
|
|
"移动端配置", "水电站管理", "告警配置"); |
|
|
|
// "移动端配置", "水电站管理", "告警配置");
|
|
|
|
|
|
|
|
LambdaQueryWrapper<LogOptionsModuleName> queryWrapper = new LambdaQueryWrapper<LogOptionsModuleName>(); |
|
|
|
|
|
|
|
queryWrapper.orderByAsc(LogOptionsModuleName::getSort); |
|
|
|
|
|
|
|
List<LogOptionsModuleName> moduleNames = logOptionsModuleNameService.list(queryWrapper); |
|
|
|
int result = 0; |
|
|
|
int result = 0; |
|
|
|
for (int i = 0; i < moduleNames.size(); i++) { |
|
|
|
for (int i = 0; i < moduleNames.size(); i++) { |
|
|
|
String name = moduleNames.get(i); |
|
|
|
LogOptionsModuleName logOptionsModuleName = moduleNames.get(i); |
|
|
|
if (name.equals(moduleName)) { |
|
|
|
if (logOptionsModuleName.getModuleName().equals(moduleName)) { |
|
|
|
result = i + 1; |
|
|
|
result = logOptionsModuleName.getSort(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|