diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java index 45b1e9c1..39dbaf70 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java @@ -18,6 +18,7 @@ import com.daqing.framework.utils.PageUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -56,6 +57,7 @@ public class CustomerController implements CustomerControllerApi { * 查询客户列表(所有)、根据创建时间筛选、根据客户类型筛选、根据客户编号或者名称搜索 */ @GetMapping("/queryList") + //@PreAuthorize("hasPermission('/crms/customer/queryList','222')") public ResponseResult queryList(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, CustomerRequest customerRequest) { return new ResponseResult().SUCCESS(customerService.queryList(page, size, customerRequest)); diff --git a/dq-financial-guarantee/pom.xml b/dq-financial-guarantee/pom.xml index 27e6a59b..7c224442 100644 --- a/dq-financial-guarantee/pom.xml +++ b/dq-financial-guarantee/pom.xml @@ -20,12 +20,12 @@ - + org.springframework.boot diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/DqFinancialGuaranteeApplication.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/DqFinancialGuaranteeApplication.java index 5702e99f..45915ec8 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/DqFinancialGuaranteeApplication.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/DqFinancialGuaranteeApplication.java @@ -1,10 +1,12 @@ package com.daqing.financial.guarantee; +import com.daqing.financial.hrauth.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Import; import org.springframework.scheduling.annotation.EnableScheduling; import springfox.documentation.swagger2.annotations.EnableSwagger2; @@ -14,6 +16,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; @EnableScheduling @EnableSwagger2 @ComponentScan(basePackages = "com.daqing") +@Import({SecurityConfig.class}) public class DqFinancialGuaranteeApplication { public static void main(String[] args) { diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/config/IPageConfig.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/config/IPageConfig.java index 29169b16..f3c1c0bf 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/config/IPageConfig.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/config/IPageConfig.java @@ -1,13 +1,16 @@ +/* package com.daqing.financial.guarantee.config; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +*/ /** * @auther River * @date 2020/11/5 14:38 - */ + *//* + @Configuration public class IPageConfig { @Bean @@ -15,3 +18,4 @@ public class IPageConfig { return new PaginationInterceptor(); } } +*/ diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index 9c816553..5c09e546 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java @@ -33,6 +33,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.models.auth.In; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.beanutils.ConvertUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.RequestContextHolder; @@ -80,6 +81,7 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA @ApiOperation(value = "获取当前用户角色") public ResponseResult getRoles(){ String roleIds = applyAmountInfoService.getRoles(); + //List list = applyAmountInfoService.getPermission(roleIds); return ResponseResult.SUCCESS(roleIds); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java index de4bb3c7..4d46fbd0 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java @@ -2,6 +2,8 @@ package com.daqing.financial.guarantee.feign; import com.daqing.framework.domain.guarantee.po.DgGuaranteePO; import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; +import com.daqing.framework.domain.hrms.PermissionEntity; +import com.daqing.framework.domain.hrms.RolePermissionEntity; import com.daqing.framework.domain.hrms.ext.EmployeeTO; import com.daqing.framework.domain.hrms.ext.EmployeeVO; import com.daqing.framework.model.response.ResponseResult; @@ -66,4 +68,20 @@ public interface HrmsFeignService { @GetMapping("hrms/employee/selectUserRole") ResponseResult selectUserRole(@RequestParam("userId") Long userId,@RequestParam("roleId")Long roleId); + +/* *//** + * 根据角色id查询所有权限 + *//* + @GetMapping("/hrms/permission/queryPermissionsByRoleIds") + ResponseResult queryPermissionsByRoleIds(@RequestParam("ids") Long[] ids); + + *//** + * 根据主键id查询权限 + * @return + *//* + @GetMapping("/hrms/permission/queryPermissionsByIds") + ResponseResult> queryPermissionsByIds(@RequestParam("ids") Integer[] ids); + + @GetMapping("/hrms/permission/info") + ResponseResult info(@RequestParam("id") Long id);*/ } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index c2cd7fe5..67d77157 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -22,6 +22,9 @@ import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.*; import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; +import com.daqing.framework.domain.hrms.DepartmentVO; +import com.daqing.framework.domain.hrms.PermissionEntity; +import com.daqing.framework.domain.hrms.ext.UserDeptVO; import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; @@ -30,7 +33,10 @@ import com.daqing.framework.util.RandomUtil; import com.daqing.framework.util.RedisUtil; import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.excel.ExcelUtil; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.beanutils.ConvertUtils; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -41,6 +47,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.*; +import java.util.stream.Collectors; /** *

diff --git a/dq-financial-hrms/pom.xml b/dq-financial-hrms/pom.xml index dd7ecb82..050c3081 100644 --- a/dq-financial-hrms/pom.xml +++ b/dq-financial-hrms/pom.xml @@ -39,12 +39,12 @@ ooxml-schemas 1.0 - +