Pārlūkot izejas kodu

短信发送对接
直播统计数据代码整理

沈静伟 4 gadi atpakaļ
vecāks
revīzija
85eef80075

+ 1 - 1
src/dsb/com/cnd3b/common/restful/SQL/持久化账号列表查询.sql

@@ -32,4 +32,4 @@ from tenterprise_users t1
          left join tpayinfo t6 on t1.siteid = t6.siteid and ((t1.fusertype = '¾­ÏúÉÌ' and t1.tagentsid = t6.tagentsid) or
                                                              (t1.fusertype = 'ÆóÒµ' and t1.tenterprise_userid = t6.tenterprise_userid)) and
                                   t6.fbegdate <= GETDATE() and t6.fenddate >= GETDATE()
-where t1.accesstoken=$accesstoken$ and t1.fisused=1
+where t1.accesstoken=$accesstoken$ and t1.fisused=1 order by fisadministrator desc,t1.tenterprise_userid desc

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/customer/live/SQL/私域直播详情.sql

@@ -1,5 +1,5 @@
 select t1.tliveid, t1.siteid, t1.createby, t1.changeby, t1.createdate, t1.changedate,
        t1.tactivityid, t1.tliveapplyid, t1.tagentsid, t1.fliveurl_web,t1.fliveurl_client, t1.fliveshowurl,
        t1.categoryid,t1.categoryname, t1.channelname, t1.channelpasswd, t1.channelid,t1.fassistanturl,t1.fisneedauth,t1.secretkey,t1.livestatus,t1.channelcoverimageurl from tlive t1
-                                                                                                                                                                                 inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
+inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
 where t1.siteid=$siteid$ and t1.categoryName='˽ÓòÖ±²¥' and t1.tagentsid = $tagentsid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/customer/live/SQL/观看人数.sql

@@ -1,7 +1,7 @@
 SELECT SUM
            (t1.num) as num
 FROM (
-         SELECT mobileuniqueviewer + pcuniqueviewer AS num
+         SELECT isnull(mobileuniqueviewer,0) + isnull(pcuniqueviewer,0) AS num
          FROM tlive_data
          WHERE channelid = $channelid$
      ) AS t1

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/customer/live/SQL/观看时长.sql

@@ -1,7 +1,7 @@
 SELECT SUM
            (t1.num) as num
 FROM (
-         SELECT PCPLAYDURATION + MOBILEPLAYDURATION AS num
+         SELECT isnull(PCPLAYDURATION,0) + isnull(MOBILEPLAYDURATION,0) AS num
          FROM tlive_data
          WHERE channelid = $channelid$
      ) AS t1

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/customer/live/SQL/观看次数.sql

@@ -1,7 +1,7 @@
 SELECT SUM
            (t1.num) as num
 FROM (
-         SELECT PCVIDEOVIEW + MOBILEVIDEOVIEW AS num
+         SELECT isnull(PCVIDEOVIEW,0) + isnull(MOBILEVIDEOVIEW,0) AS num
          FROM tlive_data
          WHERE channelid = $channelid$
      ) AS t1

+ 0 - 2
src/dsb/com/cnd3b/restcontroller/customer/live/live.java

@@ -110,8 +110,6 @@ public class live extends Controller {
         } else {
             return getSucReturnObject().setData(rows).toString();
         }
