修改获取患者历史数据图表

master
chenfei 2 years ago
parent b04b2f7826
commit 63fe4e8b80

@ -146,7 +146,7 @@ public class TRecordController extends BaseController
{ {
RecordHistoryDataResp recordHistoryDataResp = new RecordHistoryDataResp(); RecordHistoryDataResp recordHistoryDataResp = new RecordHistoryDataResp();
List<String> dateList = records.stream().map(tRecord -> DateUtils.parseDateToStr("dd/MM/yyyy",tRecord.getCreateTime())).collect(Collectors.toList()); List<Date> dateList = records.stream().map(TRecord::getCreateTime).collect(Collectors.toList());
recordHistoryDataResp.setDateList(dateList); recordHistoryDataResp.setDateList(dateList);
List<JSONObject> result = records.stream().map(tRecord -> { List<JSONObject> result = records.stream().map(tRecord -> {
JSONObject jsonObject; JSONObject jsonObject;
@ -157,7 +157,6 @@ public class TRecordController extends BaseController
} }
return jsonObject; return jsonObject;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Map<String,List<Integer>> dataMap = new HashMap<>();
if (!CollectionUtils.isEmpty(result)){ if (!CollectionUtils.isEmpty(result)){
List<Integer> shezhiList = new LinkedList<>(); List<Integer> shezhiList = new LinkedList<>();
List<Integer> shetaiList = new LinkedList<>(); List<Integer> shetaiList = new LinkedList<>();
@ -170,11 +169,10 @@ public class TRecordController extends BaseController
shetaiList.add(jsonObject.getJSONObject("data").getJSONObject("shetai").getInteger(key1)); shetaiList.add(jsonObject.getJSONObject("data").getJSONObject("shetai").getInteger(key1));
shexiaList.add(jsonObject.getJSONObject("data").getJSONObject("shexia").getInteger(key2)); shexiaList.add(jsonObject.getJSONObject("data").getJSONObject("shexia").getInteger(key2));
}); });
dataMap.put("shezhi",shezhiList); recordHistoryDataResp.setShezhiList(shezhiList);
dataMap.put("shetai",shetaiList); recordHistoryDataResp.setShetaiList(shetaiList);
dataMap.put("shexia",shexiaList); recordHistoryDataResp.setShexiaList(shexiaList);
} }
recordHistoryDataResp.setDataMap(dataMap);
return recordHistoryDataResp; return recordHistoryDataResp;
} }
} }

@ -6,29 +6,51 @@ import java.util.Map;
public class RecordHistoryDataResp public class RecordHistoryDataResp
{ {
private Map<String,List<Integer>> dataMap; private List<Integer> shezhiList;
private List<String> dateList; private List<Integer> shetaiList;
private List<Integer> shexiaList;
private List<Date> dateList;
public RecordHistoryDataResp() public RecordHistoryDataResp()
{ {
} }
public Map<String, List<Integer>> getDataMap() public List<Integer> getShezhiList()
{ {
return dataMap; return shezhiList;
} }
public void setDataMap(Map<String, List<Integer>> dataMap) public void setShezhiList(List<Integer> shezhiList)
{ {
this.dataMap = dataMap; this.shezhiList = shezhiList;
} }
public List<String> getDateList() public List<Integer> getShetaiList()
{
return shetaiList;
}
public void setShetaiList(List<Integer> shetaiList)
{
this.shetaiList = shetaiList;
}
public List<Integer> getShexiaList()
{
return shexiaList;
}
public void setShexiaList(List<Integer> shexiaList)
{
this.shexiaList = shexiaList;
}
public List<Date> getDateList()
{ {
return dateList; return dateList;
} }
public void setDateList(List<String> dateList) public void setDateList(List<Date> dateList)
{ {
this.dateList = dateList; this.dateList = dateList;
} }

Loading…
Cancel
Save