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
0bdd5ca4
Commit
0bdd5ca4
authored
Mar 07, 2022
by
zhaochengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
赵呈明
parent
94f60d41
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
50 deletions
+39
-50
src/main/java/com/pms/ocp/controller/OcpApiTreeController.java
...ain/java/com/pms/ocp/controller/OcpApiTreeController.java
+6
-2
src/main/java/com/pms/ocp/model/dto/ApiTreeGroupDto.java
src/main/java/com/pms/ocp/model/dto/ApiTreeGroupDto.java
+3
-3
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
+29
-44
No files found.
src/main/java/com/pms/ocp/controller/OcpApiTreeController.java
View file @
0bdd5ca4
...
...
@@ -42,8 +42,12 @@ public class OcpApiTreeController {
@PostMapping
(
"/instertree"
)
@ApiOperation
(
"服务树分类--新增"
)
public
ResponseVO
inseter
(
@RequestBody
OcpApiGroupDtos
ocpApiGroupDtos
){
service
.
insertTree
(
ocpApiGroupDtos
);
boolean
flag
=
service
.
insertTree
(
ocpApiGroupDtos
);
if
(
flag
){
return
ResponseVO
.
ok
();
}
return
ResponseVO
.
error
(
"您的服务编码重复,请重新输入"
);
}
@PostMapping
(
"/updatatree"
)
@ApiOperation
(
"服务树分类--修改"
)
...
...
@@ -56,7 +60,7 @@ public class OcpApiTreeController {
public
ResponseVO
deleteTree
(
@RequestBody
OcpApiGroup
ocpApiGroup
){
boolean
tree
=
service
.
deleteOcpTree
(
ocpApiGroup
);
if
(
tree
){
return
ResponseVO
.
ok
();
return
ResponseVO
.
ok
(
"删除成功!"
);
}
else
{
return
ResponseVO
.
error
(
"请先删除下级目录"
);
}
...
...
src/main/java/com/pms/ocp/model/dto/ApiTreeGroupDto.java
View file @
0bdd5ca4
...
...
@@ -11,7 +11,7 @@ import java.util.List;
public
class
ApiTreeGroupDto
{
@ApiModelProperty
(
"一级"
)
private
List
<
OneTreeUpList
>
one
up
List
;
private
List
<
OneTreeUpList
>
oneList
;
@ApiModelProperty
(
"二级"
)
...
...
@@ -21,11 +21,11 @@ public class ApiTreeGroupDto {
private
List
<
ThreeTreeList
>
ThreeList
;
public
List
<
OneTreeUpList
>
getOneupList
()
{
return
one
up
List
;
return
oneList
;
}
public
void
setOneupList
(
List
<
OneTreeUpList
>
oneupList
)
{
this
.
one
up
List
=
oneupList
;
this
.
oneList
=
oneupList
;
}
public
List
<
TwoDownList
>
getTwoList
()
{
...
...
src/main/java/com/pms/ocp/service/OcpApiTreeService.java
View file @
0bdd5ca4
...
...
@@ -17,7 +17,7 @@ public interface OcpApiTreeService extends IService<OcpApiGroup> {
/**
* 新增服务分类
*/
void
insertTree
(
OcpApiGroupDtos
ocpApiGroupDtos
);
boolean
insertTree
(
OcpApiGroupDtos
ocpApiGroupDtos
);
/*
...
...
src/main/java/com/pms/ocp/service/impl/OcpApiTreeServiceImpl.java
View file @
0bdd5ca4
...
...
@@ -50,8 +50,6 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
//一级服务分类
List
<
OneTreeUpList
>
oneTreeUpLists
=
new
ArrayList
<>();
for
(
OcpApiGroup
ocpApiGroup
:
ocpApiGroups
)
{
//判断数据状态
if
(!(
ocpApiGroup
.
getIsDelete
()
==
0
))
{
...
...
@@ -95,12 +93,6 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
BeanUtils
.
copyProperties
(
ocpApiGroup
,
twoDownList
);
twoTreeLists
.
add
(
twoDownList
);
/* String apiGroupCode = ocpApiGroup.getApiGroupCode();
String apiGroupName = ocpApiGroup.getApiGroupName();
twoDownList.setCode(apiGroupCode);
twoDownList.setpName(apiGroupName);
twoDownList.setDownList(ocpApiGroup);
threeTreeLists.add(twoDownList);*/
}
}
}
...
...
@@ -140,42 +132,35 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
* @param ocpApiGroupDtos
*/
@Override
public
void
insertTree
(
OcpApiGroupDtos
ocpApiGroupDtos
)
{
OcpApiBase
ocpApiBase
=
new
OcpApiBase
();
ocpApiBase
.
setApiCode
(
ocpApiGroupDtos
.
getApiGroupCode
());
// ocpApiBase.setApiMtime(new Date("yyyy-MM-dd").getTime());
BeanUtils
.
copyProperties
(
ocpApiGroupDtos
,
ocpApiBase
);
ocpApiBase
.
setApiName
(
"新增服务分类"
);
Timestamp
timestamp
=
new
Timestamp
(
System
.
currentTimeMillis
());
ocpApiBase
.
setApiMtime
(
timestamp
);
ocpApiBase
.
setApiCtime
(
ocpApiGroupDtos
.
getApiGroupCtime
());
ocpApiBase
.
setApiUserId
(
ocpApiGroupDtos
.
getApiGroupUserId
());
ocpApiBase
.
setObjId
(
""
);
/* ocpApiBase.setApiCode(ocpApiGroupDtos.getApiGroupCode());
ocpApiBase.setApiName(ocpApiGroupDtos.getApiGroupName());
ocpApiBase.setApiGroupCode(ocpApiGroupDtos.getApiGroupPcode());
ocpApiBase.setApiPromotion(ocpApiGroupDtos.getApiGroupPromotionType());
ocpApiBase.setApiReq(ocpApiGroupDtos.getApiReq());
ocpApiBase.setApiResp(ocpApiGroupDtos.getApiResp());
ocpApiBase.setApiUrl(ocpApiBase.getApiUrl());
ocpApiBase.setApiCtime(ocpApiGroupDtos.getApiGroupCtime());
ocpApiBase.setApiMtime(new Date("yyyy-MM-dd").getTime());
ocpApiBase.setApiUserId(ocpApiGroupDtos.getApiGroupUserId());
ocpApiBase.setApiUnit(ocpApiGroupDtos.getOwnerCompanyCode());
ocpApiBase.setOwnerCompanyCode(ocpApiGroupDtos.getOwnerCompanyCode());
ocpApiBase.setOwnerCompanyName(ocpApiGroupDtos.getOwnerCompanyCode());
ocpApiBase.setIsDelete(ocpApiGroupDtos.getIsDelete());*/
OcpApiGroup
ocpApiGroup
=
new
OcpApiGroup
();
ocpApiGroup
.
setObjId
(
""
);
BeanUtils
.
copyProperties
(
ocpApiGroupDtos
,
ocpApiGroup
);
ocpApiBaseMapper
.
insert
(
ocpApiBase
);
mapper
.
insert
(
ocpApiGroup
);
public
boolean
insertTree
(
OcpApiGroupDtos
ocpApiGroupDtos
)
{
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
.
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
);
ocpApiBaseMapper
.
insert
(
ocpApiBase
);
mapper
.
insert
(
ocpApiGroup1
);
}
return
flag
;
}
...
...
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