feat:修正字典入库逻辑
This commit is contained in:
parent
e09b5efbfe
commit
273484b62e
@ -56,6 +56,7 @@ public class DictionaryProcessor implements InitializingBean {
|
|||||||
.map(field -> field.getAnnotation(DictValue.class))
|
.map(field -> field.getAnnotation(DictValue.class))
|
||||||
.filter(annotation -> null != annotation && StringUtils.isNotBlank(annotation.value()) &&
|
.filter(annotation -> null != annotation && StringUtils.isNotBlank(annotation.value()) &&
|
||||||
BlankEnum.class != annotation.enumType())
|
BlankEnum.class != annotation.enumType())
|
||||||
|
.distinct(DictValue::enumType)
|
||||||
// 查找是否存在,不存在插入,存在无视
|
// 查找是否存在,不存在插入,存在无视
|
||||||
.flatMap(annotation -> dictionaryService
|
.flatMap(annotation -> dictionaryService
|
||||||
.getByCode(annotation.value())
|
.getByCode(annotation.value())
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.flyfish.framework.file.domain;
|
package com.flyfish.framework.file.domain;
|
||||||
|
|
||||||
|
import com.flyfish.framework.annotations.Property;
|
||||||
import com.flyfish.framework.domain.base.AuditDomain;
|
import com.flyfish.framework.domain.base.AuditDomain;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.springframework.data.mongodb.core.mapping.Document;
|
import org.springframework.data.mongodb.core.mapping.Document;
|
||||||
@ -10,6 +11,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
|
@Property(key = "name", value = "附件名称")
|
||||||
public class Attachment extends AuditDomain {
|
public class Attachment extends AuditDomain {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -222,6 +222,7 @@ public class BeanProperty {
|
|||||||
Class<?> elementClass = ReflectionUtils.getGenericType(field).orElse(Object.class);
|
Class<?> elementClass = ReflectionUtils.getGenericType(field).orElse(Object.class);
|
||||||
if (property.isAttachment(elementClass)) {
|
if (property.isAttachment(elementClass)) {
|
||||||
property.prop("attachment", true);
|
property.prop("attachment", true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
annotations
|
annotations
|
||||||
.as(SubBean.class)
|
.as(SubBean.class)
|
||||||
|
Loading…
Reference in New Issue
Block a user