|
@@ -10,12 +10,14 @@ import com.cnd3b.common.data.RowsMap;
|
|
|
import com.cnd3b.common.data.SQLFactory;
|
|
|
import com.cnd3b.common.parameter.parameter;
|
|
|
import com.cnd3b.common.websocket.WebClientSocket;
|
|
|
+import com.cnd3b.utility.Encryption;
|
|
|
import org.apache.ibatis.jdbc.SQL;
|
|
|
import p2.pao.PaoRemote;
|
|
|
import p2.pao.PaoSetRemote;
|
|
|
import p2.util.P2Exception;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
|
|
|
public class imdialog extends Controller {
|
|
|
|
|
@@ -117,6 +119,32 @@ public class imdialog extends Controller {
|
|
|
row.put("usertotalcount", userrows.size());
|
|
|
row.put("useronlinecount", onlinecount);
|
|
|
}
|
|
|
+ if (content.containsKey("message")) {
|
|
|
+ //初始聊天记录,话题
|
|
|
+ JSONObject messageObject = content.getJSONObject("message");
|
|
|
+ long messageuserid = messageObject.getJSONObject("sendfrom").getLong("userid");
|
|
|
+ messageObject.put("timdialogid", timdialogid);
|
|
|
+ messageObject.put("fdatetime", getDateTime_Str());
|
|
|
+ messageObject.put("fmessageid", new Encryption().Encode_MD5(siteid + messageuserid + Calendar.getInstance().getTimeInMillis()));
|
|
|
+
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "即时通讯群消息插入");
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ sqlFactory.addParameter("fnotes", "话题回复");
|
|
|
+ sqlFactory.addParameter("timdialogid", timdialogid);
|
|
|
+ sqlFactory.addParameter("tenterprise_userid", messageuserid);
|
|
|
+ sqlFactory.addParameter("fmessageobj", messageObject.toJSONString());
|
|
|
+ sqlFactory.addParameter("fmessageid", messageObject.getString("messageid"));
|
|
|
+ sqlFactory.addParameter("fmessagetype", messageObject.getString("ftype"));
|
|
|
+
|
|
|
+ if ("data".equals(messageObject.getString("ftype"))) {
|
|
|
+ sqlFactory.addParameter("ownerid", messageObject.getJSONObject("data").getString("ownerid"));
|
|
|
+ sqlFactory.addParameter("ownertable", messageObject.getJSONObject("data").getString("ownertable"));
|
|
|
+ } else {
|
|
|
+ sqlFactory.addParameter("ownerid", "null");
|
|
|
+ sqlFactory.addParameter("ownertable", "null");
|
|
|
+ }
|
|
|
+ dbConnect.runSqlUpdate(sqlFactory.getSQL());
|
|
|
+ }
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
@@ -422,10 +450,8 @@ public class imdialog extends Controller {
|
|
|
Rows rows = dbConnect.runSqlQuery("select fisclose from timsubject where siteid='" + siteid + "' and timsubjectid=" + timsubjectid);
|
|
|
if (!rows.isEmpty() && !rows.get(0).getBoolean("fisclose")) {
|
|
|
dbConnect.runSqlUpdate("update timsubjectanalysis set fisanswer=1,fanswertime=getDate() where siteid='" + siteid + "' and timsubjectid='" + timsubjectid + "' and tenterprise_userid='" + userid + "' and fisanswer=0");
|
|
|
- return getSucReturnObject().toString();
|
|
|
- } else {
|
|
|
- return getErrReturnObject().setErrMsg("话题已关闭或不存在").toString();
|
|
|
}
|
|
|
+ return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
|
/**
|