|
|
@ -6,6 +6,7 @@ import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.platbean.*;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.platbean.*;
|
|
|
|
import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
|
import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -42,110 +44,116 @@ public class ImppLogController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 系统日志分页复杂查询
|
|
|
|
* 系统日志分页复杂查询
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param logSystem 查询条件
|
|
|
|
* @param logSystem 查询条件
|
|
|
|
* @param pager 分页数据
|
|
|
|
* @param pager 分页数据
|
|
|
|
* @return 处理结果
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/system/query")
|
|
|
|
@GetMapping("/system/query")
|
|
|
|
@ApiOperation(value = "系统日志分页复杂查询",notes = "系统日志分页复杂查询")
|
|
|
|
@ApiOperation(value = "系统日志分页复杂查询", notes = "系统日志分页复杂查询")
|
|
|
|
public ResultBean querySysLogSystemByPager(SysLogSystem logSystem, Pager pager){
|
|
|
|
public ResultBean querySysLogSystemByPager(SysLogSystem logSystem, Pager pager) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ListPager logSystemList = logService.queryLogSystemPager(logSystem, pager);
|
|
|
|
ListPager logSystemList = logService.queryLogSystemPager(logSystem, pager);
|
|
|
|
return ResultBean.success("操作成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
return ResultBean.success("操作成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
}catch(Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 定时任务日志分页复杂查询
|
|
|
|
* 定时任务日志分页复杂查询
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param sysLogTaskTime 查询日志
|
|
|
|
* @param sysLogTaskTime 查询日志
|
|
|
|
* @param pager 分页数据
|
|
|
|
* @param pager 分页数据
|
|
|
|
* @return 处理结果
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/task-time/query")
|
|
|
|
@GetMapping("/task-time/query")
|
|
|
|
@ApiOperation(value = "定时任务日志分页复杂查询",notes = "定时任务日志分页复杂查询")
|
|
|
|
@ApiOperation(value = "定时任务日志分页复杂查询", notes = "定时任务日志分页复杂查询")
|
|
|
|
public ResultBean querySysLogSystemByPager(SysLogTaskTime sysLogTaskTime, Pager pager){
|
|
|
|
public ResultBean querySysLogSystemByPager(SysLogTaskTime sysLogTaskTime, Pager pager) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ListPager logSystemList = logService.queryLogTaskTimePager(sysLogTaskTime, pager);
|
|
|
|
ListPager logSystemList = logService.queryLogTaskTimePager(sysLogTaskTime, pager);
|
|
|
|
return ResultBean.success("操作成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
return ResultBean.success("操作成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
}catch(Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 操作日志复杂查询,分页,排序
|
|
|
|
* 操作日志复杂查询,分页,排序
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param logOperate 操作日志
|
|
|
|
* @param logOperate 操作日志
|
|
|
|
* @param pager 分页数据
|
|
|
|
* @param pager 分页数据
|
|
|
|
* @return 处理结果
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/operate/query")
|
|
|
|
@GetMapping(value = "/operate/query")
|
|
|
|
@ApiOperation(value = "操作日志复杂查询,分页,排序",notes = "操作日志复杂查询,分页,排序")
|
|
|
|
@ApiOperation(value = "操作日志复杂查询,分页,排序", notes = "操作日志复杂查询,分页,排序")
|
|
|
|
public ResultBean querySysLogOperateByPager(SysLogOperate logOperate, Pager pager){
|
|
|
|
public ResultBean querySysLogOperateByPager(SysLogOperate logOperate, Pager pager) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ListPager logSystemList = logService.queryLogOperatePager(logOperate, pager);
|
|
|
|
ListPager logSystemList = logService.queryLogOperatePager(logOperate, pager);
|
|
|
|
return ResultBean.success("操作成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
return ResultBean.success("操作成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
}catch(Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 异常日志复杂查询,分页,排序
|
|
|
|
* 异常日志复杂查询,分页,排序
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param sysLogException 查询条件
|
|
|
|
* @param sysLogException 查询条件
|
|
|
|
* @param pager 分页信息
|
|
|
|
* @param pager 分页信息
|
|
|
|
* @return 处理结果
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/exception/query")
|
|
|
|
@GetMapping(value = "/exception/query")
|
|
|
|
@ApiOperation(value = "异常日志复杂查询,分页,排序",notes = "异常日志复杂查询,分页,排序")
|
|
|
|
@ApiOperation(value = "异常日志复杂查询,分页,排序", notes = "异常日志复杂查询,分页,排序")
|
|
|
|
public ResultBean querySysLogExceptionByPager(SysLogException sysLogException, Pager pager){
|
|
|
|
public ResultBean querySysLogExceptionByPager(SysLogException sysLogException, Pager pager) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ListPager logExceptionList = logService.queryLogExceptionPager(sysLogException, pager);
|
|
|
|
ListPager logExceptionList = logService.queryLogExceptionPager(sysLogException, pager);
|
|
|
|
return ResultBean.success("查询成功").setListPager(logExceptionList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
return ResultBean.success("查询成功").setListPager(logExceptionList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
}catch(Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 异常日志复杂查询,分页,排序
|
|
|
|
* 异常日志复杂查询,分页,排序
|
|
|
|
* @param bean 查询条件
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param bean 查询条件
|
|
|
|
* @param pager 分页信息
|
|
|
|
* @param pager 分页信息
|
|
|
|
* @return 处理结果
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/console/query")
|
|
|
|
@GetMapping(value = "/console/query")
|
|
|
|
@ApiOperation(value = "异常日志复杂查询,分页,排序",notes = "异常日志复杂查询,分页,排序")
|
|
|
|
@ApiOperation(value = "异常日志复杂查询,分页,排序", notes = "异常日志复杂查询,分页,排序")
|
|
|
|
public ResultBean querySysLogConsoleByPager(SysLogConsole bean, Pager pager){
|
|
|
|
public ResultBean querySysLogConsoleByPager(SysLogConsole bean, Pager pager) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ListPager logExceptionList = logService.queryLogConsolePager(bean, pager);
|
|
|
|
ListPager logExceptionList = logService.queryLogConsolePager(bean, pager);
|
|
|
|
return ResultBean.success("查询成功").setListPager(logExceptionList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
return ResultBean.success("查询成功").setListPager(logExceptionList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
}catch(Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 定时任务控制台日志,分页,排序
|
|
|
|
* 定时任务控制台日志,分页,排序
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param bean 查询条件
|
|
|
|
* @param bean 查询条件
|
|
|
|
* @return 处理结果
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/console/query-schedule")
|
|
|
|
@GetMapping(value = "/console/query-schedule")
|
|
|
|
@ApiOperation(value = "定时任务控制台日志,分页,排序",notes = "定时任务控制台日志")
|
|
|
|
@ApiOperation(value = "定时任务控制台日志,分页,排序", notes = "定时任务控制台日志")
|
|
|
|
public ResultBean querySchdeuleLogConsoleByPager(SysLogConsole bean){
|
|
|
|
public ResultBean querySchdeuleLogConsoleByPager(SysLogConsole bean) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ValidatorBean.beginValid(bean)
|
|
|
|
ValidatorBean.beginValid(bean)
|
|
|
|
.notNull("logGroup",bean.getLogGroup());
|
|
|
|
.notNull("logGroup", bean.getLogGroup());
|
|
|
|
// 参数
|
|
|
|
// 参数
|
|
|
|
// 1. group = CommonConstWords.SCHEDULE_LOG:Gourp.Name
|
|
|
|
// 1. group = CommonConstWords.SCHEDULE_LOG:Gourp.Name
|
|
|
|
// 2.
|
|
|
|
// 2.
|
|
|
@ -162,11 +170,34 @@ public class ImppLogController extends CoreBaseController {
|
|
|
|
if (StringUtils.isBlank(bean.getCreateDateTimeEnd())) {
|
|
|
|
if (StringUtils.isBlank(bean.getCreateDateTimeEnd())) {
|
|
|
|
bean.setCreateDateTimeEnd(TimeTool.getNowTime(true));
|
|
|
|
bean.setCreateDateTimeEnd(TimeTool.getNowTime(true));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List logExceptionList = logService.findLogConsoleList(bean);
|
|
|
|
// 一次100条
|
|
|
|
return ResultBean.success("查询成功").setResultList(logExceptionList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
bean.setOrderByParam("createDatetime");
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
bean.setAscOrDesc(CommonEnumUtil.ASC_OR_DESC.ASC.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List logScheduleList = new ArrayList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Pager pager = new Pager();
|
|
|
|
|
|
|
|
pager.setPageSize(100);
|
|
|
|
|
|
|
|
pager.setCurrentPage(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ListPager listPager;
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
|
|
if (pager.getTotalRows() != 0) {
|
|
|
|
|
|
|
|
pager.next();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
listPager = logService.queryLogConsolePager(bean, pager);
|
|
|
|
|
|
|
|
if(listPager!= null && listPager.getObjectList()!= null) {
|
|
|
|
|
|
|
|
logScheduleList.addAll(listPager.getObjectList());
|
|
|
|
|
|
|
|
pager = listPager.getObjectPager();
|
|
|
|
|
|
|
|
}else if(pager.hasNext()) {
|
|
|
|
|
|
|
|
pager.setCurrentPage(pager.getTotalPages());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} while (pager.hasNext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("查询成功").setResultList(logScheduleList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
}catch(Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -174,12 +205,12 @@ public class ImppLogController extends CoreBaseController {
|
|
|
|
@GetMapping(value = "/clean-log")
|
|
|
|
@GetMapping(value = "/clean-log")
|
|
|
|
@ApiOperation(value = "添加操作日志", notes = "添加操作日志,可用于国际化")
|
|
|
|
@ApiOperation(value = "添加操作日志", notes = "添加操作日志,可用于国际化")
|
|
|
|
public ResultBean logClean(String time) {
|
|
|
|
public ResultBean logClean(String time) {
|
|
|
|
try{
|
|
|
|
try {
|
|
|
|
Date thisTime = TimeTool.parseDate(time);
|
|
|
|
Date thisTime = TimeTool.parseDate(time);
|
|
|
|
String startTime = TimeTool.getToday(TimeTool.getDateBefore(thisTime, 0)) + " 00:00:00";
|
|
|
|
String startTime = TimeTool.getToday(TimeTool.getDateBefore(thisTime, 0)) + " 00:00:00";
|
|
|
|
String endTime = TimeTool.getToday(TimeTool.getDateBefore(thisTime, 0)) + " 23:59:59";
|
|
|
|
String endTime = TimeTool.getToday(TimeTool.getDateBefore(thisTime, 0)) + " 23:59:59";
|
|
|
|
|
|
|
|
|
|
|
|
logService.actionCleanLog(startTime,endTime);
|
|
|
|
logService.actionCleanLog(startTime, endTime);
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(busExcep).build();
|
|
|
|
return ResultBean.fail(busExcep).build();
|
|
|
|