|
@@ -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();
|
|
|
+ }
|
|
|
+
|
|
|
}
|