原记录在有道云笔记。
public String pddGetOrders() {
String orderidinfo=pddMap();
System.out.println(orderidinfo);
Map
Map
System.out.println(order);
String orderCount=String.valueOf(order.get("orderCount"));
int page=Integer.valueOf((String) order.get("page"));
System.out.println(orderCount);
System.out.println(page);
JSONArray array = JSONArray.fromObject(order.get("orderList"));
System.out.println(array);
//遍历得到所有id,放进pddidslist集合里
List
do{
for (int i = 0; i < array.size(); i++) {
Map map= (Map) array.get(i);
String orderid=(String) map.get("orderSN");
System.out.println("订单ID:"+orderid);
pddidslist.add(orderid);
System.out.println(pddidslist);
}
page++;
}
while(orderCount=="100");
// pddidslist转换成数组
String[] arrays = new String[pddidslist.size()];
for (int j = 0; j < pddidslist.size(); j++) {
arrays[j] = pddidslist.get(j);
}
List
for(int k = 0; k < psidslist.size(); k++){
String psid=psidslist.get(k).getId();
for(int j = 0; j < pddidslist.size(); j++){
if (psid.equals(pddidslist.get(j))) {
//去掉数据库中已有的
pddidslist.remove(j);
break;
}
}
}
System.out.println(pddidslist);
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
return "redirect:";
}
public String pddMap() {
Map
Map
Map
item.put("orderSN", "151210-65418251031");
Map
item1.put("orderSN", "151214-77466052010");
Map
item2.put("orderSN", "201612251706202020995");
Map
item3.put("orderSN", "201612251654555555680");
List
orders.add(item);
orders.add(item1);
orders.add(item2);
orders.add(item3);
result.put("orderCount", "4");
result.put("page", "1");
result.put("result", "1");
result.put("cause", "");
result.put("orderList", orders);
order.put("order", result);
String d=JSON.toJSONString(order);
return d;
}