提交一版日志的action查询和展示

This commit is contained in:
chenjinsong
2018-06-14 10:37:59 +08:00
parent 7334247f5b
commit 30c6d43130
4 changed files with 110 additions and 46 deletions

View File

@@ -473,21 +473,31 @@ public class BaseController {
}
}
public void initLogServiceType(Model model, BaseLogEntity log) {
public void setLogAction(BaseLogEntity log) {
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
for (FunctionServiceDict dict : serviceList) {
if (dict.getServiceId().intValue() == log.getServiceType().intValue()) {
log.setAction(dict.getAction());
}
}
}
//初始化查询值判断
public void initLogSearchValue(BaseLogEntity entry,Map<String, Object> params){
params.put("operator", entry.getCurrentUser().getName());
params.put("opTime", DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
params.put("opAction", 4);
if (StringUtils.isNotBlank(entry.getSearchFoundStartTime())&&StringUtils.isNotBlank(entry.getSearchFoundEndTime())) {
params.put("searchFoundStartTime", entry.getSearchFoundStartTime());
params.put("searchFoundEndTime", entry.getSearchFoundEndTime());
}else{
//设置默认查询当前时间及前五分钟
String startTime = DateUtils.getDateTime();
Date dateEnd = new Date(new Date().getTime()-Constants.LOG_TIME_RANGE);
String endTime = DateUtils.formatDateTime(dateEnd);
String endTime = DateUtils.getDateTime();
Date dateStart = new Date(new Date().getTime() - Constants.LOG_TIME_RANGE);
String startTime = DateUtils.formatDateTime(dateStart);
params.put("searchFoundStartTime", startTime);
params.put("searchFoundEndTime",endTime );
entry.setSearchFoundStartTime(startTime);