فهرست منبع

供需字段调整,新增阅读次数和沟通次数

沈静伟 4 سال پیش
والد
کامیت
9a8b6cbd7e

+ 3 - 1
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/供需列表查询.sql

@@ -7,7 +7,9 @@ t1.fcontent,
 t1.fstatus,
 t1.checkdate,
 t1.fenddate,
-t2.fagentname
+t2.fagentname,
+t1.freadtimes,
+(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
 where t1.siteid=$siteid$ and t1.fstatus not in ('н¨') and $where$

+ 4 - 2
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/供需详情查询.sql

@@ -1,8 +1,10 @@
 select t1.tsupplyanddemandid, t1.ftitle,t1.fissupply,
        t1.ftype, t1.fstatus, t1.checkdate,
        t1.fenddate,t1.tcooperationagentsid,t2.fagentname,t3.fname,t3.fphonenumber,
-       t1.fcontent,t1.tenterprise_userid
+       t1.fcontent,t1.tenterprise_userid,
+       t1.freadtimes,
+       (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 tenterprise_users t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
-where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$ and tsupplyanddemandid=$tsupplyanddemandid$
+where t1.siteid=$siteid$ and tsupplyanddemandid=$tsupplyanddemandid$

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/我的供需列表查询.sql

@@ -8,7 +8,8 @@ t1.fstatus,
 t1.checkdate,
 t1.fenddate,
 t2.fagentname,
-10 as fcommunicationtimes,
+t1.freadtimes,
+(select count(0) from timdialog where siteid=t1.siteid and ownertable='tsupplyanddemand' and ownerid=t1.tsupplyanddemandid) as fcommunicationtimes,
 t1.tcooperationagentsid,
 t3.fagentname as fcooperationagentname
 from tsupplyanddemand t1

+ 3 - 1
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/我的供需详情查询.sql

@@ -1,7 +1,9 @@
 select t1.tsupplyanddemandid, t1.ftitle,t1.fissupply,
        t1.ftype, t1.fstatus, t1.checkdate,
        t1.fenddate,t1.tcooperationagentsid,
-       t1.fcontent,t4.fagentname as fcooperationagentname,10 as fcommunicationtimes
+       t1.fcontent,t4.fagentname as fcooperationagentname,
+       t1.freadtimes,
+       (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 tenterprise_users t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid

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

@@ -53,8 +53,8 @@ public class supplyanddemand extends Controller {
 
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         RowsMap attinfoRowsMap = getAttachmentUrl("tsupplyanddemand", rows.toArrayList("tsupplyanddemandid"));
-
         for (Row row : rows) {
+            //附件信息
             row.put("attinfos", attinfoRowsMap.get(row.getString("tsupplyanddemandid")));
         }
         return getSucReturnObject().setDataByPaging(rows).saveToDataPool().toString();
@@ -67,10 +67,13 @@ public class supplyanddemand extends Controller {
      */
     public String query_supplyanddemandMain() throws P2Exception {
         long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
+        /**
+         * 阅读次数+1
+         */
+        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='"+siteid+"' and tsupplyanddemandid='"+tsupplyanddemandid+"'");
 
         SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
         sqlFactory.addParameter("siteid", siteid);
-        sqlFactory.addParameter("tagentsid", tagentsid);
         sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
 
@@ -178,6 +181,7 @@ public class supplyanddemand extends Controller {
             row.put("attinfos", attinfoRowsMap.get(row.getString("tsupplyanddemandid")));
             row.put("imdialogs", dialogrows);
         }
+
         return getSucReturnObject().setData(rows).toString();
     }