Просмотр исходного кода

课件分类返回附件,课件详情返回资料附件,职位新增查询删除

吴志根 3 лет назад
Родитель
Сommit
36b4035f96

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/customer/wechatapplet/SQL/分类.sql

@@ -4,7 +4,7 @@ SELECT t1.ttypedetailid,
        t1.fparentid
 
 FROM ttypedetail t1
-where t1.fparentid = $fparentid$
+where t1.fparentid in (SELECT ttypedetailid FROM ttypedetail where fparentid = 1)
   and t1.fisused = 1
   and $where$
 order by t1.ttypedetailid desc

+ 8 - 2
src/dsb/com/cnd3b/restcontroller/customer/wechatapplet/wechatapplet.java

@@ -108,10 +108,12 @@ public class wechatapplet extends Controller {
         sqlFactory.addParameter("tarchives_scid", tarchives_scid);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         RowsMap rowsMap = getAttachmentUrl("tarchives_sc", rows.toArrayList("tarchives_scid"), "video");
+        RowsMap rowsMapFile = getAttachmentUrl("tarchives_sc", rows.toArrayList("tarchives_scid"), "file");
         //²éѯ·âÃæ
         RowsMap rowsMapCover = getAttachmentUrl("tarchives_sc", rows.toArrayList("tarchives_scid"), "cover");
         for (Row row : rows) {
             row.put("attinfos", rowsMap.get(row.getString("tarchives_scid")));
+            row.put("attinfos_file", rowsMapFile.get(row.getString("tarchives_scid")));
             Rows coverRows = rowsMapCover.get(row.getString("tarchives_scid"));
             if (!coverRows.isEmpty()) {
                 row.put("cover", coverRows.get(0).getString("fobsurl"));
@@ -154,13 +156,17 @@ public class wechatapplet extends Controller {
             where = "t1.fisagent ='1'";
         }
 
-        String fparentid = content.getString("fparentid");
         SQLFactory sqlFactory = new SQLFactory(this, "·ÖÀà");
-        sqlFactory.addParameter_SQL("fparentid", fparentid);
         sqlFactory.addParameter_SQL("where", where);
         String sql = sqlFactory.getSQL();
         Rows rows = dbConnect.runSqlQuery(sql);
 
+        RowsMap rowsMap = getAttachmentUrl("ttypedetail", rows.toArrayList("ttypedetailid"));
+        for (Row row : rows) {
+            row.put("attinfos", rowsMap.get(row.getString("ttypedetailid")));
+
+        }
+
         createRequestLog("Åàѵѧϰ");
         return getSucReturnObject().setData(rows).toString();
     }

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/tarchives_sc/tarchives_sc.java

@@ -161,10 +161,12 @@ public class tarchives_sc extends Controller {
 
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         RowsMap rowsMap = getAttachmentUrl("tarchives_sc", rows.toArrayList("tarchives_scid"), "video");
+        RowsMap rowsMapFile = getAttachmentUrl("tarchives_sc", rows.toArrayList("tarchives_scid"), "file");
         //²éѯ·âÃæ
         RowsMap rowsMapCover = getAttachmentUrl("tarchives_sc", rows.toArrayList("tarchives_scid"), "cover");
         for (Row row : rows) {
             row.put("attinfos", rowsMap.get(row.getString("tarchives_scid")));
+            row.put("attinfos_file", rowsMapFile.get(row.getString("tarchives_scid")));
             row.put("coverinfos", rowsMapCover.get(row.getString("tarchives_scid")));
             Rows coverRows = rowsMapCover.get(row.getString("tarchives_scid"));
             if (!coverRows.isEmpty()) {

+ 53 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/tposition/tposition.java

@@ -0,0 +1,53 @@
+package com.cnd3b.restcontroller.enterprise.tposition;
+
+import com.alibaba.fastjson.JSONObject;
+import com.cnd3b.common.Controller;
+import com.cnd3b.common.data.Rows;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+public class tposition extends Controller {
+    /**
+     * 构造函数
+     *
+     * @param content
+     */
+    public tposition(JSONObject content) {
+        super(content);
+    }
+
+    //新增职位
+    public String inseret() throws P2Exception {
+
+        String fname = content.getString("fname");
+        Long ftype = content.getLong("ftype");
+
+        PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tposition");
+        PaoRemote paoRemote = paoSetRemote.addAtEnd();
+        paoRemote.setValue("tpositionid", paoRemote.getUniqueIDValue(), 11L);
+        paoRemote.setValue("fname", fname, 11L);
+        paoRemote.setValue("ftype", ftype, 11L);
+        paoSetRemote.save();
+
+        return getSucReturnObject().toString();
+    }
+
+    //查询职位列表
+    public String selectList() throws P2Exception {
+
+        Rows rows = dbConnect.runSqlQuery("SELECT tpositionid,fname,ftype FROM tposition order by createdate DESC");
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+
+    //删除职位列表
+    public String delete() throws P2Exception {
+
+        Long tpositionid = content.getLong("tpositionid");
+        dbConnect.runSqlUpdate("DELETE FROM tposition WHERE tpositionid= " + tpositionid);
+        return getSucReturnObject().toString();
+    }
+
+
+}