Commit 62e4bc37 authored by xixinzhao's avatar xixinzhao

解决查询预警记录报错

parent 515f43ee
...@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A; import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -117,15 +118,17 @@ public class EquipInformationCardController { ...@@ -117,15 +118,17 @@ public class EquipInformationCardController {
}); });
String cs = ""; String cs = "";
JSONArray list = record.getJSONArray("rectificationProposal"); JSONArray list = record.getJSONArray("rectificationProposal");
for (int i = 0; i < list.size(); i++) { //TODO 赋码记录业务迁移到了idx,先解决报错,后续移到idx服务
if (i != (list.size() - 1)){ if (!CollectionUtils.isEmpty(list)) {
cs += list.getJSONObject(i).getString("measuresDesc")+","; for (int i = 0; i < list.size(); i++) {
} else { if (i != (list.size() - 1)){
cs += list.getJSONObject(i).getString("measuresDesc"); cs += list.getJSONObject(i).getString("measuresDesc")+",";
} else {
cs += list.getJSONObject(i).getString("measuresDesc");
}
} }
} }
record.put("measure",cs); record.put("measure",cs);
}); });
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
......
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