Procházet zdrojové kódy

沈静伟:提报增加一事多报的形式
1:企业web端提报列表查询接口新增是否多次提报查询字段。
2:业务员web端、业务员手机端、经销商web端、经销商手机端提报模列表查询接口新增多次提报字段fcanalwayssubmit查询条件

沈静伟 před 4 roky
rodič
revize
87cfe8657b

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/agentclient/mainpage/submitedit/SQL/提报列表查询.sql

@@ -12,4 +12,4 @@ select t1.tsubmiteditmodelid,
        t1.fcanalwayssubmit
 from tsubmiteditmodel t1
 inner join tsubmitedit t2 on t1.siteid = t2.siteid and t1.tsubmiteditmodelid = t2.tsubmiteditmodelid and t2.tenterprise_userid =$tenterprise_userid$
-where t1.fstatus='·¢²¼' and t1.siteid=$siteid$
+where t1.fstatus='·¢²¼' and t1.siteid=$siteid$ and $where$

+ 22 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/agentclient/mainpage/submitedit/submitedit.java

@@ -7,6 +7,7 @@ import com.cnd3b.common.data.SQLFactory;
 import com.cnd3b.common.data.db.DataPool;
 
 import com.alibaba.fastjson.JSONObject;
+
 /**
  * 提报管理
  */
@@ -27,9 +28,27 @@ public class submitedit extends Controller {
          */
         String[] sortfield = {"t1.checkdate"};
         String sort = getSort(sortfield, "t1.checkdate desc");
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+            if (whereObject.containsKey("fcanalwayssubmit") && !"".equals(whereObject.getString("fcanalwayssubmit"))) {
+                where.append(" and(");
+                where.append("t1.fcanalwayssubmit ='").append(whereObject.getString("fcanalwayssubmit")).append("' ");
+                where.append(")");
+            }
+        }
         SQLFactory costhead = new SQLFactory(this, "提报列表查询", pageSize, pageNumber, sort);
         costhead.addParameter("siteid", siteid);
         costhead.addParameter("tenterprise_userid", userid);
+        costhead.addParameter_SQL("where", where);
         Rows rows = dbConnect.runSqlQuery(costhead.getSQL());
         return getSucReturnObject().setDataByPaging(rows, sortfield).setFinalDo(DataPool.defaultdatalife, 1);
     }
@@ -50,6 +69,7 @@ public class submitedit extends Controller {
         dbConnect.runSqlUpdate("update tsubmitedit set fisread=1 where siteid='" + siteid + "' and tsubmiteditmodelid='" + tsubmiteditmodelid + "' and tenterprise_userid='" + userid + "'");
         return getSucReturnObject().setData(rows).toString();
     }
