Commit e6c9d58c authored by 郭凡凡's avatar 郭凡凡

bug修复 查询和应用关联的服务

parent a8905475
...@@ -3,6 +3,8 @@ package com.pms.ocp.controller; ...@@ -3,6 +3,8 @@ package com.pms.ocp.controller;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.pms.ocp.model.dto.*; import com.pms.ocp.model.dto.*;
import com.pms.ocp.model.entity.OcpApiBase;
import com.pms.ocp.model.entity.OcpApiTenantRel;
import com.pms.ocp.model.entity.OcpTenantBase; import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.entity.OcpTenantGroup; import com.pms.ocp.model.entity.OcpTenantGroup;
import com.pms.ocp.model.vo.ResponseVO; import com.pms.ocp.model.vo.ResponseVO;
...@@ -128,4 +130,9 @@ public class TenantBasicManagementController { ...@@ -128,4 +130,9 @@ public class TenantBasicManagementController {
public ResponseVO update(@RequestBody OcpBaseTiocnDto ocpBaseTiocnDto){ public ResponseVO update(@RequestBody OcpBaseTiocnDto ocpBaseTiocnDto){
return tenantBasicManagementService.updateByCondition(ocpBaseTiocnDto); return tenantBasicManagementService.updateByCondition(ocpBaseTiocnDto);
} }
@ApiOperation("个人信息中-查询和应用关联的服务")
@PostMapping("/selectOcpByApi")
public ResponseVO<List<OcpApiBase>> selectOcpByApi(@RequestParam(required = false) String tenantCode){
return tenantBasicManagementService.selectOcpByApi(tenantCode);
}
} }
...@@ -3,8 +3,10 @@ package com.pms.ocp.mapper; ...@@ -3,8 +3,10 @@ package com.pms.ocp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pms.ocp.model.dto.GroupDto; import com.pms.ocp.model.dto.GroupDto;
import com.pms.ocp.model.dto.OcpTenantBaseDto; import com.pms.ocp.model.dto.OcpTenantBaseDto;
import com.pms.ocp.model.entity.OcpApiBase;
import com.pms.ocp.model.entity.OcpTenantBase; import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.vo.CompanyVo; import com.pms.ocp.model.vo.CompanyVo;
import com.pms.ocp.model.vo.ResponseVO;
import com.pms.ocp.model.vo.TenantGroupVo; import com.pms.ocp.model.vo.TenantGroupVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
...@@ -3,9 +3,7 @@ package com.pms.ocp.service; ...@@ -3,9 +3,7 @@ package com.pms.ocp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.pms.ocp.model.dto.*; import com.pms.ocp.model.dto.*;
import com.pms.ocp.model.entity.OcpApiGroup; import com.pms.ocp.model.entity.*;
import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.entity.OcpTenantGroup;
import com.pms.ocp.model.vo.OcpApiBaseVo; import com.pms.ocp.model.vo.OcpApiBaseVo;
import com.pms.ocp.model.vo.ResponseVO; import com.pms.ocp.model.vo.ResponseVO;
...@@ -97,6 +95,13 @@ public interface TenantBasicManagementService extends IService<OcpTenantBase> { ...@@ -97,6 +95,13 @@ public interface TenantBasicManagementService extends IService<OcpTenantBase> {
*/ */
ResponseVO updateByCondition(OcpBaseTiocnDto ocpBaseTiocnDto); ResponseVO updateByCondition(OcpBaseTiocnDto ocpBaseTiocnDto);
/**
* 个人信息中-查询和应用关联的服务
* @param tenantCode
* @return
*/
ResponseVO <List<OcpApiBase>>selectOcpByApi(String tenantCode);
/** /**
* 应用树 * 应用树
* @param tenantGroupCode * @param tenantGroupCode
......
...@@ -42,6 +42,8 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan ...@@ -42,6 +42,8 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan
@Autowired @Autowired
private OcpApiTenantRelService ocpApiTenantRelService; private OcpApiTenantRelService ocpApiTenantRelService;
@Autowired @Autowired
private OcpApiTenantRelMapper ocpApiTenantRelMapper;
@Autowired
private OcpTenantGroupService ocpTenantGroupService; private OcpTenantGroupService ocpTenantGroupService;
@Autowired @Autowired
private OcpTenantGroupMapper ocpTenantGroupMapper; private OcpTenantGroupMapper ocpTenantGroupMapper;
...@@ -49,6 +51,8 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan ...@@ -49,6 +51,8 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan
private OcpTenantAuditMapper ocpTenantAuditMapper; private OcpTenantAuditMapper ocpTenantAuditMapper;
@Autowired @Autowired
private OcpTenantIocnService ocpTenantIocnService; private OcpTenantIocnService ocpTenantIocnService;
@Autowired
private ApiBasicManagementMapper apiBasicManagementMapper;
List<String> tenantGroup = new ArrayList<>(); List<String> tenantGroup = new ArrayList<>();
/** /**
...@@ -393,6 +397,33 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan ...@@ -393,6 +397,33 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan
return ResponseVO.ok(); return ResponseVO.ok();
} }
/**
* 个人信息中-查询和应用关联的服务
*
* @param tenantCode
* @return
*/
@Override
public ResponseVO<List<OcpApiBase>> selectOcpByApi(String tenantCode) {
LambdaQueryWrapper<OcpApiTenantRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(tenantCode), OcpApiTenantRel::getTenantCode, tenantCode);
List<OcpApiTenantRel> ocpApiTenantRel = ocpApiTenantRelMapper.selectList(lambdaQueryWrapper);
if (ocpApiTenantRel.size() == 0) {
return ResponseVO.ok(Collections.EMPTY_LIST);
} else {
for (OcpApiTenantRel apiTenantRel : ocpApiTenantRel) {
LambdaQueryWrapper<OcpApiBase> queryWrapper = new LambdaQueryWrapper<>();
String apiCode = apiTenantRel.getApiCode();
queryWrapper.eq(StringUtils.isNotEmpty(apiCode), OcpApiBase::getApiCode, apiCode);
List<OcpApiBase> list = apiBasicManagementMapper.selectList(queryWrapper);
return ResponseVO.ok(list);
}
}
return ResponseVO.ok();
}
/** /**
* 应用树2 * 应用树2
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment