Browse Source

装备资源库管理

eganwu 1 year ago
parent
commit
0f7d58d266

BIN
lib/yos.core-2.4.9-sources.jar → lib/yos.core-2.4.11-sources.jar


BIN
lib/yos.core-2.4.9.jar → lib/yos.core-2.4.11.jar


+ 15 - 0
src/custom/restcontroller/R.java

@@ -5869,6 +5869,21 @@ public class R {
         }
     }
 
+    public static class ID20240407135802 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID20240407135902 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID20240407140002 {
+        public static class v1 {
+        }
+    }
+
 
 }
 

+ 4 - 0
src/custom/restcontroller/webmanage/saletool/courseware/coursewaretesthead.java

@@ -1,5 +1,6 @@
 package restcontroller.webmanage.saletool.courseware;
 
+import beans.attachment.Attachment;
 import beans.department.Department;
 import beans.salearea.SaleArea;
 import com.alibaba.fastjson.JSON;
@@ -500,6 +501,9 @@ public class coursewaretesthead extends Controller {
             row.put("typemxstr", answer_fact.size() > 1 ? "多选" : "单选");
             JSONArray answer = row.getJSONArray("answer");
             row.put("answer", answer);
+
+            Rows optionsrows= Attachment.get(this,"sat_courseware_testitems",row.getLong("sat_courseware_testitemsid"));
+            row.put("attinfos", optionsrows);
         }
 
 

+ 51 - 0
src/custom/restcontroller/webmanage/saletool/sharematerial/EquipmentResourceLibrary.java

@@ -215,4 +215,55 @@ public class EquipmentResourceLibrary extends Controller {
         return getSucReturnObject().setData(rows).toString();
     }
 
+
+    @API(title = "图片新增或编辑", apiversion = R.ID20240407135802.v1.class)
+    public String attachmentInsertOrUpdate() throws YosException {
+
+        Long sys_attachment_linksid = content.getLongValue("sys_attachment_linksid");
+
+        if (sys_attachment_linksid <= 0) {
+            sys_attachment_linksid = createTableID("sys_attachment_links");
+            InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_attachment_links");
+            insertSQL.setSiteid(siteid);
+            insertSQL.setUniqueid(sys_attachment_linksid);
+            insertSQL.setValue("usetype", "sat_sharematerial");
+            insertSQL.setValue("linksid", 0);
+            insertSQL.setValue("attachmentid", content.getLongValue("attachmentid"));
+            insertSQL.setValue("jumpurl", content.getStringValue("jumpurl", true));
+            insertSQL.setValue("sequence", content.getLongValue("attachmentid"));
+            insertSQL.setValue("ownertable", content.getStringValue("ownertable"));
+            insertSQL.setValue("ownerid", content.getLongValue("ownerid"));
+            insertSQL.insert();
+        }
+        if (sys_attachment_linksid > 0) {
+            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sys_attachment_links");
+            updateSQL.setSiteid(siteid);
+            updateSQL.setUniqueid(sys_attachment_linksid);
+            updateSQL.setValue("jumpurl", content.getStringValue("jumpurl", true));
+            updateSQL.setValue("sequence", content.getLongValue("attachmentid"));
+            updateSQL.update();
+        }
+
+        String sql ="SELECT * from sys_attachment_links WHERE sys_attachment_linksid=" + sys_attachment_linksid + " and siteid='" + siteid + "'";
+
+        Rows rows = dbConnect.runSqlQuery(sql);
+
+
+        return getSucReturnObject().setData(rows.get(0)).toString();
+    }
+
+    @API(title = "图片删除", apiversion = R.ID20240407135902.v1.class)
+    public String attachmentDelete() {
+
+
+        return getSucReturnObject().setData("").toString();
+    }
+
+    @API(title = "图片列表", apiversion = R.ID20240407140002.v1.class)
+    public String attachmentList() {
+
+
+        return getSucReturnObject().setData("").toString();
+    }
+
 }

+ 1 - 1
src/custom/restcontroller/webmanage/saletool/sharematerial/SQL/素材分类-查询.sql

@@ -1,4 +1,4 @@
-SELECT sat_sharematerial_classid, classname, parentid,createdate, isenable,sequence
+SELECT sat_sharematerial_classid, classname, parentid,createdate, isenable,sequence,level
 FROM sat_sharematerial_class
 WHERE parentid = $parentid$ and siteid = $siteid$ and $where$
 ORDER BY sequence DESC,createdate DESC