Преглед на файлове

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

沈静伟 преди 3 години
родител
ревизия
b7910fc70b

+ 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", "{}");
                 }

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/customer/tagents/SQL/经销商账号列表查询_主账号.sql

@@ -0,0 +1,2 @@
+select tenterprise_userid,t1.fname,t1.frole,t1.fphonenumber,t1.fisused,t1.fisadministrator from tenterprise_users t1
+where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$ and t1.fisadministrator=1 and t1.fusertype='¾­ÏúÉÌ' AND frole = '¹ÜÀíÔ±'

+ 11 - 1
src/dsb/com/cnd3b/restcontroller/customer/tagents/tagents.java

@@ -330,7 +330,17 @@ public class tagents extends Controller {
         SQLFactory sqlFactory = new SQLFactory(this, "¾­ÏúÉÌÕ˺ÅÁбí²éѯ");
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("tagentsid", tagentsid);
-        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
+        String sql = sqlFactory.getSQL();
+        Rows rows = dbConnect.runSqlQuery(sql);
+        if (content.containsKey("hasAdministrator") && "1".equals(content.getString("hasAdministrator"))) {
+            SQLFactory factory = new SQLFactory(this, "¾­ÏúÉÌÕ˺ÅÁбí²éѯ_Ö÷Õ˺Å");
+            factory.addParameter("siteid", siteid);
+            factory.addParameter("tagentsid", tagentsid);
+            Rows tempRows = dbConnect.runSqlQuery(factory.getSQL());
+            if(!tempRows.isEmpty()){
+                rows.add(0,tempRows.get(0));
+            }
+        }
 
         RowsMap attinfosMap = getAttachmentUrl("tenterprise_users", rows.toArrayList("tenterprise_userid"), "headportrait");
         for (Row row : rows) {

+ 9 - 3
src/dsb/com/cnd3b/restcontroller/system/im/imdialog/SQL/即时通讯群成员列表查询.sql

@@ -1,4 +1,10 @@
-select timdialogusersid,t1.tenterprise_userid,fname,case when t1.tenterprise_userid=t2.tenterprise_userid then 1 else 0 end as fisadministrator from timdialogusers t1
-inner join timdialog t2 on t1.siteid=t2.siteid and t1.timdialogid=t2.timdialogid
-where t1.siteid=$siteid$ and t1.timdialogid in $timdialogid$ and t1.fisremove=0
+select timdialogusersid,
+       t1.timdialogid,
+       t1.tenterprise_userid,
+       fname,
+       case when t1.tenterprise_userid = t2.tenterprise_userid then 1 else 0 end as fisadministrator
+from timdialogusers t1
+         inner join timdialog t2 on t1.siteid = t2.siteid and t1.timdialogid = t2.timdialogid
+where t1.siteid = $siteid$
+  and t1.timdialogid in $timdialogid$ and t1.fisremove=0