代码说明
This commit is contained in:
85
src/main/java/com/example/sso/newcontroller/DingShi1.java
Normal file
85
src/main/java/com/example/sso/newcontroller/DingShi1.java
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
package com.example.sso.newcontroller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class DingShi1 {
|
||||||
|
@Scheduled(cron = "0/5 * 6-23 1-15 * ?")
|
||||||
|
public void main1() {
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","68a7c86a0499bc38086d05ce");
|
||||||
|
jsonObject.put("limit",1);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","_widget_1724117232219");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray value = new JSONArray();
|
||||||
|
value.add("");
|
||||||
|
jsonObject1.put("value",value);
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("field","_widget_1717727492391");
|
||||||
|
jsonObject2.put("method","eq");
|
||||||
|
JSONArray value1 = new JSONArray();
|
||||||
|
value1.add("是");
|
||||||
|
jsonObject2.put("value",value1);
|
||||||
|
|
||||||
|
JSONObject jsonObject6 = new JSONObject();
|
||||||
|
jsonObject6.put("field","_widget_1724396148712");
|
||||||
|
jsonObject6.put("method","empty");
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
cond.add(jsonObject6);
|
||||||
|
cond.add(jsonObject2);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
System.out.println("我是数据 " +list );
|
||||||
|
|
||||||
|
JSONObject jsonObject3 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject3.getJSONArray("data");
|
||||||
|
for (Object o : data){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("_id");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject4.put("entry_id","68a7c86a0499bc38086d05ce");
|
||||||
|
jsonObject4.put("data_id",id);
|
||||||
|
JSONObject jsonObject5 = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject _widget_1717726834808 = new JSONObject();
|
||||||
|
_widget_1717726834808.put("value","是");
|
||||||
|
jsonObject5.put("_widget_1724396148712",_widget_1717726834808);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject4.put("data",jsonObject5);
|
||||||
|
|
||||||
|
String string1 = jsonObject4.toJSONString();
|
||||||
|
V5utils.updata(string1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
85
src/main/java/com/example/sso/newcontroller/DingShi2.java
Normal file
85
src/main/java/com/example/sso/newcontroller/DingShi2.java
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
package com.example.sso.newcontroller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class DingShi2 {
|
||||||
|
|
||||||
|
@Scheduled(cron = "0/5 * 6-23 1-19 * ?")
|
||||||
|
public void main2(){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","665fd98bf718f1edcc00377c");
|
||||||
|
jsonObject.put("limit",1);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","_widget_1724117232219");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray value = new JSONArray();
|
||||||
|
value.add("");
|
||||||
|
jsonObject1.put("value",value);
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("field","_widget_1717727492391");
|
||||||
|
jsonObject2.put("method","eq");
|
||||||
|
JSONArray value1 = new JSONArray();
|
||||||
|
value1.add("是");
|
||||||
|
jsonObject2.put("value",value1);
|
||||||
|
|
||||||
|
JSONObject jsonObject6 = new JSONObject();
|
||||||
|
jsonObject6.put("field","_widget_1724396148712");
|
||||||
|
jsonObject6.put("method","empty");
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
cond.add(jsonObject6);
|
||||||
|
cond.add(jsonObject2);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
System.out.println("我是数据 " +list );
|
||||||
|
|
||||||
|
JSONObject jsonObject3 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject3.getJSONArray("data");
|
||||||
|
for (Object o : data){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("_id");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject4.put("entry_id","665fd98bf718f1edcc00377c");
|
||||||
|
jsonObject4.put("data_id",id);
|
||||||
|
JSONObject jsonObject5 = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject _widget_1717726834808 = new JSONObject();
|
||||||
|
_widget_1717726834808.put("value","是");
|
||||||
|
jsonObject5.put("_widget_1724396148712",_widget_1717726834808);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject4.put("data",jsonObject5);
|
||||||
|
|
||||||
|
String string1 = jsonObject4.toJSONString();
|
||||||
|
V5utils.updata(string1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.sso.newcontroller;
|
||||||
|
|
||||||
|
import com.example.sso.newdao.*;
|
||||||
|
|
||||||
|
public class ZhiKongDelete {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
DeleteZhiKong.main1();
|
||||||
|
DeleteZhiKong1.main2();
|
||||||
|
DeleteZhiKong2.main3();
|
||||||
|
DeleteZhiKong3.main4();
|
||||||
|
DeleteZhiKong4.main5();
|
||||||
|
DeleteZhiKong5.main6();
|
||||||
|
DeleteZhiKong6.main7();
|
||||||
|
DeleteZhiKong7.main8();
|
||||||
|
DeleteZhiKong8.main9();
|
||||||
|
}
|
||||||
|
}
|
||||||
107
src/main/java/com/example/sso/newdao/DeleteZhiKong.java
Normal file
107
src/main/java/com/example/sso/newdao/DeleteZhiKong.java
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong {
|
||||||
|
|
||||||
|
public static void main1() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","68abd504bf5e56180dde9e99");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd504bf5e56180dde9e99");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd504bf5e56180dde9e99");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd504bf5e56180dde9e99");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
105
src/main/java/com/example/sso/newdao/DeleteZhiKong1.java
Normal file
105
src/main/java/com/example/sso/newdao/DeleteZhiKong1.java
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong1 {
|
||||||
|
public static void main2() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","68abd55a0499bc3808879f02");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd55a0499bc3808879f02");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd55a0499bc3808879f02");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd55a0499bc3808879f02");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
105
src/main/java/com/example/sso/newdao/DeleteZhiKong2.java
Normal file
105
src/main/java/com/example/sso/newdao/DeleteZhiKong2.java
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong2 {
|
||||||
|
public static void main3() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","68abd53ebf5e56180ddea983");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd53ebf5e56180ddea983");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd53ebf5e56180ddea983");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "68abd53ebf5e56180ddea983");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
105
src/main/java/com/example/sso/newdao/DeleteZhiKong3.java
Normal file
105
src/main/java/com/example/sso/newdao/DeleteZhiKong3.java
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong3 {
|
||||||
|
public static void main4() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","694e589f2b2ce8cf41e165c0");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e589f2b2ce8cf41e165c0");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e589f2b2ce8cf41e165c0");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e589f2b2ce8cf41e165c0");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
107
src/main/java/com/example/sso/newdao/DeleteZhiKong4.java
Normal file
107
src/main/java/com/example/sso/newdao/DeleteZhiKong4.java
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong4 {
|
||||||
|
|
||||||
|
public static void main5() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
105
src/main/java/com/example/sso/newdao/DeleteZhiKong5.java
Normal file
105
src/main/java/com/example/sso/newdao/DeleteZhiKong5.java
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong5 {
|
||||||
|
public static void main6() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","6667e754f718f1edcc1ba298");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
105
src/main/java/com/example/sso/newdao/DeleteZhiKong6.java
Normal file
105
src/main/java/com/example/sso/newdao/DeleteZhiKong6.java
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong6 {
|
||||||
|
public static void main7() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","66696a25f718f1edcc29d436");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
105
src/main/java/com/example/sso/newdao/DeleteZhiKong7.java
Normal file
105
src/main/java/com/example/sso/newdao/DeleteZhiKong7.java
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong7 {
|
||||||
|
public static void main8() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","66626e72f718f1edcc1063eb");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
105
src/main/java/com/example/sso/newdao/DeleteZhiKong8.java
Normal file
105
src/main/java/com/example/sso/newdao/DeleteZhiKong8.java
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.sso.newdao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.V5utils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteZhiKong8 {
|
||||||
|
public static void main9() {
|
||||||
|
|
||||||
|
Boolean flag = true;
|
||||||
|
String id = "";
|
||||||
|
List<String> lists = new ArrayList<>();
|
||||||
|
while (flag){
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject.put("entry_id","6667dd8a09f3185646f17f81");
|
||||||
|
jsonObject.put("limit",10000);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("createTime");
|
||||||
|
jsonObject.put("fields",fields);
|
||||||
|
if (!id.equals("")){
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String list = V5utils.list(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(list);
|
||||||
|
JSONArray data = jsonObject1.getJSONArray("data");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int size = data.size();
|
||||||
|
log.info("我是长度 " + size);
|
||||||
|
|
||||||
|
|
||||||
|
if (size < 10000 ) {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
for (Object o : data) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("_id");
|
||||||
|
lists.add(string);
|
||||||
|
id = string;
|
||||||
|
if (lists.size() == 100) {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "665ea38ef718f1edccf7b20d");
|
||||||
|
jsonObject2.put("entry_id", "694e2e9f4997401c0bc48444");
|
||||||
|
jsonObject2.put("data_ids", lists);
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
log.info("我是删除参数 " + jsonString1);
|
||||||
|
V5utils.deletes(jsonString1);
|
||||||
|
lists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user