Browse Source

Merge remote-tracking branch 'origin/dev_five_coverage' into dev_five_coverage

master
yinzuomei 3 years ago
parent
commit
a4cad2a98d
  1. 49
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java
  2. 5
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java
  3. 7
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java
  4. 6
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java
  5. 2
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java
  6. 3
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java
  7. 6
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java
  8. 12
      epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml

49
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

5
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java

@ -2,6 +2,8 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.GovRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.GovMenuDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.NewUserRoleResultDTO;
@ -59,4 +61,7 @@ public interface GovAccessFeignClient {
@PostMapping("/gov/access/menu/getCustomerMenuList")
Result<List<GovMenuDTO>> getCustomerMenuList(@RequestBody GetCustomerMenuListFormDTO formDTO);
@PostMapping("/gov/access/govrole/getgovrole")
Result<GovRoleDTO> getGovRole(@RequestBody GovRoleListDTO formDTO);
}

7
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java

@ -3,6 +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.GovRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.GovMenuDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.NewUserRoleResultDTO;
@ -43,4 +45,9 @@ public class GovAccessFeignClientFallBack implements GovAccessFeignClient {
public Result<List<GovMenuDTO>> getCustomerMenuList(GetCustomerMenuListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getCustomerMenuList", formDTO);
}
@Override
public Result<GovRoleDTO> getGovRole(GovRoleListDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getGovRole", formDTO);
}
}

6
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<List<GovRoleDTO>>().ok(data);
}
@PostMapping("getgovrole")
public Result<GovRoleDTO> getGovRole(@RequestBody GovRoleListDTO fromDTO){
return new Result<GovRoleDTO>().ok(govRoleService.getGovRole(fromDTO));
}
}

2
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<GovRoleEntity> {
*/
List<NewUserRoleResultDTO> getCustomerRoles(@Param("customerId")String customerId);
GovRoleDTO selectGovRole(@Param("customerId") String customerId, @Param("name") String name);
}

3
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<GovRoleEntity> {
* @date 2020-03-18
*/
void delete(String[] ids);
GovRoleDTO getGovRole(GovRoleListDTO fromDTO);
}

6
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<GovRoleDao, GovRoleEntit
govRoleUserService.deleteByRoleIds(ids);
}
@Override
public GovRoleDTO getGovRole(GovRoleListDTO fromDTO) {
return baseDao.selectGovRole(fromDTO.getCustomerId(), fromDTO.getName());
}
}

12
epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml

@ -12,4 +12,16 @@
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
</select>
<select id="selectGovRole" resultType="com.epmet.dto.GovRoleDTO">
SELECT
*
FROM gov_role
WHERE
del_flag = 0
AND customer_id = #{customerId}
AND `name` = #{name}
LIMIT 1
</select>
</mapper>

Loading…
Cancel
Save