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
8a01a3da
Commit
8a01a3da
authored
Jan 12, 2021
by
mcb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dmp_dev' of
http://gitlab.ioubuy.cn/yaobenzhang/jz-dmp-service
into dmp_dev
parents
babf1bd3
f6d2960f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
13 deletions
+44
-13
DmpMemberController.java
...om/jz/dmp/modules/controller/sys/DmpMemberController.java
+4
-4
DmpMemberDto.java
.../com/jz/dmp/modules/controller/sys/bean/DmpMemberDto.java
+10
-1
DmpMember.java
src/main/java/com/jz/dmp/modules/model/DmpMember.java
+6
-0
DmpPermission.java
src/main/java/com/jz/dmp/modules/model/DmpPermission.java
+4
-0
DmpRole.java
src/main/java/com/jz/dmp/modules/model/DmpRole.java
+4
-0
DmpMemberMapper.xml
src/main/resources/mapper/sys/DmpMemberMapper.xml
+16
-8
No files found.
src/main/java/com/jz/dmp/modules/controller/sys/DmpMemberController.java
View file @
8a01a3da
...
...
@@ -101,7 +101,7 @@ public class DmpMemberController {
* @param dmpMemberRequest
* @return
*/
//@RequestMapping(method = RequestMethod.
POS
T, value = "/delete")
//@RequestMapping(method = RequestMethod.
GE
T, value = "/delete")
//@ApiOperation(value = "删除用户表", notes = "删除用户表")
//@ApiImplicitParam(name = "userId", value = "用户表主键")
public
BaseResponse
delete
(
@RequestParam
(
name
=
"userId"
,
required
=
true
)
Integer
userId
,
HttpServletRequest
httpRequest
){
...
...
@@ -121,7 +121,7 @@ public class DmpMemberController {
* @param userId
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POS
T
,
value
=
"/softDelete"
)
@RequestMapping
(
method
=
RequestMethod
.
GE
T
,
value
=
"/softDelete"
)
@ApiOperation
(
value
=
"软删除用户表"
,
notes
=
"软删除用户表"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户表主键"
)
public
BaseResponse
softDelete
(
@RequestParam
(
name
=
"userId"
,
required
=
true
)
Integer
userId
,
HttpServletRequest
httpRequest
){
...
...
@@ -198,7 +198,7 @@ public class DmpMemberController {
* @param dmpMemberRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POS
T
,
value
=
"/switchProj"
)
@RequestMapping
(
method
=
RequestMethod
.
GE
T
,
value
=
"/switchProj"
)
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目主键"
)
@ApiOperation
(
value
=
"用户项目切换"
,
notes
=
"用户项目切换"
)
public
BaseBeanResponse
<
DmpMember
>
switchProj
(
@RequestParam
(
name
=
"projectId"
,
required
=
true
)
Integer
projectId
,
HttpServletRequest
httpRequest
){
...
...
@@ -218,7 +218,7 @@ public class DmpMemberController {
* @param dmpMemberRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POS
T
,
value
=
"/findListUnChoose"
)
@RequestMapping
(
method
=
RequestMethod
.
GE
T
,
value
=
"/findListUnChoose"
)
@ApiOperation
(
value
=
"获取项目下不是成员的所有用户"
,
notes
=
"获取项目下不是成员的所有用户"
)
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目主键"
)
public
BaseBeanResponse
<
DmpMemberDto
>
findListUnChoose
(
@RequestParam
(
name
=
"projectId"
,
required
=
true
)
Integer
projectId
,
HttpServletRequest
httpRequest
){
...
...
src/main/java/com/jz/dmp/modules/controller/sys/bean/DmpMemberDto.java
View file @
8a01a3da
package
com
.
jz
.
dmp
.
modules
.
controller
.
sys
.
bean
;
import
java.io.Serializable
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.jz.dmp.modules.model.DmpMember
;
import
com.jz.dmp.modules.model.DmpRole
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -14,7 +17,13 @@ import lombok.Data;
*/
@Data
@ApiModel
(
value
=
"用户表Dto"
,
description
=
"用户表Dto"
)
public
class
DmpMemberDto
extends
DmpMember
{
@JsonIgnoreProperties
(
value
=
{
"handler"
})
public
class
DmpMemberDto
extends
DmpMember
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"项目角色列表"
)
private
List
<
String
>
roles
;
...
...
src/main/java/com/jz/dmp/modules/model/DmpMember.java
View file @
8a01a3da
...
...
@@ -7,9 +7,12 @@ import java.util.Collection;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
/**用户表
* @author ybz
*
...
...
@@ -56,6 +59,7 @@ public class DmpMember implements UserDetails{
* 最近登录时间
*/
@ApiModelProperty
(
value
=
"最近登录时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
loginTime
;
/**
...
...
@@ -92,6 +96,7 @@ public class DmpMember implements UserDetails{
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
...
...
@@ -104,6 +109,7 @@ public class DmpMember implements UserDetails{
* 修改时间
*/
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"用户当前所在工作空间(项目)"
)
...
...
src/main/java/com/jz/dmp/modules/model/DmpPermission.java
View file @
8a01a3da
...
...
@@ -7,6 +7,8 @@ import java.io.Serializable;
import
java.util.Date
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
/**资源表
* @author ybz
*
...
...
@@ -88,6 +90,7 @@ public class DmpPermission implements Serializable {
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
...
...
@@ -100,6 +103,7 @@ public class DmpPermission implements Serializable {
* 修改时间
*/
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"所有孩子节点"
)
...
...
src/main/java/com/jz/dmp/modules/model/DmpRole.java
View file @
8a01a3da
...
...
@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
/**角色表
* @author ybz
*
...
...
@@ -69,6 +71,7 @@ public class DmpRole implements Serializable{
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
...
...
@@ -81,6 +84,7 @@ public class DmpRole implements Serializable{
* 修改时间
*/
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
public
Integer
getRoleId
()
{
...
...
src/main/resources/mapper/sys/DmpMemberMapper.xml
View file @
8a01a3da
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.jz.dmp.modules.dao.sys.DmpMemberMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jz.dmp.modules.model.DmpMember"
>
<
result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<
id
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"user_name"
property=
"userName"
jdbcType=
"VARCHAR"
/>
<result
column=
"user_password"
property=
"userPassword"
jdbcType=
"VARCHAR"
/>
<result
column=
"real_name"
property=
"realName"
jdbcType=
"VARCHAR"
/>
...
...
@@ -19,15 +19,24 @@
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<!-- <resultMap id="roleMap" type="com.jz.dmp.modules.model.DmpRole">
<result column="role_name" property="roleName" jdbcType="VARCHAR" />
</resultMap> -->
<resultMap
id=
"BaseDtoResultMap"
type=
"com.jz.dmp.modules.controller.sys.bean.DmpMemberDto"
extends=
"BaseResultMap"
>
<!-- /*$BaseDtoResultMapContent$*/ -->
<collection
property=
"roles"
ofType=
"java.lang.String"
>
<constructor>
<arg
column=
"role_name"
/>
</constructor>
<collection
property=
"roles"
ofType=
"java.lang.String"
javaType=
"java.util.List"
column=
"userId"
select=
"getRoleNamesByUserid"
>
</collection>
</resultMap>
<!-- 封装用户项目角色信息 -->
<select
id=
"getRoleNamesByUserid"
resultType=
"java.lang.String"
>
select 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>
<sql
id=
"Base_Column_List"
>
user_id, user_name, user_password, real_name, user_phone,
login_ip, login_time, login_locked, login_errtimes, remark,
...
...
@@ -37,8 +46,7 @@
<sql
id=
"BaseDto_Column_List"
>
m.user_id, m.user_name, m.user_password, m.real_name, m.user_phone,
m.login_ip, m.login_time, m.login_locked, m.login_errtimes, m.remark,
m.data_status, m.create_user_id, m.create_time, m.update_user_id, m.update_time,
role.role_name
m.data_status, m.create_user_id, m.create_time, m.update_user_id, m.update_time
</sql>
<!-- 根据主键查询用户表 -->
...
...
@@ -271,7 +279,7 @@
<!-- 条件查询用户表 -->
<select
id=
"findList"
resultMap=
"BaseDtoResultMap"
>
SELECT
SELECT
DISTINCT
<include
refid=
"BaseDto_Column_List"
/>
FROM dmp_member m
left join dmp_member_project_role mprole on m.user_id=mprole.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