|
|
@@ -8,6 +8,9 @@ import com.cnd3b.common.data.Rows;
|
|
|
import com.cnd3b.common.data.SQLFactory;
|
|
|
import com.cnd3b.common.data.db.DataPool;
|
|
|
import com.cnd3b.utility.polyv.Polyv;
|
|
|
+import p2.pao.PaoRemote;
|
|
|
+import p2.pao.PaoSetRemote;
|
|
|
+import p2.util.P2Exception;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
@@ -92,11 +95,21 @@ public class live extends Controller {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public String getSYLiveInfo() {
|
|
|
+ public String getSYLiveInfo() throws P2Exception {
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "私域直播详情");
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
- return getSucReturnObject().setData(rows).toString();
|
|
|
+ if (rows.isEmpty()) {
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tliveapply", "siteid = '" + siteid + "' AND fissecret = 1 AND fstatus = '申请'");
|
|
|
+ if (paoSetRemote.isEmpty()) {
|
|
|
+ return getErrReturnObject().setErrCode("3").setErrMsg("无直播间信息").toString();
|
|
|
+ } else {
|
|
|
+ return getErrReturnObject().setErrCode("2").setErrMsg("直播申请中").toString();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -125,19 +138,6 @@ public class live extends Controller {
|
|
|
return getSucReturnObject().setData(resultObject).toString();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取数量
|
|
|
- *
|
|
|
- * @param SQLMODELNAME SQL名称
|
|
|
- * @param fieldname 取数据的字段名称
|
|
|
- * @return
|
|
|
- */
|
|
|
- public double getCount(String SQLMODELNAME, String fieldname) {
|
|
|
- SQLFactory sqlFactory = new SQLFactory(this, SQLMODELNAME);
|
|
|
- sqlFactory.addParameter("siteid", siteid);
|
|
|
- Rows rows = sqlFactory.runSqlQuery();
|
|
|
- return rows.isEmpty() ? 0 : rows.get(0).getDouble(fieldname);
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 私域直播用户观看列表
|
|
|
@@ -152,5 +152,49 @@ public class live extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 私域直播申请
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String applySYLive() throws P2Exception {
|
|
|
+
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tliveapply", "siteid = '" + siteid + "' AND fissecret = 1 AND fstatus = '申请'");
|
|
|
+ if (paoSetRemote.isEmpty()) {
|
|
|
+ PaoRemote paoRemote = paoSetRemote.addAtEnd();
|
|
|
+ paoRemote.setValue("CHANGEBY", username, 11L);
|
|
|
+ paoRemote.setValue("CHANGEDATE", getDateTime_Str(), 11L);
|
|
|
+ paoRemote.setValue("CREATEBY", username, 11L);
|
|
|
+ paoRemote.setValue("CREATEDATE", getDateTime_Str(), 11L);
|
|
|
+ paoRemote.setValue("FISSECRET", true, 11L);
|
|
|
+ paoRemote.setValue("FSTATUS", "申请", 11L);
|
|
|
+ paoRemote.setValue("FNOTES", "私域直播申请", 11L);
|
|
|
+ paoRemote.setValue("SITEID", siteid);
|
|
|
+ paoRemote.setValue("TAGENTSID", tagentsid);
|
|
|
+ saveDataLog(paoRemote);
|
|
|
+ paoSetRemote.save();
|
|
|
+ return getSucReturnObject().setData("私域直播申请成功").toString();
|
|
|
+ } else {
|
|
|
+ return getErrReturnObject().setErrMsg("私域直播已申请").toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取数量
|
|
|
+ *
|
|
|
+ * @param SQLMODELNAME SQL名称
|
|
|
+ * @param fieldname 取数据的字段名称
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public double getCount(String SQLMODELNAME, String fieldname) {
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, SQLMODELNAME);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ Rows rows = sqlFactory.runSqlQuery();
|
|
|
+ return rows.isEmpty() ? 0 : rows.get(0).getDouble(fieldname);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|