87 lines
2.4 KiB
Java
87 lines
2.4 KiB
Java
package com.example.sso.dao;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.example.sso.util.V5utils;
|
|
|
|
public class DeleteEnd {
|
|
public static void del() {
|
|
Boolean b = true;
|
|
String ID = "";
|
|
|
|
JSONArray jsonArrayEND = new JSONArray();
|
|
while (b) {
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("app_id","628eeaace7f28c00089a60cc");
|
|
jsonObject.put("entry_id","666973a2507c72e064cc585d");
|
|
jsonObject.put("limit",10000);
|
|
if (!ID.isEmpty()) {
|
|
jsonObject.put("data_id", ID);
|
|
}
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
|
jsonArray.add("hphm");
|
|
|
|
|
|
jsonObject.put("fields",jsonArray);
|
|
JSONObject filter = new JSONObject();
|
|
filter.put("rel","and");
|
|
JSONArray cond = new JSONArray();
|
|
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
jsonObject1.put("field","hphm");
|
|
jsonObject1.put("method","eq");
|
|
JSONArray value = new JSONArray();
|
|
value.add("结束");
|
|
jsonObject1.put("value",value);
|
|
|
|
|
|
|
|
cond.add(jsonObject1);
|
|
|
|
filter.put("cond",cond);
|
|
jsonObject.put("filter",filter);
|
|
String jsonString = jsonObject.toJSONString();
|
|
String list = V5utils.list(jsonString);
|
|
JSONObject jsonObject2 = JSON.parseObject(list);
|
|
JSONArray jsonArray1 = jsonObject2.getJSONArray("data");
|
|
int size = jsonArray1.size();
|
|
if (size < 10000) {
|
|
for (Object o : jsonArray1) {
|
|
JSONObject test = (JSONObject) o;
|
|
jsonArrayEND.add(test);
|
|
|
|
|
|
|
|
}
|
|
b = false;
|
|
} else {
|
|
for (Object o : jsonArray1) {
|
|
JSONObject test = (JSONObject) o;
|
|
String id = test.getString("_id");
|
|
|
|
ID = id;
|
|
jsonArrayEND.add(test);
|
|
|
|
}
|
|
jsonObject.put("data_id", ID);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (Object o : jsonArrayEND ){
|
|
JSONObject TE = (JSONObject) o;
|
|
String id = TE.getString("_id");
|
|
|
|
String s = UpData.main1(id);
|
|
System.out.println(s);
|
|
}
|
|
}
|
|
|
|
|
|
} |