|
|
@ -2,8 +2,8 @@ package cn.estsh.i3plus.core.apiservice.controller.busi;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.base.ISysLogService;
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.base.ISysLogService;
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
|
|
|
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.platform.plugin.elasticsearch.ElasticSearchTool;
|
|
|
|
|
|
|
|
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.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
@ -12,14 +12,18 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
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.Calendar;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @Description :
|
|
|
|
* @Description :
|
|
|
@ -131,6 +135,42 @@ public class ImppLogController extends CoreBaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 定时任务控制台日志,分页,排序
|
|
|
|
|
|
|
|
* @param bean 查询条件
|
|
|
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping(value = "/console/query-schedule")
|
|
|
|
|
|
|
|
@ApiOperation(value = "定时任务控制台日志,分页,排序",notes = "定时任务控制台日志")
|
|
|
|
|
|
|
|
public ResultBean querySchdeuleLogConsoleByPager(SysLogConsole bean){
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
ValidatorBean.beginValid(bean)
|
|
|
|
|
|
|
|
.notNull("logGroup",bean.getLogGroup());
|
|
|
|
|
|
|
|
// 参数
|
|
|
|
|
|
|
|
// 1. group = CommonConstWords.SCHEDULE_LOG:Gourp.Name
|
|
|
|
|
|
|
|
// 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bean.setLogGroup(CommonConstWords.SCHEDULE_LOG + ":" + bean.getLogGroup());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 开始时间默认为上一分钟
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(bean.getCreateDateTimeStart())) {
|
|
|
|
|
|
|
|
Date lastMinute = TimeTool.timeCalc(new Date(), Calendar.MINUTE, -1);
|
|
|
|
|
|
|
|
bean.setCreateDateTimeStart(TimeTool.pareDateToString(lastMinute));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 结束时间默认为当前时间
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(bean.getCreateDateTimeEnd())) {
|
|
|
|
|
|
|
|
bean.setCreateDateTimeEnd(TimeTool.getNowTime(true));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List logExceptionList = logService.findLogConsoleList(bean);
|
|
|
|
|
|
|
|
return ResultBean.success("查询成功").setResultList(logExceptionList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/clean-log")
|
|
|
|
@GetMapping(value = "/clean-log")
|
|
|
|
@ApiOperation(value = "添加操作日志", notes = "添加操作日志,可用于国际化")
|
|
|
|
@ApiOperation(value = "添加操作日志", notes = "添加操作日志,可用于国际化")
|
|
|
|
public ResultBean logClean(String time) {
|
|
|
|
public ResultBean logClean(String time) {
|
|
|
|