From fba0a7772b629275c1ef7145706cc0e4e75ab249 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 27 Jul 2022 17:44:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/GovRoleListDTO.java | 49 +++++++++++++++++++ .../com/epmet/feign/GovAccessFeignClient.java | 9 ++-- .../GovAccessFeignClientFallBack.java | 11 +++-- .../epmet/controller/GovRoleController.java | 6 +++ .../main/java/com/epmet/dao/GovRoleDao.java | 2 + .../com/epmet/service/GovRoleService.java | 3 ++ .../service/impl/GovRoleServiceImpl.java | 6 +++ .../src/main/resources/mapper/GovRoleDao.xml | 12 +++++ 8 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java new file mode 100644 index 0000000000..7ff4de4670 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java @@ -0,0 +1,49 @@ +/** + * 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.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovRoleListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 角色名称 + */ + private String name; + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java index 36ccf542bb..d5b6623ea8 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -2,10 +2,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.GetStaffExistRoleFormDTO; -import com.epmet.dto.form.InitDefaultOperationsFormDTO; -import com.epmet.dto.form.ListOpePermsFormDTO; -import com.epmet.dto.form.RoleUserFormDTO; +import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.feign.fallback.GovAccessFeignClientFallBackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -52,4 +50,7 @@ public interface GovAccessFeignClient { @PostMapping("/gov/access/govroleuser/getStaffExistRole") Result> getStaffExistRole(@RequestBody GetStaffExistRoleFormDTO formDTO); + @PostMapping("/gov/access/govrole/getgovrole") + Result getGovRole(@RequestBody GovRoleListDTO formDTO); + } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java index bfb9acbc3b..9fb58edf69 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java @@ -3,10 +3,8 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.GetStaffExistRoleFormDTO; -import com.epmet.dto.form.InitDefaultOperationsFormDTO; -import com.epmet.dto.form.ListOpePermsFormDTO; -import com.epmet.dto.form.RoleUserFormDTO; +import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.feign.GovAccessFeignClient; @@ -40,4 +38,9 @@ public class GovAccessFeignClientFallBack implements GovAccessFeignClient { public Result> getStaffExistRole(GetStaffExistRoleFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getStaffExistRole", formDTO); } + + @Override + public Result getGovRole(GovRoleListDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getGovRole", formDTO); + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java index c11faba160..0159a8d891 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java @@ -27,6 +27,7 @@ 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.GovRoleDTO; +import com.epmet.dto.form.GovRoleListDTO; import com.epmet.service.GovRoleMenuService; import com.epmet.service.GovRoleService; import org.springframework.beans.factory.annotation.Autowired; @@ -102,4 +103,9 @@ public class GovRoleController { return new Result>().ok(data); } + @PostMapping("getgovrole") + public Result getGovRole(@RequestBody GovRoleListDTO fromDTO){ + return new Result().ok(govRoleService.getGovRole(fromDTO)); + } + } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java index 526dbf9b37..a70c839a63 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java @@ -9,6 +9,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.GovRoleDTO; import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.entity.GovRoleEntity; import org.apache.ibatis.annotations.Mapper; @@ -33,4 +34,5 @@ public interface GovRoleDao extends BaseDao { */ List getCustomerRoles(@Param("customerId")String customerId); + GovRoleDTO selectGovRole(@Param("customerId") String customerId, @Param("name") String name); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java index 4fbf7e0f58..b7ca62a420 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.GovRoleListDTO; import com.epmet.entity.GovRoleEntity; import java.util.List; @@ -92,4 +93,6 @@ public interface GovRoleService extends BaseService { * @date 2020-03-18 */ void delete(String[] ids); + + GovRoleDTO getGovRole(GovRoleListDTO fromDTO); } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java index 72a542c9e7..c171d081d9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.GovRoleDao; import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.GovRoleListDTO; import com.epmet.entity.GovRoleEntity; import com.epmet.redis.GovRoleRedis; import com.epmet.service.GovRoleMenuService; @@ -122,4 +123,9 @@ public class GovRoleServiceImpl extends BaseServiceImpl + + +