Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
operation-control-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王锦盛
operation-control-platform
Commits
0c107339
Commit
0c107339
authored
Mar 24, 2022
by
郭凡凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用列表 服务列表 左侧树目录
parent
69b0d5ad
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
200 additions
and
55 deletions
+200
-55
src/main/java/com/pms/ocp/controller/ApiBasicManagementController.java
.../com/pms/ocp/controller/ApiBasicManagementController.java
+3
-2
src/main/java/com/pms/ocp/controller/TenantBasicManagementController.java
...m/pms/ocp/controller/TenantBasicManagementController.java
+15
-3
src/main/java/com/pms/ocp/mapper/OcpApiGroupMapper.java
src/main/java/com/pms/ocp/mapper/OcpApiGroupMapper.java
+5
-0
src/main/java/com/pms/ocp/mapper/OcpTenantGroupMapper.java
src/main/java/com/pms/ocp/mapper/OcpTenantGroupMapper.java
+4
-1
src/main/java/com/pms/ocp/model/dto/GroupDto.java
src/main/java/com/pms/ocp/model/dto/GroupDto.java
+4
-0
src/main/java/com/pms/ocp/model/dto/OcpGroupBaseDto.java
src/main/java/com/pms/ocp/model/dto/OcpGroupBaseDto.java
+27
-0
src/main/java/com/pms/ocp/service/ApiBasicManagementService.java
...n/java/com/pms/ocp/service/ApiBasicManagementService.java
+2
-5
src/main/java/com/pms/ocp/service/TenantBasicManagementService.java
...ava/com/pms/ocp/service/TenantBasicManagementService.java
+10
-5
src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java
...m/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java
+39
-26
src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java
...ms/ocp/service/impl/TenantBasicManagementServiceImpl.java
+30
-2
src/main/resources/mapper/OcpApiGroupMapper.xml
src/main/resources/mapper/OcpApiGroupMapper.xml
+49
-8
src/main/resources/mapper/OcpGroup.xml
src/main/resources/mapper/OcpGroup.xml
+12
-3
No files found.
src/main/java/com/pms/ocp/controller/ApiBasicManagementController.java
View file @
0c107339
...
...
@@ -5,6 +5,7 @@ import com.pms.ocp.common.utils.ExcelUtils;
import
com.pms.ocp.common.utils.FileExport
;
import
com.pms.ocp.common.utils.FileUtil
;
import
com.pms.ocp.model.dto.ApiBaseDto
;
import
com.pms.ocp.model.dto.OcpGroupBaseDto
;
import
com.pms.ocp.model.entity.OcpApiBase
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.vo.OcpApiBaseVo
;
...
...
@@ -209,8 +210,8 @@ public class ApiBasicManagementController {
@ApiOperation
(
"服务分类层级"
)
@GetMapping
(
"/apiBaseTreeOther"
)
public
ResponseVO
<
List
<
Ocp
ApiGroup
>>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupCode
,
Integer
apiGroupPromotionType
)
{
List
<
Ocp
ApiGroup
>
apiTreeGroupDtos
=
apiBasicManagementService
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
apiGroupCode
,
apiGroupPromotionType
);
public
ResponseVO
<
List
<
Ocp
GroupBaseDto
>>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupCode
,
Integer
apiGroupPromotionType
,
String
apiCode
,
String
apiPromotion
)
{
List
<
Ocp
GroupBaseDto
>
apiTreeGroupDtos
=
apiBasicManagementService
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
apiGroupCode
,
apiGroupPromotionType
,
apiCode
,
apiPromotion
);
return
ResponseVO
.
ok
(
apiTreeGroupDtos
);
}
...
...
src/main/java/com/pms/ocp/controller/TenantBasicManagementController.java
View file @
0c107339
package
com.pms.ocp.controller
;
import
com.github.pagehelper.PageInfo
;
import
com.pms.ocp.model.dto.*
;
...
...
@@ -21,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* @author guofanfan
*/
...
...
@@ -86,12 +86,24 @@ public class TenantBasicManagementController {
@ApiOperation
(
"应用树层级"
)
@GetMapping
(
"/tenantBaseTreeOther"
)
public
ResponseVO
<
List
<
GroupDto
>>
tenantBaseTreeOther
(
@RequestParam
(
required
=
false
)
String
tenantGroupCode
,
@RequestParam
(
required
=
false
)
String
tenantGroupCompanyCode
public
ResponseVO
<
List
<
GroupDto
>>
tenantBaseTreeOther
(
@RequestParam
(
required
=
false
)
String
tenantGroupCode
,
@RequestParam
(
required
=
false
)
String
tenantGroupCompanyCode
,
@RequestParam
(
required
=
false
)
String
tenantCode
)
{
List
<
GroupDto
>
ocpApiGroups
=
tenantBasicManagementService
.
tenantBaseTreeOther
(
tenantGroupCode
,
tenantGroupCompanyCode
);
List
<
GroupDto
>
ocpApiGroups
=
tenantBasicManagementService
.
tenantBaseTreeOther
(
tenantGroupCode
,
tenantGroupCompanyCode
,
tenantCode
);
// if (ocpApiGroups.size() != 0) {
// return ResponseVO.ok(ocpApiGroups);
// } else {
// List<GroupDto> ocpBaseGroupDto = tenantBasicManagementService.selectBase(tenantGroupCode, tenantGroupCompanyCode);
//
// }
return
ResponseVO
.
ok
(
ocpApiGroups
);
}
/**
* @param tenantGroupCode
* @param tenantGroupCompanyCode
* @return
*/
@ApiOperation
(
"应用树底层"
)
@GetMapping
(
"/tenantBaseTree"
)
public
ResponseVO
<
List
<
OcpTenantBase
>>
tenantBaseTree
(
@RequestParam
(
required
=
false
)
String
tenantGroupCode
,
...
...
src/main/java/com/pms/ocp/mapper/OcpApiGroupMapper.java
View file @
0c107339
...
...
@@ -2,6 +2,7 @@ package com.pms.ocp.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.pms.ocp.model.dto.ApiBaseDto
;
import
com.pms.ocp.model.dto.OcpGroupBaseDto
;
import
com.pms.ocp.model.entity.OcpApiBase
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.vo.OcpApiBaseVo
;
...
...
@@ -21,5 +22,9 @@ public interface OcpApiGroupMapper extends BaseMapper<OcpApiGroup> {
List
<
OcpApiBaseVo
>
selectPageLists
(
ApiBaseDto
apiBaseReq
);
List
<
OcpGroupBaseDto
>
apiTree
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
,
String
apiPromotion
);
List
<
OcpGroupBaseDto
>
selectBase
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
String
apiPromotion
);
// List<WholeLinkTreeVo> queryApiTreeData1();
}
src/main/java/com/pms/ocp/mapper/OcpTenantGroupMapper.java
View file @
0c107339
...
...
@@ -3,10 +3,11 @@ package com.pms.ocp.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.pms.ocp.model.dto.GroupDto
;
import
com.pms.ocp.model.dto.OcpTenantBaseDto
;
import
com.pms.ocp.model.dto.TenantDto
;
import
com.pms.ocp.model.entity.OcpTenantGroup
;
import
com.pms.ocp.model.vo.ResponseVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -19,4 +20,6 @@ public interface OcpTenantGroupMapper extends BaseMapper<OcpTenantGroup> {
List
<
OcpTenantBaseDto
>
selectPageLists
(
TenantDto
tenantDto
);
OcpTenantGroup
selectRegister
(
@Param
(
"tenantGroupCode"
)
String
tenantGroupCode
,
@Param
(
"tenantGroupCompanyCode"
)
String
tenantGroupCompanyCode
);
List
<
GroupDto
>
selectBase
(
@Param
(
"tenantGroupCode"
)
String
tenantGroupCode
,
String
tenantGroupCompanyCode
);
}
src/main/java/com/pms/ocp/model/dto/GroupDto.java
View file @
0c107339
...
...
@@ -23,6 +23,10 @@ public class GroupDto extends OcpTenantGroup implements Serializable {
@ApiModelProperty
(
"应用代码"
)
private
String
tenantCode
;
@ApiModelProperty
(
"flag"
)
private
Integer
flag
;
/**
* 应用分类代码
*/
...
...
src/main/java/com/pms/ocp/model/dto/OcpGroupBaseDto.java
0 → 100644
View file @
0c107339
package
com.pms.ocp.model.dto
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @author guofanfan
* 服务组dto
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
OcpGroupBaseDto
extends
OcpApiGroup
implements
Serializable
{
@ApiModelProperty
(
"服务代码"
)
private
String
apiCode
;
@ApiModelProperty
(
"服务接口中文名称"
)
private
String
apiName
;
@ApiModelProperty
(
"服务分类代码"
)
private
String
apiGroupCode
;
}
src/main/java/com/pms/ocp/service/ApiBasicManagementService.java
View file @
0c107339
...
...
@@ -3,10 +3,7 @@ package com.pms.ocp.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.github.pagehelper.PageInfo
;
import
com.pms.ocp.model.QueryResponseResult
;
import
com.pms.ocp.model.dto.ApiBaseDto
;
import
com.pms.ocp.model.dto.ApiTreeGroupDto
;
import
com.pms.ocp.model.dto.OcpApiBaseDto
;
import
com.pms.ocp.model.dto.WholeLinkParamDto
;
import
com.pms.ocp.model.dto.*
;
import
com.pms.ocp.model.entity.OcpApiBase
;
import
com.pms.ocp.model.entity.OcpApiExtent
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
...
...
@@ -75,7 +72,7 @@ public interface ApiBasicManagementService extends IService<OcpApiBase> {
* @param apiGroupPcode
* @return
*/
List
<
Ocp
ApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
);
List
<
Ocp
GroupBaseDto
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
,
String
apiCode
,
String
apiPromotion
);
/**
* 根据分组code获取列表
...
...
src/main/java/com/pms/ocp/service/TenantBasicManagementService.java
View file @
0c107339
...
...
@@ -2,10 +2,7 @@ package com.pms.ocp.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.github.pagehelper.PageInfo
;
import
com.pms.ocp.model.dto.GroupDto
;
import
com.pms.ocp.model.dto.OcpTenantBaseDto
;
import
com.pms.ocp.model.dto.TenantDto
;
import
com.pms.ocp.model.dto.WholeLinkParamDto
;
import
com.pms.ocp.model.dto.*
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.entity.OcpTenantBase
;
import
com.pms.ocp.model.entity.OcpTenantGroup
;
...
...
@@ -64,7 +61,7 @@ public interface TenantBasicManagementService extends IService<OcpTenantBase> {
* @param tenantGroupCompanyCode
* @return
*/
List
<
GroupDto
>
tenantBaseTreeOther
(
String
tenantGroupCode
,
String
tenantGroupCompanyCode
);
List
<
GroupDto
>
tenantBaseTreeOther
(
String
tenantGroupCode
,
String
tenantGroupCompanyCode
,
String
tenantCode
);
/**
* 应用列表
...
...
@@ -91,6 +88,14 @@ public interface TenantBasicManagementService extends IService<OcpTenantBase> {
*/
OcpTenantGroup
selectRegister
(
String
tenantGroupCode
,
String
tenantGroupCompanyCode
);
/**
* 查询基础表
* @param tenantGroupCode
* @param tenantGroupCompanyCode
* @return
*/
List
<
GroupDto
>
selectBase
(
String
tenantGroupCode
,
String
tenantGroupCompanyCode
);
/**
* 应用树
* @param tenantGroupCode
...
...
src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java
View file @
0c107339
...
...
@@ -2,24 +2,21 @@ package com.pms.ocp.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.pms.ocp.common.constants.StringUtils
;
import
com.pms.ocp.common.exception.BeagleException
;
import
com.pms.ocp.common.utils.MenuTree
;
import
com.pms.ocp.mapper.ApiBasicManagementMapper
;
import
com.pms.ocp.mapper.OcpApiExtentMapper
;
import
com.pms.ocp.mapper.OcpApiGroupMapper
;
import
com.pms.ocp.mapper.OcpApiSubsMapper
;
import
com.pms.ocp.model.CommonCode
;
import
com.pms.ocp.model.QueryResponseResult
;
import
com.pms.ocp.model.dto.ApiBaseDto
;
import
com.pms.ocp.model.dto.OcpApiBaseDto
;
import
com.pms.ocp.model.dto.WholeLinkParamDto
;
import
com.pms.ocp.model.dto.OcpGroupBaseDto
;
import
com.pms.ocp.model.entity.OcpApiBase
;
import
com.pms.ocp.model.entity.OcpApiExtent
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
...
...
@@ -29,7 +26,6 @@ import com.pms.ocp.model.vo.*;
import
com.pms.ocp.service.ApiBasicManagementService
;
import
com.pms.ocp.service.OcpApiExtentService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -39,6 +35,7 @@ import java.time.LocalDateTime;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -57,6 +54,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
private
OcpApiGroupMapper
ocpApiGroupMapper
;
List
<
String
>
apiGroupCode
=
new
ArrayList
<>();
/**
* 导出查询
*
...
...
@@ -98,6 +96,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
ocpApiSubsMapper
.
insert
(
ocpApiSubs
);
}
}
/**
* 条件查询
*
...
...
@@ -114,7 +113,6 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
return
apiBasicManagementMapper
.
queryOcpApiBaseDto
(
keyword
,
apiUnit
,
startTime
,
endTime
,
apiCode
,
pageSize
,
pageNum
);
}
/**
* 导入添加到数据库
*
...
...
@@ -177,9 +175,22 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
}
@Override
public
List
<
OcpApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
)
{
List
<
OcpApiGroup
>
ocpApiGroups
=
ocpApiGroupMapper
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
apiGroupPcode
,
apiGroupPromotionType
);
public
List
<
OcpGroupBaseDto
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
,
String
apiCode
,
String
apiPromotion
)
{
List
<
OcpGroupBaseDto
>
ocpApiGroups
=
ocpApiGroupMapper
.
apiTree
(
apiGroupCompanyCode
,
apiGroupPcode
,
apiGroupPromotionType
,
apiPromotion
);
if
(
ocpApiGroups
.
size
()
!=
0
)
{
return
ocpApiGroups
;
}
else
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
apiCode
))
{
return
Collections
.
EMPTY_LIST
;
}
else
{
List
<
OcpGroupBaseDto
>
ocpGroupBaseDto
=
ocpApiGroupMapper
.
selectBase
(
apiGroupCompanyCode
,
apiGroupPcode
,
apiPromotion
);
if
(
ocpGroupBaseDto
.
size
()
!=
0
)
{
return
ocpGroupBaseDto
;
}
return
Collections
.
EMPTY_LIST
;
}
}
}
@Override
...
...
@@ -188,8 +199,8 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
return
ResponseVO
.
error
(
"分页参数不能为空"
);
}
apiGroupCode
.
add
(
apiBaseReq
.
getApiGroupCode
());
setGroupIdValue
(
apiBaseReq
.
getApiGroupCompanyCode
()
,
apiBaseReq
.
getApiGroupCode
(),
apiBaseReq
.
getApiPromotion
());
PageHelper
.
startPage
(
apiBaseReq
.
getPageNum
(),
apiBaseReq
.
getPageSize
());
setGroupIdValue
(
apiBaseReq
.
getApiGroupCompanyCode
()
,
apiBaseReq
.
getApiGroupCode
(),
apiBaseReq
.
getApiPromotion
());
PageHelper
.
startPage
(
apiBaseReq
.
getPageNum
(),
apiBaseReq
.
getPageSize
());
apiBaseReq
.
setApiGroupCodeList
(
apiGroupCode
);
List
<
OcpApiBaseVo
>
ocpApiBaseVos
=
ocpApiGroupMapper
.
selectPageLists
(
apiBaseReq
);
apiGroupCode
.
clear
();
...
...
@@ -238,24 +249,26 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
* @param
* @param
*/
private
void
setGroupIdValue
(
String
apiGroupCompanyCode
,
String
code
,
Integer
apiGroupPromotionType
)
{
List
<
String
>
codes
=
getIdsByPIdPub
(
apiGroupCompanyCode
,
code
,
apiGroupPromotionType
);
if
(
codes
.
size
()>
0
)
{
for
(
String
cod
:
codes
)
{
setGroupIdValue
(
apiGroupCompanyCode
,
cod
,
apiGroupPromotionType
);
private
void
setGroupIdValue
(
String
apiGroupCompanyCode
,
String
code
,
Integer
apiGroupPromotionType
)
{
List
<
String
>
codes
=
getIdsByPIdPub
(
apiGroupCompanyCode
,
code
,
apiGroupPromotionType
);
if
(
codes
.
size
()
>
0
)
{
for
(
String
cod
:
codes
)
{
setGroupIdValue
(
apiGroupCompanyCode
,
cod
,
apiGroupPromotionType
);
apiGroupCode
.
add
(
cod
);
};
}
;
}
}
/**
* pcode服务分组
*
* @param apiGroupCompanyCode
* @param code
* @return
*/
public
List
<
String
>
getIdsByPIdPub
(
String
apiGroupCompanyCode
,
String
code
,
Integer
apiGroupPromotionType
)
{
List
<
OcpApiGroup
>
ocpApiGroups
=
ocpApiGroupMapper
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
code
,
apiGroupPromotionType
);
public
List
<
String
>
getIdsByPIdPub
(
String
apiGroupCompanyCode
,
String
code
,
Integer
apiGroupPromotionType
)
{
List
<
OcpApiGroup
>
ocpApiGroups
=
ocpApiGroupMapper
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
code
,
apiGroupPromotionType
);
return
ocpApiGroups
.
stream
().
map
(
OcpApiGroup:
:
getApiGroupCode
).
collect
(
Collectors
.
toList
());
}
...
...
src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java
View file @
0c107339
...
...
@@ -10,6 +10,7 @@ import com.pms.ocp.mapper.OcpTenantExtentMapper;
import
com.pms.ocp.mapper.OcpTenantGroupMapper
;
import
com.pms.ocp.mapper.TenantBasicManagementMapper
;
import
com.pms.ocp.model.dto.GroupDto
;
import
com.pms.ocp.model.dto.OcpTenantBaseDto
;
import
com.pms.ocp.model.dto.TenantDto
;
import
com.pms.ocp.model.entity.*
;
...
...
@@ -20,10 +21,13 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.sql.Timestamp
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -250,10 +254,22 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan
* @return
*/
@Override
public
List
<
GroupDto
>
tenantBaseTreeOther
(
String
tenantGroupCode
,
String
tenantGroupCompanyCode
)
{
public
List
<
GroupDto
>
tenantBaseTreeOther
(
String
tenantGroupCode
,
String
tenantGroupCompanyCode
,
String
tenantCode
)
{
List
<
GroupDto
>
ocpTenantGroups
=
ocpTenantGroupMapper
.
tenantBaseTreeOther
(
tenantGroupCode
,
tenantGroupCompanyCode
);
if
(
ocpTenantGroups
.
size
()
!=
0
)
{
return
ocpTenantGroups
;
}
else
{
if
(
StringUtils
.
isNotEmpty
(
tenantCode
))
{
return
Collections
.
EMPTY_LIST
;
}
else
{
List
<
GroupDto
>
groupDtos
=
ocpTenantGroupMapper
.
selectBase
(
tenantGroupCode
,
tenantGroupCompanyCode
);
if
(
groupDtos
.
size
()
!=
0
)
{
return
groupDtos
;
}
return
Collections
.
EMPTY_LIST
;
}
}
}
...
...
@@ -310,6 +326,18 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl<TenantBasicMan
return
ocpTenantGroup
;
}
/**
* 应用树底层
*
* @param tenantGroupCode
* @param tenantGroupCompanyCode
* @return
*/
public
List
<
GroupDto
>
selectBase
(
String
tenantGroupCode
,
String
tenantGroupCompanyCode
)
{
List
<
GroupDto
>
groupDto
=
ocpTenantGroupMapper
.
selectBase
(
tenantGroupCode
,
tenantGroupCompanyCode
);
return
groupDto
;
}
/**
* 应用树2
*
...
...
src/main/resources/mapper/OcpApiGroupMapper.xml
View file @
0c107339
...
...
@@ -48,6 +48,29 @@
and api_group_promotion_type =#{apiGroupPromotionType}
</if>
</select>
<select
id=
"apiTree"
resultType=
"com.pms.ocp.model.dto.OcpGroupBaseDto"
>
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where is_delete = 0
<if
test=
"apiGroupPcode == null"
>
and api_group_pcode is null
</if>
<if
test=
"apiGroupPcode!=null and apiGroupPcode!=''"
>
and api_group_pcode = #{apiGroupPcode}
</if>
<if
test=
"apiGroupCompanyCode!=null and apiGroupCompanyCode!=''"
>
and api_group_company_code =#{apiGroupCompanyCode}
</if>
<if
test=
"apiGroupPromotionType!=null and apiGroupPromotionType!=''"
>
and api_group_promotion_type =#{apiGroupPromotionType}
</if>
<if
test=
"test=apiPromotion!=null and apiPromotion!=''"
>
and api_group_promotion_type=#{apiPromotion}
</if>
</select>
<select
id=
"selectPageLists"
resultType=
"com.pms.ocp.model.vo.OcpApiBaseVo"
>
select
oab.obj_id,oab.api_code,oae.api_code,oab.api_name,oae.cluster_name,
...
...
@@ -84,8 +107,26 @@
</select>
<!-- <select id="queryApiTreeData1" resultType="com.pms.ocp.model.vo.WholeLinkTreeVo">-->
<!-- select api_group_code ,api_group_name ,api_group_pcode ,api_group_promotion_type from operating_platform.ocp_api_group-->
<!-- </select>-->
<select
id=
"selectBase"
resultType=
"com.pms.ocp.model.dto.OcpGroupBaseDto"
>
select obj_id,api_code,api_name,api_group_code from ocp_api_base
<where>
<if
test=
"apiGroupPcode!=null and apiGroupPcode!=''"
>
and api_group_code = #{apiGroupPcode}
</if>
<if
test=
"apiGroupCompanyCode!=null and apiGroupCompanyCode!=''"
>
and owner_company_code =#{apiGroupCompanyCode}
</if>
<if
test=
"test=apiPromotion!=null and apiPromotion!=''"
>
and api_promotion=#{apiPromotion}
</if>
</where>
</select>
<!-- <select id="queryApiTreeData1" resultType="com.pms.ocp.model.vo.WholeLinkTreeVo">-->
<!-- select api_group_code ,api_group_name ,api_group_pcode ,api_group_promotion_type from operating_platform.ocp_api_group-->
<!-- </select>-->
</mapper>
\ No newline at end of file
src/main/resources/mapper/OcpGroup.xml
View file @
0c107339
...
...
@@ -9,7 +9,7 @@
<result
property=
"tenantUrl"
column=
"tenant_url"
/>
<result
property=
"clusterName"
column=
"cluster_name"
/>
<result
property=
"spaceName"
column=
"space_name"
/>
<!-- <result property="deploymentName" column="deployment_name"/>-->
<!-- <result property="deploymentName" column="deployment_name"/>-->
<result
property=
"tenantZone"
column=
"tenant_zone"
/>
<result
property=
"tenantCtime"
column=
"tenant_ctime"
/>
<result
property=
"tenantUnit"
column=
"tenant_unit"
jdbcType=
"VARCHAR"
/>
...
...
@@ -19,8 +19,6 @@
<select
id=
"tenantBaseTreeOther"
resultType=
"com.pms.ocp.model.dto.GroupDto"
>
select
tenant_group_code,tenant_group_name,tenant_group_pcode ,tenant_group_level from ocp_tenant_group
-- LEFT join ocp_tenant_base otb on otg.tenant_group_code=otb.tenant_group_code
where is_delete = 0
<if
test=
"tenantGroupCode == null"
>
and tenant_group_pcode = ''
...
...
@@ -81,5 +79,16 @@
</select>
<select
id=
"selectBase"
resultType=
"com.pms.ocp.model.dto.GroupDto"
>
select obj_id,tenant_name,tenant_code ,tenant_group_code from ocp_tenant_base
<where>
<if
test=
"tenantGroupCode !=null and tenantGroupCode!=''"
>
and tenant_group_code=#{tenantGroupCode}
</if>
<if
test=
"tenantGroupCompanyCode !=null and tenantGroupCompanyCode !=''"
>
and owner_company_code=#{tenantGroupCompanyCode}
</if>
</where>
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment