From b0a7197cfed4705a63ed32ddc83cac6fb09a017f Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期四, 23 十月 2025 14:04:29 +0800
Subject: [PATCH] 13
---
src/main/java/com/zy/system/entity/User.java | 139 ++++++++++++++++++++++++++++++++++++++++------
1 files changed, 120 insertions(+), 19 deletions(-)
diff --git a/src/main/java/com/zy/system/entity/User.java b/src/main/java/com/zy/system/entity/User.java
index 17bcfbc..403e2fa 100644
--- a/src/main/java/com/zy/system/entity/User.java
+++ b/src/main/java/com/zy/system/entity/User.java
@@ -4,16 +4,16 @@
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
-import com.zy.system.service.HostService;
-import com.zy.system.service.RoleService;
import com.core.common.Cools;
import com.core.common.SpringUtils;
+import com.zy.system.service.HostService;
+import com.zy.system.service.RoleService;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
-//import com.zy.system.service.RoleService;
+//import com.zy.sc.system.service.RoleService;
@TableName("sys_user")
public class User implements Serializable {
@@ -32,10 +32,28 @@
@TableField("host_id")
private Long hostId;
+
+ /**
+ * 鎵�灞為儴闂�
+ */
+ @TableField("dept_id")
+ private Long deptId;
+
+ /**
+ * 瑙掕壊
+ */
+ @TableField("role_id")
+ private Long roleId;
+
/**
* 璐﹀彿
*/
private String username;
+
+ /**
+ * 鍚嶇О
+ */
+ private String nickname;
/**
* 鎵嬫満鍙�
@@ -48,10 +66,19 @@
private String password;
/**
- * 瑙掕壊
+ * 澶村儚
*/
- @TableField("role_id")
- private Long roleId;
+ private String avatar;
+
+ /**
+ * 閭
+ */
+ private String email;
+
+ /**
+ * 鎬у埆 0: 鐢� 1: 濂� 2: 鏈煡
+ */
+ private Integer sex;
/**
* 娉ㄥ唽鏃堕棿
@@ -60,7 +87,7 @@
private Date createTime;
/**
- * 鐘舵�� 1: 鍚敤 2: 鍐荤粨 3: 鍒犻櫎
+ * 鐘舵�� 1: 鍚敤 0: 绂佺敤
*/
private Integer status;
@@ -83,7 +110,7 @@
public String getHostName() {
HostService service = SpringUtils.getBean(HostService.class);
Host host = service.selectById(this.hostId);
- if (!Cools.isEmpty(host)){
+ if (!Cools.isEmpty(host)) {
return host.getName();
}
return null;
@@ -93,8 +120,33 @@
this.hostId = hostId;
}
+ public Long getDeptId() {
+ return deptId;
+ }
+
+ public String getDeptName() {
+// DeptService service = SpringUtils.getBean(DeptService.class);
+// Dept dept = service.selectById(this.deptId);
+// if (!Cools.isEmpty(dept)){
+// return dept.getName();
+// }
+ return null;
+ }
+
+ public void setDeptId(Long deptId) {
+ this.deptId = deptId;
+ }
+
public void setUsername(String username) {
this.username = username;
+ }
+
+ public String getNickname() {
+ return nickname;
+ }
+
+ public void setNickname(String nickname) {
+ this.nickname = nickname;
}
public String getMobile() {
@@ -113,15 +165,64 @@
this.password = password;
}
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public Integer getSex() {
+ return sex;
+ }
+
+ public String getSex$() {
+ if (null == this.sex) {
+ return null;
+ }
+ switch (this.sex) {
+ case 0:
+ return "鐢�";
+ case 1:
+ return "濂�";
+ case 2:
+ return "鏈煡";
+ default:
+ return String.valueOf(this.sex);
+ }
+ }
+
+ public void setSex(Integer sex) {
+ this.sex = sex;
+ }
+
public Long getRoleId() {
return roleId;
}
- public String getRoleName(){
+ public String getRoleName() {
RoleService service = SpringUtils.getBean(RoleService.class);
Role role = service.selectById(this.roleId);
- if (!Cools.isEmpty(role)){
+ if (!Cools.isEmpty(role)) {
return role.getName();
+ }
+ return null;
+ }
+
+ public String getRoleLeaderCode() {
+ RoleService service = SpringUtils.getBean(RoleService.class);
+ Role role = service.selectById(this.roleId);
+ if (!Cools.isEmpty(role)) {
+ return role.getLeaderCode();
}
return null;
}
@@ -134,8 +235,8 @@
return createTime;
}
- public String getCreateTime$(){
- if (Cools.isEmpty(this.createTime)){
+ public String getCreateTime$() {
+ if (Cools.isEmpty(this.createTime)) {
return "";
}
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
@@ -149,15 +250,15 @@
return status;
}
- public String getStatus$(){
- if (null == this.status){ return null; }
- switch (this.status){
+ public String getStatus$() {
+ if (null == this.status) {
+ return null;
+ }
+ switch (this.status) {
case 1:
return "鍚敤";
- case 2:
- return "鍐荤粨";
- case 3:
- return "鍒犻櫎";
+ case 0:
+ return "绂佺敤";
default:
return String.valueOf(this.status);
}
--
Gitblit v1.9.1