Browse Source

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

沈静伟 3 years ago
parent
commit
7d391ab81b

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

@@ -24,7 +24,7 @@ select t1.tliveid,
        t2.fbrand
 from tlive t1
          inner join tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
-         inner join tactivity t3 on t1.siteid = t3.siteid and t1.tactivityid = t3.tactivityid and t3.fstatus = '»î¶¯ÖÐ'
+         inner join tactivity t3 on t1.siteid = t3.siteid and t1.tactivityid = t3.tactivityid
 where t1.siteid = $siteid$
   and t1.categoryName = 'Õ¹»áÖ±²¥'
   and t1.tagentsid = $tagentsid$

+ 2 - 2
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/获取浏览电话分享前十.sql

@@ -1,7 +1,7 @@
-select top 10 isnull(t2.fname,'ÄäÃû') fname, t1.createdate, t1.tenterprise_userid,t2.fphonenumber
+select top 10 isnull(t2.fname,'ÄäÃû') fname, t1.createdate, t1.tenterprise_userid,t2.fphonenumber,t1.tsupplyanddemandid
 from tsupplyanddemand_log t1
          left JOIN tenterprise_users t2
                    ON t1.tenterprise_userid = t2.tenterprise_userid
-WHERE t1.tsupplyanddemandid = $tsupplyanddemandid$
+WHERE t1.tsupplyanddemandid in $tsupplyanddemandid$
   AND t1.ftype = $ftype$
 order by t1.createdate desc

