Commit 60fb5cfe authored by tianyiming's avatar tianyiming

feat(core): 增加设备类型解析功能并修正筛选条件注释

parent 835f83a5
...@@ -335,6 +335,14 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -335,6 +335,14 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
if (dto.containsKey("identification")) { if (dto.containsKey("identification")) {
dto.put("identification", JSONObject.parseObject(JSONObject.parseArray(dto.get("identification").toString()).get(0).toString()).get("url")); dto.put("identification", JSONObject.parseObject(JSONObject.parseArray(dto.get("identification").toString()).get(0).toString()).get("url"));
} }
if (dto.containsKey("equipType")){
String[] equipCodes = dto.get("equipType").toString().split(",");
List<String> equipTypes = new ArrayList<>();
for (String equipType : equipCodes) {
equipTypes.add(EquipmentClassifityEnum.getNameByCode(equipType));
}
dto.put("equipType", equipTypes.toString().replace("[", "").replace("]", ""));
}
list.add(dto); list.add(dto);
} }
totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value; totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value;
...@@ -840,7 +848,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -840,7 +848,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONArray leftGroupList = new JSONArray(); JSONArray leftGroupList = new JSONArray();
// 剥离计数参数 // 剥离计数参数
getTechParam(leftGroup, leftGroupList, leftTechParam, leftParamRange); getTechParam(leftGroup, leftGroupList, leftTechParam, leftParamRange);
// 如果技术参数分组不为空,添加技术参数筛选条件到左侧筛选条件中 // 如果技术参数分组不为空,添加技术参数筛选条件到左侧筛选条件中
if (!ObjectUtils.isEmpty(leftTechParam) && !ObjectUtils.isEmpty(leftParamRange)) { if (!ObjectUtils.isEmpty(leftTechParam) && !ObjectUtils.isEmpty(leftParamRange)) {
addTechParam(leftTechParam, leftParamRange, leftBuilder); addTechParam(leftTechParam, leftParamRange, leftBuilder);
} }
...@@ -858,7 +866,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -858,7 +866,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONArray rightGroupList = new JSONArray(); JSONArray rightGroupList = new JSONArray();
// 剥离计数参数 // 剥离计数参数
getTechParam(rightGroup, rightGroupList, rightTechParam, rightParamRange); getTechParam(rightGroup, rightGroupList, rightTechParam, rightParamRange);
// 如果技术参数分组不为空,添加技术参数筛选条件到左侧筛选条件中 // 如果技术参数和分组不为空,添加技术参数筛选条件到右侧筛选条件中
if (!ObjectUtils.isEmpty(rightTechParam) && !ObjectUtils.isEmpty(rightParamRange)) { if (!ObjectUtils.isEmpty(rightTechParam) && !ObjectUtils.isEmpty(rightParamRange)) {
addTechParam(rightTechParam, rightParamRange, rightBuilder); addTechParam(rightTechParam, rightParamRange, rightBuilder);
} }
...@@ -898,7 +906,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -898,7 +906,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
} }
private void getTechParam(JSONArray group, JSONArray resultGroup, JSONObject techParam, JSONObject paramRange) { private void getTechParam(JSONArray group, JSONArray resultGroup, JSONObject techParam, JSONObject paramRange) {
// 如果只有技术参数或者只有参数范围,则舍弃对应的分组 // 剥离技术参数分组
group.forEach(item -> { group.forEach(item -> {
JSONObject itemObj = JSONObject.parseObject(JSONObject.toJSONString(item)); JSONObject itemObj = JSONObject.parseObject(JSONObject.toJSONString(item));
if (itemObj.containsKey("field") && itemObj.containsKey("value")) { if (itemObj.containsKey("field") && itemObj.containsKey("value")) {
......
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