|
|
@@ -1,7 +1,9 @@
|
|
|
package com.cnd3b.service;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.cnd3b.common.BaseClass;
|
|
|
+import com.cnd3b.common.data.Row;
|
|
|
import com.cnd3b.common.data.Rows;
|
|
|
import com.cnd3b.common.data.RowsMap;
|
|
|
import com.cnd3b.common.data.SQLFactory;
|
|
|
@@ -23,6 +25,7 @@ public class GetPolyvAnalysisData extends BaseClass implements Runnable {
|
|
|
public void run() {
|
|
|
if (new SQLiteJDBC().checkServicesUsed("GetPolyvAnalysisData", false)) {
|
|
|
try {
|
|
|
+ checkChannelids();
|
|
|
getLiveStatusAndCoverImageUrl();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -35,12 +38,35 @@ public class GetPolyvAnalysisData extends BaseClass implements Runnable {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * ¼ì²éƵµÀºÅ
|
|
|
+ */
|
|
|
+ public void checkChannelids() {
|
|
|
+ Polyv polyv = new Polyv();
|
|
|
+ JSONArray channelids = polyv.getChannelids();
|
|
|
+ if (channelids != null) {
|
|
|
+ ArrayList<String> list = new ArrayList<>();
|
|
|
+ for (Object o : channelids) {
|
|
|
+ list.add(String.valueOf(o));
|
|
|
+ }
|
|
|
+ DBConnect dbConnect = new DBConnect();
|
|
|
+ Rows channelRows = dbConnect.runSqlQuery("select channelid from tlive");
|
|
|
+ for (Row row : channelRows) {
|
|
|
+ String channelid = row.getString("channelid");
|
|
|
+ if (!list.contains(channelid)) {
|
|
|
+ System.err.println(channelid);
|
|
|
+ dbConnect.runSqlUpdate("update tlive set livestatus='deleted' where channelid='" + channelid + "'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* ͬ²½ÆµµÀÖ±²¥×´Ì¬,¼°»ñȡֱ²¥·âÃæÍ¼
|
|
|
*/
|
|
|
public void getLiveStatusAndCoverImageUrl() {
|
|
|
DBConnect dbConnect = new DBConnect();
|
|
|
- Rows channelRows = dbConnect.runSqlQuery("select channelid,livestatus,tagentsid,siteid from tlive");
|
|
|
+ Rows channelRows = dbConnect.runSqlQuery("select channelid,livestatus,tagentsid,siteid from tlive where livestatus!='deleted'");
|
|
|
String[] channelids = channelRows.toArray("channelid");
|
|
|
RowsMap map = channelRows.toRowsMap("channelid");
|
|
|
Polyv polyv = new Polyv();
|