Преглед на файлове

展会直播详情查询关联活动表,只在活动期间才可进行展会直播数据查询
活动删除增加活动状态判断
管理端新建展会直播时,需选择活动名称

沈静伟 преди 4 години
родител
ревизия
e045ca1622

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

@@ -1,5 +1,7 @@
 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
+       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 tactivity t3 on t1.siteid=t3.siteid and t1.tactivityid=t3.tactivity and t3.fstatus='»î¶¯ÖÐ'
 where t1.siteid=$siteid$ and t1.categoryName='Õ¹»áÖ±²¥' and t1.tagentsid = $tagentsid$

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

@@ -296,6 +296,10 @@ public class activity extends Controller {
      */
     public String delete_activity() {
         long tactivityid = content.getLong("tactivityid");
+        Rows rows = dbConnect.runSqlQuery("select fstatus from tactivity where siteid='" + siteid + "' and tactivityid=" + tactivityid);
+        if (!rows.isEmpty() && !"未开始".equals(rows.get(0).getString("fstatus"))) {
+            return getErrReturnObject().setErrMsg(rows.get(0).getString("fstatus") + "状态不可删除").toString();
+        }
         SQLFactory sqlFactory = new SQLFactory(this, "活动删除");
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("tactivityid", tactivityid);

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

@@ -97,6 +97,7 @@ public class live extends Controller {
         long tagentsid = content.getLong("tagentsid");
         String channelname = content.getString("channelname");
         int categoryid = content.getInteger("categoryid");
+        long tactivityid = content.getLongValue("tactivityid");
         String channelPasswd = createPassWord();
         Polyv polyv = new Polyv();
         LiveChannelResponse liveChannelResponse = polyv.createChannel(channelname, channelPasswd, categoryid);
@@ -106,6 +107,9 @@ public class live extends Controller {
             tlive.setValue("siteid", siteid);
             tlive.setValue("tagentsid", tagentsid);
             tlive.setValue("categoryid", categoryid);//分类ID
+            if (tactivityid > 0) {
+                tlive.setValue("tactivityid", tactivityid);//活动ID
+            }
             tlive.setValue("categoryname", polyv.listCategory().get(categoryid));//分类名称
             tlive.setValue("channelid", liveChannelResponse.getChannelId());//频道ID
             tlive.setValue("channelname", liveChannelResponse.getName());//频道名称