|
|
@@ -20,13 +20,17 @@ import java.util.HashMap;
|
|
|
public class GetPolyvAnalysisData extends BaseClass implements Runnable {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- try {
|
|
|
- if (new SQLiteJDBC().checkServicesUsed("GetPolyvAnalysisData", false)) {
|
|
|
+ if (new SQLiteJDBC().checkServicesUsed("GetPolyvAnalysisData", false)) {
|
|
|
+ try {
|
|
|
getLiveStatusAndCoverImageUrl();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ try {
|
|
|
getLiveUserCount();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -63,33 +67,37 @@ public class GetPolyvAnalysisData extends BaseClass implements Runnable {
|
|
|
* 创建开播提醒消息
|
|
|
*/
|
|
|
private void createLiveMessage(String siteid, long tagentsid) {
|
|
|
- //如果从未直播状态变为直播状态,则创建系统消息提醒其合作商
|
|
|
- DBConnect dbConnect = new DBConnect();
|
|
|
- Rows agentRows = dbConnect.runSqlQuery("select * from tagents where siteid='" + siteid + "' and tagentsid='" + tagentsid + "'");
|
|
|
- if (!agentRows.isEmpty()) {
|
|
|
- String fbrand = agentRows.get(0).getString("fbrand");
|
|
|
- Rows useridRows = dbConnect.runSqlQuery("select distinct t2.tenterprise_userid from tagents_cooperation t1 inner join tenterprise_users t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid where t1.tagentsid='" + tagentsid + "'");//获取其所有合作商的账号列表
|
|
|
- ArrayList<String> userids = useridRows.toArrayList("tenterprise_userid");
|
|
|
- SQLFactory factory = new SQLFactory(this, "系统消息插入");
|
|
|
- factory.addParameter("siteid", siteid);
|
|
|
- factory.addParameter("ftype", "商户");
|
|
|
- factory.addParameter("ftitle", "开播提醒");
|
|
|
- factory.addParameter("fmessage", "合作商户" + fbrand + "正在直播!");
|
|
|
- factory.addParameter_in("tenterprise_userid", userids);
|
|
|
- factory.addParameter("objectid", "null");
|
|
|
- factory.addParameter("objectname", "null");
|
|
|
- dbConnect.runSqlUpdate(factory.getSQL());
|
|
|
- for (String id : userids) {
|
|
|
- long userid = Long.parseLong(id);
|
|
|
- if (parameter.websocketClients.containsKey(userid)) {
|
|
|
- JSONObject methodobject = new JSONObject();
|
|
|
- methodobject.put("type", "remind");//提醒
|
|
|
- methodobject.put("text", "合作商户" + fbrand + "正在直播!");
|
|
|
- for (WebClientSocket webClientSocket : parameter.websocketClients.get(userid).values()) {
|
|
|
- webClientSocket.sendSystemMessage(methodobject);
|
|
|
+ try {
|
|
|
+ //如果从未直播状态变为直播状态,则创建系统消息提醒其合作商
|
|
|
+ DBConnect dbConnect = new DBConnect();
|
|
|
+ Rows agentRows = dbConnect.runSqlQuery("select * from tagents where siteid='" + siteid + "' and tagentsid='" + tagentsid + "'");
|
|
|
+ if (!agentRows.isEmpty()) {
|
|
|
+ String fbrand = agentRows.get(0).getString("fbrand");
|
|
|
+ Rows useridRows = dbConnect.runSqlQuery("select distinct t2.tenterprise_userid from tagents_cooperation t1 inner join tenterprise_users t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid where t1.tagentsid='" + tagentsid + "'");//获取其所有合作商的账号列表
|
|
|
+ ArrayList<String> userids = useridRows.toArrayList("tenterprise_userid");
|
|
|
+ SQLFactory factory = new SQLFactory(this, "系统消息插入");
|
|
|
+ factory.addParameter("siteid", siteid);
|
|
|
+ factory.addParameter("ftype", "商户");
|
|
|
+ factory.addParameter("ftitle", "开播提醒");
|
|
|
+ factory.addParameter("fmessage", "合作商户" + fbrand + "正在直播!");
|
|
|
+ factory.addParameter_in("tenterprise_userid", userids);
|
|
|
+ factory.addParameter("objectid", "null");
|
|
|
+ factory.addParameter("objectname", "null");
|
|
|
+ dbConnect.runSqlUpdate(factory.getSQL());
|
|
|
+ for (String id : userids) {
|
|
|
+ long userid = Long.parseLong(id);
|
|
|
+ if (parameter.websocketClients.containsKey(userid)) {
|
|
|
+ JSONObject methodobject = new JSONObject();
|
|
|
+ methodobject.put("type", "remind");//提醒
|
|
|
+ methodobject.put("text", "合作商户" + fbrand + "正在直播!");
|
|
|
+ for (WebClientSocket webClientSocket : parameter.websocketClients.get(userid).values()) {
|
|
|
+ webClientSocket.sendSystemMessage(methodobject);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|