Browse Source

查询课件列表

吴志根 4 years ago
parent
commit
a18d09dfdc

+ 3 - 1
src/dsb/com/cnd3b/common/parameter/parameter.java

@@ -25,7 +25,9 @@ public class parameter {
     public static HashMap<Long, Row> userIdList = new HashMap<>(16);
 
     public static String defaultsiteid = "JIUSHENG";
-    public static Boolean isMac = true;
+    public static Boolean isMac = false;
+    //设置改部门下的为经销商
+    public static String depname = "嘉兴多三边科技有限公司";
     public static String tuserid = "";
 
     /**

+ 11 - 0
src/dsb/com/cnd3b/restcontroller/customer/wechatapplet/SQL/查询课件列表_全部.sql

@@ -0,0 +1,11 @@
+SELECT t1.tarchives_scid,
+       t1.ttypedetailid,
+       t1.createdate,
+       t1.fnotes,
+       t1.ftitle,
+       t1.fvisitors,
+       t1.fisontop,
+       t1.fiscandownload
+FROM tarchives_sc t1
+WHERE t1.fstatus = '·¢²¼'
+  and (t1.fnotes LIKE $keywords$ OR t1.ftitle LIKE $keywords$)

+ 15 - 5
src/dsb/com/cnd3b/restcontroller/customer/wechatapplet/wechatapplet.java

@@ -35,16 +35,26 @@ public class wechatapplet extends Controller {
      */
     public String getCoursewareList() throws P2Exception {
 
-        String ttypedetailid = content.getString("ttypedetailid");
-
+        String ttypedetailid = "";
+        if (content.containsKey("ttypedetailid")) {
+            ttypedetailid = content.getString("ttypedetailid");
+        }
         String keywords = "";
         if (content.containsKey("keywords")) {
             keywords = content.getString("keywords");
         }
+        SQLFactory sqlFactory = null;
+        if (ttypedetailid.equals("")) {
+            sqlFactory = new SQLFactory(this, "查询课件列表_全部", pageSize, pageNumber, " t1.createdate desc");
+            sqlFactory.addParameter("keywords", "%" + keywords + "%");
+        } else {
+            sqlFactory = new SQLFactory(this, "查询课件列表", pageSize, pageNumber, " t1.createdate desc");
+            sqlFactory.addParameter("ttypedetailid", ttypedetailid);
+            sqlFactory.addParameter("keywords", "%" + keywords + "%");
+        }
+
+        String sql = sqlFactory.getSQL();
 
-        SQLFactory sqlFactory = new SQLFactory(this, "查询课件列表", pageSize, pageNumber, " t1.createdate desc");
-        sqlFactory.addParameter("ttypedetailid", ttypedetailid);
-        sqlFactory.addParameter("keywords", "%" + keywords + "%");
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
 //        RowsMap rowsMap = getAttachmentUrl("tarchives_sc", rows.toArrayList("tarchives_scid"), "video");
         //查询封面

+ 4 - 3
src/dsb/com/cnd3b/service/GetWechatData.java

@@ -20,7 +20,7 @@ import java.util.List;
 
 public class GetWechatData extends BaseClass implements Runnable {
 
-    private String depname = "嘉兴多三边科技有限公司";
+
 
     @Override
     public void run() {
@@ -55,7 +55,7 @@ public class GetWechatData extends BaseClass implements Runnable {
                 JSONObject jsonObject = (JSONObject) obj;
                 String name = jsonObject.getString("name");
                 //查询部门名称为经销商的部门id
-                if (name.equals(depname)) {
+                if (name.equals(parameter.depname)) {
                     id = jsonObject.getIntValue("id");
                 }
                 userArray.addAll(getDepartmentUsers(jsonObject.getIntValue("id"), 0));
@@ -136,7 +136,7 @@ public class GetWechatData extends BaseClass implements Runnable {
             if (!rows.isEmpty()) {
                 wechat_depname = rows.get(0).getString("wechat_depname");
             }
-            if (wechat_depname.equals(depname)) {
+            if (wechat_depname.equals(parameter.depname)) {
                 fusertype = "经销商";
 
             } else {
@@ -233,4 +233,5 @@ public class GetWechatData extends BaseClass implements Runnable {
 //        dbConnect.runSqlUpdate(sqlFactory.getSQL());
     }
 
+
 }