|
|
@@ -0,0 +1,130 @@
|
|
|
+package com.cnd3b.restcontroller.enterprise.tarchives_sc;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.cnd3b.common.Controller;
|
|
|
+import p2.common.parse.J;
|
|
|
+import p2.pao.PaoRemote;
|
|
|
+import p2.pao.PaoSetRemote;
|
|
|
+import p2.util.P2Exception;
|
|
|
+
|
|
|
+public class tarchives_sc extends Controller {
|
|
|
+ /**
|
|
|
+ * 构造函数
|
|
|
+ *
|
|
|
+ * @param content
|
|
|
+ */
|
|
|
+ public tarchives_sc(JSONObject content) {
|
|
|
+ super(content);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增课件
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String inseretTarchives_sc() throws P2Exception {
|
|
|
+
|
|
|
+ String ttypedetailid = content.getString("ttypedetailid");
|
|
|
+ String fnotes = content.getString("fnotes");
|
|
|
+ String ftitle = content.getString("ftitle");
|
|
|
+ String fiscandownload = content.getString("fiscandownload");
|
|
|
+ String fisontop = content.getString("fisontop");
|
|
|
+
|
|
|
+ //新增
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tarchives_sc");
|
|
|
+ PaoRemote paoRemote = paoSetRemote.addAtEnd();
|
|
|
+ paoRemote.setValue("ttypedetailid", ttypedetailid, 11L);
|
|
|
+ paoRemote.setValue("fnotes", fnotes, 11L);
|
|
|
+ paoRemote.setValue("fstatus", "新建", 11L);
|
|
|
+ paoRemote.setValue("ftitle", ftitle, 11L);
|
|
|
+ paoRemote.setValue("fiscandownload", fiscandownload, 11L);
|
|
|
+ paoRemote.setValue("fisontop", fisontop, 11L);
|
|
|
+ paoSetRemote.save();
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
+ object.put("id", paoRemote.getUniqueIDValue());
|
|
|
+ return getSucReturnObject().setData(object).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新课件
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String updateTarchives_sc() throws P2Exception {
|
|
|
+ String tarchives_scid = content.getString("tarchives_scid");
|
|
|
+ String ttypedetailid = content.getString("tagentsid");
|
|
|
+ String fnotes = content.getString("fnotes");
|
|
|
+ String ftitle = content.getString("ftitle");
|
|
|
+
|
|
|
+ String fiscandownload = content.getString("fiscandownload");
|
|
|
+ String fisontop = content.getString("fisontop");
|
|
|
+ //更新体系
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tarchives_sc", "tarchives_scid = '" + tarchives_scid + "'");
|
|
|
+ if (!paoSetRemote.isEmpty()) {
|
|
|
+ PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
+ paoRemote.setValue("ttypedetailid", ttypedetailid, 11L);
|
|
|
+ paoRemote.setValue("fnotes", fnotes, 11L);
|
|
|
+ paoRemote.setValue("fstatus", "新建", 11L);
|
|
|
+ paoRemote.setValue("ftitle", ftitle, 11L);
|
|
|
+ paoRemote.setValue("fiscandownload", fiscandownload, 11L);
|
|
|
+ paoRemote.setValue("fisontop", fisontop, 11L);
|
|
|
+ paoSetRemote.save();
|
|
|
+ } else {
|
|
|
+ return getErrReturnObject().setErrMsg("未找到更新的数据").toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
+ object.put("id", tarchives_scid);
|
|
|
+ return getSucReturnObject().setData(object).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除课件列表
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String deleteTarchives_sc() throws P2Exception {
|
|
|
+ String tarchives_scid = content.getString("tarchives_scid");
|
|
|
+
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tarchives_sc", "tarchives_scid = '" + tarchives_scid + "'");
|
|
|
+ if (!paoSetRemote.isEmpty()) {
|
|
|
+ PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
+ paoRemote.delete();
|
|
|
+ paoSetRemote.save();
|
|
|
+ } else {
|
|
|
+ return getErrReturnObject().setErrMsg("删除失败").toString();
|
|
|
+ }
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发布课件
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ * @throws P2Exception
|
|
|
+ */
|
|
|
+ public String auditTarchives_sc() throws P2Exception {
|
|
|
+ String tarchives_scid = content.getString("tarchives_scid");
|
|
|
+
|
|
|
+ //更新体系
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tarchives_sc", "tarchives_scid = '" + tarchives_scid + "'");
|
|
|
+ if (!paoSetRemote.isEmpty()) {
|
|
|
+ PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
+ paoRemote.setValue("fstatus", "发布", 11L);
|
|
|
+ paoSetRemote.save();
|
|
|
+ } else {
|
|
|
+ return getErrReturnObject().setErrMsg("未找到发布的数据").toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询课件列表
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String selectTarchives_scList() {
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+}
|