xiaof 4 år sedan
förälder
incheckning
1bdb95b1cd

+ 3 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/CommonServiceImpl.java

@@ -164,10 +164,7 @@ public class CommonServiceImpl implements CommonService {
                 sysRoleQueryWrapper.lambda().in(SysRole::getId, roleIds)
                         .eq(SysRole::getEnable, true);
                 List<SysRole> sysRoleList = sysRoleService.list(sysRoleQueryWrapper);
-                long count = 0;
-                if (Objects.nonNull(sysRoleList) && sysRoleList.size() > 0) {
-                    count = sysRoleList.stream().filter(s -> s.getType() == RoleTypeEnum.ADMIN).count();
-                }
+                int count = Objects.nonNull(sysRoleList) && sysRoleList.size() > 0 ? (int) sysRoleList.stream().filter(s -> s.getType() == RoleTypeEnum.ADMIN).count() : 0;
                 QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
                 if (count > 0) {//超级系统管理员
                     sysPrivilegeQueryWrapper.lambda().eq(SysPrivilege::getType, PrivilegeEnum.URL)
@@ -175,7 +172,7 @@ public class CommonServiceImpl implements CommonService {
                     List<SysPrivilege> sysPrivilegeList = sysPrivilegeService.list(sysPrivilegeQueryWrapper);
                     authBean = new AuthBean(sysRoleList, sysPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
                 } else {
-                    BasicSchool tbSchool = Objects.nonNull(user.getOrgId()) ? cacheService.schoolCache(user.getSchoolId()) : null;
+                    BasicSchool tbSchool = Objects.nonNull(user.getSchoolId()) ? cacheService.schoolCache(user.getSchoolId()) : null;
                     SysOrg org = Objects.nonNull(user.getOrgId()) ? cacheService.orgCache(user.getOrgId()) : null;
                     sysPrivilegeQueryWrapper.lambda().in(SysPrivilege::getId, privilegeIds)
                             .eq(SysPrivilege::getProperty, PrivilegePropertyEnum.AUTH);
@@ -348,7 +345,7 @@ public class CommonServiceImpl implements CommonService {
         JSONObject object = JSONObject.parseObject(path);
         String filePath = object.getString(SystemConstant.PATH);
         String type = object.getString(SystemConstant.TYPE);
-        if (filePath.endsWith(".html")) {
+        if (filePath.endsWith(SystemConstant.HTML_PREFIX)) {
             StringBuffer sb = new StringBuffer();
             try {
                 InputStream fis;