Explorar o código

新增供需记录:分享,浏览,电话

吴志根 %!s(int64=3) %!d(string=hai) anos
pai
achega
e42d70a19b

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

@@ -13,6 +13,8 @@ t2.fagentname,
 t2.faddress,
 t2.fphonenumber,
 t1.freadtimes,
+t1.fsharetimes,
+t1.fphonetimes,
 t1.tenterprise_userid,
 t1.tposition,
 t1.tagentsid,

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

@@ -13,6 +13,8 @@ select
     t2.faddress,
     t2.fphonenumber,
     t1.freadtimes,
+    t1.fsharetimes,
+    t1.fphonetimes,
     t1.tenterprise_userid,
     t1.tposition,
     t1.tagentsid,

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

@@ -3,6 +3,8 @@ select t1.tsupplyanddemandid, t1.ftitle,t1.fissupply,
        t1.fenddate,t1.tcooperationagentsid,t2.fagentname,t3.fname,t3.fphonenumber,
        t1.fcontent,t1.tenterprise_userid,
        t1.freadtimes,
+       t1.fsharetimes,
+       t1.fphonetimes,
        t1.tposition,
        t2.tagentsid,
        (select count(0) from timdialog where siteid=t1.siteid and ownertable='tsupplyanddemand' and ownerid=t1.tsupplyanddemandid) as fcommunicationtimes

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

@@ -11,6 +11,10 @@ t1.checkdate,
 t1.fenddate,
 t2.fagentname,
 t1.freadtimes,
+t1.fsharetimes,
+t1.fphonetimes,
+t1.fsharetimes,
+t1.fphonetimes,
 t1.tenterprise_userid,
 (select count(0) from timdialog where siteid=t1.siteid and ownertable='tsupplyanddemand' and ownerid=t1.tsupplyanddemandid) as fcommunicationtimes,
 t1.tcooperationagentsid,

+ 64 - 7
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -121,11 +121,11 @@ 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 + "'");
-
+//        /**
+//         * 阅读次数+1
+//         */
+//        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
+        addsupplyanddemandLog(tsupplyanddemandid, 1);
         SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
