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
e4f44f12
Commit
e4f44f12
authored
Jan 14, 2021
by
sml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据开发相关代码提交
parent
4fba45b1
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
154 additions
and
23 deletions
+154
-23
BasePageBean.java
src/main/java/com/jz/common/bean/BasePageBean.java
+7
-1
BaseResponse.java
src/main/java/com/jz/common/bean/BaseResponse.java
+6
-0
CustomUserService.java
...ain/java/com/jz/common/interceptor/CustomUserService.java
+10
-0
DmpDevelopTaskController.java
...m/jz/dmp/modules/controller/DmpDevelopTaskController.java
+31
-2
DmpNavigationTreeController.java
...z/dmp/modules/controller/DmpNavigationTreeController.java
+54
-5
DmpPermissionController.java
...z/dmp/modules/controller/sys/DmpPermissionController.java
+7
-3
MyDmpPermissionConverter.java
...modules/controller/sys/bean/MyDmpPermissionConverter.java
+12
-6
DmpDevelopTaskDao.java
src/main/java/com/jz/dmp/modules/dao/DmpDevelopTaskDao.java
+14
-4
DmpMember.java
src/main/java/com/jz/dmp/modules/model/DmpMember.java
+11
-0
DmpMemberMapper.xml
src/main/resources/mapper/sys/DmpMemberMapper.xml
+1
-1
DmpRoleMapper.xml
src/main/resources/mapper/sys/DmpRoleMapper.xml
+1
-1
No files found.
src/main/java/com/jz/common/bean/BasePageBean.java
View file @
e4f44f12
package
com
.
jz
.
common
.
bean
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**分页信息封装
* @author ybz
*
*/
@ApiModel
(
value
=
"分页信息"
,
description
=
"分页信息封装"
)
public
class
BasePageBean
{
@ApiModelProperty
(
value
=
"当前页码"
)
private
int
pageNum
=
1
;
@ApiModelProperty
(
value
=
"每页显示记录数"
)
private
int
pageSize
=
10
;
public
int
getPageNum
()
{
...
...
src/main/java/com/jz/common/bean/BaseResponse.java
View file @
e4f44f12
package
com
.
jz
.
common
.
bean
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author ybz
*
*/
@ApiModel
(
value
=
"响应码封装实体"
,
description
=
"响应码封装实体"
)
public
class
BaseResponse
{
//错误码
@ApiModelProperty
(
value
=
"错误码"
)
private
String
code
;
//错误消息
@ApiModelProperty
(
value
=
"错误消息"
)
private
String
message
;
public
BaseResponse
()
{}
...
...
src/main/java/com/jz/common/interceptor/CustomUserService.java
View file @
e4f44f12
...
...
@@ -9,6 +9,7 @@ import org.springframework.security.core.userdetails.UserDetails;
import
org.springframework.security.core.userdetails.UserDetailsService
;
import
org.springframework.security.core.userdetails.UsernameNotFoundException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
com.jz.dmp.modules.model.DmpMember
;
import
com.jz.dmp.modules.model.DmpPermission
;
...
...
@@ -55,6 +56,15 @@ public class CustomUserService implements UserDetailsService {
//设置用户在当前默认项目的资源
List
<
DmpPermission
>
memberProjPermissions
=
dmpPermissionService
.
findPermissionByRoles
(
memberProjectRoles
);
user
.
setMemberProjectPermissionList
(
memberProjPermissions
);
//设置用户资源
List
<
DmpPermission
>
permissions
=
new
ArrayList
<
DmpPermission
>();
if
(!
CollectionUtils
.
isEmpty
(
memberPermissions
))
{
permissions
.
addAll
(
memberPermissions
);
}
if
(!
CollectionUtils
.
isEmpty
(
memberProjPermissions
))
{
permissions
.
addAll
(
memberProjPermissions
);
}
user
.
setPermissionList
(
permissions
);
List
<
GrantedAuthority
>
grantedAuthorities
=
new
ArrayList
<>();
//List<DmpPermission> permissions = permissionDao.getDmpDefaultPermission();
...
...
src/main/java/com/jz/dmp/modules/controller/DmpDevelopTaskController.java
View file @
e4f44f12
package
com
.
jz
.
dmp
.
modules
.
controller
;
import
com.jz.dmp.modules.service.DmpDevelopTaskService
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.dmp.modules.controller.bean.DmpDevelopTaskDto
;
import
com.jz.dmp.modules.controller.bean.DmpDevelopTaskRequest
;
import
com.jz.dmp.modules.service.DmpDevelopTaskService
;
import
io.swagger.annotations.ApiOperation
;
/**
* 任务开发(DmpDevelopTask)表控制层
*
...
...
@@ -20,5 +31,23 @@ public class DmpDevelopTaskController {
@Autowired
private
DmpDevelopTaskService
dmpDevelopTaskService
;
/**列表查询任务开发
* @param dmpDevelopTaskRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findListWithPage"
)
@ApiOperation
(
value
=
"分頁列表查询任务开发"
,
notes
=
"分頁列表查询任务开发"
)
public
PageInfoResponse
<
DmpDevelopTaskDto
>
findListWithPage
(
@RequestBody
DmpDevelopTaskRequest
dmpDevelopTaskRequest
,
HttpServletRequest
httpRequest
){
PageInfoResponse
<
DmpDevelopTaskDto
>
pageInfo
=
new
PageInfoResponse
<
DmpDevelopTaskDto
>();
try
{
pageInfo
=
dmpDevelopTaskService
.
findListWithPage
(
dmpDevelopTaskRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
pageInfo
.
setMessage
(
"查询失败"
);
pageInfo
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
pageInfo
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DmpNavigationTreeController.java
View file @
e4f44f12
package
com
.
jz
.
dmp
.
modules
.
controller
;
import
com.jz.dmp.modules.model.DmpNavigationTree
;
import
com.jz.dmp.modules.service.DmpNavigationTreeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.dmp.modules.controller.bean.DmpNavigationTreeDto
;
import
com.jz.dmp.modules.controller.bean.DmpNavigationTreeRequest
;
import
com.jz.dmp.modules.model.DmpNavigationTree
;
import
com.jz.dmp.modules.service.DmpNavigationTreeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
* DMP资源导航树(DmpNavigationTree)表控制层
...
...
@@ -39,4 +47,45 @@ public class DmpNavigationTreeController {
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
.
CODE_SUCCESS
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
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/controller/sys/DmpPermissionController.java
View file @
e4f44f12
...
...
@@ -25,6 +25,7 @@ import com.jz.dmp.modules.service.sys.DmpPermissionService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
/**
...
...
@@ -161,12 +162,15 @@ public class DmpPermissionController {
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findListByParentCode"
)
@ApiOperation
(
value
=
"获取当前用户指定资源"
,
notes
=
"根据父级资源编码,获取当前登录用户所有资源"
)
@ApiImplicitParam
(
name
=
"parentCode"
,
value
=
"父资源编码"
)
public
BaseBeanResponse
<
DmpPermissionDto
>
findListByParentCode
(
@RequestParam
(
name
=
"parentCode"
,
required
=
true
)
String
parentCode
,
HttpServletRequest
httpRequest
){
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"parentCode"
,
value
=
"父资源编码"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"请求类型:0:用户项目下资源;1:用户系统级别资源"
)
})
public
BaseBeanResponse
<
DmpPermissionDto
>
findListByParentCode
(
@RequestParam
(
name
=
"parentCode"
,
required
=
true
)
String
parentCode
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpPermissionDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpPermissionDto
>();
try
{
baseBeanResponse
=
dmpPermissionService
.
findListByParentCode
(
parentCode
,
httpRequest
);
baseBeanResponse
=
dmpPermissionService
.
findListByParentCode
(
parentCode
,
type
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
...
...
src/main/java/com/jz/dmp/modules/controller/sys/bean/MyDmpPermissionConverter.java
View file @
e4f44f12
...
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.CollectionUtils
;
import
com.jz.dmp.modules.model.DmpPermission
;
...
...
@@ -30,9 +31,11 @@ public class MyDmpPermissionConverter {
public
List
<
DmpPermissionDto
>
domain2dto
(
List
<
DmpPermission
>
dmpPermissions
)
{
List
<
DmpPermissionDto
>
dmpPermissionDtos
=
new
ArrayList
<
DmpPermissionDto
>();
if
(!
CollectionUtils
.
isEmpty
(
dmpPermissions
))
{
dmpPermissions
.
stream
().
forEach
(
x
->
{
dmpPermissionDtos
.
add
(
domain2dto
(
x
));
});
}
return
dmpPermissionDtos
;
}
...
...
@@ -46,9 +49,12 @@ public class MyDmpPermissionConverter {
public
List
<
DmpPermission
>
dto2domain
(
List
<
DmpPermissionDto
>
dmpPermissionDtos
)
{
List
<
DmpPermission
>
dmpPermissions
=
new
ArrayList
<
DmpPermission
>();
if
(!
CollectionUtils
.
isEmpty
(
dmpPermissionDtos
))
{
dmpPermissionDtos
.
stream
().
forEach
(
x
->
{
dmpPermissions
.
add
(
domain2dto
(
x
));
});
}
return
dmpPermissions
;
}
...
...
src/main/java/com/jz/dmp/modules/dao/DmpDevelopTaskDao.java
View file @
e4f44f12
package
com
.
jz
.
dmp
.
modules
.
dao
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.jz.dmp.modules.controller.bean.DmpDevelopTaskDto
;
import
com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto
;
import
com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq
;
import
com.jz.dmp.modules.model.DmpDevelopTask
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
DmpDevelopTaskDao
{
...
...
@@ -34,4 +36,12 @@ public interface DmpDevelopTaskDao {
* @since 2021-01-13
*/
List
<
DataDevTaskListDto
>
queryDevTaskListPage
(
DataDevTaskListReq
req
)
throws
Exception
;
/**条件查询任务开发
* @param param
* @return
* @throws Exception
*/
public
List
<
DmpDevelopTask
>
findList
(
Map
<
String
,
Object
>
param
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/model/DmpMember.java
View file @
e4f44f12
...
...
@@ -127,6 +127,9 @@ public class DmpMember implements UserDetails{
@ApiModelProperty
(
value
=
"用户当前项目资源"
)
private
List
<
DmpPermission
>
memberProjectPermissionList
;
@ApiModelProperty
(
value
=
"用户资源"
)
private
List
<
DmpPermission
>
permissionList
;
@ApiModelProperty
(
value
=
"权限"
)
private
List
<?
extends
GrantedAuthority
>
authorities
;
...
...
@@ -290,6 +293,14 @@ public class DmpMember implements UserDetails{
this
.
memberProjectPermissionList
=
memberProjectPermissionList
;
}
public
List
<
DmpPermission
>
getPermissionList
()
{
return
permissionList
;
}
public
void
setPermissionList
(
List
<
DmpPermission
>
permissionList
)
{
this
.
permissionList
=
permissionList
;
}
public
void
setAuthorities
(
List
<?
extends
GrantedAuthority
>
authorities
)
{
this
.
authorities
=
authorities
;
}
...
...
src/main/resources/mapper/sys/DmpMemberMapper.xml
View file @
e4f44f12
...
...
@@ -32,7 +32,7 @@
<!-- 封装用户项目角色信息 -->
<select
id=
"getRoleNamesByUserid"
resultType=
"java.lang.String"
>
select role.role_name
select
DISTINCT
role.role_name
from dmp_member_project_role mprole left join dmp_role role on mprole.role_id = role.role_id
where mprole.user_id=#{userId,jdbcType=INTEGER}
</select>
...
...
src/main/resources/mapper/sys/DmpRoleMapper.xml
View file @
e4f44f12
...
...
@@ -301,7 +301,7 @@
<!-- 项目角色用户人数统计 -->
<select
id=
"projRoleStat"
resultType=
"map"
>
select
role.role_code AS roleCode,role.role_name AS roleName,COUNT(
1
) AS statCount
role.role_code AS roleCode,role.role_name AS roleName,COUNT(
DISTINCT member.user_id
) AS statCount
from dmp_member_project_role mprole
left join dmp_role role on mprole.role_id=role.role_id
left join dmp_member member on mprole.user_id=member.user_id
...
...
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