|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.qmth.boot.core.enums.Platform;
|
|
import com.qmth.boot.core.enums.Platform;
|
|
import com.qmth.distributed.print.business.bean.auth.AuthBean;
|
|
import com.qmth.distributed.print.business.bean.auth.AuthBean;
|
|
|
|
+import com.qmth.distributed.print.business.bean.dto.OrgDto;
|
|
import com.qmth.distributed.print.business.bean.dto.PrivilegeCacheDto;
|
|
import com.qmth.distributed.print.business.bean.dto.PrivilegeCacheDto;
|
|
import com.qmth.distributed.print.business.bean.result.PrivilegeResult;
|
|
import com.qmth.distributed.print.business.bean.result.PrivilegeResult;
|
|
import com.qmth.distributed.print.business.bean.result.RolePrivilegeResult;
|
|
import com.qmth.distributed.print.business.bean.result.RolePrivilegeResult;
|
|
@@ -89,6 +90,9 @@ public class CommonServiceImpl implements CommonService {
|
|
@Resource
|
|
@Resource
|
|
AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
|
|
AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysOrgService sysOrgService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 新增用户权限
|
|
* 新增用户权限
|
|
*
|
|
*
|
|
@@ -162,7 +166,7 @@ public class CommonServiceImpl implements CommonService {
|
|
List<SysRole> sysRoleList = sysRoleService.list(sysRoleQueryWrapper);
|
|
List<SysRole> sysRoleList = sysRoleService.list(sysRoleQueryWrapper);
|
|
long count = 0;
|
|
long count = 0;
|
|
if (Objects.nonNull(sysRoleList) && sysRoleList.size() > 0) {
|
|
if (Objects.nonNull(sysRoleList) && sysRoleList.size() > 0) {
|
|
- count = sysRoleList.stream().filter(s -> s.getType() == RoleTypeEnum.ADMIN || s.getType() == RoleTypeEnum.CUSTOMER).count();
|
|
|
|
|
|
+ count = sysRoleList.stream().filter(s -> s.getType() == RoleTypeEnum.ADMIN).count();
|
|
}
|
|
}
|
|
QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
|
|
if (count > 0) {//超级系统管理员
|
|
if (count > 0) {//超级系统管理员
|
|
@@ -171,7 +175,7 @@ public class CommonServiceImpl implements CommonService {
|
|
List<SysPrivilege> sysPrivilegeList = sysPrivilegeService.list(sysPrivilegeQueryWrapper);
|
|
List<SysPrivilege> sysPrivilegeList = sysPrivilegeService.list(sysPrivilegeQueryWrapper);
|
|
authBean = new AuthBean(sysRoleList, sysPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
|
|
authBean = new AuthBean(sysRoleList, sysPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
|
|
} else {
|
|
} else {
|
|
- BasicSchool tbSchool = cacheService.schoolCache(user.getSchoolId());
|
|
|
|
|
|
+ BasicSchool tbSchool = Objects.nonNull(user.getOrgId()) ? cacheService.schoolCache(user.getSchoolId()) : null;
|
|
SysOrg org = Objects.nonNull(user.getOrgId()) ? cacheService.orgCache(user.getOrgId()) : null;
|
|
SysOrg org = Objects.nonNull(user.getOrgId()) ? cacheService.orgCache(user.getOrgId()) : null;
|
|
sysPrivilegeQueryWrapper.lambda().in(SysPrivilege::getId, privilegeIds)
|
|
sysPrivilegeQueryWrapper.lambda().in(SysPrivilege::getId, privilegeIds)
|
|
.eq(SysPrivilege::getProperty, PrivilegePropertyEnum.AUTH);
|
|
.eq(SysPrivilege::getProperty, PrivilegePropertyEnum.AUTH);
|
|
@@ -526,6 +530,12 @@ public class CommonServiceImpl implements CommonService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<Long> listSubOrgIds(Long orgId) {
|
|
|
|
+ List<OrgDto> orgDtos = sysOrgService.listOrgTree();
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
public static void outputFile(HttpServletResponse response, File file, String fileName) {
|
|
public static void outputFile(HttpServletResponse response, File file, String fileName) {
|
|
try {
|
|
try {
|
|
|
|
|