@@ -156,7 +156,7 @@ public class supplyanddemand extends Controller {
         } else {
             Rows rows = dbConnect.runSqlQuery("select ftitle,tenterprise_userid from tsupplyanddemand where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
             if (!rows.isEmpty()) {
-                if(rows.get(0).getString("fstatus").equals("对接中")){
+                if (rows.get(0).getString("fstatus").equals("对接中")) {
                     return getErrReturnObject().setErrMsg("正在对接中").toString();
                 }
                 //聊天对话框不存在时,自动生成一个聊天对话框
@@ -220,7 +220,7 @@ public class supplyanddemand extends Controller {
                 where.append(" and t1.fissupply =").append(whereObject.getBooleanValue("fissupply") ? 1 : 0);
             }
         }
-        sort= "t1.fstatus,t1.tsupplyanddemandid desc";
+        sort = "t1.fstatus,t1.tsupplyanddemandid desc";
         SQLFactory sqlFactory = new SQLFactory(this, "我的供需列表查询", pageSize, pageNumber, sort);
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("tagentsid", tagentsid);
@@ -407,4 +407,61 @@ public class supplyanddemand extends Controller {
             return getErrReturnObject().setErrMsg(status).toString();
         }
     }
+
+    /**
+     * 添加记录:浏览,电话,分享
+     *
+     * @return
+     */
+    public String addsupplyanddemandLog() throws P2Exception {
+        int ftype = content.getIntValue("ftype");
+        long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
+        long tenterprise_userid = content.getLong("tenterprise_userid");
+
+
+        addsupplyanddemandLog(tsupplyanddemandid, ftype);
+
+        return getSucReturnObject().toString();
+
+    }
+
+    /**
+     * 添加记录:浏览,电话,分享
+     *
+     * @return
+     */
+    public void addsupplyanddemandLog(Long tsupplyanddemandid, int ftype) throws P2Exception {
+        /**
+         * 阅读次数+1
+         */
+        if (ftype == 1) {
+            dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
+        }
+        /**
+         * 电话次数+1
+         */
+        if (ftype == 2) {
+            dbConnect.runSqlUpdate("update tsupplyanddemand set fphonetimes=isnull(fphonetimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
+        }
+        /**
+         * 分享次数+1
+         */
+        if (ftype == 3) {
+            dbConnect.runSqlUpdate("update tsupplyanddemand set fsharetimes=isnull(fsharetimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
+        }
+
+        PaoSetRemote logPaoSetRemote = getP2ServerSystemPaoSet("tsupplyanddemand_log");
+        PaoRemote paoRemote = logPaoSetRemote.addAtEnd();
+        paoRemote.setValue("siteid", siteid, 11L);//企业ID
+        paoRemote.setValue("tagentsid", tagentsid, 11L);//企业ID
+        paoRemote.setValue("createby", username, 11L);//录入人
+        paoRemote.setValue("createdate", sysdate, 11L);//录入时间
+        paoRemote.setValue("changeby", username, 11L);//修改人
+        paoRemote.setValue("changedate", sysdate, 11L);//修改时间
+        paoRemote.setValue("tenterprise_userid", 0, 11L);//修改时间
+        paoRemote.setValue("tsupplyanddemandid", tsupplyanddemandid, 11L);
+        paoRemote.setValue("ftype", ftype, 11L);
+        logPaoSetRemote.save();
+    }
+
 }

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/供需列表查询.sql

@@ -13,6 +13,8 @@ t2.fagentname,
 t1.tagentsid,
 t1.tenterprise_userid,
 t1.freadtimes,
+t1.fsharetimes,
+t1.fphonetimes,
 t1.tposition,
 (select count(0) from timdialog where siteid=t1.siteid and ownertable='tsupplyanddemand' and ownerid=t1.tsupplyanddemandid) as fcommunicationtimes
 from tsupplyanddemand t1

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/供需详情查询.sql

@@ -3,6 +3,8 @@ select t1.tsupplyanddemandid, t1.ftitle,t1.fissupply,
        t1.fenddate,t1.tcooperationagentsid,t2.fagentname,t3.fname,t3.fphonenumber,
        t1.fcontent,
        t1.freadtimes,
+       t1.fsharetimes,
+       t1.fphonetimes,
        t1.tenterprise_userid,
        t1.tposition,
         (select count(0) from timdialog where siteid=t1.siteid and ownertable='tsupplyanddemand' and ownerid=t1.tsupplyanddemandid) as fcommunicationtimes

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/搜索_供需.sql

@@ -13,6 +13,8 @@ SELECT t1.tsupplyanddemandid,
        t1.tenterprise_userid,
        t1.tposition,
        t1.freadtimes,
+       t1.fsharetimes,
+       t1.fphonetimes,
        (select count(0)
         from timdialog
         where siteid = t1.siteid

+ 27 - 5
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/homepage.java

@@ -88,15 +88,12 @@ public class homepage extends Controller {
      *
      * @return
      */
-    public String query_supplyanddemandMain() {
+    public String query_supplyanddemandMain() throws P2Exception {
         long tsupplyanddemandid = content.getLongValue("tsupplyanddemandid");
         long tagentsid = content.getLongValue("tagentsid");
 
-        /**
-         * 阅读次数+1
-         */
-        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
 
+        addsupplyanddemandLog(tsupplyanddemandid);
 
         SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
         sqlFactory.addParameter("siteid", siteid);
@@ -112,6 +109,31 @@ public class homepage extends Controller {
         return getSucReturnObject().setData(rows).toString();
     }
 
+    /**
+     * 添加记录:浏览,电话,分享
+     *
+     * @return
+     */
+    public void addsupplyanddemandLog(Long tsupplyanddemandid) throws P2Exception {
+        /**
+         * 阅读次数+1
+         */
+        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
+
+        PaoSetRemote logPaoSetRemote = getP2ServerSystemPaoSet("tsupplyanddemand_log");
+        PaoRemote paoRemote = logPaoSetRemote.addAtEnd();
+        paoRemote.setValue("siteid", siteid, 11L);//企业ID
+        paoRemote.setValue("tagentsid", tagentsid, 11L);//企业ID
+        paoRemote.setValue("createby", username, 11L);//录入人
+        paoRemote.setValue("createdate", sysdate, 11L);//录入时间
+        paoRemote.setValue("changeby", username, 11L);//修改人
+        paoRemote.setValue("changedate", sysdate, 11L);//修改时间
+        paoRemote.setValue("tenterprise_userid", 0, 11L);//修改时间
+        paoRemote.setValue("tsupplyanddemandid", tsupplyanddemandid, 11L);
+        paoRemote.setValue("ftype", 1, 11L);
+        logPaoSetRemote.save();
+    }
+
     /**
      * 热门商户
      *