Просмотр исходного кода

供需新增状态查询字段
新增活动商户删除接口
供需分类查询新增附件返回
新增热门展商、热门展品接口
其他代码调整

沈静伟 4 лет назад
Родитель
Сommit
8568a0ea77

+ 8 - 5
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -46,6 +46,9 @@ public class supplyanddemand extends Controller {
             if (whereObject.containsKey("fissupply") && !"".equals(whereObject.getString("fissupply"))) {
                 where.append(" and t1.fissupply =").append(whereObject.getBooleanValue("fissupply") ? 1 : 0);
             }
+            if (whereObject.containsKey("fstatus") && !"".equals(whereObject.getString("fstatus"))) {
+                where.append(" and t1.fstatus ='").append(whereObject.getBooleanValue("fstatus")).append("' ");
+            }
         }
         SQLFactory sqlFactory = new SQLFactory(this, "供需列表查询", pageSize, pageNumber, sort);
         sqlFactory.addParameter("siteid", siteid);
@@ -70,7 +73,7 @@ public class supplyanddemand extends Controller {
         /**
          * 阅读次数+1
          */
-        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='"+siteid+"' and tsupplyanddemandid='"+tsupplyanddemandid+"'");
+        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
 
         SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
         sqlFactory.addParameter("siteid", siteid);
@@ -270,10 +273,10 @@ public class supplyanddemand extends Controller {
         if (!rows.isEmpty() && !"新建".equals(rows.get(0).getString("fstatus"))) {
             return getErrReturnObject().setErrMsg("当前状态不可删除").toString();
         }
-        SQLFactory sqlFactory=new SQLFactory(this,"供需删除");
-        sqlFactory.addParameter("siteid",siteid);
-        sqlFactory.addParameter("tagentsid",tagentsid);
-        sqlFactory.addParameter("tsupplyanddemandid",tsupplyanddemandid);
+        SQLFactory sqlFactory = new SQLFactory(this, "供需删除");
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("tagentsid", tagentsid);
+        sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
         String status = dbConnect.runSqlUpdate(sqlFactory.getSQL());
         if ("true".equals(status)) {
             return getSucReturnObject().toString();

+ 1 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/SQL/活动商户删除.sql

@@ -0,0 +1 @@
+delete from tactivity_agentmsg where siteid=$siteid$ and tactivityid=$tactivityid$  and tagentsid=$tagentsid$

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

@@ -194,6 +194,23 @@ public class activity extends Controller {
         return query_activityAgentMain();
     }
 
+    /**
+     * 删除活动商户
+     *
+     * @return
+     */
+    public String delete_activityAgent() throws D3bException, P2Exception {
+        long tactivityid = content.getLong("tactivityid");
+        long tagentsid = content.getLong("tagentsid");
+
+        SQLFactory sqlFactory = new SQLFactory(this, "活动商户删除");
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("tactivityid", tactivityid);
+        sqlFactory.addParameter("tagentsid", tagentsid);
+        dbConnect.runSqlUpdate(sqlFactory.getSQL());
+        return query_activityAgentMain();
+    }
+
     /**
      * 活动商户商品列表查询
      *

+ 12 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/system/supplyanddemand.java

@@ -3,7 +3,9 @@ package com.cnd3b.restcontroller.enterprise.system;
 import com.alibaba.fastjson.JSONObject;
 import com.cnd3b.common.Controller;
 import com.cnd3b.common.D3bException;
+import com.cnd3b.common.data.Row;
 import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.RowsMap;
 import com.cnd3b.common.data.SQLFactory;
 import p2.pao.PaoRemote;
 import p2.pao.PaoSetRemote;
@@ -23,6 +25,10 @@ public class supplyanddemand extends Controller {
         SQLFactory sql = new SQLFactory(this, "供需分类查询");
         sql.addParameter("siteid", siteid);
         Rows rows = dbConnect.runSqlQuery(sql.getSQL());
+        RowsMap map = getAttachmentUrl("ttypedetail", rows.toArrayList("ttypedetailid"));
+        for (Row row : rows) {
+            row.put("attinfos", map.get(row.getString("ttypedetailid")));
+        }
         return getSucReturnObject().setData(rows).saveToDataPool().toString();
     }
 
@@ -78,7 +84,11 @@ public class supplyanddemand extends Controller {
      * @return
      */
     public String query_typeselectList() {
-        Rows rows = dbConnect.runSqlQuery("select fvalue as ftype from ttypedetail where ftype = '供需分类' and siteid ='" + siteid + "' and fisused=1 order by sequence");
-        return getSucReturnObject().setData(rows.toArray("ftype")).toString();
+        Rows rows = dbConnect.runSqlQuery("select ttypedetailid,fvalue as ftype from ttypedetail where ftype = '供需分类' and siteid ='" + siteid + "' and fisused=1 order by sequence");
+        RowsMap map = getAttachmentUrl("ttypedetail", rows.toArrayList("ttypedetailid"));
+        for (Row row : rows) {
+            row.put("attinfos", map.get(row.getString("ttypedetailid")));
+        }
+        return getSucReturnObject().setData(rows).toString();
     }
 }

+ 0 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/商户主界面查询.sql

@@ -9,7 +9,6 @@ select t1.tagentsid,
        t1.fintroduction,
        t1.fdutyparagraph,
        t1.fisused,
-       --(stuff((select ',' + fprodclassname from tagents_prodclass where siteid = t1.siteid and tagentsid=t1.tagentsid for xml path('')),1,1,'')) as fprodclassname,
        count(t2.tenterprise_userid) as fteamsize,
        max(t3.flastrequestdate)as flastrequestdate,
        isnull(t1.saleprodclass,'[]')as saleprodclass

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

@@ -7,7 +7,6 @@ select t1.tagentsid,
        t1.fphonenumber,
        t1.fbrand,
        t1.fisused,
-       --(stuff((select ',' + fprodclassname from tagents_prodclass where siteid = t1.siteid and tagentsid=t1.tagentsid for xml path('')),1,1,'')) as fprodclassname,
        count(t2.tenterprise_userid) as fteamsize,
        max(t3.flastrequestdate)as flastrequestdate,
        isnull(t1.saleprodclass,'[]')as saleprodclass

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

@@ -1,7 +1,8 @@
-select channelid,tagentsid,t.fbrand,t.fprodclassname,count as fcount,t.channelcoverimageurl from (
+select channelid,tagentsid,t.fbrand,t.saleprodclass,count as fcount,t.channelcoverimageurl from (
 select ROW_NUMBER()over(partition by t1.channelid order by t1.time desc)as num,t1.channelid,t2.tagentsid,t1.count,t2.channelcoverimageurl,
-t3.fbrand,(stuff((select ',' + fprodclassname from tagents_prodclass where siteid = t3.siteid and tagentsid=t3.tagentsid for xml path('')),1,1,'')) as fprodclassname
+t3.fbrand,t3.saleprodclass
 from tlive_usercount t1
 inner join tlive t2 on t1.channelid=t2.channelid --and t2.livestatus='live'
 inner join tagents t3 on t2.siteid=t3.siteid and t2.tagentsid=t3.tagentsid
+where t2.tactivityid=$tactivityid$
 )t where t.num=1

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

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

+ 4 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/活动直播间观众总数查询.sql

@@ -0,0 +1,4 @@
+select count(0)fcount from tlive_viewlog t1
+inner join tlive t2 on t1.channelid=t2.channelid
+inner join tactivity t3 on t2.siteid=t3.siteid and t2.tactivityid=t3.tactivityid
+where t3.tactivityid=$tactivityid$

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/热门展品.sql

@@ -0,0 +1,2 @@
+select t1.tactivity_agentmsgid,t1.tagentsid,t1.flocationclass,t1.flocation,t1.fbrand,t1.fintroduction from tactivity_agentmsg t1
+where t1.tactivityid=$tactivityid$

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/热门展商.sql

@@ -0,0 +1,2 @@
+select t1.tactivity_agentmsgid,t1.tagentsid,t1.flocationclass,t1.flocation,t1.fbrand,t1.fintroduction from tactivity_agentmsg t1
+where t1.tactivityid=$tactivityid$

+ 17 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/认证商户列表查询.sql

@@ -0,0 +1,17 @@
+select t1.tagentsid,
+       t1.siteid,
+       t1.createdate,
+       t1.fagentname,
+       t1.faddress,
+       t1.fcontact,
+       t1.fphonenumber,
+       t1.fbrand,
+       t1.fisused,
+       count(t2.tenterprise_userid) as fteamsize,
+       max(t3.flastrequestdate)as flastrequestdate,
+       isnull(t1.saleprodclass,'[]')as saleprodclass
+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

+ 57 - 13
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -2,8 +2,11 @@ package com.cnd3b.restcontroller.publicmethod.live;
 
 import com.alibaba.fastjson.JSONObject;
 import com.cnd3b.common.Controller;
+import com.cnd3b.common.data.Row;
 import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.RowsMap;
 import com.cnd3b.common.data.SQLFactory;
+import org.apache.ibatis.jdbc.SQL;
 
 public class live extends Controller {
     public live(JSONObject content) {
@@ -16,24 +19,65 @@ public class live extends Controller {
      * @return
      */
     public String getLiveChannelData() {
-        Rows liveCountRows = dbConnect.runSqlQuery("select count(0)fcount from tlive where livestatus='live'");
-        Rows liverows = dbConnect.runSqlQuery(new SQLFactory(this, "当前线上观众人数查询").getSQL());
-        Rows totalcustCountrows = dbConnect.runSqlQuery("select count(0)fcount from tlive_viewlog");
-
+        String tactivityid = content.getString("tactivityid");
         JSONObject resultObject = new JSONObject();
-        //直播商户数
-        resultObject.put("flivecount", liveCountRows.isEmpty() ? 0 : liveCountRows.get(0).getInteger("fcount"));
-        //当前在线观众人数
-        resultObject.put("fcustcount", liverows.isEmpty() ? 0 : liverows.sum("fcount"));
-        //直播总时长
-        resultObject.put("ftotallivetime", 1000);
+        //参展商
+        SQLFactory agentcountSql = new SQLFactory(this, "活动直播间总数查询");
+        agentcountSql.addParameter("tactivityid", tactivityid);
+        Rows agentCountRows = agentcountSql.runSqlQuery();
+        resultObject.put("fagentcount", agentCountRows.isEmpty() ? 0 : agentCountRows.get(0).getInteger("fcount"));
+
         //观众总人数
+        SQLFactory custcountSql = new SQLFactory(this, "活动直播间观众总数查询");
+        custcountSql.addParameter("tactivityid", tactivityid);
+        Rows totalcustCountrows = custcountSql.runSqlQuery();
         resultObject.put("ftotalcustcount", totalcustCountrows.isEmpty() ? 0 : totalcustCountrows.get(0).getInteger("fcount"));
-        /**
-         * 直播列表
-         */
+
+        SQLFactory livecustcount = new SQLFactory(this, "当前线上观众人数查询");
+        livecustcount.addParameter("tactivityid", tactivityid);
+        Rows liverows = dbConnect.runSqlQuery(livecustcount.getSQL());
+        //正在直播数
+        resultObject.put("flivecount", liverows.size());
+        //当前在线观众人数
+        resultObject.put("fcustcount", liverows.isEmpty() ? 0 : liverows.sum("fcount"));
+        //直播列表
         resultObject.put("tlivelist", liverows);
         return getSucReturnObject().setData(resultObject).toString();
     }
 
+
+    /**
+     * 热门展商
+     *
+     * @return
+     */
+    public String agentList() {
+        String tactivityid = content.getString("tactivityid");
+        SQLFactory agentlistSql = new SQLFactory(this, "热门展商");
+        agentlistSql.addParameter("tactivityid", tactivityid);
+        Rows rows = agentlistSql.runSqlQuery();
+        RowsMap map = getAttachmentUrl("tactivity_agentmsg", rows.toArrayList("tactivity_agentmsgid"));
+        for (Row row : rows) {
+            row.put("attinfos", map.get(row.getString("tactivity_agentmsgid")));
+        }
+        return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
+    }
+
+    /**
+     * 热门展品
+     *
+     * @return
+     */
+    public String prodList() {
+        String tactivityid = content.getString("tactivityid");
+        SQLFactory agentlistSql = new SQLFactory(this, "热门展品");
+        agentlistSql.addParameter("tactivityid", tactivityid);
+        Rows rows = agentlistSql.runSqlQuery();
+        RowsMap map = getAttachmentUrl("tactivity_agentmsg", rows.toArrayList("tactivity_agentmsgid"));
+        for (Row row : rows) {
+            row.put("attinfos", map.get(row.getString("tactivity_agentmsgid")));
+        }
+        return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
+    }
+
 }