diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index fb500b62..ce076cdd 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -133,7 +133,7 @@ public class ResourceController { page.getList().forEach(item -> { item.setInfoList(resourceService.selectAttrsByResourceId(item.getId())); if (item.getDeptId() != null) { - String deptName = sysDeptService.get(item.getDeptId()).getName(); + String deptName = sysDeptService.get(item.getDeptId()) == null ? null : sysDeptService.get(item.getDeptId()).getName(); item.setDeptName(StringUtils.isNotBlank(deptName) ? deptName : "--"); } }); @@ -257,7 +257,7 @@ public class ResourceController { public Result importResource(@RequestParam("config") MultipartFile uploadFile, HttpServletRequest request) { List> dept = jdbcTemplate.queryForList("SELECT id,`name` FROM sys_dept"); - logger.info("上传文件:{}" , uploadFile.getOriginalFilename()); + logger.info("上传文件:{}", uploadFile.getOriginalFilename()); String format = sdf.format(new Date()); File folder = new File(uploadPath + "upload" + File.separator + format); logger.info(folder.getPath());