|
@@ -585,14 +585,45 @@ Debug.Log("msg error===>"+msg);
|
|
|
public void GetGaoJingTaiZhang(Action<List<baojing>> callback)
|
|
|
{
|
|
|
List<baojing> bj = new List<baojing>();
|
|
|
- for (var i=0;i<100;i++)
|
|
|
+ StartCoroutine(getAlarmledger(1,bj,callback));
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator getAlarmledger(int page, List<baojing> bj,Action<List<baojing>> callback)
|
|
|
+ {
|
|
|
+ JsonData datas =new JsonData();
|
|
|
+ datas["page"] = page;
|
|
|
+ datas["pageSize"] = 10;
|
|
|
+ JsonData d =new JsonData();
|
|
|
+ yield return StartCoroutine(Post_Demo("/digital-twin/v1/device/alarmLedger",datas.ToJson(), (string msg) => {
|
|
|
+
|
|
|
+ d =JsonMapper.ToObject(msg);
|
|
|
+
|
|
|
+ for (var i=0;i<d["data"]["list"].Count;i++)
|
|
|
+ {
|
|
|
+ for (var j=0;j< d["data"]["list"][i]["alarmLocation"].Count;j++)
|
|
|
+ {
|
|
|
+ baojing b = new baojing();
|
|
|
+ b.name = d["data"]["list"][i]["deviceName"].ToString();
|
|
|
+ b.time = changedate( d["data"]["list"][i]["date"].ToString(),4);
|
|
|
+ b.dev = d["data"]["list"][i]["alarmLocation"][j].ToString();
|
|
|
+ bj.Add(b);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }));
|
|
|
+ while(d==null)
|
|
|
+ {
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+ if((int.Parse(d["data"]["total"].ToString())/10+1)>page)
|
|
|
{
|
|
|
- baojing b = new baojing();
|
|
|
- b.name = i.ToString();
|
|
|
- b.time = DateTime.Now.ToString();
|
|
|
- b.dev = i.ToString();
|
|
|
- bj.Add(b);
|
|
|
+ page++;
|
|
|
+ yield return StartCoroutine(getAlarmledger(page,bj,callback));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ callback.Invoke(bj);
|
|
|
+
|
|
|
}
|
|
|
- callback.Invoke(bj);
|
|
|
+
|
|
|
}
|
|
|
}
|