-
-
     }
 
     /**

+ 3 - 3
src/dsb/com/cnd3b/restcontroller/enterprise/live/live.java

@@ -129,7 +129,7 @@ public class live extends Controller {
             tliveSet.save();
 
         } else {
-            return getErrReturnObject().toString();
+            return getErrReturnObject().setErrMsg("直播间创建失败!").toString();
         }
         return queryChannelMain();
     }
@@ -175,7 +175,7 @@ public class live extends Controller {
         Polyv polyv = new Polyv();
         String secretKey = polyv.updateChannelAuthExternal(channelid);
         if (secretKey == null) {
-            return getErrReturnObject().toString();
+            return getErrReturnObject().setErrMsg("开启直播间外部授权失败!").toString();
         } else {
             String fliveshowurl = "https://www.buwanjia.com/customer/index.html#/authLiveLogin?tliveid=" + tliveid;
             String status = dbConnect.runSqlUpdate("update tlive set fliveshowurl='" + fliveshowurl + "', fisneedauth=1,secretkey='" + secretKey + "' where siteid='" + siteid + "' and tliveid='" + tliveid + "'");
@@ -209,7 +209,7 @@ public class live extends Controller {
                 return getErrReturnObject().setErrMsg(status).toString();
             }
         } else {
-            return getErrReturnObject().toString();
+            return getErrReturnObject().setErrMsg("关闭直播间外部授权失败").toString();
         }
     }
 

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/优质商户.sql

@@ -1,2 +1,2 @@
 select t1.tagentsid,t1.saleprodclass,t1.fbrand,t1.fagentname from tagents t1
-where t1.saleprodclass=$saleprodclass$ and t1.siteid=$siteid$
+where t1.ftype!='¸öÈË' and t1.saleprodclass=$saleprodclass$ and t1.siteid=$siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/优质商户_全部.sql

@@ -1,2 +1,2 @@
 select t1.tagentsid,t1.saleprodclass,t1.fbrand,t1.fagentname from tagents t1
-where  t1.siteid=$siteid$
+where t1.ftype!='¸öÈË' and t1.siteid=$siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/品类观众人数占比.sql

@@ -1,5 +1,5 @@
 select t3.flocationclass,count(0)fcount from tlive_viewlog t1
 inner join tlive t2 on t1.channelid=t2.channelid
 inner join tactivity_agentmsg t3 on t2.siteid=t3.siteid and t2.tactivityid=t3.tactivityid and t2.tagentsid=t3.tagentsid
---where currentday=convert(varchar(10),getdate(),120)
+where t2.tactivityid=$tactivityid$ and t2.siteid=$siteid$
 group by t3.flocationclass

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/商户观众总数排行.sql

@@ -1,5 +1,5 @@
 select t3.fbrand,count(0)fcount from tlive_viewlog t1
 inner join tlive t2 on t1.channelid=t2.channelid
 inner join tactivity_agentmsg t3 on t2.siteid=t3.siteid and t2.tactivityid=t3.tactivityid and t2.tagentsid=t3.tagentsid
---where currentday=convert(varchar(10),getdate(),120)
+where t2.tactivityid=$tactivityid$ and t2.siteid=$siteid$
 group by t3.fbrand order by count(0) desc

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/活动直播间总数查询.sql

@@ -1 +1,2 @@
-select count(0)fcount from tlive where livestatus='live' and tactivityid=$tactivityid$ and siteid=$siteid$
+select count(0)fcount from tlive
+where livestatus='live' and tactivityid=$tactivityid$ and siteid=$siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/线上观众人数趋势.sql

@@ -1,3 +1,3 @@
 select right(convert(varchar(16),time,120),5)as time,max(count) as fcount from tlive_usercount
---where convert(varchar(10),time,120)=convert(varchar(10),getdate(),120)
+where convert(varchar(10),time,120)=convert(varchar(10),getdate(),120)
 group by convert(varchar(16),time,120) order by time

+ 4 - 3
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/观看渠道人数占比.sql

@@ -1,3 +1,4 @@
-select ismobile,count(0)fcount from tlive_viewlog
---where currentday=convert(varchar(10),getdate(),120)
-group by ismobile
+select t1.ismobile,count(0)fcount from tlive_viewlog t1
+inner join tlive t2 on t1.channelid=t2.channelid
+where t2.tactivityid=$tactivityid$ and t2.siteid=$siteid$
+group by t1.ismobile

+ 4 - 3
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/观看直播地区人数占比.sql

@@ -1,3 +1,4 @@
-select province,city,count(0)fcount from tlive_viewlog
---where currentday=convert(varchar(10),getdate(),120)
-group by province,city
+select t1.province,t1.city,count(0)fcount from tlive_viewlog t1
+inner join tlive t2 on t1.channelid=t2.channelid
+where t2.tactivityid=$tactivityid$ and t2.siteid=$siteid$
+group by t1.province,t1.city

+ 17 - 16
src/dsb/com/cnd3b/utility/Sms.java

@@ -17,12 +17,12 @@ import java.util.HashMap;
 public class Sms extends BaseClass {
     public static void main(String[] args) {
         Sms sms = new Sms();
-        //  sms.sendout("13732579910", "12345");
-        System.err.println(sms.queryBalance());
+        sms.sendOutMsg("13732579910","123112" );
+        //System.err.println(sms.queryBalance());
     }
 
     public void sendOutMsg(String phone, String msg) {
-        msg = "【布万家】您好,您的验证码" + msg;
+        msg = "【布万家】您好,您的验证码" + msg;
         sendout(msg, phone);
     }
 
@@ -38,6 +38,7 @@ public class Sms extends BaseClass {
         map.put("extend", "");//自定义扩展码
         JSONObject js = (JSONObject) JSONObject.toJSON(map);
         String result = sendSmsByPost(sendUrl, js.toString());
+        System.err.println(result);
         PaoSetRemote tsmslogSet = null;
         try {
             JSONObject json = JSONObject.parseObject(result);
@@ -46,28 +47,28 @@ public class Sms extends BaseClass {
             String time = json.getString("time");
             String errorMsg = json.getString("errorMsg");
 
-            tsmslogSet = getP2ServerSystemPaoSet("tsmslog");
-            PaoRemote pao = tsmslogSet.addAtEnd();
-            pao.setValue("createdate", Calendar.getInstance().getTime(), 11L);
-            pao.setValue("fmsg", msg, 11L);
-            pao.setValue("fphonenumber", phone, 11L);
-            pao.setValue("code", code, 11L);
-            pao.setValue("msgid", msgid, 11L);
-            pao.setValue("time", time, 11L);
-            pao.setValue("errorMsg", errorMsg, 11L);
-
-            tsmslogSet.save();
+//            tsmslogSet = getP2ServerSystemPaoSet("tsmslog");
+//            PaoRemote pao = tsmslogSet.addAtEnd();
+//            pao.setValue("createdate", Calendar.getInstance().getTime(), 11L);
+//            pao.setValue("fmsg", msg, 11L);
+//            pao.setValue("fphonenumber", phone, 11L);
+//            pao.setValue("code", code, 11L);
+//            pao.setValue("msgid", msgid, 11L);
+//            pao.setValue("time", time, 11L);
+//            pao.setValue("errorMsg", errorMsg, 11L);
+//
+//            tsmslogSet.save();
         } catch (Exception e) {
             e.printStackTrace();
         } finally {
             try {
-                tsmslogSet.close();
+                //tsmslogSet.close();
             } catch (Exception e) {
                 e.printStackTrace();
             }
         }
     }
-    
+
     public String queryBalance() {
         //查询余额
         String balanceUrl = "https://smssh1.253.com/msg/balance/json";