Parcourir la source

供需列表查询_对接中调整

吴志根 il y a 3 ans
Parent
commit
bd004eabb4

+ 20 - 0
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/供需列表查询_对接中.sql

@@ -0,0 +1,20 @@
+select
+    t1.tsupplyanddemandid,
+    t1.fissupply,
+    t1.ftype,
+    t1.ftitle,
+    t1.fcontent,
+    t1.fstatus,
+    t1.createby,
+    t1.checkby,
+    t1.checkdate,
+    t1.fenddate,
+    t2.fagentname,
+    t1.freadtimes,
+    t1.tenterprise_userid,
+    t1.tagentsid,
+    (select count(0) from timdialog where siteid=t1.siteid and ownertable='tsupplyanddemand' and ownerid=t1.tsupplyanddemandid) as fcommunicationtimes
+from tsupplyanddemand t1
+         inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
+         inner join timdialogusers t3 on t3.TENTERPRISE_USERID= $userid$ and t1.TIMDIALOGID_TALKING=t3.timdialogid
+where t1.siteid=$siteid$ and t1.fstatus not in ('н¨') and $where$

+ 13 - 3
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -27,6 +27,7 @@ public class supplyanddemand extends Controller {
      * @return
      */
     public String query_supplyanddemandList() {
+        String fstatus = "";
         /**
          *排序条件设置
          */
@@ -50,15 +51,24 @@ public class supplyanddemand extends Controller {
                 where.append(" and t1.fissupply =").append(whereObject.getBooleanValue("fissupply") ? 1 : 0);
             }
             if (whereObject.containsKey("fstatus") && !"".equals(whereObject.getString("fstatus"))) {
+                fstatus = whereObject.getString("fstatus");
                 if ("对接中".equals(whereObject.getString("fstatus"))) {
-                    where.append(" and t1.fstatus ='").append(whereObject.getString("fstatus")).append("' and tenterprise_userid!=" + userid);
+                    where.append(" and t1.fstatus ='").append(whereObject.getString("fstatus")).append("' and t1.tenterprise_userid !=" + userid);
                 } else {
                     where.append(" and t1.fstatus ='").append(whereObject.getString("fstatus")).append("'");
                 }
             }
         }
-        SQLFactory sqlFactory = new SQLFactory(this, "供需列表查询", pageSize, pageNumber, sort);
+        SQLFactory sqlFactory;
+        if (fstatus.equals("对接中")) {
+            sqlFactory = new SQLFactory(this, "供需列表查询_对接中", pageSize, pageNumber, sort);
+        } else {
+            sqlFactory = new SQLFactory(this, "供需列表查询", pageSize, pageNumber, sort);
+        }
+
+
         sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("userid", userid);
         sqlFactory.addParameter_SQL("where", where);
 
 //        System.err.println(sqlFactory.getSQL());
@@ -87,7 +97,7 @@ public class supplyanddemand extends Controller {
             for (Row newmsg : newmsgrows) {
                 try {
                     newmsg.put("message", JSONObject.parseObject(newmsg.getString("message")));
-                }catch (Exception e){
+                } catch (Exception e) {
                     e.printStackTrace();
                     newmsg.put("message", "{}");
                 }