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
8875e5a3
Commit
8875e5a3
authored
Mar 14, 2022
by
zhaochengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
赵呈明 --应用服务树分类
parent
b849f96b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
31 deletions
+79
-31
src/main/java/com/pms/ocp/controller/OcpApiTreeController.java
...ain/java/com/pms/ocp/controller/OcpApiTreeController.java
+2
-2
src/main/java/com/pms/ocp/mapper/OcpApiTreeMapper.java
src/main/java/com/pms/ocp/mapper/OcpApiTreeMapper.java
+4
-1
src/main/java/com/pms/ocp/model/entity/OcpApiGroup.java
src/main/java/com/pms/ocp/model/entity/OcpApiGroup.java
+1
-0
src/main/java/com/pms/ocp/service/OcpApiTreeService.java
src/main/java/com/pms/ocp/service/OcpApiTreeService.java
+1
-1
src/main/java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
.../java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
+12
-20
src/main/java/com/pms/ocp/service/impl/TenantServiceImpl.java
...main/java/com/pms/ocp/service/impl/TenantServiceImpl.java
+0
-3
src/main/resources/mapper/OcpApiTreeMapper.xml
src/main/resources/mapper/OcpApiTreeMapper.xml
+13
-4
src/main/resources/mapper/OcpTenantGroup.xml
src/main/resources/mapper/OcpTenantGroup.xml
+46
-0
No files found.
src/main/java/com/pms/ocp/controller/OcpApiTreeController.java
View file @
8875e5a3
...
...
@@ -42,8 +42,8 @@ public class OcpApiTreeController {
@PostMapping
(
"/instertree"
)
@ApiOperation
(
"服务树分类--新增"
)
public
ResponseVO
inseter
(
@RequestBody
OcpApiGroup
Dtos
ocpApiGroupDtos
){
boolean
flag
=
service
.
insertTree
(
ocpApiGroup
Dtos
);
public
ResponseVO
inseter
(
@RequestBody
OcpApiGroup
ocpApiGroup
){
boolean
flag
=
service
.
insertTree
(
ocpApiGroup
);
if
(
flag
){
return
ResponseVO
.
ok
();
}
...
...
src/main/java/com/pms/ocp/mapper/OcpApiTreeMapper.java
View file @
8875e5a3
...
...
@@ -32,5 +32,8 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> {
List
<
OcpApiGroup
>
selectThreeApiGroupsList
(
Long
apiGroupPromotionType
,
String
apiGroupCode
);
List
<
OcpApiGroup
>
selectList
(
Long
apiGroupPromotionType
,
String
apiGroupCode
,
Long
apiGroupLevel
);
List
<
OcpApiGroup
>
selectLists
(
Long
apiGroupPromotionType
,
String
apiGroupCode
,
Long
apiGroupLevel
);
//code重复问题
List
<
OcpApiGroup
>
selectGroupCode
();
}
src/main/java/com/pms/ocp/model/entity/OcpApiGroup.java
View file @
8875e5a3
...
...
@@ -16,6 +16,7 @@ import java.util.List;
@TableName
(
"ocp_api_group"
)
@ApiModel
(
"服务分类表"
)
public
class
OcpApiGroup
{
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
"主键ID"
)
private
String
objId
;
...
...
src/main/java/com/pms/ocp/service/OcpApiTreeService.java
View file @
8875e5a3
...
...
@@ -21,7 +21,7 @@ public interface OcpApiTreeService extends IService<OcpApiGroup> {
/**
* 新增服务分类
*/
boolean
insertTree
(
OcpApiGroup
Dtos
ocpApiGroupDtos
);
boolean
insertTree
(
OcpApiGroup
ocpApiGroup
);
/*
...
...
src/main/java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
View file @
8875e5a3
...
...
@@ -62,30 +62,19 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
/**
* 新增服务分类
*
* @param
ocpApiGroupDtos
* @param
*/
@Override
public
boolean
insertTree
(
OcpApiGroupDtos
ocpApiGroupDtos
)
{
public
boolean
insertTree
(
OcpApiGroup
ocpApiGroup
)
{
Timestamp
timestamp
=
new
Timestamp
(
System
.
currentTimeMillis
());
String
code
=
RandomStringUtils
.
getRandomString
(
6
);
boolean
flag
=
true
;
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
null
);
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
if
(
ocpApiGroup
.
getApiGroupCode
().
equals
(
ocpApiGroupDtos
.
getApiGroupCode
()))
{
flag
=
false
;
break
;
}
}
if
(
flag
==
true
)
{
OcpApiGroup
ocpApiGroup1
=
new
OcpApiGroup
();
ocpApiGroup1
.
setObjId
(
""
);
ocpApiGroup1
.
setApiGroupMtime
(
timestamp
);
ocpApiGroup1
.
setApiGroupCtime
(
timestamp
);
BeanUtils
.
copyProperties
(
ocpApiGroupDtos
,
ocpApiGroup1
);
ocpApiGroup1
.
setApiGroupCode
(
code
);
mapper
.
insert
(
ocpApiGroup1
);
}
ocpApiGroup
.
setObjId
(
""
);
ocpApiGroup
.
setApiGroupMtime
(
timestamp
);
ocpApiGroup
.
setApiGroupCtime
(
timestamp
);
ocpApiGroup
.
setApiGroupPcode
(
ocpApiGroup
.
getApiGroupCode
());
ocpApiGroup
.
setApiGroupCode
(
code
);
mapper
.
insert
(
ocpApiGroup
);
return
flag
;
}
...
...
@@ -150,8 +139,11 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
if
(
StringUtils
.
isBlank
(
pageGroupDto
.
getApiGroupCode
())){
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectTwoApiGroups
(
pageGroupDto
.
getApiGroupPromotionType
());
pageInfo
.
setRecords
(
ocpApiGroups
);
LambdaQueryWrapper
<
OcpApiGroup
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
eq
(
OcpApiGroup:
:
getApiGroupPromotionType
,
pageGroupDto
.
getApiGroupPromotionType
());
mapper
.
selectPage
(
pageInfo
,
lambdaQueryWrapper
);
}
else
if
(!(
StringUtils
.
isBlank
(
pageGroupDto
.
getApiGroupCode
()))){
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
pageGroupDto
.
getApiGroupPromotionType
(),
pageGroupDto
.
getApiGroupCode
(),
pageGroupDto
.
getApiGroupLevel
());
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
s
(
pageGroupDto
.
getApiGroupPromotionType
(),
pageGroupDto
.
getApiGroupCode
(),
pageGroupDto
.
getApiGroupLevel
());
LambdaQueryWrapper
<
OcpApiGroup
>
lwq
=
new
LambdaQueryWrapper
<>();
pageInfo
.
setRecords
(
ocpApiGroups
);
mapper
.
selectPage
(
pageInfo
,
lwq
);
...
...
src/main/java/com/pms/ocp/service/impl/TenantServiceImpl.java
View file @
8875e5a3
...
...
@@ -86,13 +86,10 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
ocpTenantGroup
.
setTenantGroupVersion
(
"1.0"
);
}
OcpTenantBase
ocpTenantBase
=
new
OcpTenantBase
();
BeanUtils
.
copyProperties
(
tenanBaseDto
,
ocpTenantBase
);
if
(
"null"
.
equals
(
tenanBaseDto
.
getTenantGroupCode
())){
group
.
setTenantGroupCode
(
randomString
);
}
tenantMapper
.
insert
(
tenanBaseDto
);
tenantBasicMapper
.
insert
(
ocpTenantBase
);
return
falg
;
}
...
...
src/main/resources/mapper/OcpApiTreeMapper.xml
View file @
8875e5a3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pms.ocp.mapper.OcpApiTreeMapper"
>
<!-- 一级树-->
<!--
特
一级树-->
<select
id=
"selectApiGroups"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
SELECT * FROM (select *,ROW_NUMBER() over(partition by api_group_promotion_type) as rn from ocp_api_group) as u where u.rn= 1;
</select>
<!--
二
级树-->
<!--
一
级树-->
<select
id=
"selectTwoApiGroups"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType};
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType}
and api_group_level = '1'
;
</select>
<!--
三
级-->
<!--
二
级-->
<select
id=
"selectThreeApiGroupsList"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_pcode = #{apiGroupCode};
</select>
<!--服务树 -查询-->
<select
id=
"selectLists"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_pcode = #{apiGroupCode} and api_group_level = #{apiGroupLevel};
</select>
<!-- code值重复问题 -->
<select
id=
"selectGroupCode"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
SELECT api_group_code FROM ocp_api_group;
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/OcpTenantGroup.xml
View file @
8875e5a3
...
...
@@ -25,6 +25,52 @@
<select
id=
"selectGroups"
resultType=
"com.pms.ocp.model.entity.OcpTenantGroup"
>
SELECT * FROM ocp_tenant_group WHERE tenant_group_company_code = #{tenantGroupCompanyCode} and tenant_group_level = '1' ;
</select>
<!-- 模糊查询-->
<select
id=
"queryLike"
resultType=
"com.pms.ocp.model.entity.OcpTenantGroup"
>
select * from ocp_tenant_group
<where>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_code like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_name like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_company_code like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_pcode like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_type like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_version like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_order_no like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_user_id like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_user_name like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_ctime like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_mtime like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and is_delete like CONCAT('%', #{keyword}::text,'%')
</if>
<if
test=
"keyword !=null and keyword != '' "
>
and tenant_group_level like CONCAT('%', #{keyword}::text,'%')
</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