|
|
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
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.SQLFactory;
|
|
|
import p2.pao.PaoRemote;
|
|
|
import p2.pao.PaoSetRemote;
|
|
|
@@ -28,19 +30,65 @@ public class imdialog extends Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
public String query_imdialogList() {
|
|
|
-
|
|
|
- return "";
|
|
|
+ /**
|
|
|
+ * 过滤条件设置
|
|
|
+ */
|
|
|
+ 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("t1.fimdialogname like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ SQLFactory timdialogSQL = new SQLFactory(this, "即时通讯普通群列表查询");
|
|
|
+ timdialogSQL.addParameter("siteid", siteid);
|
|
|
+ timdialogSQL.addParameter("tenterprise_userid", userid);
|
|
|
+ timdialogSQL.addParameter_SQL("where", where);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(timdialogSQL.getSQL());
|
|
|
+ return getSucReturnObject().setData(rows).saveToDataPool().toString();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 群对话框主界面查询
|
|
|
+ * 群主界面查询
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public String query_imdialogMain() {
|
|
|
- return "";
|
|
|
+ SQLFactory timdialogSQL = new SQLFactory(this, "即时通讯群主界面查询");
|
|
|
+ timdialogSQL.addParameter("siteid", siteid);
|
|
|
+ timdialogSQL.addParameter("tenterprise_userid", userid);
|
|
|
+ timdialogSQL.addParameter("timdialogid", content.getString("timdialogid"));
|
|
|
+
|
|
|
+ Rows rows = dbConnect.runSqlQuery(timdialogSQL.getSQL());
|
|
|
+ for (Row row : rows) {
|
|
|
+ SQLFactory timdialoguserSQL = new SQLFactory(this, "即时通讯群成员列表查询");
|
|
|
+ timdialoguserSQL.addParameter("siteid", siteid);
|
|
|
+ timdialoguserSQL.addParameter("timdialogid", content.getString("timdialogid"));
|
|
|
+ Rows userrows = dbConnect.runSqlQuery(timdialoguserSQL.getSQL());
|
|
|
+ row.put("users", userrows);
|
|
|
+ }
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 群消息查询
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String query_imdialogMssage() {
|
|
|
+ /**
|
|
|
+ *排序条件设置
|
|
|
+ */
|
|
|
+ String[] sortfield = {"t1.createdate desc"};
|
|
|
+ String sort = getSort(sortfield, "t1.createdate desc");
|
|
|
+ SQLFactory timdialogSQL = new SQLFactory(this, "即时通讯群历史消息查询", pageSize, pageNumber, sort);
|
|
|
+ timdialogSQL.addParameter("siteid", siteid);
|
|
|
+ timdialogSQL.addParameter("timdialogid", content.getString("timdialogid"));
|
|
|
+ Rows rows = dbConnect.runSqlQuery(timdialogSQL.getSQL());
|
|
|
+ return getSucReturnObject().setDataByPaging(rows).toString();
|
|
|
+ }
|
|
|
|
|
|
public String insertOrModify() throws D3bException, P2Exception {
|
|
|
long timdialogid = content.getLongValue("timdialogid"); //群ID 新增时默认传0
|