From 5c2b8b9414d649371c371074fdc6f68ff67dd8b8 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 23 Feb 2023 16:22:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=93=E5=82=A8=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E4=BA=BA=E5=91=98=E7=9A=84=E6=9D=83=E9=99=90=E8=8C=83?= =?UTF-8?q?=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PageController.java | 20 ++++++++++++++----- .../templates/pages/group/group-out.html | 6 +++--- .../templates/pages/group/group_edit.html | 8 ++++---- .../pages/material/material-out.html | 4 ++-- .../pages/materialtype/materialType_view.html | 8 ++++---- .../templates/pages/split/split-out.html | 8 ++++---- .../templates/pages/group/group-out.html | 6 +++--- .../templates/pages/group/group_edit.html | 8 ++++---- .../pages/material/material-out.html | 4 ++-- .../pages/materialtype/materialType_view.html | 8 ++++---- .../templates/pages/split/split-out.html | 8 ++++---- 11 files changed, 49 insertions(+), 39 deletions(-) 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 dd7c7dd0..2e1ca9d2 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -434,7 +434,7 @@ public class PageController { if (role == null) { role = 1; } - if (role == 4) { + if (role == 4 || Integer.compare(userToken.getMaindeparment(),361) == 0) { mv.addObject("display", "inline-block"); } else { mv.addObject("display", "none"); @@ -455,7 +455,7 @@ public class PageController { if (isadmin == null) { isadmin = 1; } - if (isadmin == 4) { + if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(),361) == 0) { mv.addObject("display", "inline-block"); } else { mv.addObject("display", "none"); @@ -657,7 +657,7 @@ public class PageController { } List materialTypeAll = materialTypeService.findMaterialTypeByCondition(map); mv.addObject("materialTypes", materialTypeAll); - if (role == 4) { + if (role == 4 || Integer.compare(userToken.getMaindeparment(),361) == 0) { mv.addObject("display", "inline-block"); } else { mv.addObject("display", "none"); @@ -893,7 +893,7 @@ public class PageController { if (isadmin == null) { isadmin = 1; } - if (isadmin == 4) { + if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(),361) == 0) { mv.addObject("display", "inline-block"); } else { mv.addObject("display", "none"); @@ -926,10 +926,20 @@ public class PageController { } @GetMapping("/group_edit") - public ModelAndView groupEdit(Integer id) { + public ModelAndView groupEdit(Integer id,HttpServletRequest request) { ModelAndView mv = new ModelAndView(); mv.setViewName("pages/group/group_edit"); Group group = groupService.findGroupOnlyById(id); + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + Integer isadmin = userToken.getIsadmin(); + if (isadmin == null) { + isadmin = 1; + } + if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(),361) == 0) { + mv.addObject("display", "inline-block"); + } else { + mv.addObject("display", "none"); + } mv.addObject("id", id); mv.addObject("record", group); return mv; diff --git a/src/main/resources/templates/pages/group/group-out.html b/src/main/resources/templates/pages/group/group-out.html index 967bf23a..732df512 100644 --- a/src/main/resources/templates/pages/group/group-out.html +++ b/src/main/resources/templates/pages/group/group-out.html @@ -14,8 +14,8 @@
diff --git a/src/main/resources/templates/pages/group/group_edit.html b/src/main/resources/templates/pages/group/group_edit.html index b323cd7d..9a0fd678 100644 --- a/src/main/resources/templates/pages/group/group_edit.html +++ b/src/main/resources/templates/pages/group/group_edit.html @@ -58,16 +58,16 @@
diff --git a/src/main/resources/templates/pages/material/material-out.html b/src/main/resources/templates/pages/material/material-out.html index 1cccf0a9..0f0051a2 100644 --- a/src/main/resources/templates/pages/material/material-out.html +++ b/src/main/resources/templates/pages/material/material-out.html @@ -81,7 +81,7 @@ diff --git a/src/main/resources/templates/pages/materialtype/materialType_view.html b/src/main/resources/templates/pages/materialtype/materialType_view.html index abb0e9c4..e80c5d51 100644 --- a/src/main/resources/templates/pages/materialtype/materialType_view.html +++ b/src/main/resources/templates/pages/materialtype/materialType_view.html @@ -59,8 +59,8 @@ diff --git a/src/main/resources/templates/pages/split/split-out.html b/src/main/resources/templates/pages/split/split-out.html index e29a012b..d11c14b8 100644 --- a/src/main/resources/templates/pages/split/split-out.html +++ b/src/main/resources/templates/pages/split/split-out.html @@ -69,16 +69,16 @@
diff --git a/target/classes/templates/pages/group/group-out.html b/target/classes/templates/pages/group/group-out.html index 967bf23a..732df512 100644 --- a/target/classes/templates/pages/group/group-out.html +++ b/target/classes/templates/pages/group/group-out.html @@ -14,8 +14,8 @@
diff --git a/target/classes/templates/pages/group/group_edit.html b/target/classes/templates/pages/group/group_edit.html index b323cd7d..9a0fd678 100644 --- a/target/classes/templates/pages/group/group_edit.html +++ b/target/classes/templates/pages/group/group_edit.html @@ -58,16 +58,16 @@
diff --git a/target/classes/templates/pages/material/material-out.html b/target/classes/templates/pages/material/material-out.html index 1cccf0a9..0f0051a2 100644 --- a/target/classes/templates/pages/material/material-out.html +++ b/target/classes/templates/pages/material/material-out.html @@ -81,7 +81,7 @@ diff --git a/target/classes/templates/pages/materialtype/materialType_view.html b/target/classes/templates/pages/materialtype/materialType_view.html index abb0e9c4..e80c5d51 100644 --- a/target/classes/templates/pages/materialtype/materialType_view.html +++ b/target/classes/templates/pages/materialtype/materialType_view.html @@ -59,8 +59,8 @@ diff --git a/target/classes/templates/pages/split/split-out.html b/target/classes/templates/pages/split/split-out.html index e29a012b..d11c14b8 100644 --- a/target/classes/templates/pages/split/split-out.html +++ b/target/classes/templates/pages/split/split-out.html @@ -69,16 +69,16 @@