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/Role.java | 40 ++++++++++++++++++++++++++--------------
1 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/zy/system/entity/Role.java b/src/main/java/com/zy/system/entity/Role.java
index 7f31512..faf7c31 100644
--- a/src/main/java/com/zy/system/entity/Role.java
+++ b/src/main/java/com/zy/system/entity/Role.java
@@ -3,9 +3,9 @@
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
-import com.zy.system.service.RoleService;
import com.core.common.Cools;
import com.core.common.SpringUtils;
+import com.zy.system.service.RoleService;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
@@ -18,37 +18,38 @@
/**
* 缂栧彿
*/
- @ApiModelProperty(value= "缂栧彿")
+ @ApiModelProperty(value = "缂栧彿")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 缂栫爜
*/
- @ApiModelProperty(value= "缂栫爜")
+ @ApiModelProperty(value = "缂栫爜")
private String code;
/**
* 鍚嶇О
*/
- @ApiModelProperty(value= "鍚嶇О")
+ @ApiModelProperty(value = "鍚嶇О")
private String name;
/**
* 涓婄骇
*/
- @ApiModelProperty(value= "涓婄骇")
+ @ApiModelProperty(value = "涓婄骇")
private Long leader;
/**
- * 瑙掕壊绛夌骇 1: 涓�绾� 2: 浜岀骇 3: 涓夌骇 4: 鍥涚骇 5: 浜旂骇
+ * 瑙掕壊绛夌骇 1: 涓�绾� 2: 浜岀骇 3: 涓夌骇 4: 鍥涚骇 5: 浜旂骇
*/
- @ApiModelProperty(value= "瑙掕壊绛夌骇 1: 涓�绾� 2: 浜岀骇 3: 涓夌骇 4: 鍥涚骇 5: 浜旂骇 ")
+ @ApiModelProperty(value = "瑙掕壊绛夌骇 1: 涓�绾� 2: 浜岀骇 3: 涓夌骇 4: 鍥涚骇 5: 浜旂骇 ")
private Short level;
- public Role() {}
+ public Role() {
+ }
- public Role(String code,String name,Long leader,Short level) {
+ public Role(String code, String name, Long leader, Short level) {
this.code = code;
this.name = name;
this.leader = leader;
@@ -90,11 +91,20 @@
return leader;
}
- public String getLeader$(){
+ public String getLeader$() {
RoleService service = SpringUtils.getBean(RoleService.class);
Role role = service.selectById(this.leader);
- if (!Cools.isEmpty(role)){
+ if (!Cools.isEmpty(role)) {
return String.valueOf(role.getName());
+ }
+ return null;
+ }
+
+ public String getLeaderCode() {
+ RoleService service = SpringUtils.getBean(RoleService.class);
+ Role role = service.selectById(this.leader);
+ if (!Cools.isEmpty(role)) {
+ return String.valueOf(role.getCode());
}
return null;
}
@@ -107,9 +117,11 @@
return level;
}
- public String getLevel$(){
- if (null == this.level){ return null; }
- switch (this.level){
+ public String getLevel$() {
+ if (null == this.level) {
+ return null;
+ }
+ switch (this.level) {
case 1:
return "涓�绾�";
case 2:
--
Gitblit v1.9.1