+
     /**
      * 经销商保存
      *
@@ -57,7 +77,7 @@ public class submitedit extends Controller {
      */
     public String saveedit() throws D3bException {
         String tsubmiteditmodelid = content.getString("tsubmiteditmodelid");//提报模板ID
-        String fcontent = content.getString("fcontent","tsubmitedit.fcontent", "提报内容");
+        String fcontent = content.getString("fcontent", "tsubmitedit.fcontent", "提报内容");
         SQLFactory sqlFactory = new SQLFactory(this, "保存");
         sqlFactory.addParameter("fcontent", fcontent);
         sqlFactory.addParameter("changeby", username);
@@ -80,7 +100,7 @@ public class submitedit extends Controller {
      */
     public String submitedit() throws D3bException {
         String tsubmiteditmodelid = content.getString("tsubmiteditmodelid");//提报模板ID
-        String fcontent = content.getString("fcontent","tsubmitedit.fcontent", "提报内容");
+        String fcontent = content.getString("fcontent", "tsubmitedit.fcontent", "提报内容");
 
         SQLFactory sqlFactory = new SQLFactory(this, "提报");
         sqlFactory.addParameter("submitby", username);

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/agentwebclient/mainpage/submitedit/SQL/提报列表查询.sql

@@ -12,4 +12,4 @@ select t1.tsubmiteditmodelid,
        t1.fcanalwayssubmit
 from tsubmiteditmodel t1
 inner join tsubmitedit t2 on t1.siteid = t2.siteid and t1.tsubmiteditmodelid = t2.tsubmiteditmodelid and t2.tenterprise_userid =$tenterprise_userid$
-where t1.fstatus='·¢²¼' and t1.siteid=$siteid$
+where t1.fstatus='·¢²¼' and t1.siteid=$siteid$ and $where$

+ 18 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/agentwebclient/mainpage/submitedit/submitedit.java

@@ -27,9 +27,27 @@ public class submitedit extends Controller {
          */
         String[] sortfield = {"t1.checkdate"};
         String sort = getSort(sortfield, "t1.checkdate desc");
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+            if (whereObject.containsKey("fcanalwayssubmit") && !"".equals(whereObject.getString("fcanalwayssubmit"))) {
+                where.append(" and(");
+                where.append("t1.fcanalwayssubmit ='").append(whereObject.getString("fcanalwayssubmit")).append("' ");
+                where.append(")");
+            }
+        }
         SQLFactory costhead = new SQLFactory(this, "提报列表查询", pageSize, pageNumber, sort);
         costhead.addParameter("siteid", siteid);
         costhead.addParameter("tenterprise_userid", userid);
+        costhead.addParameter_SQL("where", where);
         Rows rows = dbConnect.runSqlQuery(costhead.getSQL());
         return getSucReturnObject().setDataByPaging(rows,sortfield).setFinalDo(DataPool.defaultdatalife,1);
     }

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/salerclient/mainpage/submitedit/SQL/提报列表查询.sql

@@ -13,4 +13,4 @@ select t1.tsubmiteditmodelid,
 from tsubmiteditmodel t1
        inner join tsubmitedit t2
                  on t1.siteid = t2.siteid and t1.tsubmiteditmodelid = t2.tsubmiteditmodelid and t2.tenterprise_userid =$tenterprise_userid$
-where t1.fstatus='·¢²¼' and t1.siteid=$siteid$
+where t1.fstatus='·¢²¼' and t1.siteid=$siteid$ and $where$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/salerclient/mainpage/submitedit/SQL/提报管理列表查询.sql

@@ -12,5 +12,5 @@ from DSBCRM..tsubmiteditmodel t1
 where t1.fstatus = '·¢²¼'
   and t1.siteid =$siteid$
   and (t3.fsaleruserid in $tenterprise_userid$
-)
+) and $where$
 group by t1.tsubmiteditmodelid, t1.ftitle, t1.fbegdate, t1.fenddate, t1.checkdate,t1.fcanalwayssubmit

+ 40 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/salerclient/mainpage/submitedit/submitedit.java

@@ -31,9 +31,28 @@ public class submitedit extends Controller {
          */
         String[] sortfield = {"t1.checkdate"};
         String sort = getSort(sortfield, "t1.checkdate desc");
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+            if (whereObject.containsKey("fcanalwayssubmit") && !"".equals(whereObject.getString("fcanalwayssubmit"))) {
+                where.append(" and(");
+                where.append("t1.fcanalwayssubmit ='").append(whereObject.getString("fcanalwayssubmit")).append("' ");
+                where.append(")");
+            }
+        }
+
         SQLFactory costhead = new SQLFactory(this, "提报列表查询", pageSize, pageNumber, sort);
         costhead.addParameter("siteid", siteid);
         costhead.addParameter("tenterprise_userid", userid);
+        costhead.addParameter_SQL("where", where);
         Rows rows = dbConnect.runSqlQuery(costhead.getSQL());
         return getSucReturnObject().setDataByPaging(rows, sortfield).setFinalDo(DataPool.defaultdatalife, 1);
     }
