parent
e77af7ef7b
commit
10cc6b0b1d
@ -0,0 +1,80 @@
|
||||
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description : Dashboard服务接口
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-12-14 15:41
|
||||
* @Modify:
|
||||
**/
|
||||
public interface ISysDashboardService {
|
||||
|
||||
/**
|
||||
* 查询组织个数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询组织个数")
|
||||
long getSysOrganizeCount();
|
||||
|
||||
/**
|
||||
* 获取部门数量
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取部门数量")
|
||||
long getSysDepartmentCount();
|
||||
|
||||
/**
|
||||
* 查询用户登录日志
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询用户登录日志",notes = "查询用户登录日志")
|
||||
List findSysUserLoginLog();
|
||||
|
||||
/**
|
||||
* 查询最近操作日志
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询操作日志",notes = "查询最近操作日志")
|
||||
List findNewSysLogOperateSize(Integer size);
|
||||
|
||||
/**
|
||||
* 查询最近异常日志
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询异常日志",notes = "查询最近异常日志")
|
||||
List findNewSysLogExceptionSize(Integer size);
|
||||
|
||||
/**
|
||||
* 查询系统日志各级别占比
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询系统日志",notes = "查询系统日志各级别占比")
|
||||
Map findSysLogSystempByLevel(String startTime,String endTime);
|
||||
|
||||
/**
|
||||
* 查询平均耗时
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询操作日志",notes = "查询平均响应耗时")
|
||||
Map querySysLogSystemAvgExecuteTime(String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 查询时间段内各等级日志数量
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询系统日志",notes = "查询各模块系统日志数量")
|
||||
Map querySysLogSystemByLevel(String startTime, String endTime);
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.core.api.iservice.busi.ISysDashboardService;
|
||||
import cn.estsh.i3plus.core.apiservice.dao.ISysLogSystemDao;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysLogOperate;
|
||||
import cn.estsh.i3plus.pojo.platform.repository.SysDepartmentRepository;
|
||||
import cn.estsh.i3plus.pojo.platform.repository.SysLogUserLoginRepository;
|
||||
import cn.estsh.i3plus.pojo.platform.repository.SysOrganizeRepository;
|
||||
import cn.estsh.i3plus.pojo.platform.repositorymongo.SysLogExceptionRepository;
|
||||
import cn.estsh.i3plus.pojo.platform.repositorymongo.SysLogOperateRepository;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-12-15 15:26
|
||||
* @Modify:
|
||||
**/
|
||||
@Service
|
||||
public class SysDashboardService implements ISysDashboardService {
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(SysConfigService.class);
|
||||
|
||||
@Autowired
|
||||
private SysOrganizeRepository sysOrganizeRDao;
|
||||
|
||||
@Autowired
|
||||
private SysDepartmentRepository sysDepartmentRDao;
|
||||
|
||||
@Autowired
|
||||
private SysLogOperateRepository sysLogOperateRDao;
|
||||
|
||||
@Autowired
|
||||
private SysLogExceptionRepository sysLogExceptionRDao;
|
||||
|
||||
@Autowired
|
||||
private ISysLogSystemDao sysLogSystemDao;
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "查询组织个数")
|
||||
public long getSysOrganizeCount() {
|
||||
return sysOrganizeRDao.listCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "获取部门数量")
|
||||
public long getSysDepartmentCount() {
|
||||
return sysDepartmentRDao.listCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "查询用户登录日志",notes = "查询用户登录日志")
|
||||
public List findSysUserLoginLog() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "查询操作日志",notes = "查询最新的几条操作日志")
|
||||
public List findNewSysLogOperateSize(Integer size) {
|
||||
Pager page = new Pager();
|
||||
page.setCurrentPage(1);
|
||||
page.setPageSize(size);
|
||||
SysLogOperate sysLogOperate = new SysLogOperate();
|
||||
sysLogOperate.setOrderByParam("createDatetime");
|
||||
sysLogOperate.setAscOrDesc(CommonEnumUtil.ASC_OR_DESC.DESC.getValue());
|
||||
return sysLogOperateRDao.findByBsonPager(null,page,sysLogOperate.getOrderByParam(),sysLogOperate.getAscOrDesc());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "查询操异常日志",notes = "查询最新的几条异常日志")
|
||||
public List findNewSysLogExceptionSize(Integer size) {
|
||||
Pager page = new Pager();
|
||||
page.setCurrentPage(1);
|
||||
page.setPageSize(size);
|
||||
SysLogOperate sysLogOperate = new SysLogOperate();
|
||||
sysLogOperate.setOrderByParam("createDatetime");
|
||||
sysLogOperate.setAscOrDesc(CommonEnumUtil.ASC_OR_DESC.DESC.getValue());
|
||||
return sysLogExceptionRDao.findByBsonPager(null,page,sysLogOperate.getOrderByParam(),sysLogOperate.getAscOrDesc());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "查询系统日志",notes = "查询系统日志各级别占比")
|
||||
public Map findSysLogSystempByLevel(String startTime, String endTime) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "查询系统日志",notes = "查询系统日志平均执行时间")
|
||||
public Map querySysLogSystemAvgExecuteTime(String startTime, String endTime) {
|
||||
return sysLogSystemDao.querySysLogSystemAvgExecuteTime(startTime,endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApiOperation(value = "查询系统日志",notes = "查询各模块系统日志数量")
|
||||
public Map querySysLogSystemByLevel(String startTime, String endTime) {
|
||||
return sysLogSystemDao.querySysLogSystemByLevel(startTime,endTime);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue