From 5541d61203ec16b1f5724c5508d8bd7d434e44ae Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Wed, 24 May 2023 10:58:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=89=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=88=86=E7=BA=A7=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../area/user/AreaUserRouteController.java | 42 + .../templates/area/user/list-area-admin.html | 187 +++++ .../area/user/list-area-user-admin.html | 748 ++++++++++++++++++ .../templates/area/user/list-area.html | 11 +- 4 files changed, 986 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/templates/area/user/list-area-admin.html create mode 100644 src/main/resources/templates/area/user/list-area-user-admin.html diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/route/area/user/AreaUserRouteController.java b/src/main/java/cn/com/tenlion/usercenter/controller/route/area/user/AreaUserRouteController.java index 776b146..c3ce2a3 100644 --- a/src/main/java/cn/com/tenlion/usercenter/controller/route/area/user/AreaUserRouteController.java +++ b/src/main/java/cn/com/tenlion/usercenter/controller/route/area/user/AreaUserRouteController.java @@ -1,11 +1,18 @@ package cn.com.tenlion.usercenter.controller.route.area.user; +import cn.com.tenlion.usercenter.pojo.dtos.userexpand.UserExpandDTO; +import cn.com.tenlion.usercenter.pojo.pos.userexpand.UserExpandPO; import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.SearchException; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.user.IUserExpandBaseService; import ink.wgink.interfaces.user.IUserExpandOptionButton; +import ink.wgink.module.dictionary.pojo.dtos.AreaDTO; +import ink.wgink.module.dictionary.service.IAreaService; import ink.wgink.service.user.util.UserUtil; import io.swagger.annotations.Api; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -21,6 +28,10 @@ public class AreaUserRouteController { private IUserExpandBaseService userExpandBaseService; @Autowired(required = false) private IUserExpandOptionButton userExpandOptionButton; + @Autowired + private SecurityComponent securityComponent; + @Autowired + private IAreaService areaService; @GetMapping("save-area-user") public ModelAndView saveAreaUser() { @@ -40,6 +51,30 @@ public class AreaUserRouteController { return mv; } + @GetMapping("list-area-admin") + public ModelAndView listAreaAdmin() { + ModelAndView mv = new ModelAndView("area/user/list-area-admin"); + if (securityComponent.isAdmin()) { + mv.addObject("baseParentId", "0"); + } else { + UserExpandPO userExpandPO = securityComponent.getExpandData(UserExpandPO.class); + if (userExpandPO == null) { + throw new SearchException("未绑定拓展属性"); + } + if (StringUtils.isBlank(userExpandPO.getAreaCode())) { + throw new SearchException("未绑定地区"); + } + AreaDTO areaDTO = areaService.getByCode(userExpandPO.getAreaCode()); + if (areaDTO == null) { + throw new SearchException("地区不存在"); + } + mv.addObject("baseAreaId", areaDTO.getAreaId()); + mv.addObject("baseAreaParentId", areaDTO.getAreaParentId()); + mv.addObject("baseAreaCode", areaDTO.getAreaCode()); + } + return mv; + } + @GetMapping("list-area-user") public ModelAndView listAreaUser() { ModelAndView mv = new ModelAndView("area/user/list-area-user"); @@ -47,4 +82,11 @@ public class AreaUserRouteController { return mv; } + @GetMapping("list-area-user-admin") + public ModelAndView listAreaUserAdmin() { + ModelAndView mv = new ModelAndView("area/user/list-area-user-admin"); + UserUtil.setUserListPageExpand(userExpandBaseService, userExpandOptionButton, mv); + return mv; + } + } diff --git a/src/main/resources/templates/area/user/list-area-admin.html b/src/main/resources/templates/area/user/list-area-admin.html new file mode 100644 index 0000000..303d053 --- /dev/null +++ b/src/main/resources/templates/area/user/list-area-admin.html @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/src/main/resources/templates/area/user/list-area-user-admin.html b/src/main/resources/templates/area/user/list-area-user-admin.html new file mode 100644 index 0000000..3e55b02 --- /dev/null +++ b/src/main/resources/templates/area/user/list-area-user-admin.html @@ -0,0 +1,748 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
请选择组织机构
+
+ + +
+ +
+
+ +
请选择角色
+
+ + +
+ +
+
+ +
请选择职位
+
+ + +
+ +
+
+ +
请选择组
+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/src/main/resources/templates/area/user/list-area.html b/src/main/resources/templates/area/user/list-area.html index 9b69e2c..9f5059a 100644 --- a/src/main/resources/templates/area/user/list-area.html +++ b/src/main/resources/templates/area/user/list-area.html @@ -20,7 +20,7 @@
-
+
-
+
@@ -120,6 +120,13 @@ function init() { top.restAjax.get(top.restAjax.path('api/area/user/list-area-user-count/area-parent-id/{parentId}', [parentId]), {}, null, function(code, data) { render(data); + if(data.length === 0) { + $('#areaTable').hide(); + $('#userTable').attr('class', 'layui-col-md12 layui-col-sm12 layui-col-xs12'); + } else { + $('#areaTable').show(); + $('#userTable').attr('class', 'layui-col-md9 layui-col-sm9 layui-col-xs9'); + } }, function(code, data) { top.dialog.msg(data.msg); })