mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-04-29 02:37:52 +08:00
新增枚举字典的Excel导入和导出方式
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.system.api.domain;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import com.ruoyi.system.api.emun.EnableStatusEnum;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
@@ -11,7 +12,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysDictData extends BaseEntity
|
||||
@@ -48,8 +49,11 @@ public class SysDictData extends BaseEntity
|
||||
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
|
||||
private String isDefault;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
* @see EnableStatusEnum
|
||||
**/
|
||||
@Excel(name = "状态", readConverterEnum = EnableStatusEnum.class)
|
||||
private String status;
|
||||
|
||||
public Long getDictCode()
|
||||
@@ -153,7 +157,7 @@ public class SysDictData extends BaseEntity
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.system.api.domain;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import com.ruoyi.system.api.emun.EnableStatusEnum;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
@@ -11,7 +12,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 字典类型表 sys_dict_type
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysDictType extends BaseEntity
|
||||
@@ -30,8 +31,11 @@ public class SysDictType extends BaseEntity
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
* @see EnableStatusEnum
|
||||
**/
|
||||
@Excel(name = "状态", readConverterEnum = EnableStatusEnum.class)
|
||||
private String status;
|
||||
|
||||
public Long getDictId()
|
||||
@@ -78,7 +82,7 @@ public class SysDictType extends BaseEntity
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.Set;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import com.ruoyi.system.api.emun.EnableStatusEnum;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
@@ -12,7 +13,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 角色表 sys_role
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysRole extends BaseEntity
|
||||
@@ -45,8 +46,11 @@ public class SysRole extends BaseEntity
|
||||
/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||
private boolean deptCheckStrictly;
|
||||
|
||||
/** 角色状态(0正常 1停用) */
|
||||
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||
/**
|
||||
* 角色状态(0正常 1停用)
|
||||
* @see EnableStatusEnum
|
||||
**/
|
||||
@Excel(name = "角色状态", readConverterEnum = EnableStatusEnum.class)
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.system.api.domain;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import com.ruoyi.system.api.emun.EnableStatusEnum;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
@@ -14,7 +15,7 @@ import com.ruoyi.common.core.xss.Xss;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysUser extends BaseEntity
|
||||
@@ -55,8 +56,11 @@ public class SysUser extends BaseEntity
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
* @see EnableStatusEnum
|
||||
**/
|
||||
@Excel(name = "帐号状态", readConverterEnum = EnableStatusEnum.class)
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.ruoyi.system.api.emun;
|
||||
|
||||
import com.ruoyi.common.core.annotation.DictTag;
|
||||
|
||||
/**
|
||||
* ===========================================
|
||||
* Copyright 2024 xiaoyang
|
||||
* All rights reserved
|
||||
* <p>项 目 名 :RuoYi-Cloud</p>
|
||||
* <p>文 件 名 :EnableStatusEnum</p>
|
||||
* <p>描 述 :启用状态枚举</p>
|
||||
*
|
||||
* @author :xiaoyang
|
||||
* @date : 2024/1/12 20:26
|
||||
* ============================================
|
||||
*/
|
||||
public enum EnableStatusEnum implements DictTag
|
||||
{
|
||||
/**
|
||||
* 正常
|
||||
*/
|
||||
enable("0", "正常"),
|
||||
/**
|
||||
* 停用
|
||||
*/
|
||||
disable("1", "停用");
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
;
|
||||
|
||||
EnableStatusEnum(String code, String name)
|
||||
{
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
@Override
|
||||
public String getKey()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* 获取编码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取键(集成字典类型)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user