渗透检测-委托用户角色校验,角色编号获取
This commit is contained in:
@ -104,11 +104,9 @@ public class ProjectEntrustController{
|
||||
@ApiOperation("查询分页数据")
|
||||
@PostMapping("/getPage")
|
||||
@PreAuthorize("hasAnyAuthority('ebtp-purchase','ebtp-agency-sub-admin','ebtp-agency-admin','ebtp-agency-project-manager')")
|
||||
public BaseResponse<IPage<ProjectEntrustVO>> getPage(@ApiParam(value = "对象数据", required = true) @RequestBody ProjectEntrustVO projectEntrust,
|
||||
@RequestHeader(name = "currentRoleCode", required = false) String currentRoleCode){
|
||||
public BaseResponse<IPage<ProjectEntrustVO>> getPage(@ApiParam(value = "对象数据", required = true) @RequestBody ProjectEntrustVO projectEntrust){
|
||||
|
||||
log.info("查询分页数据 currentRoleCode:"+currentRoleCode);
|
||||
return BaseResponse.success(projectEntrustService.getPage(projectEntrust,currentRoleCode));
|
||||
return BaseResponse.success(projectEntrustService.getPage(projectEntrust));
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@ public interface IProjectEntrustService extends IBaseService<ProjectEntrust>{
|
||||
* @param projectEntrust 委托单查询信息
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<ProjectEntrustVO> getPage(ProjectEntrustVO projectEntrust,String currentRoleCode);
|
||||
IPage<ProjectEntrustVO> getPage(ProjectEntrustVO projectEntrust);
|
||||
|
||||
/**
|
||||
* 分派项目经理
|
||||
|
@ -105,13 +105,15 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
|
||||
* @param projectEntrust 查询条件
|
||||
* @return 返回查询条件
|
||||
*/
|
||||
private QueryWrapper<ProjectEntrust> getProjectEntrustQueryWrapper(ProjectEntrustVO projectEntrust,String currentRoleCode) {
|
||||
private QueryWrapper<ProjectEntrust> getProjectEntrustQueryWrapper(ProjectEntrustVO projectEntrust) {
|
||||
QueryWrapper<ProjectEntrust> query = new QueryWrapper<>();
|
||||
//项目名称
|
||||
if(StringUtils.isNotBlank(projectEntrust.getProjectName())){
|
||||
query.like("project_name", projectEntrust.getProjectName());
|
||||
}
|
||||
log.info("查询分页数据 currentRoleCode2:"+cacheUserService.getCacheUser().getCurrentRoleCode());
|
||||
|
||||
String currentRoleCode = cacheUserService.getCacheUser().getCurrentRoleCode();
|
||||
log.info("查询分页数据 currentRoleCode2:"+currentRoleCode);
|
||||
//String currentRoleCode = cacheUserService.getCacheUser().getCurrentRoleCode();
|
||||
|
||||
//采购经理查 采购经理
|
||||
@ -123,7 +125,7 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
|
||||
query.eq("agency_company", cacheUserService.getCacheUser().getOrganizationId());
|
||||
}
|
||||
//代理机构业务经理 查 项目经理
|
||||
if("ebtp-agency-project-manager ".equals(currentRoleCode)){
|
||||
if("ebtp-agency-project-manager".equals(currentRoleCode)){
|
||||
query.eq("project_manager", cacheUserService.getCacheUser().getUserId());
|
||||
}
|
||||
|
||||
@ -166,9 +168,9 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ProjectEntrustVO> getPage(ProjectEntrustVO projectEntrust,String currentRoleCode) {
|
||||
public IPage<ProjectEntrustVO> getPage(ProjectEntrustVO projectEntrust) {
|
||||
|
||||
QueryWrapper<ProjectEntrust> query = getProjectEntrustQueryWrapper(projectEntrust,currentRoleCode);
|
||||
QueryWrapper<ProjectEntrust> query = getProjectEntrustQueryWrapper(projectEntrust);
|
||||
|
||||
query.orderByDesc("id");
|
||||
|
||||
|
Reference in New Issue
Block a user