Browse Source

修复供需列表查询接口

吴志根 3 years ago
parent
commit
bce4514406

+ 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

+ 2 - 4
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -61,7 +61,7 @@ public class supplyanddemand extends Controller {
         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"));
 
@@ -78,13 +78,11 @@ public class supplyanddemand extends Controller {
         timnewmsgSQL.addParameter("siteid", siteid);
         timnewmsgSQL.addParameter("userid", userid);
         timnewmsgSQL.addParameter_in("timdialogid", dialogrows.toArrayList("timdialogid"));
-        System.err.println(dialogrows.toArrayList("timdialogid"));
-        // System.err.println(timnewmsgSQL.getSQL());
+        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) {
-                System.err.println(newmsg.getString("message"));
                 try {
                     newmsg.put("message", JSONObject.parseObject(newmsg.getString("message")));
                 }catch (Exception e){