浏览代码

Merge remote-tracking branch 'origin/develop' into develop

沈静伟 3 年之前
父节点
当前提交
5248d7f92e

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/activity/SQL/活动商户列表查询.sql

@@ -1,5 +1,6 @@
 select t1.tactivity_agentmsgid, t1.tagentsid, t1.tactivityid,t2.fagentname, t1.fbrand, t1.fintroduction,t1.flocationclass, t1.fcontact, t1.fphonenumber,
-       t1.flocation,t1.fstatus
+       t1.flocation,t1.fstatus,t3.channelid
 from tactivity_agentmsg t1
 inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
+left join tlive t3 on  t1.tagentsid=t3.tagentsid
 where t1.siteid=$siteid$ and t1.tactivityid=$tactivityid$ and $where$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/activity/activity.java

@@ -130,7 +130,7 @@ public class activity extends Controller {
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("tactivityid", tactivityid);
         sqlFactory.addParameter_SQL("where", where);
-
+       // String sql = sqlFactory.getSQL();
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         RowsMap brandlogoRowsMap = getAttachmentUrl("tagents", rows.toArrayList("tagentsid"), "brandlogo");
         for (Row row : rows) {

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

@@ -47,8 +47,8 @@ public class live extends Controller {
         /**
          *排序条件设置
          */
-        String[] sortfield = {"t1.livestatus,t1.createdate desc"};
-        String sort = getSort(sortfield, "t1.livestatus,t1.createdate desc");
+        String[] sortfield = {"case t1.livestatus when 'waiting' then 0 else '' end,t1.createdate desc"};
+        String sort = getSort(sortfield, "case t1.livestatus when 'waiting' then 0 else '' end,t1.createdate desc");
         /**
          * 过滤条件设置
          */

+ 8 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/查询重复的商户.sql

@@ -0,0 +1,8 @@
+SELECT tagentsid
+FROM tagents t1
+         INNER JOIN (
+    SELECT fbrand, faddress, fagentname
+    FROM tagents
+    WHERE tagentsid IN (
+        SELECT tagentsid
+        FROM tlive)) t2 ON t1.fbrand = t2.fbrand AND t1.faddress = t2.faddress AND t2.fagentname = t1.fagentname

+ 4 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/认证商户列表查询.sql

@@ -14,4 +14,7 @@ from tagents t1
 inner join tenterprise_users t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
 left join tuserrequestlog t3 on t1.siteid = t3.siteid and t2.tenterprise_userid = t3.tenterprise_userid
 where t1.siteid =$siteid$ and $where$ and t1.ftype!='¸öÈË'
-group by t1.tagentsid,t1.siteid,t1.createdate,t1.fagentname,t1.faddress,t1.fcontact,t1.fphonenumber,t1.fbrand,t1.fisused,t1.saleprodclass
+group by t1.tagentsid,t1.siteid,t1.createdate,t1.fagentname,t1.faddress,t1.fcontact,t1.fphonenumber,t1.fbrand,t1.fisused,t1.saleprodclass
+
+--select * from tagents A where not exists(select 1 from tagents where fbrand=A.fbrand and faddress=A.faddress and fagentname=A.fagentname and tagentsid<A.tagentsid)
+-- and t1.tagentsidnot in $tagentsid$

+ 9 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/tagents.java

@@ -59,6 +59,7 @@ public class tagents extends Controller {
      * @return
      */
     public String query_agentsList() {
+
         /**
          * 过滤条件设置
          */
@@ -88,11 +89,19 @@ public class tagents extends Controller {
                         "and isnull(tactivityid,0)='' and tagentsid=t1.tagentsid) ");
             }
         }
+//        Rows tRows = dbConnect.runSqlQuery(" SELECT DISTINCT tagentsid FROM tlive");
+//        SQLFactory sqlFactory2 = new SQLFactory(this, "查询重复的商户");
+//        Rows tRows2 = dbConnect.runSqlQuery(sqlFactory2.getSQL());
+//        tRows.addAll(tRows2);
         SQLFactory agentsql = new SQLFactory(this, "认证商户列表查询", pageSize, pageNumber, "t1.tagentsid desc");
         agentsql.addParameter("siteid", siteid);
         agentsql.addParameter_SQL("where", where);
+        //排除掉已经创建直播的商户
+//        agentsql.addParameter_in("tagentsid",tRows.toArrayList("tagentsid"));
         Rows rows = dbConnect.runSqlQuery(agentsql.getSQL());
 
+        String sql = agentsql.getSQL();
+
         SQLFactory agentchecksql = new SQLFactory(this, "商户认证时间查询");
         agentchecksql.addParameter("siteid", siteid);
         agentchecksql.addParameter_in("tagentsid", rows.toArrayList("tagentsid"));

+ 9 - 5
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/当前线上观众人数查询.sql

@@ -1,5 +1,5 @@
 select channelid,
-       tagentsid,
+       t.tagentsid,
        t.fbrand,
        t.flocationclass,
        t.flocation,
@@ -7,12 +7,13 @@ select channelid,
        t.livestatus,
        count as fcustcount,
        t.channelcoverimageurl,
+       t4.saleprodclass,
        fliveshowurl
 from (
          select ROW_NUMBER() over(partition by t1.channelid order by t1.time desc)as num,t1.channelid,
                 t2.tagentsid,
                 t2.livestatus,
-                (t1.count+t1.fadjustcount)as count,
+                (t1.count + t1.fadjustcount)as count,
                 t2.channelcoverimageurl,
                 t2.fliveshowurl,
                 t3.fbrand,
@@ -20,9 +21,12 @@ from (
                 t3.flocation,
                 t3.fintroduction
          from tlive_usercount t1
-                  inner join tlive t2 on t1.channelid = t2.channelid and t2.livestatus = 'live'
-                  inner join tactivity_agentmsg t3 on t2.siteid = t3.siteid and t2.tagentsid = t3.tagentsid
+             inner join tlive t2
+         on t1.channelid = t2.channelid and t2.livestatus = 'live'
+             inner join tactivity_agentmsg t3 on t2.siteid = t3.siteid and t2.tagentsid = t3.tagentsid
          where t2.tactivityid = $tactivityid$
            and t2.siteid = $siteid$
      ) t
-where t.num = 1
+         left join tagents t4 on t4.tagentsid = t.tagentsid
+where t.num = 1
+  and t4.saleprodclass LIKE $saleprodclass$

+ 7 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -20,6 +20,10 @@ public class live extends Controller {
      */
     public String getLiveChannelData() {
         String tactivityid = content.getString("tactivityid");
+        String saleprodclass = content.getString("saleprodclass");
+        if(saleprodclass==null){
+            saleprodclass = "";
+        }
         JSONObject resultObject = new JSONObject();
         //参展商
         SQLFactory agentcountSql = new SQLFactory(this, "活动直播间总数查询");
@@ -38,8 +42,11 @@ public class live extends Controller {
         SQLFactory livecustcount = new SQLFactory(this, "当前线上观众人数查询");
         livecustcount.addParameter("tactivityid", tactivityid);
         livecustcount.addParameter("siteid", siteid);
+        livecustcount.addParameter("saleprodclass","%"+saleprodclass+"%");
         Rows liverows = dbConnect.runSqlQuery(livecustcount.getSQL());
 
+        String sql = livecustcount.getSQL();
+
         SQLFactory brandcustcount = new SQLFactory(this, "商户观众总数排行");
         brandcustcount.addParameter("tactivityid", tactivityid);
         brandcustcount.addParameter("siteid", siteid);