Przeglądaj źródła

Merge remote-tracking branch 'origin/develop' into develop

沈静伟 4 lat temu
rodzic
commit
3252dc3811

+ 2 - 2
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/供需详情查询_对话框列表.sql

@@ -1,4 +1,4 @@
-select t1.timdialogid, t1.createdate,  t2.fname, t2.funreadmsgcount, fdatastatus
+select t1.timdialogid, t1.createdate,  t2.fname, t2.funreadmsgcount, t1.fdatastatus
 from timdialog t1
          inner join timdialogusers t2 on t1.siteid = t2.siteid and t1.timdialogid = t2.timdialogid
         -- inner join tenterprise_users t3 on t2.siteid = t3.siteid and t2.tenterprise_userid = t3.tenterprise_userid
@@ -7,5 +7,5 @@ where t1.siteid = $siteid$
   and t1.ownertable = 'tsupplyanddemand'
   and t1.ownerid in $tsupplyanddemandid$
   and t1.fdatastatus = '2'
-  and t1.tenterprise_userid = $userid$
+  and t2.tenterprise_userid = $userid$
 --order by (select MAX (timdialogmessageid) timdialogmessageid from timdialogmessage where siteid=$siteid$ and timdialogid=t1.timdialogid group by timdialogid) desc

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/即时通讯群最新消息查询.sql

@@ -1,7 +1,7 @@
 select t1.timdialogid,t1.fmessagetype as message,t1.fmessageobj,t3.fname,t1.createdate,t1.ownertable,t1.ownerid,t1.tenterprise_userid from timdialogmessage t1
 inner join (
 select siteid,timdialogid,MAX(timdialogmessageid)timdialogmessageid from timdialogmessage
-where siteid=$siteid$ and timdialogid in $timdialogid$ and tenterprise_userid != $userid$
+where siteid=$siteid$ and timdialogid in $timdialogid$ and tenterprise_userid = $userid$
 group by siteid,timdialogid
 )t2 on t1.siteid=t2.siteid and t1.timdialogid=t2.timdialogid and t1.timdialogmessageid=t2.timdialogmessageid
 left join timdialogusers t3 on t1.siteid=t3.siteid and t1.timdialogid=t3.timdialogid and t1.tenterprise_userid=t3.tenterprise_userid

+ 22 - 11
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -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) {