Commit 586b0352 authored by tianyiming's avatar tianyiming

refactor: 优化设备类型处理逻辑

parent 3bb3bbd2
...@@ -335,13 +335,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -335,13 +335,13 @@ 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")){ if (dto.containsKey("equipType")) {
String[] equipCodes = dto.get("equipType").toString().split(","); String[] equipCodes = dto.get("equipType").toString().split(",");
List<String> equipTypes = new ArrayList<>(); StringBuilder equipTypes = new StringBuilder();
for (String equipType : equipCodes) { for (String equipType : equipCodes) {
equipTypes.add(EquipmentClassifityEnum.getNameByCode(equipType)); equipTypes.append(EquipmentClassifityEnum.getNameByCode(equipType) + ",");
} }
dto.put("equipType", equipTypes.toString().replace("[", "").replace("]", "")); dto.put("equipType", equipTypes.substring(0, equipTypes.length() - 1));
} }
list.add(dto); list.add(dto);
} }
......
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