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
bf3f53c1
Commit
bf3f53c1
authored
Mar 08, 2022
by
zhaochengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
赵呈明
parent
ac71bdf8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
145 additions
and
72 deletions
+145
-72
src/main/java/com/pms/ocp/controller/OcpApiTreeController.java
...ain/java/com/pms/ocp/controller/OcpApiTreeController.java
+12
-1
src/main/java/com/pms/ocp/model/dto/OcpApiGroupDtos.java
src/main/java/com/pms/ocp/model/dto/OcpApiGroupDtos.java
+6
-0
src/main/java/com/pms/ocp/model/dto/TwoDownList.java
src/main/java/com/pms/ocp/model/dto/TwoDownList.java
+2
-0
src/main/java/com/pms/ocp/model/entity/OcpApiGroup.java
src/main/java/com/pms/ocp/model/entity/OcpApiGroup.java
+7
-0
src/main/java/com/pms/ocp/service/OcpApiTreeService.java
src/main/java/com/pms/ocp/service/OcpApiTreeService.java
+14
-1
src/main/java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
.../java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
+104
-70
No files found.
src/main/java/com/pms/ocp/controller/OcpApiTreeController.java
View file @
bf3f53c1
package
com.pms.ocp.controller
;
package
com.pms.ocp.controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.pms.ocp.common.config.PageParam
;
import
com.pms.ocp.model.dto.ApiTreeGroupDto
;
import
com.pms.ocp.model.dto.ApiTreeGroupDto
;
import
com.pms.ocp.model.dto.OcpApiGroupDtos
;
import
com.pms.ocp.model.dto.OcpApiGroupDtos
;
import
com.pms.ocp.model.entity.OcpApiBase
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.vo.ResponseVO
;
import
com.pms.ocp.model.vo.ResponseVO
;
import
com.pms.ocp.service.OcpApiTreeService
;
import
com.pms.ocp.service.OcpApiTreeService
;
...
@@ -13,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -13,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@Slf4j
@Slf4j
@RequestMapping
(
"/api-group/v1"
)
@RequestMapping
(
"/api-group/v1"
)
...
@@ -46,6 +49,14 @@ public class OcpApiTreeController {
...
@@ -46,6 +49,14 @@ public class OcpApiTreeController {
return
ResponseVO
.
error
(
"您的服务编码重复,请重新输入"
);
return
ResponseVO
.
error
(
"您的服务编码重复,请重新输入"
);
}
}
@GetMapping
(
"/getone"
)
@ApiOperation
(
"服务树分类--分级数据"
)
public
List
<
OcpApiGroup
>
getOne
(
int
pageSize
,
int
pageNum
,
int
apiGroupLevel
){
List
<
OcpApiGroup
>
onePage
=
service
.
getOnePage
(
pageSize
,
pageNum
,
apiGroupLevel
);
return
onePage
;
}
@PostMapping
(
"/updatatree"
)
@PostMapping
(
"/updatatree"
)
@ApiOperation
(
"服务树分类--修改"
)
@ApiOperation
(
"服务树分类--修改"
)
public
ResponseVO
updataTree
(
@RequestBody
OcpApiGroup
ocpApiGroup
){
public
ResponseVO
updataTree
(
@RequestBody
OcpApiGroup
ocpApiGroup
){
...
...
src/main/java/com/pms/ocp/model/dto/OcpApiGroupDtos.java
View file @
bf3f53c1
...
@@ -11,6 +11,12 @@ import java.sql.Timestamp;
...
@@ -11,6 +11,12 @@ import java.sql.Timestamp;
@Data
@Data
public
class
OcpApiGroupDtos
{
public
class
OcpApiGroupDtos
{
@ApiModelProperty
(
value
=
"当前页码"
)
private
int
pageSize
;
@ApiModelProperty
(
value
=
"每页大小"
)
private
int
pageNum
;
@ApiModelProperty
(
"分类编码"
)
@ApiModelProperty
(
"分类编码"
)
private
String
apiGroupCode
;
private
String
apiGroupCode
;
...
...
src/main/java/com/pms/ocp/model/dto/TwoDownList.java
View file @
bf3f53c1
...
@@ -14,6 +14,7 @@ import java.util.List;
...
@@ -14,6 +14,7 @@ import java.util.List;
@ApiModel
(
value
=
"中心层"
)
@ApiModel
(
value
=
"中心层"
)
@Data
@Data
public
class
TwoDownList
{
public
class
TwoDownList
{
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
"主键ID"
)
@ApiModelProperty
(
"主键ID"
)
private
String
objId
;
private
String
objId
;
...
@@ -57,6 +58,7 @@ public class TwoDownList {
...
@@ -57,6 +58,7 @@ public class TwoDownList {
@ApiModelProperty
(
"分层树层级 1中台层 2中心层 3 服务组层 4服务层 "
)
@ApiModelProperty
(
"分层树层级 1中台层 2中心层 3 服务组层 4服务层 "
)
private
long
apiGroupLevel
;
private
long
apiGroupLevel
;
public
long
getApiGroupLevel
()
{
public
long
getApiGroupLevel
()
{
return
apiGroupLevel
;
return
apiGroupLevel
;
}
}
...
...
src/main/java/com/pms/ocp/model/entity/OcpApiGroup.java
View file @
bf3f53c1
...
@@ -58,7 +58,13 @@ public class OcpApiGroup {
...
@@ -58,7 +58,13 @@ public class OcpApiGroup {
private
long
apiGroupLevel
;
private
long
apiGroupLevel
;
public
long
getApiGroupLevel
()
{
return
apiGroupLevel
;
}
public
void
setApiGroupLevel
(
long
apiGroupLevel
)
{
this
.
apiGroupLevel
=
apiGroupLevel
;
}
public
String
getObjId
()
{
public
String
getObjId
()
{
return
objId
;
return
objId
;
...
@@ -176,4 +182,5 @@ public class OcpApiGroup {
...
@@ -176,4 +182,5 @@ public class OcpApiGroup {
this
.
isDelete
=
isDelete
;
this
.
isDelete
=
isDelete
;
}
}
}
}
src/main/java/com/pms/ocp/service/OcpApiTreeService.java
View file @
bf3f53c1
package
com.pms.ocp.service
;
package
com.pms.ocp.service
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.pms.ocp.common.config.PageParam
;
import
com.pms.ocp.model.dto.ApiTreeGroupDto
;
import
com.pms.ocp.model.dto.ApiTreeGroupDto
;
import
com.pms.ocp.model.dto.OcpApiGroupDtos
;
import
com.pms.ocp.model.dto.OcpApiGroupDtos
;
import
com.pms.ocp.model.entity.OcpApiBase
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.vo.ResponseVO
;
import
java.util.List
;
public
interface
OcpApiTreeService
extends
IService
<
OcpApiGroup
>
{
public
interface
OcpApiTreeService
extends
IService
<
OcpApiGroup
>
{
...
@@ -32,4 +37,12 @@ public interface OcpApiTreeService extends IService<OcpApiGroup> {
...
@@ -32,4 +37,12 @@ public interface OcpApiTreeService extends IService<OcpApiGroup> {
* 删除服务分类
* 删除服务分类
*/
*/
boolean
deleteOcpTree
(
OcpApiGroup
ocpApiGroup
);
boolean
deleteOcpTree
(
OcpApiGroup
ocpApiGroup
);
/**
* 服务列表分级查询
* @param
*/
List
<
OcpApiGroup
>
getOnePage
(
int
pageSize
,
int
pageNum
,
int
apiGroupLevel
);
}
}
src/main/java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
View file @
bf3f53c1
package
com.pms.ocp.service.impl
;
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.extension.api.R
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pms.ocp.common.config.PageParam
;
import
com.pms.ocp.common.utils.RandomStringUtil
;
import
com.pms.ocp.common.utils.RandomStringUtil
;
import
com.pms.ocp.mapper.OcpApiBaseMapper
;
import
com.pms.ocp.mapper.OcpApiBaseMapper
;
import
com.pms.ocp.mapper.OcpApiTreeMapper
;
import
com.pms.ocp.mapper.OcpApiTreeMapper
;
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.OcpApiBase
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.entity.OcpApiGroup
;
import
com.pms.ocp.model.vo.ResponseVO
;
import
com.pms.ocp.service.OcpApiTreeService
;
import
com.pms.ocp.service.OcpApiTreeService
;
import
org.apache.commons.lang3.RandomStringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -17,9 +24,11 @@ import org.springframework.stereotype.Service;
...
@@ -17,9 +24,11 @@ import org.springframework.stereotype.Service;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.function.Consumer
;
@Service
@Service
@Slf4j
public
class
OcpApiTreeServiceImpl
extends
ServiceImpl
<
OcpApiTreeMapper
,
OcpApiGroup
>
implements
OcpApiTreeService
{
public
class
OcpApiTreeServiceImpl
extends
ServiceImpl
<
OcpApiTreeMapper
,
OcpApiGroup
>
implements
OcpApiTreeService
{
...
@@ -31,15 +40,17 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
...
@@ -31,15 +40,17 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
/**
/**
* 服务树分类
* 服务树分类
*
* @return
* @return
*/
*/
@Override
@Override
public
ApiTreeGroupDto
getByGroup
()
{
public
ApiTreeGroupDto
getByGroup
()
{
//服务树全表数据
//服务树全表数据
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
null
);
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
null
);
//服务树分类对象
//服务树分类对象
ApiTreeGroupDto
apiTreeGroupList
=
new
ApiTreeGroupDto
();
ApiTreeGroupDto
apiTreeGroupList
=
new
ApiTreeGroupDto
();
//1中台层
//1中台层
...
@@ -52,127 +63,137 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
...
@@ -52,127 +63,137 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
OneTreeUpList
oneTreeUpList
=
new
OneTreeUpList
();
OneTreeUpList
oneTreeUpList
=
new
OneTreeUpList
();
// 判断数据是否有上级服务分类
// 判断数据是否有上级服务分类
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
1
)
{
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
1
)
{
BeanUtils
.
copyProperties
(
ocpApiGroup
,
oneTreeUpList
);
BeanUtils
.
copyProperties
(
ocpApiGroup
,
oneTreeUpList
);
oneTreeUpLists
.
add
(
oneTreeUpList
);
oneTreeUpLists
.
add
(
oneTreeUpList
);
}
}
}
}
}
}
List
<
TwoDownList
>
twoDownLists
=
twoTreeLists
(
oneTreeUpLists
,
ocpApiGroups
);
List
<
TwoDownList
>
twoDownLists
=
twoTreeLists
(
oneTreeUpLists
,
ocpApiGroups
);
List
<
ThreeTreeList
>
threeTreeLists
=
threeTreeLists
(
twoDownLists
,
ocpApiGroups
);
List
<
ThreeTreeList
>
threeTreeLists
=
threeTreeLists
(
twoDownLists
,
ocpApiGroups
);
List
<
FourTreeList
>
fourTreeLists
=
fourTreeLists
(
threeTreeLists
,
ocpApiGroups
);
apiTreeGroupList
.
setOneList
(
oneTreeUpLists
);
apiTreeGroupList
.
setOneList
(
oneTreeUpLists
);
apiTreeGroupList
.
setTwoList
(
twoDownLists
);
apiTreeGroupList
.
setTwoList
(
twoDownLists
);
apiTreeGroupList
.
setThreeList
(
threeTreeLists
);
apiTreeGroupList
.
setThreeList
(
threeTreeLists
);
apiTreeGroupList
.
setFourList
(
fourTreeLists
);
return
apiTreeGroupList
;
return
apiTreeGroupList
;
}
}
/**
/**
* 2中心层
* 2中心层
*
* @param oneTreeUpLists
* @param oneTreeUpLists
* @return
* @return
*/
*/
public
List
<
TwoDownList
>
twoTreeLists
(
List
<
OneTreeUpList
>
oneTreeUpLists
,
List
<
OcpApiGroup
>
ocpApiGroups
)
{
public
List
<
TwoDownList
>
twoTreeLists
(
List
<
OneTreeUpList
>
oneTreeUpLists
,
List
<
OcpApiGroup
>
ocpApiGroups
)
{
List
<
OcpApiGroup
>
twolists
=
new
ArrayList
<>();
/* List<OcpApiGroup> groupList = new ArrayList<>();*/
List
<
TwoDownList
>
twoTreeLists
=
new
ArrayList
<>();
List
<
TwoDownList
>
twoTreeLists
=
new
ArrayList
<>();
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
if
(!(
ocpApiGroup
.
getIsDelete
()
==
0
)){
TwoDownList
twoDownList
=
new
TwoDownList
();
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
2
){
if
(!(
ocpApiGroup
.
getIsDelete
()
==
0
))
{
twolists
.
add
(
ocpApiGroup
);
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
2
)
{
}
else
{
BeanUtils
.
copyProperties
(
ocpApiGroup
,
twoDownList
);
twoTreeLists
.
add
(
twoDownList
);
}
else
{
continue
;
continue
;
}
}
}
}
}
}
BeanUtils
.
copyProperties
(
twolists
,
twoTreeLists
);
return
twoTreeLists
;
return
twoTreeLists
;
}
}
/**
/**
* 3服务组层
* 3服务组层
*
* @param twoDownLists
* @param twoDownLists
* @return
* @return
*/
*/
public
List
<
ThreeTreeList
>
threeTreeLists
(
List
<
TwoDownList
>
twoDownLists
,
List
<
OcpApiGroup
>
ocpApiGroups
)
{
public
List
<
ThreeTreeList
>
threeTreeLists
(
List
<
TwoDownList
>
twoDownLists
,
List
<
OcpApiGroup
>
ocpApiGroups
)
{
List
<
ThreeTreeList
>
threeTreeLists
=
new
ArrayList
<>();
List
<
ThreeTreeList
>
threeTreeLists
=
new
ArrayList
<>();
List
<
OcpApiGroup
>
threeLists
=
new
ArrayList
<>();
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
ThreeTreeList
threeTreeList
=
new
ThreeTreeList
();
if
(!(
ocpApiGroup
.
getIsDelete
()
==
0
))
{
if
(!(
ocpApiGroup
.
getIsDelete
()
==
0
))
{
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
3
){
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
3
)
{
threeLists
.
add
(
ocpApiGroup
);
BeanUtils
.
copyProperties
(
ocpApiGroup
,
threeTreeList
);
}
threeTreeLists
.
add
(
threeTreeList
);
}
else
{
continue
;
}
}
BeanUtils
.
copyProperties
(
threeLists
,
threeTreeLists
);
}
else
{
continue
;
}
}
}
return
threeTreeLists
;
return
threeTreeLists
;
}
}
/**
/**
* 4服务层
* 4服务层
*
* @param threeTreeLists
* @param threeTreeLists
* @return
* @return
*/
*/
public
List
<
FourTreeList
>
fourTreeLists
(
List
<
ThreeTreeList
>
threeTreeLists
,
List
<
OcpApiGroup
>
ocpApiGroups
)
{
public
List
<
FourTreeList
>
fourTreeLists
(
List
<
ThreeTreeList
>
threeTreeLists
,
List
<
OcpApiGroup
>
ocpApiGroups
)
{
List
<
FourTreeList
>
foureTreeList
=
new
ArrayList
<>();
List
<
FourTreeList
>
foureTreeList
=
new
ArrayList
<>();
List
<
OcpApiGroup
>
foureLists
=
new
ArrayList
<>();
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
FourTreeList
fourTreeList
=
new
FourTreeList
();
if
(!(
ocpApiGroup
.
getIsDelete
()
==
0
))
{
if
(!(
ocpApiGroup
.
getIsDelete
()
==
0
))
{
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
4
){
if
(
ocpApiGroup
.
getApiGroupLevel
()
==
4
)
{
foureLists
.
add
(
ocpApiGroup
);
BeanUtils
.
copyProperties
(
fourTreeList
,
foureTreeList
);
foureTreeList
.
add
(
fourTreeList
);
}
}
}
else
{
}
else
{
continue
;
continue
;
}
}
BeanUtils
.
copyProperties
(
foureLists
,
foureTreeList
);
}
}
return
foureTreeList
;
return
foureTreeList
;
}
}
/**
/**
* 新增服务分类
* 新增服务分类
*
*
* @param ocpApiGroupDtos
* @param ocpApiGroupDtos
*/
*/
@Override
@Override
public
boolean
insertTree
(
OcpApiGroupDtos
ocpApiGroupDtos
)
{
public
boolean
insertTree
(
OcpApiGroupDtos
ocpApiGroupDtos
)
{
String
code
=
RandomStringUtil
.
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
)
{
OcpApiBase
ocpApiBase
=
new
OcpApiBase
();
ocpApiBase
.
setApiCode
(
ocpApiGroupDtos
.
getApiGroupCode
());
BeanUtils
.
copyProperties
(
ocpApiGroupDtos
,
ocpApiBase
);
ocpApiBase
.
setApiGroupCode
(
code
);
ocpApiBase
.
setApiName
(
"新增服务分类"
);
Timestamp
timestamp
=
new
Timestamp
(
System
.
currentTimeMillis
());
ocpApiBase
.
setApiMtime
(
timestamp
);
ocpApiBase
.
setApiCtime
(
ocpApiGroupDtos
.
getApiGroupCtime
());
ocpApiBase
.
setApiUserId
(
ocpApiGroupDtos
.
getApiGroupUserId
());
ocpApiBase
.
setObjId
(
""
);
OcpApiGroup
ocpApiGroup1
=
new
OcpApiGroup
();
ocpApiGroup1
.
setObjId
(
""
);
BeanUtils
.
copyProperties
(
ocpApiGroupDtos
,
ocpApiGroup1
);
ocpApiGroup1
.
setApiGroupCode
(
code
);
ocpApiBaseMapper
.
insert
(
ocpApiBase
);
mapper
.
insert
(
ocpApiGroup1
);
String
code
=
RandomStringUtil
.
getRandomString
(
6
);
boolean
flag
=
true
;
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
null
);
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
if
(
ocpApiGroup
.
getApiGroupCode
().
equals
(
ocpApiGroupDtos
.
getApiGroupCode
()))
{
flag
=
false
;
break
;
}
}
return
flag
;
}
if
(
flag
==
true
)
{
OcpApiBase
ocpApiBase
=
new
OcpApiBase
();
ocpApiBase
.
setApiCode
(
ocpApiGroupDtos
.
getApiGroupCode
());
BeanUtils
.
copyProperties
(
ocpApiGroupDtos
,
ocpApiBase
);
ocpApiBase
.
setApiGroupCode
(
code
);
ocpApiBase
.
setApiName
(
"新增服务分类"
);
Timestamp
timestamp
=
new
Timestamp
(
System
.
currentTimeMillis
());
ocpApiBase
.
setApiMtime
(
timestamp
);
ocpApiBase
.
setApiCtime
(
ocpApiGroupDtos
.
getApiGroupCtime
());
ocpApiBase
.
setApiUserId
(
ocpApiGroupDtos
.
getApiGroupUserId
());
ocpApiBase
.
setObjId
(
""
);
OcpApiGroup
ocpApiGroup1
=
new
OcpApiGroup
();
ocpApiGroup1
.
setObjId
(
""
);
BeanUtils
.
copyProperties
(
ocpApiGroupDtos
,
ocpApiGroup1
);
ocpApiGroup1
.
setApiGroupCode
(
code
);
ocpApiBaseMapper
.
insert
(
ocpApiBase
);
mapper
.
insert
(
ocpApiGroup1
);
}
}
return
flag
;
}
/**
/**
...
@@ -186,7 +207,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
...
@@ -186,7 +207,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
null
);
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
null
);
for
(
OcpApiGroup
apiGroup
:
ocpApiGroups
)
{
for
(
OcpApiGroup
apiGroup
:
ocpApiGroups
)
{
String
code
=
apiGroup
.
getApiGroupCode
();
String
code
=
apiGroup
.
getApiGroupCode
();
if
(
code
==
ocpApiGroup
.
getApiGroupCode
()){
if
(
code
==
ocpApiGroup
.
getApiGroupCode
())
{
falg
=
false
;
falg
=
false
;
break
;
break
;
}
}
...
@@ -196,7 +217,6 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
...
@@ -196,7 +217,6 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
}
}
/**
/**
* 删除服务分类
* 删除服务分类
*
*
...
@@ -206,15 +226,29 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
...
@@ -206,15 +226,29 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
public
boolean
deleteOcpTree
(
OcpApiGroup
ocpApiGroup
)
{
public
boolean
deleteOcpTree
(
OcpApiGroup
ocpApiGroup
)
{
String
objId
=
ocpApiGroup
.
getObjId
();
String
objId
=
ocpApiGroup
.
getObjId
();
OcpApiGroup
ocpApiGroup1
=
mapper
.
selectById
(
objId
);
OcpApiGroup
ocpApiGroup1
=
mapper
.
selectById
(
objId
);
if
(
StringUtils
.
isBlank
(
ocpApiGroup1
.
getApiGroupPcode
()))
{
if
(
StringUtils
.
isBlank
(
ocpApiGroup1
.
getApiGroupPcode
()))
{
mapper
.
deleteById
(
objId
);
mapper
.
deleteById
(
objId
);
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
}
}
}
/**
* 一级服务
*
* @param
*/
@Override
public
List
<
OcpApiGroup
>
getOnePage
(
int
pageSize
,
int
pageNum
,
int
apiGroupLevel
)
{
Page
pageInfo
=
new
Page
(
pageSize
,
pageNum
);
LambdaQueryWrapper
<
OcpApiGroup
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
OcpApiGroup
>
eq
=
queryWrapper
.
eq
(
OcpApiGroup:
:
getApiGroupLevel
,
apiGroupLevel
);
List
<
OcpApiGroup
>
ocpApiGroups
=
mapper
.
selectList
(
eq
);
return
ocpApiGroups
;
}
}
}
}
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