viewer权限
This commit is contained in:
+9
@@ -1752,4 +1752,13 @@ public class SysUserController {
|
||||
List<SysUser> sysUserList = sysUserService.querySysUserListByIdList(userIdList);
|
||||
return sysUserList;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户管理-查出所有部门及其用户")
|
||||
@GetMapping(value = "/queryViewerInfo")
|
||||
public ViewerInfoVo queryViewerInfoVo(@RequestParam(name = "userId", required = true) String userId){
|
||||
ViewerInfoVo viewerInfoVo = new ViewerInfoVo();
|
||||
viewerInfoVo.setBrandList(projectUserBrandService.queryBrandByUserId(userId));
|
||||
viewerInfoVo.setDutyTerritoryList(projectUserDutyTerritoryService.queryDutyTerritoryByUserId(userId));
|
||||
return viewerInfoVo;
|
||||
}
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ViewerInfoVo {
|
||||
|
||||
List<String> brandList;
|
||||
List<String> dutyTerritoryList;
|
||||
|
||||
public List<String> getBrandList() {
|
||||
return brandList;
|
||||
}
|
||||
|
||||
public void setBrandList(List<String> brandList) {
|
||||
this.brandList = brandList;
|
||||
}
|
||||
|
||||
public List<String> getDutyTerritoryList() {
|
||||
return dutyTerritoryList;
|
||||
}
|
||||
|
||||
public void setDutyTerritoryList(List<String> dutyTerritoryList) {
|
||||
this.dutyTerritoryList = dutyTerritoryList;
|
||||
}
|
||||
|
||||
public ViewerInfoVo() {
|
||||
}
|
||||
|
||||
public ViewerInfoVo(List<String> brandList, List<String> dutyTerritoryList) {
|
||||
this.brandList = brandList;
|
||||
this.dutyTerritoryList = dutyTerritoryList;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@ public enum ProjectRoleEnum {
|
||||
REGULATI_AND_HOMOLOGATION_ENGINEER("法规工程师/认证工程师","4","Regulatory Engineer/Certification Engineer"),
|
||||
MANAGER("领导角色","11","R&H Manager"),
|
||||
ADMIN("系统管理员","12","admin"),
|
||||
VIEWER("Viewer","","Viewer"),
|
||||
VIEWER("Viewer","13","Viewer"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+2
@@ -42,4 +42,6 @@ public interface IProjectUserBrandService extends IService<ProjectUserBrand> {
|
||||
* @return
|
||||
*/
|
||||
List<ProjectUserBrand> queryList();
|
||||
|
||||
List<String> queryBrandByUserId(String userId);
|
||||
}
|
||||
|
||||
+8
@@ -42,4 +42,12 @@ public interface IProjectUserDutyTerritoryService extends IService<ProjectUserDu
|
||||
* @return
|
||||
*/
|
||||
List<ProjectUserDutyTerritory> queryList();
|
||||
|
||||
/**
|
||||
* 根据id查询对应的dutyTerritory集合
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<String> queryDutyTerritoryByUserId(String userId);
|
||||
|
||||
}
|
||||
|
||||
+14
@@ -1,10 +1,13 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.modules.system.entity.ProjectUserBrand;
|
||||
import com.jero.modules.system.mapper.ProjectUserBrandMapper;
|
||||
import com.jero.modules.system.service.IProjectUserBrandService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
@@ -59,4 +62,15 @@ public class ProjectUserBrandServiceImpl extends ServiceImpl<ProjectUserBrandMap
|
||||
public List<ProjectUserBrand> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryBrandByUserId(String userId) {
|
||||
QueryWrapper<ProjectUserBrand> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", userId);
|
||||
List<ProjectUserBrand> list = list(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(list)) {
|
||||
return list.stream().map(ProjectUserBrand::getBrandType).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+21
@@ -1,10 +1,15 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.modules.system.entity.ProjectUserDutyTerritory;
|
||||
import com.jero.modules.system.mapper.ProjectUserDutyTerritoryMapper;
|
||||
import com.jero.modules.system.service.IProjectUserDutyTerritoryService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
@@ -59,4 +64,20 @@ public class ProjectUserDutyTerritoryServiceImpl extends ServiceImpl<ProjectUser
|
||||
public List<ProjectUserDutyTerritory> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询对应的dutyTerritory集合
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> queryDutyTerritoryByUserId(String userId) {
|
||||
QueryWrapper<ProjectUserDutyTerritory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", userId);
|
||||
List<ProjectUserDutyTerritory> list = list(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(list)) {
|
||||
return list.stream().map(ProjectUserDutyTerritory::getDutyTerritory).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user