修改日志权限
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.dto.DeviceLogDTO;
|
||||
@@ -11,6 +12,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.param.CsMarketDataParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLogsPO;
|
||||
import com.njcn.csdevice.service.impl.CsLogsPOService;
|
||||
import com.njcn.user.enums.AppRoleEnum;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
@@ -19,6 +21,8 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -61,9 +65,12 @@ public class CsLogController extends BaseController {
|
||||
@ApiImplicitParam(name = "baseParam", value = "查询日志参数", required = true)
|
||||
public HttpResult<List<CsLogsPO>> queryLog(@RequestBody BaseParam baseParam){
|
||||
String username = RequestUtil.getUsername();
|
||||
String userRole = RequestUtil.getUserRole();
|
||||
List<String> strings = JSONArray.parseArray(userRole, String.class);
|
||||
String methodDescribe = getMethodDescribe("queryLog");
|
||||
List<CsLogsPO> list = csLogsPOService.lambdaQuery().eq(CsLogsPO::getUserName, username).
|
||||
between(CsLogsPO::getCreateTime,baseParam.getSearchBeginTime(),baseParam.getSearchEndTime()).list();
|
||||
List<CsLogsPO> list = csLogsPOService.lambdaQuery().eq(!strings.contains(AppRoleEnum.OPERATION_MANAGER.getCode()),CsLogsPO::getUserName, username).
|
||||
ge(StringUtils.isNotBlank(baseParam.getSearchBeginTime()),CsLogsPO::getCreateTime,baseParam.getSearchBeginTime()).
|
||||
le(StringUtils.isNotBlank(baseParam.getSearchEndTime()),CsLogsPO::getCreateTime,baseParam.getSearchEndTime()).orderByDesc(CsLogsPO::getCreateTime).list();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user