mirror of https://gitee.com/stylefeng/roses
Merge remote-tracking branch 'origin/group5-dictTag'
commit
04afa15e2a
|
@ -53,7 +53,7 @@ public enum TreeNodeEnum {
|
|||
* @author liuhanqing
|
||||
* @date 2021/1/15 13:36
|
||||
*/
|
||||
public static String codeToMessage(String code) {
|
||||
public static String codeToName(String code) {
|
||||
if (null != code) {
|
||||
for (TreeNodeEnum e : TreeNodeEnum.values()) {
|
||||
if (e.getCode().equals(code)) {
|
||||
|
|
|
@ -24,13 +24,6 @@
|
|||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--短信校验的业务-->
|
||||
<dependency>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>sms-business-validation</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -16,7 +16,14 @@
|
|||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -9,11 +9,22 @@ package cn.stylefeng.roses.kernel.dict.api;
|
|||
public interface DictApi {
|
||||
|
||||
/**
|
||||
* 获取字典名称通过id
|
||||
* 获取字典名称通过code
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/25 14:14
|
||||
*/
|
||||
String getDictNameByDictCode(String dictCode);
|
||||
|
||||
/**
|
||||
* 通过字典类型编码和字典编码获取名称
|
||||
*
|
||||
* @param dictTypeCode 字典类型编码
|
||||
* @param dictCode 字典编码
|
||||
* @return 字典名称
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 23:18
|
||||
*/
|
||||
String getDictName(String dictTypeCode, String dictCode);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
package cn.stylefeng.roses.kernel.dict.api.serializer;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.dict.api.context.DictContext;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
|
||||
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper;
|
||||
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* jackson 序列化获取字典名称
|
||||
* <p>
|
||||
* 使用@JsonSerialize(using=DictValueSerializer.class)
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 22:21
|
||||
*/
|
||||
@JacksonStdImpl
|
||||
public final class DictValueSerializer
|
||||
extends StdScalarSerializer<Object> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 字典类型编码和字典值的分隔符
|
||||
*/
|
||||
private static final String SEPARATOR = "|";
|
||||
/**
|
||||
* 空值字符串
|
||||
*/
|
||||
private static final String NULL_STR = "null";
|
||||
/**
|
||||
* 字典值之前分隔符
|
||||
*/
|
||||
private static final String VALUE_SEPARATOR = ",";
|
||||
|
||||
public DictValueSerializer() {
|
||||
super(String.class, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty(SerializerProvider prov, Object value) {
|
||||
String str = (String) value;
|
||||
return str.length() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Object value, JsonGenerator gen, SerializerProvider provider) throws IOException {
|
||||
|
||||
if (value == null) {
|
||||
gen.writeNull();
|
||||
return;
|
||||
}
|
||||
|
||||
String strVal = value.toString();
|
||||
// 判断需要翻译字典值是否为不空且含有字典标识
|
||||
if (StrUtil.isNotBlank(strVal) && strVal.indexOf(SEPARATOR) > 0) {
|
||||
// 分隔需要序列化的值
|
||||
String[] dictArr = strVal.split("\\|");
|
||||
if (dictArr.length == 2) {
|
||||
// 获取字典编码值
|
||||
String dictCode = dictArr[1];
|
||||
if (StrUtil.isBlank(dictCode) || NULL_STR.equals(dictArr[1])) {
|
||||
strVal = StrUtil.EMPTY;
|
||||
} else {
|
||||
// 获取字典名称逻辑,多个名称用逗号分隔
|
||||
String[] codeArr = dictCode.split(VALUE_SEPARATOR);
|
||||
if (codeArr.length > 0) {
|
||||
if (codeArr.length == 1) {
|
||||
strVal = DictContext.me().getDictName(dictArr[0], codeArr[0]);
|
||||
} else {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (String dic : codeArr) {
|
||||
String dicVal = DictContext.me().getDictName(dictArr[0], dic);
|
||||
if (StrUtil.isNotBlank(dicVal)) {
|
||||
sb.append(dicVal).append(",");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(sb)) {
|
||||
strVal = StrUtil.removeSuffix(sb.toString(), ",");
|
||||
} else {
|
||||
strVal = dictArr[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
strVal = StrUtil.EMPTY;
|
||||
}
|
||||
}
|
||||
gen.writeString(strVal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void serializeWithType(Object value, JsonGenerator gen, SerializerProvider provider,
|
||||
TypeSerializer typeSer) throws IOException {
|
||||
// no type info, just regular serialization
|
||||
gen.writeString((String) value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonNode getSchema(SerializerProvider provider, Type typeHint) {
|
||||
return createSchemaNode("string", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException {
|
||||
visitStringFormat(visitor, typeHint);
|
||||
}
|
||||
}
|
|
@ -296,6 +296,33 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
|||
return StrUtil.EMPTY;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getDictName(String dictTypeCode, String dictCode) {
|
||||
LambdaQueryWrapper<SysDict> sysDictLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sysDictLambdaQueryWrapper.eq(SysDict::getDictTypeCode, dictTypeCode);
|
||||
sysDictLambdaQueryWrapper.eq(SysDict::getDictCode, dictCode);
|
||||
sysDictLambdaQueryWrapper.ne(SysDict::getDelFlag, YesOrNotEnum.Y.getCode());
|
||||
|
||||
List<SysDict> list = this.list(sysDictLambdaQueryWrapper);
|
||||
|
||||
// 如果查询不到字典,则返回空串
|
||||
if (list.isEmpty()) {
|
||||
return StrUtil.EMPTY;
|
||||
}
|
||||
|
||||
// 字典code存在多个重复的,返回空串并打印错误日志
|
||||
if (list.size() > 1) {
|
||||
log.error(DICT_CODE_REPEAT.getUserTip(), "", dictCode);
|
||||
return StrUtil.EMPTY;
|
||||
}
|
||||
|
||||
String dictName = list.get(0).getDictName();
|
||||
if (dictName != null) {
|
||||
return dictName;
|
||||
} else {
|
||||
return StrUtil.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改pids的请求
|
||||
|
|
|
@ -188,7 +188,7 @@ CREATE TABLE `sys_database_info` (
|
|||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_dict`;
|
||||
CREATE TABLE `sys_dict` (
|
||||
`dict_id` bigint(20) NOT NULL COMMENT '字典id',
|
||||
`dict_id` bigint(0) NOT NULL COMMENT '字典id',
|
||||
`dict_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '字典编码',
|
||||
`dict_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '字典名称',
|
||||
`dict_name_pinyin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典名称首字母',
|
||||
|
@ -196,48 +196,58 @@ CREATE TABLE `sys_dict` (
|
|||
`dict_type_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '字典类型的编码',
|
||||
`dict_short_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典简称',
|
||||
`dict_short_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典简称的编码',
|
||||
`dict_parent_id` bigint(20) NOT NULL COMMENT '上级字典的id(如果没有上级字典id,则为-1)',
|
||||
`status_flag` tinyint(4) NOT NULL COMMENT '状态:(1-启用,2-禁用),参考 StatusEnum',
|
||||
`dict_parent_id` bigint(0) NOT NULL COMMENT '上级字典的id(如果没有上级字典id,则为-1)',
|
||||
`status_flag` tinyint(0) NOT NULL COMMENT '状态:(1-启用,2-禁用),参考 StatusEnum',
|
||||
`dict_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序,带小数点',
|
||||
`dict_pids` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '父id集合',
|
||||
`del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否删除,Y-被删除,N-未删除',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`create_user` bigint(20) NULL DEFAULT NULL COMMENT '创建用户id',
|
||||
`create_user` bigint(0) NULL DEFAULT NULL COMMENT '创建用户id',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`update_user` bigint(20) NULL DEFAULT NULL COMMENT '修改用户id',
|
||||
PRIMARY KEY (`dict_id`) USING BTREE
|
||||
`update_user` bigint(0) NULL DEFAULT NULL COMMENT '修改用户id',
|
||||
PRIMARY KEY (`dict_id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典' ROW_FORMAT = Dynamic;
|
||||
|
||||
INSERT INTO `sys_dict`(`dict_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_type_code`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `status_flag`, `dict_sort`, `dict_pids`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1348235720908619802, 'M', '男', 'n', 'male', 'sex', NULL, NULL, -1, 1, 1.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict`(`dict_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_type_code`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `status_flag`, `dict_sort`, `dict_pids`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1348235720908619803, 'F', '女', 'n', 'female', 'sex', NULL, NULL, -1, 1, 2.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict`(`dict_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_type_code`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `status_flag`, `dict_sort`, `dict_pids`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1348235720908619804, '1', '启用', 'n', 'male', 'user_status', NULL, NULL, -1, 1, 1.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict`(`dict_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_type_code`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `status_flag`, `dict_sort`, `dict_pids`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1348235720908619805, '2', '禁用', 'n', 'female', 'user_status', NULL, NULL, -1, 1, 2.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict`(`dict_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_type_code`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `status_flag`, `dict_sort`, `dict_pids`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1348235720908619806, '3', '冻结', 'n', 'female', 'user_status', NULL, NULL, -1, 1, 2.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
-- ----------------------------
|
||||
-- Records of sys_dict
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_dict` VALUES (1348235720908619802, 'M', '男', 'n', 'male', 'sex', NULL, NULL, -1, 1, 1.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict` VALUES (1348235720908619803, 'F', '女', 'n', 'female', 'sex', NULL, NULL, -1, 1, 2.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict` VALUES (1348235720908619804, '1', '启用', 'n', 'male', 'user_status', NULL, NULL, -1, 1, 1.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict` VALUES (1348235720908619805, '2', '禁用', 'n', 'female', 'user_status', NULL, NULL, -1, 1, 2.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict` VALUES (1348235720908619806, '3', '冻结', 'n', 'female', 'user_status', NULL, NULL, -1, 1, 2.00, '[-1],', 'N', '2021-01-14 14:46:13', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict` VALUES (1350457799368257537, 'low', '低', 'd', NULL, 'priority_level', '低', '', -1, 1, 1.00, '-1', 'N', '2021-01-16 23:00:04', 1339550467939639299, NULL, NULL);
|
||||
INSERT INTO `sys_dict` VALUES (1350457870780477442, 'middle', '中', 'z', NULL, 'priority_level', '中', '', -1, 1, 2.00, '-1', 'N', '2021-01-16 23:00:21', 1339550467939639299, NULL, NULL);
|
||||
INSERT INTO `sys_dict` VALUES (1350457950417727489, 'high', '高', 'g', NULL, 'priority_level', '高', '', -1, 1, 3.00, '-1', 'N', '2021-01-16 23:00:40', 1339550467939639299, NULL, NULL);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_dict_type
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_dict_type`;
|
||||
CREATE TABLE `sys_dict_type` (
|
||||
`dict_type_id` bigint(20) NOT NULL COMMENT '字典类型id',
|
||||
`dict_type_class` int(11) NULL DEFAULT NULL COMMENT '字典类型: 1-业务类型,2-系统类型,参考 DictTypeClassEnum',
|
||||
`dict_type_id` bigint(0) NOT NULL COMMENT '字典类型id',
|
||||
`dict_type_class` int(0) NULL DEFAULT NULL COMMENT '字典类型: 1-业务类型,2-系统类型,参考 DictTypeClassEnum',
|
||||
`dict_type_bus_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典类型业务编码',
|
||||
`dict_type_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典类型编码',
|
||||
`dict_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典类型名称',
|
||||
`dict_type_name_pinyin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典类型名称首字母拼音',
|
||||
`dict_type_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典类型描述',
|
||||
`status_flag` tinyint(4) NULL DEFAULT NULL COMMENT '字典类型的状态:1-启用,2-禁用,参考 StatusEnum',
|
||||
`status_flag` tinyint(0) NULL DEFAULT NULL COMMENT '字典类型的状态:1-启用,2-禁用,参考 StatusEnum',
|
||||
`dict_type_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序,带小数点',
|
||||
`del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否删除:Y-被删除,N-未删除',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`create_user` bigint(20) NULL DEFAULT NULL COMMENT '创建用户id',
|
||||
`create_user` bigint(0) NULL DEFAULT NULL COMMENT '创建用户id',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`update_user` bigint(20) NULL DEFAULT NULL COMMENT '修改用户id',
|
||||
`update_user` bigint(0) NULL DEFAULT NULL COMMENT '修改用户id',
|
||||
PRIMARY KEY (`dict_type_id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型' ROW_FORMAT = Dynamic;
|
||||
|
||||
INSERT INTO `sys_dict_type`(`dict_type_id`, `dict_type_class`, `dict_type_bus_code`, `dict_type_code`, `dict_type_name`, `dict_type_name_pinyin`, `dict_type_desc`, `status_flag`, `dict_type_sort`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1348235720908619811, 1, 'base', 'sex', '性别', 'xb', NULL, 1, 1.00, 'N', '2021-01-14 14:47:32', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_type`(`dict_type_id`, `dict_type_class`, `dict_type_bus_code`, `dict_type_code`, `dict_type_name`, `dict_type_name_pinyin`, `dict_type_desc`, `status_flag`, `dict_type_sort`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1348235720908619812, 2, 'system', 'user_status', '用户状态', 'yhzt', NULL, 1, 2.00, 'N', '2021-01-14 14:47:32', NULL, NULL, NULL);
|
||||
-- ----------------------------
|
||||
-- Records of sys_dict_type
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_dict_type` VALUES (1348235720908619811, 1, 'base', 'sex', '性别', 'xb', NULL, 1, 1.00, 'N', '2021-01-14 14:47:32', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_type` VALUES (1348235720908619812, 2, 'system', 'user_status', '用户状态', 'yhzt', NULL, 1, 2.00, 'N', '2021-01-14 14:47:32', NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_type` VALUES (1350457656690618370, 1, 'notice', 'priority_level', '优先级', 'yxj', '', 1, 5.00, 'N', '2021-01-16 22:59:30', 1339550467939639299, NULL, NULL);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_file_info
|
||||
|
|
|
@ -61,6 +61,13 @@
|
|||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--字典模块-->
|
||||
<dependency>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>dict-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
package cn.stylefeng.roses.kernel.notice.modular.entity;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||
import cn.stylefeng.roses.kernel.message.api.enums.MessagePriorityLevelEnum;
|
||||
import cn.stylefeng.roses.kernel.dict.api.serializer.DictValueSerializer;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
* 通知表
|
||||
|
@ -79,12 +78,16 @@ public class SysNotice extends BaseEntity {
|
|||
@TableField(value = "del_flag", fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
public String getPriorityLevelValue(){
|
||||
/*public String getPriorityLevelValue(){
|
||||
AtomicReference<String> value = new AtomicReference<>("");
|
||||
Optional.ofNullable(this.priorityLevel).ifPresent(val ->{
|
||||
value.set(MessagePriorityLevelEnum.getName(this.priorityLevel));
|
||||
});
|
||||
return value.get();
|
||||
}*/
|
||||
@JsonSerialize(using = DictValueSerializer.class)
|
||||
public String getPriorityLevelValue() {
|
||||
return "priority_level|" + this.priorityLevel;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue