feat:修正字典入库逻辑

This commit is contained in:
wangyu 2022-01-15 20:19:37 +08:00
parent e09b5efbfe
commit 273484b62e
3 changed files with 4 additions and 0 deletions

View File

@ -56,6 +56,7 @@ public class DictionaryProcessor implements InitializingBean {
.map(field -> field.getAnnotation(DictValue.class))
.filter(annotation -> null != annotation && StringUtils.isNotBlank(annotation.value()) &&
BlankEnum.class != annotation.enumType())
.distinct(DictValue::enumType)
// 查找是否存在不存在插入存在无视
.flatMap(annotation -> dictionaryService
.getByCode(annotation.value())

View File

@ -1,5 +1,6 @@
package com.flyfish.framework.file.domain;
import com.flyfish.framework.annotations.Property;
import com.flyfish.framework.domain.base.AuditDomain;
import lombok.*;
import org.springframework.data.mongodb.core.mapping.Document;
@ -10,6 +11,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Property(key = "name", value = "附件名称")
public class Attachment extends AuditDomain {
/**

View File

@ -222,6 +222,7 @@ public class BeanProperty {
Class<?> elementClass = ReflectionUtils.getGenericType(field).orElse(Object.class);
if (property.isAttachment(elementClass)) {
property.prop("attachment", true);
break;
}
annotations
.as(SubBean.class)