+ * 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.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.OperLanguageDTO;
+import com.epmet.service.OperLanguageService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+/**
+ * 国际化
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@RestController
+@RequestMapping("operlanguage")
+public class OperLanguageController {
+
+ @Autowired
+ private OperLanguageService operLanguageService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = operLanguageService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ OperLanguageDTO data = operLanguageService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody OperLanguageDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ operLanguageService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody OperLanguageDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ operLanguageService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ operLanguageService.delete(ids);
+ return new Result();
+ }
+
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperMenuController.java
new file mode 100644
index 0000000000..b1f96c1692
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperMenuController.java
@@ -0,0 +1,156 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.exception.ErrorCode;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.OperMenuDTO;
+import com.epmet.dto.result.MenuResourceDTO;
+import com.epmet.service.OperMenuService;
+import com.epmet.service.OperResourceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * 菜单管理
+ *
+ * @author zhaoqifeng
+ * @date 2020/3/17 16:35
+ */
+@RestController
+@RequestMapping("menu")
+public class OperMenuController {
+
+ @Autowired
+ private OperMenuService operMenuService;
+
+ @Autowired
+ private OperResourceService operResourceService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = operMenuService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ OperMenuDTO data = operMenuService.get(id);
+
+ //菜单资源列表
+ List resourceList = operResourceService.getMenuResourceList(id);
+
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody OperMenuDTO dto, @LoginUser TokenDto tokenDto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ operMenuService.save(dto,tokenDto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody OperMenuDTO dto, @LoginUser TokenDto tokenDto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ operMenuService.update(dto,tokenDto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ operMenuService.delete(ids);
+ return new Result();
+ }
+
+ @DeleteMapping("{id}")
+ public Result delete(@PathVariable("id") String id, @LoginUser TokenDto tokenDto){
+ //效验数据
+ AssertUtils.isNull(id, "id");
+
+ //判断是否有子菜单或按钮
+ List list = operMenuService.getListPid(id);
+ if(list.size() > 0){
+ return new Result().error(ErrorCode.SUB_MENU_EXIST);
+ }
+
+ operMenuService.delete(id, tokenDto);
+
+ return new Result();
+ }
+
+
+ /**
+ * 获取菜单列表
+ * @param type 类型
+ * @return Result>
+ */
+ @GetMapping("list")
+ public Result> list(Integer type){
+ List list = operMenuService.getMenuList(type);
+
+ return new Result>().ok(list);
+ }
+
+ /**
+ * 导航
+ * @param tokenDto token
+ * @return List
+ */
+ @GetMapping("nav")
+ public Result> nav(@LoginUser TokenDto tokenDto){
+ List list = operMenuService.getUserMenuNavList(tokenDto);
+ return new Result>().ok(list);
+ }
+
+ /**
+ * 权限标识
+ * @param tokenDto token
+ * @return Set
+ */
+ @GetMapping("permissions")
+ public Result> permissions(@LoginUser TokenDto tokenDto){
+ Set set = operMenuService.getUserPermissions(tokenDto);
+ return new Result>().ok(set);
+ }
+
+ /**
+ * 角色菜单权限
+ * @param tokenDto token
+ * @return
+ */
+ @GetMapping("select")
+ public Result> select(@LoginUser TokenDto tokenDto){
+ List list = operMenuService.getUserMenuList(tokenDto, null);
+
+ return new Result>().ok(list);
+ }
+
+ /**
+ * @param tokenDto
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author yinzuomei
+ * @Description 运营端用户退出系统,清空菜单和操作权限
+ * @Date 2020/5/21 18:07
+ **/
+ @GetMapping("clearoperuseraccess")
+ public Result clearOperUserAccess(@LoginUser TokenDto tokenDto) {
+ operMenuService.clearOperUserAccess(tokenDto.getApp(), tokenDto.getClient(), tokenDto.getUserId());
+ return new Result();
+ }
+}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperResourceController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperResourceController.java
new file mode 100644
index 0000000000..8bda911e28
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperResourceController.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.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.OperResourceDTO;
+import com.epmet.service.OperResourceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+/**
+ * 资源管理
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@RestController
+@RequestMapping("operresource")
+public class OperResourceController {
+
+ @Autowired
+ private OperResourceService operResourceService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = operResourceService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ OperResourceDTO data = operResourceService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody OperResourceDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ operResourceService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody OperResourceDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ operResourceService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ operResourceService.delete(ids);
+ return new Result();
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleController.java
new file mode 100644
index 0000000000..33659c8c03
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleController.java
@@ -0,0 +1,104 @@
+/**
+ * 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.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.OperRoleDTO;
+import com.epmet.service.OperRoleMenuService;
+import com.epmet.service.OperRoleService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 角色管理
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@RestController
+@RequestMapping("operrole")
+public class OperRoleController {
+
+ @Autowired
+ private OperRoleService operRoleService;
+ @Autowired
+ private OperRoleMenuService operRoleMenuService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = operRoleService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ OperRoleDTO data = operRoleService.get(id);
+
+ //查询角色对应的菜单
+ List menuIdList = operRoleMenuService.getMenuIdList(id);
+ data.setMenuIdList(menuIdList);
+
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody OperRoleDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ operRoleService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody OperRoleDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ operRoleService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ operRoleService.delete(ids);
+ return new Result();
+ }
+
+
+ @GetMapping("list")
+ @ApiOperation("列表")
+ public Result> list(){
+ List data = operRoleService.list(new HashMap<>(1));
+
+ return new Result>().ok(data);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleMenuController.java
new file mode 100644
index 0000000000..6520623e16
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleMenuController.java
@@ -0,0 +1,85 @@
+/**
+ * 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.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.OperRoleMenuDTO;
+import com.epmet.service.OperRoleMenuService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+/**
+ * 角色菜单关系
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@RestController
+@RequestMapping("operrolemenu")
+public class OperRoleMenuController {
+
+ @Autowired
+ private OperRoleMenuService operRoleMenuService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = operRoleMenuService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ OperRoleMenuDTO data = operRoleMenuService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody OperRoleMenuDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ operRoleMenuService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody OperRoleMenuDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ operRoleMenuService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ operRoleMenuService.delete(ids);
+ return new Result();
+ }
+
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleUserController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleUserController.java
new file mode 100644
index 0000000000..b58bfd322b
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/OperRoleUserController.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.
+ *
+ * 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.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 国际化
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@Component
+public class OperLanguageRedis {
+ @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/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperMenuRedis.java
new file mode 100644
index 0000000000..f1b568f33a
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperMenuRedis.java
@@ -0,0 +1,74 @@
+/**
+ * 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.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisKeys;
+import com.epmet.commons.tools.redis.RedisUtils;
+import com.epmet.commons.tools.utils.HttpContextUtils;
+import com.epmet.dto.OperMenuDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 菜单管理
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@Component
+public class OperMenuRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(String userId, String app, String client) {
+ redisUtils.deleteByPattern(RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage()));
+ redisUtils.delete(RedisKeys.getUserPermissionsKey(userId, app, client));
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+ public void setUserMenuNavList(String userId, String app, String client, List menuList){
+ String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage());
+ redisUtils.set(key, menuList);
+ }
+
+ public List getUserMenuNavList(String userId, String app, String client){
+ String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage());
+ return (List)redisUtils.get(key);
+ }
+
+ public void setUserPermissions(String userId, String app, String client, Set permsSet){
+ String key = RedisKeys.getUserPermissionsKey(userId, app, client);
+ redisUtils.set(key, permsSet);
+ }
+
+ public Set getUserPermissions(String userId, String app, String client){
+ String key = RedisKeys.getUserPermissionsKey(userId, app, client);
+ return (Set)redisUtils.get(key);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperResourceRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperResourceRedis.java
new file mode 100644
index 0000000000..68ea39a15e
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperResourceRedis.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.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisKeys;
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 资源管理
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@Component
+public class OperResourceRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete() {
+ String key = RedisKeys.getSysResourceKey();
+
+ redisUtils.delete(key);
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleMenuRedis.java
new file mode 100644
index 0000000000..28f98c5615
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleMenuRedis.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.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 角色菜单关系
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@Component
+public class OperRoleMenuRedis {
+ @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/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleRedis.java
new file mode 100644
index 0000000000..15e6682155
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleRedis.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.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 角色管理
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@Component
+public class OperRoleRedis {
+ @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/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleUserRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleUserRedis.java
new file mode 100644
index 0000000000..7f6df90fa3
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperRoleUserRedis.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.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 角色用户关系
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@Component
+public class OperRoleUserRedis {
+ @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/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/OperLanguageService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/OperLanguageService.java
new file mode 100644
index 0000000000..0f0ad555bc
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/OperLanguageService.java
@@ -0,0 +1,105 @@
+/**
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.epmet.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.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.dao.OperRoleUserDao;
+import com.epmet.dto.OperRoleUserDTO;
+import com.epmet.entity.OperRoleUserEntity;
+import com.epmet.redis.OperRoleUserRedis;
+import com.epmet.service.OperRoleUserService;
+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 generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-18
+ */
+@Service
+public class OperRoleUserServiceImpl extends BaseServiceImpl implements OperRoleUserService {
+
+ @Autowired
+ private OperRoleUserRedis operRoleUserRedis;
+ @Autowired
+ private OperRoleUserDao operRoleUserDao;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, OperRoleUserDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, OperRoleUserDTO.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 OperRoleUserDTO get(String id) {
+ OperRoleUserEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, OperRoleUserDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(OperRoleUserDTO dto) {
+ OperRoleUserEntity entity = ConvertUtils.sourceToTarget(dto, OperRoleUserEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(OperRoleUserDTO dto) {
+ OperRoleUserEntity entity = ConvertUtils.sourceToTarget(dto, OperRoleUserEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void saveOrUpdate(String userId, List roleIdList) {
+ //先删除角色用户关系
+ deleteByUserId(userId);
+
+ //用户没有一个角色权限的情况
+ if(CollUtil.isEmpty(roleIdList)){
+ return ;
+ }
+
+ //保存角色用户关系
+ for(String roleId : roleIdList){
+ OperRoleUserEntity operRoleUserEntity = new OperRoleUserEntity();
+ operRoleUserEntity.setUserId(userId);
+ operRoleUserEntity.setRoleId(roleId);
+
+ //保存
+ insert(operRoleUserEntity);
+ }
+ }
+
+ @Override
+ public void deleteByRoleId(String roleId) {
+ operRoleUserDao.deleteByRoleId(roleId);
+ }
+
+ @Override
+ public void deleteByUserId(String userId) {
+ operRoleUserDao.deleteByUserId(userId);
+ }
+
+ @Override
+ public List getRoleIdList(String userId) {
+
+ return baseDao.getRoleIdList(userId);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteByRoleIds(String[] roleIds) {
+ operRoleUserDao.deleteByRoleIds(roleIds);
+ }
+
+ @Override
+ public void deleteByUserIds(String[] userIds) {
+ operRoleUserDao.deleteByUserIds(userIds);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperLanguageDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperLanguageDao.xml
new file mode 100644
index 0000000000..a64735e21f
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperLanguageDao.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO `oper_language` ( `table_name`, `table_id`, `field_name`, `field_value`, `language` )
+ VALUES
+ ( #{tableName}, #{tableId}, #{fieldName}, #{fieldValue}, #{language} )
+
+
diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperMenuDao.xml
new file mode 100644
index 0000000000..e3a61dbd36
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperMenuDao.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperResourceDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperResourceDao.xml
new file mode 100644
index 0000000000..94c839c252
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperResourceDao.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ delete from oper_resource where resource_code = #{value}
+
+
+
+
+
+
+
+
+
diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleDao.xml
new file mode 100644
index 0000000000..e1df3a1038
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleDao.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleMenuDao.xml
new file mode 100644
index 0000000000..b9075fceda
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleMenuDao.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+ update oper_role_menu set del_flag = 1 where del_flag = 0 and role_id in
+
+ #{roleId}
+
+
+
+
+ update oper_role_menu set del_flag = 1 where role_id = #{value} and del_flag = 0
+
+
+
+ update oper_role_menu set del_flag = 1 where menu_id = #{value} and del_flag = 0
+
+
+
diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleUserDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleUserDao.xml
new file mode 100644
index 0000000000..005ef2451c
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperRoleUserDao.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+ update oper_role_user set del_flag = 1 where del_flag = 0 and role_id in
+
+ #{roleId}
+
+
+
+
+ update oper_role_user set del_flag = 1 where del_flag = 0 and user_id in
+
+ #{userId}
+
+
+
+
+ update oper_role_user set del_flag = 1 where role_id = #{value} and del_flag = 0
+
+
+
+ update oper_role_user set del_flag = 1 where user_id = #{value} and del_flag = 0
+
+
+
+
+