@@ -85,9 +104,9 @@ public class submitedit extends Controller {
      *
      * @return
      */
-    public String submitedit()throws D3bException {
+    public String submitedit() throws D3bException {
         String tsubmiteditmodelid = content.getString("tsubmiteditmodelid");//提报模板ID
-        String fcontent = content.getString("fcontent","tsubmitedit.fcontent", "提报内容");
+        String fcontent = content.getString("fcontent", "tsubmitedit.fcontent", "提报内容");
 
         SQLFactory sqlFactory = new SQLFactory(this, "提报");
         sqlFactory.addParameter("fcontent", fcontent);
@@ -112,9 +131,28 @@ public class submitedit extends Controller {
          */
         String[] sortfield = {"t1.checkdate"};
         String sort = getSort(sortfield, "t1.checkdate desc");
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+            if (whereObject.containsKey("fcanalwayssubmit") && !"".equals(whereObject.getString("fcanalwayssubmit"))) {
+                where.append(" and(");
+                where.append("t1.fcanalwayssubmit ='").append(whereObject.getString("fcanalwayssubmit")).append("' ");
+                where.append(")");
+            }
+        }
+
         SQLFactory costhead = new SQLFactory(this, "提报管理列表查询", pageSize, pageNumber, sort);
         costhead.addParameter("siteid", siteid);
         costhead.addParameter_in("tenterprise_userid", getSubUsers());
+        costhead.addParameter_SQL("where", where);
         Rows rows = dbConnect.runSqlQuery(costhead.getSQL());
         return getSucReturnObject().setDataByPaging(rows, sortfield).setFinalDo(DataPool.defaultdatalife, 1);
     }

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/salerwebclient/mainpage/submitedit/SQL/提报列表查询.sql

@@ -13,4 +13,4 @@ select t1.tsubmiteditmodelid,
 from tsubmiteditmodel t1
        inner join tsubmitedit t2
                  on t1.siteid = t2.siteid and t1.tsubmiteditmodelid = t2.tsubmiteditmodelid and t2.tenterprise_userid =$tenterprise_userid$
-where t1.fstatus='·¢²¼' and t1.siteid=$siteid$
+where t1.fstatus='·¢²¼' and t1.siteid=$siteid$ and $where$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/salerwebclient/mainpage/submitedit/SQL/提报管理列表查询.sql

@@ -12,5 +12,5 @@ from DSBCRM..tsubmiteditmodel t1
 where t1.fstatus = '·¢²¼'
   and t1.siteid =$siteid$
   and (t3.fsaleruserid in $tenterprise_userid$
-)
+) and $where$
 group by t1.tsubmiteditmodelid, t1.ftitle, t1.fbegdate, t1.fenddate, t1.checkdate,t1.fcanalwayssubmit

+ 40 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/salerwebclient/mainpage/submitedit/submitedit.java

@@ -31,9 +31,29 @@ public class submitedit extends Controller {
          */
         String[] sortfield = {"t1.checkdate"};
         String sort = getSort(sortfield, "t1.checkdate desc");
+
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+            if (whereObject.containsKey("fcanalwayssubmit") && !"".equals(whereObject.getString("fcanalwayssubmit"))) {
+                where.append(" and(");
+                where.append("t1.fcanalwayssubmit ='").append(whereObject.getString("fcanalwayssubmit")).append("' ");
+                where.append(")");
+            }
+        }
+
         SQLFactory costhead = new SQLFactory(this, "提报列表查询", pageSize, pageNumber, sort);
         costhead.addParameter("siteid", siteid);
         costhead.addParameter("tenterprise_userid", userid);
+        costhead.addParameter_SQL("where", where);
         Rows rows = dbConnect.runSqlQuery(costhead.getSQL());
         return getSucReturnObject().setDataByPaging(rows, sortfield).setFinalDo(DataPool.defaultdatalife, 1);
     }
@@ -87,7 +107,7 @@ public class submitedit extends Controller {
      */
     public String submitedit() throws D3bException {
         String tsubmiteditmodelid = content.getString("tsubmiteditmodelid");//提报模板ID
-        String fcontent = content.getString("fcontent","tsubmitedit.fcontent", "提报内容");//提报模板ID
+        String fcontent = content.getString("fcontent", "tsubmitedit.fcontent", "提报内容");//提报模板ID
 
         SQLFactory sqlFactory = new SQLFactory(this, "提报");
         sqlFactory.addParameter("fcontent", fcontent);
@@ -113,9 +133,28 @@ public class submitedit extends Controller {
          */
         String[] sortfield = {"t1.checkdate"};
         String sort = getSort(sortfield, "t1.checkdate desc");
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+            if (whereObject.containsKey("fcanalwayssubmit") && !"".equals(whereObject.getString("fcanalwayssubmit"))) {
+                where.append(" and(");
+                where.append("t1.fcanalwayssubmit ='").append(whereObject.getString("fcanalwayssubmit")).append("' ");
+                where.append(")");
+            }
+        }
+
         SQLFactory costhead = new SQLFactory(this, "提报管理列表查询", pageSize, pageNumber, sort);
         costhead.addParameter("siteid", siteid);
         costhead.addParameter_in("tenterprise_userid", getSubUsers());
+        costhead.addParameter_SQL("where", where);
         Rows rows = dbConnect.runSqlQuery(costhead.getSQL());
         return getSucReturnObject().setDataByPaging(rows, sortfield).setFinalDo(DataPool.defaultdatalife, 1);
     }

+ 5 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/webclient/submitedit/submitedit.java

@@ -120,6 +120,11 @@ public class submitedit extends Controller {
                 where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
+            if (whereObject.containsKey("fcanalwayssubmit") && !"".equals(whereObject.getString("fcanalwayssubmit"))) {
+                where.append(" and(");
+                where.append("t1.fcanalwayssubmit ='").append(whereObject.getString("fcanalwayssubmit")).append("' ");
+                where.append(")");
+            }
         }
         SQLFactory sqlFactory = new SQLFactory(this, "ÌᱨÁбí²éѯ", pageSize, pageNumber, sort);
         sqlFactory.addParameter("siteid", siteid);