62,629
社区成员
发帖
与我相关
我的任务
分享
String str = result.get();
JSONArray json = JSONArray.fromObject(str);
List<WorkOrder> list = new ArrayList<>();
list = (List)JSONArray.toCollection(json,WorkOrder.class);


try{
String str = result.get();
JSONArray jsonArray = new JSONArray(str);
for(int i = 0; i < jsonArray.length(); i++){
JSONObject jsonObject = jsonArray.getJSONObject(i);
WorkOrder wo = new WorkOrder();
wo.Id = jsonObject.getInt("Id");
wo.CustomerComplaint = jsonObject.getString("CustomerComplaint");
wo.Type = jsonObject.getInt("Type");
wo.Status = jsonObject.getInt("Status");
wo.CreationTime = jsonObject.getString("CreationTime");
wo.CreatedBy = jsonObject.getString("CreatedBy");
wo.ProcessOn = jsonObject.getString("ProcessOn");
wo.ProcessBy = jsonObject.getString("ProcessBy");
mData.add(wo);
}
}catch (ExecutionException e){
}catch (InterruptedException e){
public class WorkOrder
{
public int Id { get; set; }
public string CaseNumber { get; set; }
public string Name { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string CustomerComplaint { get; set; }
public int Type { get; set; }
public int Status { get; set; }
public decimal Price { get; set; }
public string Vip { get; set; }
public string CsSummary { get; set; }
public string TreatmentResult { get; set; }
public DateTime CreationTime { get; set; }
public string CreatedBy { get; set; }
public string ProcessOn { get; set; }
public string ProcessBy { get; set; }
}
这是我 android 的
public class WorkOrder {
public int Id;
public String CaseNumber;
public String Name;
public String Phone;
public String Email;
public String CustomerComplaint;
public int Type;
public int Status;
public Double Price;
public String Vip;
public String CsSummary;
public String TreatmentResult;
public String CreationTime;
public String CreatedBy;
public String ProcessOn;
public String ProcessBy;
}