Commit 0c1ed10f authored by suhuiguang's avatar suhuiguang

feat(综合搜索):实体类创建

1.人员、企业、设备 2.技术参数
parent 1f9f0b33
package com.yeejoin.amos.boot.module.common.api.entity;
import com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter;
import com.yeejoin.amos.boot.module.common.api.dto.TechParamMeta;
import com.yeejoin.amos.boot.module.common.api.dto.TechParamItem;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
......@@ -364,7 +364,7 @@ public class ESEquipmentInfo {
@Field(type = FieldType.Date)
private Date dateValue;
public TechParam(TechParamMeta meta, Object rawValue) {
public TechParam(TechParamItem meta, Object rawValue) {
this.paramKey = meta.getParamKey();
this.paramLabel = meta.getParamLabel();
setValueByType(meta.getParamType(), rawValue, meta.getMaxPrecision());
......
......@@ -3,7 +3,7 @@ package com.yeejoin.amos.boot.module.common.biz.utils;
import com.yeejoin.amos.boot.biz.common.annotation.Group;
import com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter;
import com.yeejoin.amos.boot.module.common.api.dto.ITechParamDefine;
import com.yeejoin.amos.boot.module.common.api.dto.TechParamMeta;
import com.yeejoin.amos.boot.module.common.api.dto.TechParamItem;
import org.reflections.Reflections;
import java.lang.reflect.Field;
......@@ -15,7 +15,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class TechParamUtil {
private static final Set<Class<? extends ITechParamDefine>> subClasses;
private static final Map<String, List<TechParamMeta>> techParamsMetaMap = new ConcurrentHashMap<>();
private static final Map<String, List<TechParamItem>> techParamsMetaMap = new ConcurrentHashMap<>();
static {
//▼ 指定扫描包路径(根据实际项目调整)
......@@ -24,9 +24,9 @@ public class TechParamUtil {
subClasses = reflections.getSubTypesOf(ITechParamDefine.class);
}
public static List<TechParamMeta> getParamMetaList(String equListCode) {
public static List<TechParamItem> getParamMetaList(String equListCode) {
return techParamsMetaMap.computeIfAbsent(equListCode, (key) -> {
List<TechParamMeta> techParamMetas = new ArrayList<>();
List<TechParamItem> techParamItems = new ArrayList<>();
for (Class<? extends ITechParamDefine> subClass : subClasses) {
Field[] fields = subClass.getDeclaredFields();
Group group = subClass.getAnnotation(Group.class);
......@@ -34,16 +34,16 @@ public class TechParamUtil {
for (Field field : fields) {
field.setAccessible(true);
TechnicalParameter technicalParameter = field.getAnnotation(TechnicalParameter.class);
TechParamMeta techParamMeta = new TechParamMeta();
techParamMeta.setParamKey(technicalParameter.key());
techParamMeta.setParamLabel(technicalParameter.label());
techParamMeta.setEquListCode(equListCode);
techParamMeta.setParamType(technicalParameter.type());
techParamMetas.add(techParamMeta);
TechParamItem techParamItem = new TechParamItem();
techParamItem.setParamKey(technicalParameter.key());
techParamItem.setParamLabel(technicalParameter.label());
techParamItem.setEquListCode(equListCode);
techParamItem.setParamType(technicalParameter.type());
techParamItems.add(techParamItem);
}
}
}
return techParamMetas;
return techParamItems;
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment