Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 83c16e89
authored
Oct 10, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:调整用户组织关联id
1 parent
6e37c205
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
11 deletions
project-user/src/main/java/com/dituhui/pea/user/entity/UserOrgEntity.java
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
project-user/src/main/java/com/dituhui/pea/user/entity/UserOrgEntity.java
View file @
83c16e8
...
@@ -2,21 +2,33 @@ package com.dituhui.pea.user.entity;
...
@@ -2,21 +2,33 @@ package com.dituhui.pea.user.entity;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.
time.LocalDateTim
e
;
import
java.
util.Dat
e
;
@Entity
@Entity
@Table
(
name
=
"sys_user_org"
)
@Table
(
name
=
"sys_user_org"
)
@Data
@Data
@Accessors
(
chain
=
true
)
// @Accessors(chain = true)
@EntityListeners
(
AuditingEntityListener
.
class
)
public
class
UserOrgEntity
{
public
class
UserOrgEntity
{
private
static
final
long
serialVersionUID
=
595672847439664430L
;
/**
* 主键
*/
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
generator
=
"uuid"
)
private
Integer
id
;
@GenericGenerator
(
name
=
"uuid"
,
strategy
=
"uuid"
)
@Column
(
name
=
"ID"
,
unique
=
true
,
nullable
=
false
,
length
=
32
)
private
String
id
;
@Column
(
name
=
"user_id"
,
nullable
=
false
,
unique
=
true
)
// @Column(name = "user_id", nullable = false, unique = true)
@Column
(
name
=
"user_id"
,
nullable
=
false
)
private
String
userId
;
private
String
userId
;
@Column
(
name
=
"org_id"
,
nullable
=
false
)
@Column
(
name
=
"org_id"
,
nullable
=
false
)
...
@@ -27,10 +39,26 @@ public class UserOrgEntity {
...
@@ -27,10 +39,26 @@ public class UserOrgEntity {
*/
*/
@Column
(
name
=
"org_level"
,
nullable
=
false
)
@Column
(
name
=
"org_level"
,
nullable
=
false
)
private
Integer
orgLevel
;
private
Integer
orgLevel
;
/**
@Column
(
name
=
"create_time"
,
nullable
=
false
,
updatable
=
false
,
columnDefinition
=
"timestamp default current_timestamp"
)
* 创建人
private
LocalDateTime
createTime
;
*/
@Column
(
name
=
"CREATED_BY"
)
@Column
(
name
=
"update_time"
,
nullable
=
false
,
columnDefinition
=
"timestamp default current_timestamp on update current_timestamp"
)
private
String
createdBy
;
private
LocalDateTime
updateTime
;
/**
* 创建时间
*/
@Column
(
name
=
"create_time"
)
@CreatedDate
private
Date
createdTime
;
/**
* 更新人
*/
@Column
(
name
=
"UPDATED_BY"
)
private
String
updatedBy
;
/**
* 更新时间
*/
@Column
(
name
=
"update_time"
)
@LastModifiedDate
private
Date
updatedTime
;
}
}
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
View file @
83c16e8
...
@@ -475,6 +475,7 @@ public class UserService {
...
@@ -475,6 +475,7 @@ public class UserService {
UserRoleEntity
userRoleEntity
=
new
UserRoleEntity
();
UserRoleEntity
userRoleEntity
=
new
UserRoleEntity
();
userRoleEntity
.
setUserId
(
userInfo
.
getId
());
userRoleEntity
.
setUserId
(
userInfo
.
getId
());
userRoleEntity
.
setRoleId
(
roleId
);
userRoleEntity
.
setRoleId
(
roleId
);
userRoleEntity
.
setCreatedBy
(
userInfo
.
getCreatedBy
());
userRoleDao
.
save
(
userRoleEntity
);
userRoleDao
.
save
(
userRoleEntity
);
}
}
}
}
...
@@ -492,6 +493,7 @@ public class UserService {
...
@@ -492,6 +493,7 @@ public class UserService {
UserOrgEntity
userOrgEntity
=
new
UserOrgEntity
();
UserOrgEntity
userOrgEntity
=
new
UserOrgEntity
();
userOrgEntity
.
setUserId
(
userInfo
.
getId
());
userOrgEntity
.
setUserId
(
userInfo
.
getId
());
userOrgEntity
.
setOrgId
(
orgId
);
userOrgEntity
.
setOrgId
(
orgId
);
userOrgEntity
.
setCreatedBy
(
userInfo
.
getCreatedBy
());
userOrgEntity
.
setOrgLevel
(
userInfo
.
getOrgLevel
());
userOrgEntity
.
setOrgLevel
(
userInfo
.
getOrgLevel
());
userOrgDao
.
save
(
userOrgEntity
);
userOrgDao
.
save
(
userOrgEntity
);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment