Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
jz-dmp-service
Commits
d750eed8
Commit
d750eed8
authored
Jan 27, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
cd138596
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
94 deletions
+113
-94
DmpNavigationTreeController.java
...z/dmp/modules/controller/DmpNavigationTreeController.java
+109
-92
DmpNavigationTreeServiceImpl.java
...mp/modules/service/impl/DmpNavigationTreeServiceImpl.java
+4
-2
No files found.
src/main/java/com/jz/dmp/modules/controller/DmpNavigationTreeController.java
View file @
d750eed8
...
...
@@ -50,97 +50,114 @@ public class DmpNavigationTreeController {
public
DmpNavigationTree
selectOne
(
Integer
id
)
{
return
this
.
dmpNavigationTreeService
.
queryById
(
id
);
}
/**列表查询DMP资源导航树
* @param dmpNavigationTreeRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findList"
)
@ApiOperation
(
value
=
"列表查询DMP资源导航树"
,
notes
=
"列表查询DMP资源导航树"
)
public
BaseBeanResponse
<
DmpNavigationTreeDto
>
findList
(
@RequestBody
DmpNavigationTreeRequest
dmpNavigationTreeRequest
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpNavigationTreeDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpNavigationTreeDto
>();
try
{
baseBeanResponse
=
dmpNavigationTreeService
.
findList
(
dmpNavigationTreeRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**新增DMP资源导航树
* @param dmpNavigationTreeRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/add"
)
@ApiOperation
(
value
=
"新增DMP资源导航树"
,
notes
=
"新增DMP资源导航树"
)
public
BaseBeanResponse
<
DmpNavigationTree
>
add
(
@RequestBody
DmpNavigationTree
dmpNavigationTree
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpNavigationTree
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpNavigationTree
>();
try
{
DmpNavigationTree
dmpNavigationTreeDb
=
dmpNavigationTreeService
.
insert
(
dmpNavigationTree
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpNavigationTreeDb
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"新增失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**删除DMP资源导航树
* @param id
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/deleteById"
)
@ApiOperation
(
value
=
"删除DMP资源导航树"
,
notes
=
"删除DMP资源导航树"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"DMP资源导航树主键"
)
public
BaseResponse
deleteById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
Integer
id
,
HttpServletRequest
httpRequest
){
BaseResponse
baseResponse
=
new
BaseResponse
();
try
{
boolean
flag
=
dmpNavigationTreeService
.
deleteById
(
id
);
if
(
flag
)
{
baseResponse
.
setMessage
(
"删除成功"
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
}
else
{
baseResponse
.
setMessage
(
"删除失败"
);
baseResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
}
}
catch
(
Exception
e
)
{
baseResponse
.
setMessage
(
"删除失败"
);
baseResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseResponse
;
}
/**修改DMP资源导航树
* @param dmpNavigationTreeRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/edit"
)
@ApiOperation
(
value
=
"修改DMP资源导航树"
,
notes
=
"修改DMP资源导航树"
)
public
BaseBeanResponse
<
DmpNavigationTree
>
edit
(
@RequestBody
DmpNavigationTree
dmpNavigationTree
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpNavigationTree
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpNavigationTree
>();
try
{
DmpNavigationTree
dmpNavigationTreeDb
=
dmpNavigationTreeService
.
update
(
dmpNavigationTree
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setData
(
dmpNavigationTreeDb
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"修改失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**
* 列表查询DMP资源导航树
*
* @param dmpNavigationTreeRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findList"
)
@ApiOperation
(
value
=
"列表查询DMP资源导航树"
,
notes
=
"列表查询DMP资源导航树"
)
public
BaseBeanResponse
<
DmpNavigationTreeDto
>
findList
(
@RequestBody
DmpNavigationTreeRequest
dmpNavigationTreeRequest
,
HttpServletRequest
httpRequest
)
{
BaseBeanResponse
<
DmpNavigationTreeDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpNavigationTreeDto
>();
try
{
baseBeanResponse
=
dmpNavigationTreeService
.
findList
(
dmpNavigationTreeRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**
* 新增DMP资源导航树
*
* @param dmpNavigationTreeRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/add"
)
@ApiOperation
(
value
=
"新增DMP资源导航树"
,
notes
=
"新增DMP资源导航树"
)
public
BaseBeanResponse
<
DmpNavigationTree
>
add
(
@RequestBody
DmpNavigationTree
dmpNavigationTree
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpNavigationTree
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpNavigationTree
>();
//树名称去重
DmpNavigationTreeRequest
dmpNavigationTreeRequest
=
new
DmpNavigationTreeRequest
();
dmpNavigationTreeRequest
.
setName
(
dmpNavigationTree
.
getName
());
BaseBeanResponse
<
DmpNavigationTreeDto
>
baseBeanResponseRe
=
dmpNavigationTreeService
.
findList
(
dmpNavigationTreeRequest
,
httpRequest
);
if
(
baseBeanResponseRe
.
getDatas
()
!=
null
&&
baseBeanResponseRe
.
getDatas
().
size
()
>
0
)
{
baseBeanResponse
.
setCode
(
StatuConstant
.
CODE_ERROR_PARAMETER
);
baseBeanResponse
.
setMessage
(
"树名称不能重复"
);
return
baseBeanResponse
;
}
try
{
DmpNavigationTree
dmpNavigationTreeDb
=
dmpNavigationTreeService
.
insert
(
dmpNavigationTree
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpNavigationTreeDb
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"新增失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**
* 删除DMP资源导航树
*
* @param id
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/deleteById"
)
@ApiOperation
(
value
=
"删除DMP资源导航树"
,
notes
=
"删除DMP资源导航树"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"DMP资源导航树主键"
)
public
BaseResponse
deleteById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
Integer
id
,
HttpServletRequest
httpRequest
)
{
BaseResponse
baseResponse
=
new
BaseResponse
();
try
{
boolean
flag
=
dmpNavigationTreeService
.
deleteById
(
id
);
if
(
flag
)
{
baseResponse
.
setMessage
(
"删除成功"
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
}
else
{
baseResponse
.
setMessage
(
"删除失败"
);
baseResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
}
}
catch
(
Exception
e
)
{
baseResponse
.
setMessage
(
"删除失败"
);
baseResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseResponse
;
}
/**
* 修改DMP资源导航树
*
* @param dmpNavigationTreeRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/edit"
)
@ApiOperation
(
value
=
"修改DMP资源导航树"
,
notes
=
"修改DMP资源导航树"
)
public
BaseBeanResponse
<
DmpNavigationTree
>
edit
(
@RequestBody
DmpNavigationTree
dmpNavigationTree
,
HttpServletRequest
httpRequest
)
{
BaseBeanResponse
<
DmpNavigationTree
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpNavigationTree
>();
try
{
DmpNavigationTree
dmpNavigationTreeDb
=
dmpNavigationTreeService
.
update
(
dmpNavigationTree
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setData
(
dmpNavigationTreeDb
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"修改失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpNavigationTreeServiceImpl.java
View file @
d750eed8
...
...
@@ -164,8 +164,10 @@ public class DmpNavigationTreeServiceImpl extends BaseService implements DmpNavi
List
<
DmpNavigationTree
>
list
=
dmpNavigationTreeDao
.
queryAll
(
dmpNavigationTree
);
List
<
DmpNavigationTreeDto
>
dtos
=
MyDmpNavigationTreeConverter
.
INSTANCE
().
domain2dto
(
list
);
dtos
=
dmpArrangeTree
(
dmpNavigationTreeRequest
.
getParentId
(),
dtos
);
if
(
dmpNavigationTreeRequest
.
getParentId
()!=
null
){
dtos
=
dmpArrangeTree
(
dmpNavigationTreeRequest
.
getParentId
(),
dtos
);
}
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
...
...
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