Commit cb2353bf authored by suhuiguang's avatar suhuiguang

fact(综合搜索):数据同步调整

1.按照种类种类类别品种获取计数参数
parent 111e9a77
......@@ -53,28 +53,26 @@ public class TechParamUtil {
}
public static List<TechParamItem> getParamMetaList(String equListCode, String equCategoryCode, String equDefineCode) {
return techParamsMetaMap.computeIfAbsent(equListCode, (key) -> {
List<TechParamItem> techParamItems = new ArrayList<>();
for (Class<? extends ITechParamDefine> subClass : subClasses) {
Field[] fields = subClass.getDeclaredFields();
Group group = subClass.getAnnotation(Group.class);
if (group != null && equListCode.equals(group.value())) {
for (Field field : fields) {
field.setAccessible(true);
TechnicalParameter technicalParameter = field.getAnnotation(TechnicalParameter.class);
// 设备类别配置空时代表,全部都有
boolean equCategoryMatch = technicalParameter.equCategory().length == 0 || StringUtils.isEmpty(equCategoryCode) || Arrays.asList(technicalParameter.equCategory()).contains(equCategoryCode);
// 设备品种配置空时代表,全部都有
boolean equDefineMatch = technicalParameter.equDefine().length == 0 || StringUtils.isEmpty(equDefineCode) || Arrays.asList(technicalParameter.equDefine()).contains(equDefineCode);
if(equCategoryMatch && equDefineMatch) {
TechParamItem techParamItem = getTechParamItem(equListCode, field);
techParamItems.add(techParamItem);
}
List<TechParamItem> techParamItems = new ArrayList<>();
for (Class<? extends ITechParamDefine> subClass : subClasses) {
Field[] fields = subClass.getDeclaredFields();
Group group = subClass.getAnnotation(Group.class);
if (group != null && equListCode.equals(group.value())) {
for (Field field : fields) {
field.setAccessible(true);
TechnicalParameter technicalParameter = field.getAnnotation(TechnicalParameter.class);
// 设备类别配置空时代表,全部都有
boolean equCategoryMatch = technicalParameter.equCategory().length == 0 || StringUtils.isEmpty(equCategoryCode) || Arrays.asList(technicalParameter.equCategory()).contains(equCategoryCode);
// 设备品种配置空时代表,全部都有
boolean equDefineMatch = technicalParameter.equDefine().length == 0 || StringUtils.isEmpty(equDefineCode) || Arrays.asList(technicalParameter.equDefine()).contains(equDefineCode);
if (equCategoryMatch && equDefineMatch) {
TechParamItem techParamItem = getTechParamItem(equListCode, field);
techParamItems.add(techParamItem);
}
}
}
return techParamItems;
});
}
return techParamItems;
}
public static Class<? extends ITechParamDefine> getParamClazz(String equListCode) {
......
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