wangliang 4 жил өмнө
parent
commit
2049aff33b

+ 2 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/CommonServiceImpl.java

@@ -160,10 +160,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)
@@ -344,7 +341,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;