|
|
@@ -126,9 +126,30 @@ public class imdialog extends Controller {
|
|
|
*/
|
|
|
String[] sortfield = {"t1.createdate desc"};
|
|
|
String sort = getSort(sortfield, "t1.createdate desc");
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 过滤条件设置
|
|
|
+ */
|
|
|
+ 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.fnotes like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("begdate") && !"".equals(whereObject.getString("begdate"))) {
|
|
|
+ where.append(" and convert(varchar(10),t1.createdate,120)>=").append("'").append(whereObject.getString("begdate")).append("'");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
|
|
|
+ where.append(" and convert(varchar(10),t1.createdate,120)<=").append("'").append(whereObject.getString("enddate")).append("'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
SQLFactory timdialogSQL = new SQLFactory(this, "即时通讯群历史消息查询", pageSize, pageNumber, sort);
|
|
|
timdialogSQL.addParameter("siteid", siteid);
|
|
|
timdialogSQL.addParameter("timdialogid", timdialogid);
|
|
|
+ timdialogSQL.addParameter("where", where);
|
|
|
Rows rows = dbConnect.runSqlQuery(timdialogSQL.getSQL());
|
|
|
for (Row row : rows) {
|
|
|
String message = row.getString("message");
|
|
|
@@ -271,7 +292,7 @@ public class imdialog extends Controller {
|
|
|
*/
|
|
|
public String closeSubject() throws D3bException, P2Exception {
|
|
|
long timsubjectid = content.getLongValue("timsubjectid"); //话题ID 新增时默认传0
|
|
|
- String status = dbConnect.runSqlUpdate("update timsubject set fisclose=1,closedate=getDate() where siteid='" + siteid + "' and timsubjectid='" + timsubjectid+"'");
|
|
|
+ String status = dbConnect.runSqlUpdate("update timsubject set fisclose=1,closedate=getDate() where siteid='" + siteid + "' and timsubjectid='" + timsubjectid + "'");
|
|
|
if ("true".equals(status)) {
|
|
|
return getSucReturnObject().toString();
|
|
|
} else {
|
|
|
@@ -321,12 +342,11 @@ public class imdialog extends Controller {
|
|
|
public String queryDialogUncloseSubject() {
|
|
|
long timdialogid = content.getLongValue("timdialogid");
|
|
|
Rows rows = dbConnect.runSqlQuery("select timsubjectid from timsubject where siteid='" + siteid + "' and timdialogid='" + timdialogid + "' and fisclose=0 order by timsubjectid desc");
|
|
|
- if(!rows.isEmpty()){
|
|
|
+ if (!rows.isEmpty()) {
|
|
|
long timsubjectid = rows.get(0).getLong("timsubjectid");
|
|
|
- content.put("timsubjectid",timsubjectid);
|
|
|
+ content.put("timsubjectid", timsubjectid);
|
|
|
return querySubject();
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
}
|