From c5198e288798018b80da809fb52bf56e7e782706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E9=A3=9E?= Date: Mon, 27 Apr 2020 16:30:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E5=AF=BC=E7=AB=AF=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=A1=A5=E4=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/dto/SysAnalysisMenuDTO.java | 141 +++++++++++++++ .../esua/epdc/dto/SysAnalysisRoleMenuDTO.java | 61 +++++++ .../com/elink/esua/epdc/dto/SysRoleDTO.java | 4 + .../elink/esua/epdc/enums/MenuTableEnum.java | 6 +- .../epdc/controller/AppMenuController.java | 12 ++ .../controller/SysAnalysisMenuController.java | 132 ++++++++++++++ .../SysAnalysisRoleMenuController.java | 94 ++++++++++ .../epdc/controller/SysRoleController.java | 6 + .../com/elink/esua/epdc/dao/AppMenuDao.java | 10 ++ .../esua/epdc/dao/SysAnalysisMenuDao.java | 84 +++++++++ .../esua/epdc/dao/SysAnalysisRoleMenuDao.java | 50 ++++++ .../epdc/entity/SysAnalysisMenuEntity.java | 120 +++++++++++++ .../entity/SysAnalysisRoleMenuEntity.java | 63 +++++++ .../esua/epdc/excel/SysAnalysisMenuExcel.java | 83 +++++++++ .../epdc/excel/SysAnalysisRoleMenuExcel.java | 50 ++++++ .../esua/epdc/redis/SysAnalysisMenuRedis.java | 47 +++++ .../epdc/redis/SysAnalysisRoleMenuRedis.java | 47 +++++ .../esua/epdc/service/AppMenuService.java | 9 + .../epdc/service/SysAnalysisMenuService.java | 125 ++++++++++++++ .../service/SysAnalysisRoleMenuService.java | 111 ++++++++++++ .../epdc/service/impl/AppMenuServiceImpl.java | 9 + .../impl/SysAnalysisMenuServiceImpl.java | 162 ++++++++++++++++++ .../impl/SysAnalysisRoleMenuServiceImpl.java | 150 ++++++++++++++++ .../epdc/service/impl/SysRoleServiceImpl.java | 8 + .../src/main/resources/mapper/AppMenuDao.xml | 39 +++++ .../resources/mapper/SysAnalysisMenuDao.xml | 132 ++++++++++++++ .../mapper/SysAnalysisRoleMenuDao.xml | 21 +++ .../epdc/dto/issue/IssueContentDetailDTO.java | 14 ++ .../dto/issue/IssueWaitHandleOrClosedDTO.java | 2 + .../result/ItemDetailForPCEndResultDTO.java | 14 ++ .../main/resources/mapper/issue/IssueDao.xml | 9 + .../main/resources/mapper/item/ItemDao.xml | 14 ++ .../dto/topic/TopicDTO.java | 4 + .../dto/topic/TopicDetailDTO.java | 21 +++ .../main/resources/mapper/topic/TopicDao.xml | 17 +- 35 files changed, 1868 insertions(+), 3 deletions(-) create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisMenuDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisRoleMenuDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisMenuDao.xml create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisMenuDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisMenuDTO.java new file mode 100644 index 00000000..c0662905 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisMenuDTO.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; + +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +public class SysAnalysisMenuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @NotNull(message = "{id.require}", groups = UpdateGroup.class) + private Long id; + + /** + * 上级ID,一级菜单为0 + */ + @NotNull(message = "{sysmenu.pid.require}", groups = DefaultGroup.class) + private Long pid; + + /** + * 类型 0:菜单 1:按钮 + */ + @Range(min = 0, max = 1, message = "{sysmenu.type.range}", groups = DefaultGroup.class) + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 样式名称 + */ + private String className; + + /** + * 排序 + */ + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + /** + * 删除标识 0:未删除 1:删除 + */ + private Integer delFlag; + + /** + * 创建者 + */ + private Long creator; + + /** + * 创建时间 + */ + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + /** + * 更新者 + */ + private Long updater; + + /** + * 更新时间 + */ + private Date updateDate; + + /** + * 菜单编码 + */ + private String menuCode; + + /** + * 备注 + */ + private String remark; + + /** + * 子模板ID + */ + private String templateId; + + @NotBlank(message = "{sysmenu.name.require}", groups = DefaultGroup.class) + private String name; + + /** + * 是否显示数字 0否 1是 + */ + private String numFlag; + + //虚字段 + + /** + * 上级菜单名称 + */ + private String parentName; + + /** + * 模块名称 + */ + private String modelname; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisRoleMenuDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisRoleMenuDTO.java new file mode 100644 index 00000000..b5a712cf --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysAnalysisRoleMenuDTO.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +public class SysAnalysisRoleMenuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private Long id; + + /** + * 角色ID + */ + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + + /** + * 创建者 + */ + private Long creator; + + /** + * 创建时间 + */ + private Date createDate; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java index 2f234a40..c73087fc 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java @@ -77,6 +77,10 @@ public class SysRoleDTO implements Serializable { * 项目处理类型授权id列表 */ private List categoryIdList; + /** + * 数据端菜单ID列表 + */ + private List analysisMenuIdList; /** * 吹哨部门id列表 diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/enums/MenuTableEnum.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/enums/MenuTableEnum.java index 6a1b5304..5874ba30 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/enums/MenuTableEnum.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/enums/MenuTableEnum.java @@ -22,7 +22,11 @@ public enum MenuTableEnum { /** * 非菜单资源 */ - APP("sys_app_menu"); + APP("sys_app_menu"), + /** + * 领导端资源 + */ + ANALYSIS("sys_analysis_menu"); private String value; diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java index 12a19cac..5bc38d2a 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java @@ -27,6 +27,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.excel.AppMenuExcel; import com.elink.esua.epdc.service.AppMenuService; @@ -126,4 +127,15 @@ public class AppMenuController { public Result> indexPanel(@PathVariable("mobile") String mobile) { return appMenuService.indexPanel(mobile); } + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + @GetMapping("/analysisIndexPanel/{userId}") + public Result> analysisIndexPanel(@PathVariable("userId") String userId) { + return appMenuService.getAnalysisIndexPanel(userId); + } } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java new file mode 100644 index 00000000..04ee8c90 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.excel.*; +import com.elink.esua.epdc.service.SysAnalysisMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@RestController +@RequestMapping("analysismenu") +public class SysAnalysisMenuController { + + @Autowired + private SysAnalysisMenuService sysAnalysisMenuService; + + /** + * 获取APP菜单列表 + * + * @param type 菜单类型 0:菜单 1:按钮 null:全部 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/11/19 13:26 + */ + @GetMapping("list") + public Result> list(Integer type) { + List list = sysAnalysisMenuService.getAnalysisMenuList(type); + return new Result>().ok(list); + } + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = sysAnalysisMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SysAnalysisMenuDTO data = sysAnalysisMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody SysAnalysisMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + sysAnalysisMenuService.save(dto); + return new Result(); + } + @GetMapping("select") + public Result> select(UserDetail userDetail) { + List list = sysAnalysisMenuService.getUserMenuList(userDetail, null); + + return new Result>().ok(list); + } + + @PutMapping + public Result update(@RequestBody SysAnalysisMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + sysAnalysisMenuService.update(dto); + return new Result(); + } + + @DeleteMapping("{id}") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + //判断是否有子菜单或按钮 + if(sysAnalysisMenuService.hasChileMenu(id)){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + sysAnalysisMenuService.delete(id); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysAnalysisMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, SysAnalysisMenuExcel.class); + } + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + @GetMapping("/analysisIndexPanel/{userId}") + public Result> analysisIndexPanel(@PathVariable("userId") String userId) { + return sysAnalysisMenuService.getAnalysisIndexPanel(userId); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java new file mode 100644 index 00000000..65deebc6 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.excel.*; +import com.elink.esua.epdc.service.SysAnalysisRoleMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@RestController +@RequestMapping("analysisrolemenu") +public class SysAnalysisRoleMenuController { + + @Autowired + private SysAnalysisRoleMenuService sysAnalysisRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = sysAnalysisRoleMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SysAnalysisRoleMenuDTO data = sysAnalysisRoleMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody SysAnalysisRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + sysAnalysisRoleMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody SysAnalysisRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + sysAnalysisRoleMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + sysAnalysisRoleMenuService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysAnalysisRoleMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, SysAnalysisRoleMenuExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java index 3845c6a8..7898ee1f 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java @@ -52,6 +52,8 @@ public class SysRoleController { private SysRoleDataScopeService sysRoleDataScopeService; @Autowired private AppRoleMenuService appRoleMenuService; + @Autowired + private SysAnalysisRoleMenuService sysAnalysisRoleMenuService; @GetMapping("page") @ApiOperation("分页") @@ -93,6 +95,10 @@ public class SysRoleController { List appMenuIdList = appRoleMenuService.getAppMenuIdList(id); data.setAppMenuIdList(appMenuIdList); + //查询角色对应数据端菜单权限 + List analysisMenuIdList = sysAnalysisRoleMenuService.getAnalysisMenuIdList(id); + data.setAnalysisMenuIdList(analysisMenuIdList); + //查询角色对应的项目处理类型权限 List categoryIdList = sysRoleService.getCategoryIdList(id); data.setCategoryIdList(categoryIdList); diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java index 8154f25e..4a748f12 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java @@ -19,6 +19,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.entity.AppMenuEntity; import org.apache.ibatis.annotations.Mapper; @@ -78,4 +79,13 @@ public interface AppMenuDao extends BaseDao { * @Date 2019/11/20 11:10 **/ List indexPanelByMobile(String mobile); + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + List getAnalysisIndexPanel(String userId); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java new file mode 100644 index 00000000..e0c83b87 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.SysAnalysisMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Mapper +public interface SysAnalysisMenuDao extends BaseDao { + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + List getAnalysisIndexPanel(String userId); + + /** + * 获取菜单详细信息 + * @param id + * @return + */ + SysAnalysisMenuDTO selectByIdDIY(@Param("id") String id, @Param("language") String language); + + /** + * 查询所有菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + */ + List getMenuList(@Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param type 菜单类型 + * @param language 语言 + */ + List getUserMenuList(@Param("userId") Long userId, @Param("type") Integer type, @Param("language") String language); + + /** + * 获取app菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/19 13:43 + */ + List selectListAppMenu(@Param("type") Integer type, @Param("language") String language); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java new file mode 100644 index 00000000..e817fc77 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Mapper +public interface SysAnalysisRoleMenuDao extends BaseDao { + + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 根据角色ID,获取菜单ID列表 + * + * @param id + * @return + */ + List getAnalysisMenuIdList(Long id); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java new file mode 100644 index 00000000..ac45ced4 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_analysis_menu") +public class SysAnalysisMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 上级ID,一级菜单为0 + */ + private Long pid; + + /** + * 菜单名称 + */ + @TableField(exist = false) + private String name; + + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 样式名称 + */ + private String className; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 菜单编码 + */ + private String menuCode; + + /** + * 备注 + */ + private String remark; + + /** + * 子模板ID + */ + private String templateId; + + /** + * 是否显示数字 0否 1是 + */ + private String numFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java new file mode 100644 index 00000000..0b05aaa7 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_analysis_role_menu") +public class SysAnalysisRoleMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 角色ID + */ + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + + /** + * 创建者 + */ + private Long creator; + + /** + * 创建时间 + */ + private Date createDate; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java new file mode 100644 index 00000000..9e2c7baa --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +public class SysAnalysisMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "上级ID,一级菜单为0") + private Long pid; + + @Excel(name = "类型 0:菜单 1:按钮") + private Integer type; + + @Excel(name = "模块名称") + private String modelname; + + @Excel(name = "菜单图标") + private String icon; + + @Excel(name = "样式名称") + private String className; + + @Excel(name = "菜单编码(议题管理-待回应:10001,议题管理-待处理:10002,项目管理-待处理:10003,用户管理-待认证居民:10004,消息:10005)") + private String menuCode; + + @Excel(name = "模板ID") + private String templateId; + + @Excel(name = "是否显示数字 0否 1是") + private String numFlag; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "删除标识 0:未删除 1:删除") + private Integer delFlag; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "更新者") + private Long updater; + + @Excel(name = "更新时间") + private Date updateDate; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java new file mode 100644 index 00000000..629ac017 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +public class SysAnalysisRoleMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "角色ID") + private Long roleId; + + @Excel(name = "菜单ID") + private Long menuId; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java new file mode 100644 index 00000000..3349f7c1 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Component +public class SysAnalysisMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java new file mode 100644 index 00000000..f660239d --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Component +public class SysAnalysisRoleMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppMenuService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppMenuService.java index b16bd65b..401d3fcd 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppMenuService.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppMenuService.java @@ -22,6 +22,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.entity.AppMenuEntity; @@ -143,4 +144,12 @@ public interface AppMenuService extends BaseService { * @Date 2019/11/20 10:42 **/ Result> indexPanel(String mobile); + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + Result> getAnalysisIndexPanel(String userId); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java new file mode 100644 index 00000000..a59c4e77 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; +import com.elink.esua.epdc.dto.*; +import java.util.List; +import java.util.Map; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +public interface SysAnalysisMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-25 + */ + List list(Map params); + + /** + * 判断是否有子级菜单 + * + * @param id 菜单ID + * @return boolean + * @author work@yujt.net.cn + * @date 2019/11/19 14:30 + */ + boolean hasChileMenu(Long id); + + List getAnalysisMenuList(Integer type); + + /** + * 单条查询 + * + * @param id + * @return SysAnalysisMenuDTO + * @author generator + * @date 2020-03-25 + */ + SysAnalysisMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void save(SysAnalysisMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void update(SysAnalysisMenuDTO dto); + + /** + * 用户app端菜单列表 + * + * @param userDetail 用户信息 + * @param type 菜单类型 + */ + List getUserMenuList(UserDetail userDetail, Integer type); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-25 + */ + void delete(Long id); + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + Result> getAnalysisIndexPanel(String userId); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java new file mode 100644 index 00000000..9ccfd8c7 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +public interface SysAnalysisRoleMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-25 + */ + List list(Map params); + + /** + * 保存或修改 + * + * @param roleId 角色ID + * @param analysisMenuIdList 菜单ID列表 + */ + void saveOrUpdate(Long roleId, List analysisMenuIdList); + + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 单条查询 + * + * @param id + * @return SysAnalysisRoleMenuDTO + * @author generator + * @date 2020-03-25 + */ + SysAnalysisRoleMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void save(SysAnalysisRoleMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void update(SysAnalysisRoleMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-25 + */ + void delete(String[] ids); + List getAnalysisMenuIdList(Long id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java index 81e31035..876d2509 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java @@ -33,6 +33,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.TreeUtils; import com.elink.esua.epdc.dao.AppMenuDao; import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.entity.AppMenuEntity; import com.elink.esua.epdc.enums.MenuTableEnum; @@ -171,6 +172,14 @@ public class AppMenuServiceImpl extends BaseServiceImpl indexPanelResultDTOList = this.baseDao.indexPanelByMobile(mobile); return new Result().ok(indexPanelResultDTOList); } + @Override + public Result> getAnalysisIndexPanel(String userId) { + if (StringUtils.isBlank(userId)) { + return new Result().error("用户Id不能为空"); + } + List list = this.baseDao.getAnalysisIndexPanel(userId); + return new Result().ok(list); + } } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java new file mode 100644 index 00000000..a4db1690 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.HttpContextUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.utils.TreeUtils; +import com.elink.esua.epdc.dao.SysAnalysisMenuDao; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; +import com.elink.esua.epdc.enums.MenuTableEnum; +import com.elink.esua.epdc.redis.SysAnalysisMenuRedis; +import com.elink.esua.epdc.service.SysAnalysisMenuService; +import com.elink.esua.epdc.service.SysLanguageService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Service +public class SysAnalysisMenuServiceImpl extends BaseServiceImpl implements SysAnalysisMenuService { + + @Autowired + private SysAnalysisMenuRedis sysAnalysisMenuRedis; + @Autowired + private SysLanguageService sysLanguageService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SysAnalysisMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysAnalysisMenuDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + @Override + public List getAnalysisMenuList(Integer type) { + List menuList = baseDao.selectListAppMenu(type, HttpContextUtils.getLanguage()); + return TreeUtils.build(menuList, Constant.MENU_ROOT); + } + + @Override + public SysAnalysisMenuDTO get(String id) { + SysAnalysisMenuDTO dto = baseDao.selectByIdDIY(id,HttpContextUtils.getLanguage()); + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysAnalysisMenuDTO dto) { + SysAnalysisMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisMenuEntity.class); + insert(entity); + sysLanguageService.saveOrUpdate(MenuTableEnum.ANALYSIS.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysAnalysisMenuDTO dto) { + SysAnalysisMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisMenuEntity.class); + updateById(entity); + sysLanguageService.saveOrUpdate(MenuTableEnum.ANALYSIS.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + @Override + public boolean hasChileMenu(Long id) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("pid", id) + .eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + Integer selectCount = baseDao.selectCount(wrapper); + return selectCount > NumConstant.ZERO; + } + /** + * 用户app端菜单列表 + * + * @param userDetail 用户信息 + * @param type 菜单类型 + */ + @Override + public List getUserMenuList(UserDetail userDetail, Integer type) { + List menuList; + + //系统管理员,拥有最高权限 + if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { + menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + } else { + menuList = baseDao.getUserMenuList(userDetail.getId(), type, HttpContextUtils.getLanguage()); + } + + List dtoList = ConvertUtils.sourceToTarget(menuList, AppMenuDTO.class); + + return TreeUtils.build(dtoList); + } + @Override + public Result> getAnalysisIndexPanel(String userId) { + if (StringUtils.isBlank(userId)) { + return new Result().error("用户Id不能为空"); + } + List list = this.baseDao.getAnalysisIndexPanel(userId); + return new Result().ok(list); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java new file mode 100644 index 00000000..81737ec1 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.SysAnalysisRoleMenuDao; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; +import com.elink.esua.epdc.redis.SysAnalysisRoleMenuRedis; +import com.elink.esua.epdc.service.SysAnalysisRoleMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Service +public class SysAnalysisRoleMenuServiceImpl extends BaseServiceImpl implements SysAnalysisRoleMenuService { + + @Autowired + private SysAnalysisRoleMenuRedis sysAnalysisRoleMenuRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SysAnalysisRoleMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysAnalysisRoleMenuDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + /** + * 保存或修改 + * + * @param roleId 角色ID + * @param appMenuIdList 菜单ID列表 + */ + @Override + public void saveOrUpdate(Long roleId, List analysisMenuIdList) { + //先删除角色菜单权限关系 + deleteByRoleId(roleId); + + //角色没有一个菜单权限的情况 + if (CollUtil.isEmpty(analysisMenuIdList)) { + return; + } + + //保存角色菜单权限关系 + for (Long menuId : analysisMenuIdList) { + SysAnalysisRoleMenuEntity appRoleMenuEntity = new SysAnalysisRoleMenuEntity(); + appRoleMenuEntity.setMenuId(menuId); + appRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(appRoleMenuEntity); + } + } + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + @Override + public void deleteByRoleId(Long roleId) { + baseDao.deleteByRoleId(roleId); + } + + @Override + public SysAnalysisRoleMenuDTO get(String id) { + SysAnalysisRoleMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, SysAnalysisRoleMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysAnalysisRoleMenuDTO dto) { + SysAnalysisRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisRoleMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysAnalysisRoleMenuDTO dto) { + SysAnalysisRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisRoleMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + /** + * 根据角色ID,获取菜单ID列表 + * + * @param id + * @return + */ + @Override + public List getAnalysisMenuIdList(Long id) { + return baseDao.getAnalysisMenuIdList(id); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java index fbc289f2..c57da68f 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java @@ -54,6 +54,8 @@ public class SysRoleServiceImpl extends BaseServiceImpl + + + + + + + + + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisMenuDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisMenuDao.xml new file mode 100644 index 00000000..649e12cd --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisMenuDao.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml new file mode 100644 index 00000000..e06a1bea --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + delete from sys_analysis_role_menu where role_id = #{value} + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueContentDetailDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueContentDetailDTO.java index fc5a1a2c..40b5718b 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueContentDetailDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueContentDetailDTO.java @@ -28,6 +28,15 @@ public class IssueContentDetailDTO implements Serializable { * 手机号 */ private String mobile; + + /** + * 网格ID + */ + private Long gridId; + /** + * 用户头像 + */ + private String userFace; /** * 议题内容 */ @@ -44,6 +53,11 @@ public class IssueContentDetailDTO implements Serializable { * 评论数 */ private Integer commentNum; + + /** + * 评论数 + */ + private Integer participantsNum; /** * 图片 */ diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueWaitHandleOrClosedDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueWaitHandleOrClosedDTO.java index f9eff189..a5293816 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueWaitHandleOrClosedDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueWaitHandleOrClosedDTO.java @@ -34,6 +34,8 @@ public class IssueWaitHandleOrClosedDTO implements Serializable { * 参与人数 */ private Integer participateNum; + + private Integer participantsNum; /** * 支持人数 */ diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemDetailForPCEndResultDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemDetailForPCEndResultDTO.java index a228b389..ff0453eb 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemDetailForPCEndResultDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemDetailForPCEndResultDTO.java @@ -81,6 +81,16 @@ public class ItemDetailForPCEndResultDTO implements Serializable { */ private String categoryName; + /** + * 用户头像 + */ + private String userFace; + + /** + * 网格ID + */ + private Long gridId; + /** * 支持数 */ @@ -93,6 +103,10 @@ public class ItemDetailForPCEndResultDTO implements Serializable { * 评论数 */ private Integer commentNum; + /** + * 评论数 + */ + private Integer participantsNum; /** * 友邻社群 diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml index 357f7597..f6bc3bff 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml @@ -13,6 +13,7 @@ e.BROWSE_NUM AS browseNum, e.COMMENT_NUM AS commentNum, ( e.APPROVE_NUM + e.OPPOSE_NUM + e.BROWSE_NUM + e.COMMENT_NUM ) AS participateNum, + ( e.APPROVE_NUM + e.OPPOSE_NUM + e.BROWSE_NUM + e.COMMENT_NUM ) AS participantsNum, issue.ISSUE_CODE FROM epdc_issue issue @@ -35,6 +36,9 @@ AND (find_in_set(#{communityId},issue.PARENT_DEPT_IDS) OR find_in_set(#{communityId},issue.ALL_DEPT_IDS)) + + + AND issue.ISSUE_CONTENT like concat('%', trim(#{keyword}), '%') AND issue.ISSUE_CODE like concat('%', #{issueCode}, '%') @@ -90,6 +94,8 @@ + + @@ -108,10 +114,13 @@ i.NICK_NAME, i.DISTRIBUTE_TIME, i.MOBILE, + i.USER_FACE, + i.GRID_ID, i.ISSUE_CONTENT, e.APPROVE_NUM, e.OPPOSE_NUM, e.COMMENT_NUM, + ( e.APPROVE_NUM + e.OPPOSE_NUM + e.COMMENT_NUM + e.BROWSE_NUM ) AS participantsNum, img.IMG_URL, i.ISSUE_ADDRESS, i.ISSUE_LATITUDE, diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml index 2990c3af..b52a4f03 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml @@ -411,7 +411,16 @@ AND eve.DEL_FLAG = '0' WHERE item.DEL_FLAG = '0' + + AND item.ITEM_STATE = #{itemState} + + + AND item.ITEM_STATE in (0,10) + + + AND item.ITEM_CONTENT like concat('%', trim(#{keyword}), '%') + AND item.ID IN ( SELECT temp.ITEM_ID @@ -455,6 +464,8 @@ + + @@ -478,9 +489,12 @@ item.ISSUE_ADDRESS, item.ISSUE_LATITUDE, item.ISSUE_LONGITUDE, + item.USER_FACE, + item.GRID_ID, eve.APPROVE_NUM, eve.OPPOSE_NUM, eve.COMMENT_NUM, + ( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.COMMENT_NUM + eve.BROWSE_NUM ) AS participantsNum, item.CATEGORY_FULL_NAME as CATEGORY_NAME, img.IMG_URL, item.GROUP_NAME diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java index ed660b49..90f12a83 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java @@ -204,5 +204,9 @@ public class TopicDTO implements Serializable { * 更新时间 */ private Date updatedTime; + /** + * 评论数 + */ + private Integer participantsNum; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java index eabb2792..73ea8072 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java @@ -56,6 +56,27 @@ public class TopicDetailDTO implements Serializable { * 友邻社群 */ private String groupName; + /** + * 用户头像 + */ + private String userFace; + /** + * 评论数 + */ + private Integer commentNum; + + /** + * 浏览数 + */ + private Integer browseNum; + /** + * 评论数 + */ + private Integer participantsNum; + /** + * 网格ID + */ + private Long gridId; /** * 所属网格详细信息 diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml index 8ffa4541..7d875611 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml @@ -190,12 +190,16 @@ temp.TOPIC_CONTENT, temp.COMMENT_NUM, temp.BROWSE_NUM, + ( temp.BROWSE_NUM + temp.COMMENT_NUM ) AS participantsNum, temp.STATE FROM epdc_topic temp WHERE temp.DEL_FLAG = '0' - AND temp.STATE IN ( 0, 5, 20 ) + AND temp.STATE IN ( 0, 5, 20) + + AND temp.STATE in (0,5,10,15) + AND (find_in_set(#{streetId},temp.PARENT_DEPT_IDS) OR find_in_set(#{streetId},temp.ALL_DEPT_IDS)) @@ -238,6 +242,10 @@ + + + + @@ -254,7 +262,12 @@ tp.TOPIC_LONGITUDE, tp.GROUP_NAME, tp.ALL_DEPT_NAMES, - img.IMG_URL + img.IMG_URL, + tp.USER_FACE, + tp.GRID_ID, + tp.COMMENT_NUM, + ( tp.BROWSE_NUM + tp.COMMENT_NUM ) AS participantsNum, + tp.BROWSE_NUM FROM epdc_topic tp LEFT JOIN epdc_topic_img img ON tp.ID = img.REFERENCE_ID