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
0820424b
Commit
0820424b
authored
Mar 12, 2022
by
diaoruifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务列表树功能优化
parent
fb57cbe3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
19 deletions
+26
-19
src/main/java/com/pms/ocp/controller/ApiBasicManagementController.java
.../com/pms/ocp/controller/ApiBasicManagementController.java
+3
-2
src/main/java/com/pms/ocp/mapper/OcpApiGroupMapper.java
src/main/java/com/pms/ocp/mapper/OcpApiGroupMapper.java
+1
-1
src/main/java/com/pms/ocp/model/dto/ApiBaseDto.java
src/main/java/com/pms/ocp/model/dto/ApiBaseDto.java
+3
-3
src/main/java/com/pms/ocp/service/ApiBasicManagementService.java
...n/java/com/pms/ocp/service/ApiBasicManagementService.java
+1
-1
src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java
...m/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java
+8
-8
src/main/resources/mapper/OcpApiGroupMapper.xml
src/main/resources/mapper/OcpApiGroupMapper.xml
+10
-4
No files found.
src/main/java/com/pms/ocp/controller/ApiBasicManagementController.java
View file @
0820424b
...
...
@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.omg.PortableInterceptor.Interceptor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -201,8 +202,8 @@ public class ApiBasicManagementController {
@ApiOperation
(
"服务树层级"
)
@GetMapping
(
"/apiBaseTreeOther"
)
public
ResponseVO
<
List
<
OcpApiGroup
>>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcod
e
)
{
List
<
OcpApiGroup
>
apiTreeGroupDtos
=
apiBasicManagementService
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
apiGroupPcode
);
public
ResponseVO
<
List
<
OcpApiGroup
>>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionTyp
e
)
{
List
<
OcpApiGroup
>
apiTreeGroupDtos
=
apiBasicManagementService
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
apiGroupPcode
,
apiGroupPromotionType
);
return
ResponseVO
.
ok
(
apiTreeGroupDtos
);
}
@ApiOperation
(
"服务列表树最低级"
)
...
...
src/main/java/com/pms/ocp/mapper/OcpApiGroupMapper.java
View file @
0820424b
...
...
@@ -12,7 +12,7 @@ public interface OcpApiGroupMapper extends BaseMapper<OcpApiGroup> {
List
<
OcpApiGroup
>
selectTreeList
(
String
apiGroupCompanyCode
);
List
<
OcpApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
);
List
<
OcpApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
);
List
<
OcpApiBase
>
selectByPcode
(
String
code
);
...
...
src/main/java/com/pms/ocp/model/dto/ApiBaseDto.java
View file @
0820424b
...
...
@@ -27,7 +27,7 @@ public class ApiBaseDto implements Serializable {
private
String
apiGroupCompanyCode
;
@ApiModelProperty
(
"推广类型0:统建;1:自建"
)
private
String
apiPromotion
;
private
Integer
apiPromotion
;
@ApiModelProperty
(
"注册时段-开始"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
...
...
@@ -54,11 +54,11 @@ public class ApiBaseDto implements Serializable {
@ApiModelProperty
(
"每页条数"
)
private
Integer
pageSize
;
public
String
getApiPromotion
()
{
public
Integer
getApiPromotion
()
{
return
apiPromotion
;
}
public
void
setApiPromotion
(
String
apiPromotion
)
{
public
void
setApiPromotion
(
Integer
apiPromotion
)
{
this
.
apiPromotion
=
apiPromotion
;
}
...
...
src/main/java/com/pms/ocp/service/ApiBasicManagementService.java
View file @
0820424b
...
...
@@ -71,7 +71,7 @@ public interface ApiBasicManagementService extends IService<OcpApiBase> {
* @param apiGroupPcode
* @return
*/
List
<
OcpApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
);
List
<
OcpApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
);
/**
* 根据分组code获取列表
...
...
src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java
View file @
0820424b
...
...
@@ -181,8 +181,8 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
}
@Override
public
List
<
OcpApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
)
{
List
<
OcpApiGroup
>
ocpApiGroups
=
ocpApiGroupMapper
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
apiGroupPcode
);
public
List
<
OcpApiGroup
>
apiBaseTreeOther
(
String
apiGroupCompanyCode
,
String
apiGroupPcode
,
Integer
apiGroupPromotionType
)
{
List
<
OcpApiGroup
>
ocpApiGroups
=
ocpApiGroupMapper
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
apiGroupPcode
,
apiGroupPromotionType
);
return
ocpApiGroups
;
}
...
...
@@ -194,7 +194,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
return
queryResponseResult
;
}
apiGroupCode
.
add
(
apiBaseReq
.
getApiGroupCode
());
setGroupIdValue
(
apiBaseReq
.
getApiGroupCompanyCode
()
,
apiBaseReq
.
getApiGroupCode
());
setGroupIdValue
(
apiBaseReq
.
getApiGroupCompanyCode
()
,
apiBaseReq
.
getApiGroupCode
()
,
apiBaseReq
.
getApiPromotion
()
);
QueryWrapper
qw
=
new
QueryWrapper
();
if
(!
StringUtils
.
isEmpty
(
apiBaseReq
.
getKeyword
()))
{
qw
.
like
(
"api_name"
,
apiBaseReq
.
getKeyword
());
...
...
@@ -244,11 +244,11 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
* @param
* @param
*/
private
void
setGroupIdValue
(
String
apiGroupCompanyCode
,
String
code
)
{
List
<
String
>
codes
=
getIdsByPIdPub
(
apiGroupCompanyCode
,
code
);
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
);
setGroupIdValue
(
apiGroupCompanyCode
,
cod
,
apiGroupPromotionType
);
apiGroupCode
.
add
(
cod
);
};
}
...
...
@@ -260,8 +260,8 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
* @param code
* @return
*/
public
List
<
String
>
getIdsByPIdPub
(
String
apiGroupCompanyCode
,
String
code
)
{
List
<
OcpApiGroup
>
ocpApiGroups
=
ocpApiGroupMapper
.
apiBaseTreeOther
(
apiGroupCompanyCode
,
code
);
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/resources/mapper/OcpApiGroupMapper.xml
View file @
0820424b
...
...
@@ -33,14 +33,20 @@
</select>
<select
id=
"apiBaseTreeOther"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where is_delete = 0
<if
test=
"apiGroupCompanyCode!=null and apiGroupCompanyCode!=''"
>
and api_group_company_code = #{apiGroupCompanyCode}
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where 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>
</select>
<select
id=
"selectByPcode"
resultType=
"com.pms.ocp.model.entity.OcpApiGroup"
>
select api_group_code,api_group_name from ocp_api_group where 1 = 1
...
...
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