Commit e70845a5 authored by 赵啸非's avatar 赵啸非

修改查询时间段

parent 762e8411
......@@ -5,6 +5,7 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.system.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -42,6 +43,9 @@ public class AccessLogController extends BaseCRUDJsonBodyMappingController<Acces
@Autowired
private ParamService paramService;
@Autowired
private MessageProducer messageProducer;
public AccessLogController() {
super.setModuleDesc("访问日志");
}
......
package com.mortals.xhx.module.error.web;
import cn.hutool.core.util.IdUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.ErrorLogPdu;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.error.model.ErrorLogQuery;
import com.mortals.xhx.system.MessageProducer;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.error.model.ErrorLogEntity;
import com.mortals.xhx.module.error.service.ErrorLogService;
......@@ -23,32 +30,38 @@ import com.mortals.framework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 异常日志
*
* @author zxfei
* @date 2022-08-24
*/
* 异常日志
*
* @author zxfei
* @date 2022-08-24
*/
@RestController
@RequestMapping("error/log")
public class ErrorLogController extends BaseCRUDJsonBodyMappingController<ErrorLogService,ErrorLogEntity,Long> {
public class ErrorLogController extends BaseCRUDJsonBodyMappingController<ErrorLogService, ErrorLogEntity, Long> {
@Autowired
private ParamService paramService;
public ErrorLogController(){
super.setModuleDesc( "异常日志");
@Autowired
private MessageProducer messageProducer;
public ErrorLogController() {
super.setModuleDesc("异常日志");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "platform", paramService.getParamBySecondOrganize("ErrorLog","platform"));
this.addDict(model, "level", paramService.getParamBySecondOrganize("ErrorLog","level"));
this.addDict(model, "platform", paramService.getParamBySecondOrganize("ErrorLog", "platform"));
this.addDict(model, "level", paramService.getParamBySecondOrganize("ErrorLog", "level"));
Map<String, String> map = paramService.getParamBySecondOrganize("BizLog", "appName");
......@@ -69,6 +82,12 @@ public class ErrorLogController extends BaseCRUDJsonBodyMappingController<ErrorL
@Override
@UnAuth
public String save(@RequestBody ErrorLogEntity entity) {
ErrorLogPdu errorLogPdu = new ErrorLogPdu();
errorLogPdu.initAttrValue();
BeanUtils.copyProperties(entity, errorLogPdu, BeanUtil.getNullPropertyNames(entity));
messageProducer.syncErrorSend(errorLogPdu);
/* ErrorLogQuery errorLogQuery = new ErrorLogQuery();
errorLogQuery.setAppName(entity.getAppName());
errorLogQuery.setPlatform(entity.getPlatform());
......@@ -79,7 +98,10 @@ public class ErrorLogController extends BaseCRUDJsonBodyMappingController<ErrorL
entity.setCheckNum(errorLogEntity.getCheckNum() + 1);
entity.setUpdateTime(new Date());
}*/
return super.save(entity);
JSONObject ret = new JSONObject();
ret.put("code", VALUE_RESULT_SUCCESS);
return ret.toJSONString();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment