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
21207592
"src/request/api/service-shop.js" did not exist on "e499f06e675fce77835f1465cb99b2068708bce5"
Commit
21207592
authored
Mar 24, 2022
by
郭凡凡
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
0c107339
585c9e1d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
src/main/java/com/pms/ocp/common/utils/RandomStringUtils.java
...main/java/com/pms/ocp/common/utils/RandomStringUtils.java
+1
-0
src/main/java/com/pms/ocp/mapper/OcpApiTreeMapper.java
src/main/java/com/pms/ocp/mapper/OcpApiTreeMapper.java
+3
-0
src/main/java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
.../java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
+12
-17
src/main/resources/mapper/OcpApiTreeMapper.xml
src/main/resources/mapper/OcpApiTreeMapper.xml
+4
-0
No files found.
src/main/java/com/pms/ocp/common/utils/RandomStringUtils.java
View file @
21207592
...
@@ -17,6 +17,7 @@ public class RandomStringUtils {
...
@@ -17,6 +17,7 @@ public class RandomStringUtils {
String
str
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
;
String
str
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
;
Random
random
=
new
Random
();
Random
random
=
new
Random
();
StringBuffer
sb
=
new
StringBuffer
();
StringBuffer
sb
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
length
;
i
++){
for
(
int
i
=
0
;
i
<
length
;
i
++){
int
number
=
random
.
nextInt
(
62
);
int
number
=
random
.
nextInt
(
62
);
sb
.
append
(
str
.
charAt
(
number
));
sb
.
append
(
str
.
charAt
(
number
));
...
...
src/main/java/com/pms/ocp/mapper/OcpApiTreeMapper.java
View file @
21207592
...
@@ -39,4 +39,7 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> {
...
@@ -39,4 +39,7 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> {
//根据code查询整条数据
//根据code查询整条数据
OcpApiGroup
selectCode
(
String
code
);
OcpApiGroup
selectCode
(
String
code
);
//根据code查询是否=含有下级服务
List
<
OcpApiGroup
>
selectGroupPcode
();
}
}
src/main/java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
View file @
21207592
...
@@ -91,7 +91,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
...
@@ -91,7 +91,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
if
(
"sys_center"
.
equals
(
ocpApiGroup
.
getApiGroupLevel
()))
{
if
(
"sys_center"
.
equals
(
ocpApiGroup
.
getApiGroupLevel
()))
{
ocpApiGroup
.
setApiGroupLevel
(
"api_group"
);
ocpApiGroup
.
setApiGroupLevel
(
"api_group"
);
}
}
if
(
StringUtils
.
isBlank
(
ocpApiGroup
.
getApiGroupLevel
())){
if
(
StringUtils
.
isBlank
(
ocpApiGroup
.
getApiGroupLevel
()))
{
ocpApiGroup
.
setApiGroupLevel
(
"Middleground"
);
ocpApiGroup
.
setApiGroupLevel
(
"Middleground"
);
}
}
mapper
.
insert
(
ocpApi
);
mapper
.
insert
(
ocpApi
);
...
@@ -135,16 +135,12 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
...
@@ -135,16 +135,12 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
public
boolean
deleteOcpTree
(
OcpApiGroup
ocpApiGroup
)
{
public
boolean
deleteOcpTree
(
OcpApiGroup
ocpApiGroup
)
{
boolean
flag
=
true
;
boolean
flag
=
true
;
LambdaQueryWrapper
<
OcpApiGroup
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
OcpApiGroup
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
OcpApiGroup:
:
getApiGroup
C
ode
,
ocpApiGroup
.
getApiGroupCode
());
queryWrapper
.
eq
(
OcpApiGroup:
:
getApiGroup
Pc
ode
,
ocpApiGroup
.
getApiGroupCode
());
String
objId
=
ocpApiGroup
.
getObjId
();
String
objId
=
ocpApiGroup
.
getObjId
();
if
(
StringUtils
.
isBlank
(
ocpApiGroup
.
getApiGroupCode
()))
{
flag
=
false
;
}
else
{
LambdaQueryWrapper
<
OcpApiGroup
>
eq
=
queryWrapper
.
eq
(
OcpApiGroup:
:
getApiGroupPcode
,
ocpApiGroup
.
getApiGroupCode
());
List
<
OcpApiGroup
>
list
=
mapper
.
selectGroupPcode
();
if
(
StringUtils
.
isBlank
(
eq
.
toString
()))
{
if
(
list
.
size
()
>=
1
)
{
flag
=
false
;
flag
=
false
;
}
}
}
if
(
flag
)
{
if
(
flag
)
{
mapper
.
deleteById
(
objId
);
mapper
.
deleteById
(
objId
);
...
@@ -164,15 +160,15 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
...
@@ -164,15 +160,15 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
Page
<
OcpApiGroup
>
pageInfo
=
new
Page
(
pageGroupDto
.
getCurrentPage
(),
pageGroupDto
.
getPageSize
());
Page
<
OcpApiGroup
>
pageInfo
=
new
Page
(
pageGroupDto
.
getCurrentPage
(),
pageGroupDto
.
getPageSize
());
LambdaQueryWrapper
<
OcpApiGroup
>
qw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
OcpApiGroup
>
qw
=
new
LambdaQueryWrapper
<>();
if
(
StringUtils
.
isBlank
(
pageGroupDto
.
getKeyword
()))
{
if
(
StringUtils
.
isBlank
(
pageGroupDto
.
getKeyword
()))
{
if
(
StringUtils
.
isBlank
(
pageGroupDto
.
getApiGroupCode
())){
if
(
StringUtils
.
isBlank
(
pageGroupDto
.
getApiGroupCode
()))
{
qw
.
eq
(
OcpApiGroup:
:
getApiGroupPromotionType
,
pageGroupDto
.
getApiGroupPromotionType
());
qw
.
eq
(
OcpApiGroup:
:
getApiGroupPromotionType
,
pageGroupDto
.
getApiGroupPromotionType
());
mapper
.
selectPage
(
pageInfo
,
qw
);
mapper
.
selectPage
(
pageInfo
,
qw
);
}
else
if
(!(
StringUtils
.
isNotBlank
(
pageGroupDto
.
getApiGroupPcode
())))
{
}
else
if
(!(
StringUtils
.
isNotBlank
(
pageGroupDto
.
getApiGroupPcode
())))
{
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectLists
(
pageGroupDto
.
getApiGroupPromotionType
(),
pageGroupDto
.
getApiGroupCode
());
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectLists
(
pageGroupDto
.
getApiGroupPromotionType
(),
pageGroupDto
.
getApiGroupCode
());
qw
.
eq
(
OcpApiGroup:
:
getApiGroupPromotionType
,
pageGroupDto
.
getApiGroupPromotionType
()).
and
(
c
->
c
.
eq
(
OcpApiGroup:
:
getApiGroupPcode
,
pageGroupDto
.
getApiGroupCode
()));
qw
.
eq
(
OcpApiGroup:
:
getApiGroupPromotionType
,
pageGroupDto
.
getApiGroupPromotionType
()).
and
(
c
->
c
.
eq
(
OcpApiGroup:
:
getApiGroupPcode
,
pageGroupDto
.
getApiGroupCode
()));
pageInfo
.
setRecords
(
ocpApiGroups
);
pageInfo
.
setRecords
(
ocpApiGroups
);
mapper
.
selectPage
(
pageInfo
,
qw
);
mapper
.
selectPage
(
pageInfo
,
qw
);
List
<
OcpApiGroup
>
records
=
pageInfo
.
getRecords
();
List
<
OcpApiGroup
>
records
=
pageInfo
.
getRecords
();
for
(
OcpApiGroup
record
:
records
)
{
for
(
OcpApiGroup
record
:
records
)
{
OcpApiGroup
ocpApiGroup
=
mapper
.
selectCode
(
record
.
getApiGroupPcode
());
OcpApiGroup
ocpApiGroup
=
mapper
.
selectCode
(
record
.
getApiGroupPcode
());
...
@@ -181,14 +177,13 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
...
@@ -181,14 +177,13 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
}
}
}
else
if
(
StringUtils
.
isNotBlank
(
pageGroupDto
.
getKeyword
()))
{
}
else
if
(
StringUtils
.
isNotBlank
(
pageGroupDto
.
getKeyword
()))
{
LambdaQueryWrapper
<
OcpApiGroup
>
ocpTenantGroupLambdaQueryWrapper
=
qw
.
and
(
c
->
c
.
like
(
OcpApiGroup:
:
getApiGroupName
,
pageGroupDto
.
getKeyword
()))
LambdaQueryWrapper
<
OcpApiGroup
>
ocpTenantGroupLambdaQueryWrapper
=
qw
.
and
(
c
->
c
.
like
(
OcpApiGroup:
:
getApiGroupName
,
pageGroupDto
.
getKeyword
()))
.
and
(
c
->
c
.
eq
(
OcpApiGroup:
:
getApiGroupPcode
,
pageGroupDto
.
getApiGroupCode
()));
.
and
(
c
->
c
.
eq
(
OcpApiGroup:
:
getApiGroupPcode
,
pageGroupDto
.
getApiGroupCode
()));
mapper
.
selectPage
(
pageInfo
,
ocpTenantGroupLambdaQueryWrapper
);
mapper
.
selectPage
(
pageInfo
,
ocpTenantGroupLambdaQueryWrapper
);
}
}
return
pageInfo
;
return
pageInfo
;
}
}
}
}
...
...
src/main/resources/mapper/OcpApiTreeMapper.xml
View file @
21207592
...
@@ -30,5 +30,9 @@
...
@@ -30,5 +30,9 @@
SELECT * FROM ocp_api_group where api_group_code = #{apiGroupCode};
SELECT * FROM ocp_api_group where api_group_code = #{apiGroupCode};
</select>
</select>
<!-- 根据code查询是否=含有下级服务-->
<select
id=
"selectGroupPcode"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
SELECT * FROM ocp_api_group where api_group_pcode = #{apiGroupCode};
</select>
</mapper>
</mapper>
\ No newline at end of file
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