Commit ea86e08e by guojuxing

操作日志过滤运营和品牌方

parent 059a5fda
......@@ -195,6 +195,16 @@ public interface UserApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.UserDTO>>


*/
ServiceResponse<List<UserDTO>> listGicUser(Integer enterpriseId);
/**
* 运维账户
* @Title: listOperationUser

* @Description:

* @author guojuxing
* @param enterpriseId

* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.UserDTO>>


*/
ServiceResponse<List<UserDTO>> listOperationUser(Integer enterpriseId);
/**
* 查询全部
* @Title: listUser

......
......@@ -453,6 +453,15 @@ public class UserApiServiceImpl implements UserApiService {
}
@Override
public ServiceResponse<List<UserDTO>> listOperationUser(Integer enterpriseId) {
List<TabSysUser> list = userService.listGicUser(enterpriseId, 1);
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(EntityUtil.changeEntityListNew(UserDTO.class, list));
}
return ServiceResponse.success(Collections.emptyList());
}
@Override
public ServiceResponse<List<UserDTO>> listUser(Integer enterpriseId) {
List<TabSysUser> list = userService.listGicUser(enterpriseId, null);
if (CollectionUtils.isNotEmpty(list)) {
......
......@@ -223,7 +223,10 @@ public class MenuController {
public RestResponse listOperationLog(String startTime, String endTime, Integer menuId, String search, PageQO pageQO)
throws ParseException {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
UserDetail userDetail = UserDetailUtils.getUserDetail();
Integer enterpriseId = userDetail.getEnterpriseId();
//是否是超级管理员
boolean isSuperAdmin = userDetail.getUserInfo().getSuperAdmin().intValue() == 1;
LogSearchDTO searchParam = new LogSearchDTO();
searchParam.setEnterpriseId(Long.valueOf(enterpriseId));
......@@ -233,7 +236,6 @@ public class MenuController {
} else {
//权限控制
List<Long> relationIdList = new ArrayList<>();
UserDetail userDetail = UserDetailUtils.getUserDetail();
//权限控制
ServiceResponse<List<MenuDTO>> gicResult = menuApiService.getUserMenuOfGicNotTree(
userDetail.getEnterpriseId(), userDetail.getUserId(), null,
......@@ -243,7 +245,6 @@ public class MenuController {
relationIdList.addAll(Optional.ofNullable(gicMenuList).orElse(new ArrayList<>()).stream()
.mapToLong(e -> e.getMenuId()).boxed().collect(Collectors.toList()));
}
boolean isSuperAdmin = userDetail.getUserInfo().getSuperAdmin().intValue() == 1;
ServiceResponse<List<MenuDTO>> appResult;
if (isSuperAdmin) {
appResult = menuApiService.listAppPageOfHasBuy(UserDetailUtils.getUserDetail().getEnterpriseId());
......@@ -269,9 +270,28 @@ public class MenuController {
searchParam.setLogTimeEnd(sdf.parse(endTime));
}
//用于过滤
List<String> matchPhoneList = new ArrayList<>();
//过滤运营操作,如果是品牌方登录;过滤品牌方日志,如果是运营登录
if (isSuperAdmin) {
ServiceResponse<List<UserDTO>> userResult;
if (userDetail.getUserInfo().getLoginType().intValue() == 0) {
userResult = userApiService.listGicUser(enterpriseId);
} else {
userResult = userApiService.listOperationUser(enterpriseId);
}
if (userResult.isSuccess()) {
List<UserDTO> userList = userResult.getResult();
matchPhoneList = userList.stream()
.filter(e -> e.getEnterpriseId().intValue() == enterpriseId.intValue())
.map(e -> e.getPhoneNumber())
.collect(Collectors.toList());
}
}
searchParam.setPhoneList(matchPhoneList);
ServiceResponse<Page<SystemSetLogDTO>> response = logApiService.listSystemSetLog(pageQO.getPageSize(),
pageQO.getCurrentPage(), searchParam);
return ResultControllerUtils.commonPageResult(response, LogListVO.class);
}
......
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