|
|
@@ -50,45 +50,56 @@ public class supplyanddemand extends Controller {
|
|
|
where.append(" and t1.fissupply =").append(whereObject.getBooleanValue("fissupply") ? 1 : 0);
|
|
|
}
|
|
|
if (whereObject.containsKey("fstatus") && !"".equals(whereObject.getString("fstatus"))) {
|
|
|
- where.append(" and t1.fstatus ='").append(whereObject.getString("fstatus")).append("' ");
|
|
|
+ if ("对接中".equals(whereObject.getString("fstatus"))) {
|
|
|
+ where.append(" and t1.fstatus ='").append(whereObject.getString("fstatus")).append("' and tenterprise_userid!=" + userid);
|
|
|
+ } else {
|
|
|
+ where.append(" and t1.fstatus ='").append(whereObject.getString("fstatus")).append("'");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "供需列表查询", pageSize, pageNumber, sort);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ System.err.println(sqlFactory.getSQL());
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
RowsMap attinfoRowsMap = getAttachmentUrl("tsupplyanddemand", rows.toArrayList("tsupplyanddemandid"));
|
|
|
|
|
|
|
|
|
-
|
|
|
SQLFactory dialoglistSQL = new SQLFactory(this, "供需详情查询_对话框列表");
|
|
|
dialoglistSQL.addParameter("siteid", siteid);
|
|
|
- dialoglistSQL.addParameter("userid",userid);
|
|
|
+ dialoglistSQL.addParameter("userid", userid);
|
|
|
dialoglistSQL.addParameter_in("tsupplyanddemandid", rows.toArrayList("tsupplyanddemandid"));
|
|
|
System.err.println(dialoglistSQL.getSQL());
|
|
|
+
|
|
|
Rows dialogrows = dbConnect.runSqlQuery(dialoglistSQL.getSQL());
|
|
|
|
|
|
SQLFactory timnewmsgSQL = new SQLFactory(this, "即时通讯群最新消息查询");
|
|
|
timnewmsgSQL.addParameter("siteid", siteid);
|
|
|
- timnewmsgSQL.addParameter("userid",userid);
|
|
|
+ timnewmsgSQL.addParameter("userid", userid);
|
|
|
timnewmsgSQL.addParameter_in("timdialogid", dialogrows.toArrayList("timdialogid"));
|
|
|
+ System.err.println(timnewmsgSQL.getSQL());
|
|
|
RowsMap newmsgmap = timnewmsgSQL.runSqlQuery().toRowsMap("timdialogid");
|
|
|
for (Row drow : dialogrows) {
|
|
|
Rows newmsgrows = newmsgmap.get(drow.getString("timdialogid"));
|
|
|
for (Row newmsg : newmsgrows) {
|
|
|
- newmsg.put("message", JSONObject.parseObject(newmsg.getString("message")));
|
|
|
+ try {
|
|
|
+ newmsg.put("message", JSONObject.parseObject(newmsg.getString("message")));
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ newmsg.put("message", "{}");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
newmsg.put("fisonline", parameter.websocketClients.containsKey(newmsg.getLong("tenterprise_userid")) ? 1 : 0);
|
|
|
}
|
|
|
drow.put("latestnews", newmsgrows);//最新消息
|
|
|
}
|
|
|
- RowsMap map= dialogrows.toRowsMap("tsupplyanddemandid");
|
|
|
+ RowsMap map = dialogrows.toRowsMap("timdialogid");
|
|
|
|
|
|
for (Row row : rows) {
|
|
|
-
|
|
|
- row.put("imdialogs", map.get(row.getString("tsupplyanddemandid")));
|
|
|
+ System.err.println("row:"+row.getString("timdialogid"));
|
|
|
+ row.put("imdialogs", map.get(row.getString("timdialogid")));
|
|
|
//附件信息
|
|
|
row.put("attinfos", attinfoRowsMap.get(row.getString("tsupplyanddemandid")));
|
|
|
//创建者头像
|
|
|
@@ -239,7 +250,7 @@ public class supplyanddemand extends Controller {
|
|
|
|
|
|
SQLFactory timnewmsgSQL = new SQLFactory(this, "即时通讯群最新消息查询");
|
|
|
timnewmsgSQL.addParameter("siteid", siteid);
|
|
|
- timnewmsgSQL.addParameter("userid",userid);
|
|
|
+ timnewmsgSQL.addParameter("userid", userid);
|
|
|
timnewmsgSQL.addParameter_in("timdialogid", dialogrows.toArrayList("timdialogid"));
|
|
|
RowsMap newmsgmap = timnewmsgSQL.runSqlQuery().toRowsMap("timdialogid");
|
|
|
for (Row row : dialogrows) {
|