diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/NoticeController.java b/src/main/java/com/dreamchaser/depository_manage/controller/NoticeController.java index 0e8a40b8..d44c15b1 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/NoticeController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/NoticeController.java @@ -122,4 +122,14 @@ public class NoticeController { } } + @PostMapping("/noticeInfo") + public RestResponse noticeInfo(@RequestBody Map< String,Object> map){ + if(map.containsKey("id")){ + NoticeP notice = noticeService.findNoticeById(ObjectFormatUtil.toInteger(map.get("id"))); + return new RestResponse(notice); + }else{ + throw new MyException("缺少必要参数"); + } + } + } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index 56ca88c0..f5c8b210 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -339,6 +339,9 @@ public class PageController { } mv.addObject("depositoryCount", depositoryIdList.size()); Integer inventoryCountByDepository = materialService.findInventoryCountByDepository(depositoryIdList); + if(inventoryCountByDepository == null){ + inventoryCountByDepository = 0; + } mv.addObject("allPrice",(int)(inventoryCountByDepository / 100)); mv.addObject("allMaterial", materialService.findMaterialCount(new HashMap<>())); /** @@ -2950,6 +2953,7 @@ public class PageController { ModelAndView mv = new ModelAndView(); mv.setViewName("pages/notice/notice-view"); + NoticeP noticeById = noticeService.findNoticeById(id); String token = request.getHeader("user-token"); if (token == null) { diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java b/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java index 4a90c397..0c8e160e 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java @@ -538,7 +538,11 @@ public class UserController { @PostMapping("/accountLook") public RestResponse accountLook(HttpServletRequest request) { - Object userToken = request.getAttribute("userToken"); + String token = request.getHeader("user-token"); + if (token == null) { + token = (String) request.getSession().getAttribute("userToken"); + } + UserByPort userToken = AuthenticationTokenPool.getUserToken(token); return new RestResponse(userToken); }