+ 26 - 16
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -126,7 +126,7 @@ public class supplyanddemand extends Controller {
 //         * 阅读次数+1
 //         */
 //        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
-        addsupplyanddemandLog(tsupplyanddemandid, 1,userid);
+        addsupplyanddemandLog(tsupplyanddemandid, 1, userid);
         SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
@@ -230,10 +230,18 @@ public class supplyanddemand extends Controller {
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         RowsMap attinfoRowsMap = getAttachmentUrl("tsupplyanddemand", rows.toArrayList("tsupplyanddemandid"));
 
+        RowsMap readRowsMap = getTop10Rows(rows.toArrayList("tsupplyanddemandid"),1).toRowsMap("tsupplyanddemandid");
+        RowsMap phoneRowsMap = getTop10Rows(rows.toArrayList("tsupplyanddemandid"),2).toRowsMap("tsupplyanddemandid");
+        RowsMap shareRowsMap = getTop10Rows(rows.toArrayList("tsupplyanddemandid"),3).toRowsMap("tsupplyanddemandid");
+
         for (Row row : rows) {
             row.put("attinfos", attinfoRowsMap.get(row.getString("tsupplyanddemandid")));
             //创建者头像
             row.put("headportraiturl", getHeadPic(row.getLong("tenterprise_userid")));
+            row.put("read", readRowsMap.get(row.getString("tsupplyanddemandid")));
+            row.put("phone", phoneRowsMap.get(row.getString("tsupplyanddemandid")));
+            row.put("share", shareRowsMap.get(row.getString("tsupplyanddemandid")));
+            row.put("indexTab", 0);
         }
         return getSucReturnObject().setDataByPaging(rows).saveToDataPool().toString();
     }
@@ -393,10 +401,10 @@ public class supplyanddemand extends Controller {
      */
     public String deletesupplyanddemand() {
         long tsupplyanddemandid = content.getLongValue("tsupplyanddemandid");
-        Rows rows = dbConnect.runSqlQuery("select * from tsupplyanddemand where siteid='" + siteid + "' and tagentsid='" + tagentsid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
-        if (!rows.isEmpty() && !"新建".equals(rows.get(0).getString("fstatus"))) {
-            return getErrReturnObject().setErrMsg("当前状态不可删除").toString();
-        }
+//        Rows rows = dbConnect.runSqlQuery("select * from tsupplyanddemand where siteid='" + siteid + "' and tagentsid='" + tagentsid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
+//        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);
@@ -420,7 +428,7 @@ public class supplyanddemand extends Controller {
         long tenterprise_userid = content.getLong("tenterprise_userid");
 
 
-        addsupplyanddemandLog(tsupplyanddemandid, ftype,tenterprise_userid);
+        addsupplyanddemandLog(tsupplyanddemandid, ftype, tenterprise_userid);
 
         return getSucReturnObject().toString();
 
@@ -431,7 +439,7 @@ public class supplyanddemand extends Controller {
      *
      * @return
      */
-    public void addsupplyanddemandLog(Long tsupplyanddemandid, int ftype,long tenterprise_userid) throws P2Exception {
+    public void addsupplyanddemandLog(Long tsupplyanddemandid, int ftype, long tenterprise_userid) throws P2Exception {
         /**
          * 阅读次数+1
          */
@@ -484,9 +492,9 @@ public class supplyanddemand extends Controller {
     }
 
     public int getTimesSQl(Long tenterprise_userid, int ftype) {
-        SQLFactory sqlFactory = new SQLFactory(this,"查询分享电话浏览总数");
-        sqlFactory.addParameter("tenterprise_userid",tenterprise_userid);
-        sqlFactory.addParameter("ftype",ftype);
+        SQLFactory sqlFactory = new SQLFactory(this, "查询分享电话浏览总数");
+        sqlFactory.addParameter("tenterprise_userid", tenterprise_userid);
+        sqlFactory.addParameter("ftype", ftype);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         if (rows.isEmpty()) {
             return 0;
@@ -503,20 +511,23 @@ public class supplyanddemand extends Controller {
     public String getsupplyanddemandLogTop10() {
         Long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
 
+        ArrayList<String> list = new ArrayList<>();
+        list.add(String.valueOf(tsupplyanddemandid));
 
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("read", getTop10Rows(tsupplyanddemandid, 1));
-        jsonObject.put("phone", getTop10Rows(tsupplyanddemandid, 2));
-        jsonObject.put("share", getTop10Rows(tsupplyanddemandid, 3));
+        jsonObject.put("read", getTop10Rows(list, 1));
+        jsonObject.put("phone", getTop10Rows(list, 2));
+        jsonObject.put("share", getTop10Rows(list, 3));
+
 
         return getSucReturnObject().setData(jsonObject).toString();
 
 
     }
 
-    public Rows getTop10Rows(Long tsupplyanddemandid, int ftype) {
+    public Rows getTop10Rows(ArrayList<String> tsupplyanddemandid, int ftype) {
         SQLFactory sqlFactory = new SQLFactory(this, "获取浏览电话分享前十");
-        sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
+        sqlFactory.addParameter_in("tsupplyanddemandid", tsupplyanddemandid);
         sqlFactory.addParameter("ftype", ftype);
 
         Rows rows = dbConnect.runSqlQuery(sqlFactory);
@@ -536,7 +547,6 @@ public class supplyanddemand extends Controller {
     public String getsupplyanddemandLogList() {
         Long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
         int ftype = content.getIntValue("ftype");
-
         SQLFactory sqlFactory = new SQLFactory(this, "获取浏览电话分享", pageSize, pageNumber, "t1.createdate desc");
         sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
         sqlFactory.addParameter("ftype", ftype);

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/bannermag/bannermag.java

@@ -35,6 +35,8 @@ public class bannermag extends Controller {
                 bannerrow.put("attinfos", getAttachmentUrl("tbannermag", bannerrow.getString("tbannermagid")));
             }
             locationrow.put("banner", bannerRows);
+            locationrow.put("servicehotline", "13157370035");
+            locationrow.put("webclienturl", "https://www.buwanjia.com/customer/index.html");
         }
         return getSucReturnObject().setData(locationrows).toString();
     }

+ 3 - 2
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/门户直播列表.sql

@@ -25,8 +25,9 @@ select t1.tliveid,
        t2.fbrand
 from tlive t1
          inner join tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
-where t1.siteid = $siteid$
-  and t1.livestatus like $livestatus$
+where t1.siteid = $siteid$ and t1.channelcoverimageurl not LIKE '%defaultChannelSplash.jpg'
+
+and $where$
 
 
 

+ 41 - 6
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -123,11 +123,25 @@ public class live extends Controller {
      * @return
      */
     public String getHomeLive() {
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t2.fagentname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t2.fbrand like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
         //直播状态 unStart:未开始 live:直播中 end:已结束 waiting:等待中 playback:回放中
         String livestatus = content.getString("livestatus");
-        SQLFactory sqlFactory = new SQLFactory(this, "门户直播列表", pageSize, pageNumber, "t1.createdate");
+        SQLFactory sqlFactory = new SQLFactory(this, "门户直播列表", pageSize, pageNumber, "t1.livestatus,t1.createdate");
         sqlFactory.addParameter("siteid", siteid);
-        sqlFactory.addParameter("livestatus", "%" + livestatus + "%");
+//        sqlFactory.addParameter("livestatus", "%" + livestatus + "%");
+        sqlFactory.addParameter_SQL("where", where);
         Rows agentRows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         for (Row row : agentRows) {
             //观看次数(次)
@@ -136,10 +150,15 @@ public class live extends Controller {
             long viewers = getCount("直播观看人数", "num", channelid);
             row.put("viewers", viewers);
         }
-//        //true:表示审核
-//        if (parameter.isminiapp()) {
-//            agentRows = new Rows();
-//        }
+        //true:表示审核
+        String sqlPara = "SELECT isminiapp from tparameter  ";
+        Rows rowsPara = dbConnect.runSqlQuery(sqlPara);
+        if (!rowsPara.isEmpty()) {
+            if (rowsPara.get(0).getBoolean("isminiapp")) {
+                agentRows = new Rows();
+            }
+
+        }
 //        return getSucReturnObject().setDataByPaging(new Rows()).preloading(1).toString();
         return getSucReturnObject().setDataByPaging(agentRows).preloading(1).toString();
     }
@@ -151,6 +170,22 @@ public class live extends Controller {
         return rows.isEmpty() ? 0 : rows.get(0).getLong(fieldname);
     }
 
+    /**
+     * 小程序审核专用:是否开启直播
+     *
+     * @return
+     */
+    public String isminiapp() {
+        int isminiapp = content.getIntValue("isminiapp");
+        String sqlPara = "UPDATE tparameter SET isminiapp = '" + isminiapp + "'";
+        String res = dbConnect.runSqlUpdate(sqlPara);
+        if (res.equals("true")) {
+            return getSucReturnObject().toString();
+        } else {
+            return getErrReturnObject().toString();
+        }
+    }
+
 
     /**
      * 热门展商