浏览代码

效果图管理

eganwu 1 年之前
父节点
当前提交
6a067b5c72

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

@@ -6019,6 +6019,21 @@ public class R {
         }
     }
 
+    public static class ID20240415164202 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID20240415164302 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID20240415164402 {
+        public static class v1 {
+        }
+    }
+
 
 }
 

+ 1 - 3
src/custom/restcontroller/webmanage/saletool/sharematerial/DailySign.java

@@ -51,9 +51,7 @@ public class DailySign extends Controller {
 //            sqlFactory.setValue("type", content.getStringValue("type"));
             sqlFactory.insert();
             content.put("sat_sharematerialid", sat_sharematerialid);
-        }
-
-        if (sat_sharematerialid > 0) {
+        }else {
             UpdateSQL sqlFactory = SQLFactory.createUpdateSQL(this, sat_sharematerial);
             sqlFactory.setUniqueid(sat_sharematerialid);
             sqlFactory.setSiteid(siteid);

+ 1 - 3
src/custom/restcontroller/webmanage/saletool/sharematerial/EquipmentResourceLibrary.java

@@ -64,9 +64,7 @@ public class EquipmentResourceLibrary extends Controller {
 
             sqlFactory.insert();
             content.put("sat_sharematerialid", sat_sharematerialid);
-        }
-
-        if (sat_sharematerialid > 0) {
+        }else  {
             UpdateSQL sqlFactory = SQLFactory.createUpdateSQL(this, sat_sharematerial);
             sqlFactory.setUniqueid(sat_sharematerialid);
             sqlFactory.setSiteid(siteid);

+ 1 - 3
src/custom/restcontroller/webmanage/saletool/sharematerial/LongPicText.java

@@ -49,9 +49,7 @@ public class LongPicText extends Controller {
             insertSQL.setValue("content", content.getStringValue("contentstr"));
             insertSQL.insert();
             content.put("sat_sharematerialid", sat_sharematerialid);
-        }
-
-        if (sat_sharematerialid > 0) {
+        }else {
 
 
             UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sat_sharematerial");

+ 96 - 0
src/custom/restcontroller/webmanage/saletool/sharematerial/Renderings.java

@@ -0,0 +1,96 @@
+package restcontroller.webmanage.saletool.sharematerial;
+
+import com.alibaba.fastjson.JSONObject;
+import common.Controller;
+import common.YosException;
+import common.annotation.API;
+import common.data.*;
+import restcontroller.R;
+
+/**
+ * 效果图管理
+ */
+public class Renderings extends Controller {
+    /**
+     * 构造函数
+     *
+     * @param content
+     */
+    public Renderings(JSONObject content) throws YosException {
+        super(content);
+    }
+
+
+    String sat_sharematerial = "sat_sharematerial";
+
+    @API(title = "效果图新增或编辑", apiversion = R.ID20240415164202.v1.class)
+    public String insertOrUpdate() throws YosException {
+        Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
+
+
+        if (sat_sharematerialid <= 0) {
+            sat_sharematerialid = createTableID(sat_sharematerial);
+            InsertSQL sqlFactory = SQLFactory.createInsertSQL(this, sat_sharematerial);
+            sqlFactory.setSiteid(siteid);
+            sqlFactory.setUniqueid(sat_sharematerialid);
+            sqlFactory.setValue("classid", 4);
+            sqlFactory.setValue("sys_enterpriseid", sys_enterpriseid);
+            sqlFactory.setValue("title", content.getStringValue("title"));
+            sqlFactory.setValue("subtitle", content.getStringValue("subtitle"));
+            sqlFactory.setValue("notes", content.getStringValue("notes"));
+            sqlFactory.setValue("panoramaurl", content.getStringValue("panoramaurl", true));
+            sqlFactory.setValue("renderingstype", content.getStringValue("renderingstype"));
+            sqlFactory.setValue("renderingsclass", content.getJSONObject("renderingsclass"));
+            sqlFactory.setValue("isapplet", content.getBooleanValue("isapplet"));
+            sqlFactory.setValue("isbussinesspic", content.getBooleanValue("isbussinesspic"));
+            sqlFactory.setValue("sequence", content.getLongValue("sequence"));
+
+            sqlFactory.insert();
+            content.put("sat_sharematerialid", sat_sharematerialid);
+        } else {
+            UpdateSQL sqlFactory = SQLFactory.createUpdateSQL(this, sat_sharematerial);
+            sqlFactory.setUniqueid(sat_sharematerialid);
+            sqlFactory.setSiteid(siteid);
+            sqlFactory.setValue("title", content.getStringValue("title"));
+            sqlFactory.setValue("subtitle", content.getStringValue("subtitle"));
+            sqlFactory.setValue("notes", content.getStringValue("notes"));
+            sqlFactory.setValue("panoramaurl", content.getStringValue("panoramaurl", true));
+            sqlFactory.setValue("renderingstype", content.getStringValue("renderingstype"));
+            sqlFactory.setValue("renderingsclass", content.getJSONObject("renderingsclass"));
+            sqlFactory.setValue("isapplet", content.getBooleanValue("isapplet"));
+            sqlFactory.setValue("isbussinesspic", content.getBooleanValue("isbussinesspic"));
+            sqlFactory.setValue("sequence", content.getLongValue("sequence"));
+            sqlFactory.update();
+        }
+
+
+        return detail();
+    }
+
+    @API(title = "效果图详情", apiversion = R.ID20240415164302.v1.class)
+    public String detail() throws YosException {
+        Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
+
+        QuerySQL querySQ = SQLFactory.createQuerySQL(this, "sat_sharematerial")
+                .setTableAlias("t1");
+        querySQ.setSiteid(siteid);
+        querySQ.setWhere("sat_sharematerialid", sat_sharematerialid);
+
+        Rows rows = querySQ.query();
+        Row detailRow = rows.isNotEmpty() ? rows.get(0) : new Row();
+
+
+        Rows attRows = getAttachmentUrl("sat_sharematerial", sat_sharematerialid);
+        detailRow.put("attinfos", attRows);
+
+
+        return getSucReturnObject().setData(detailRow).toString();
+    }
+
+
+    @API(title = "效果图列表", apiversion = R.ID20240415164402.v1.class)
+    public String list() {
+        return getSucReturnObject().toString();
+    }
+
+}

+ 1 - 2
src/custom/restcontroller/webmanage/saletool/sharematerial/sharematerialClass.java

@@ -47,8 +47,7 @@ public class sharematerialClass extends Controller {
             insertSQL.setValue("parentid", parentid);
             insertSQL.insert();
             content.put("sat_sharematerial_classid", sat_sharematerial_classid);
-        }
-        if (sat_sharematerial_classid > 0) {
+        }else{
             UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sat_sharematerial_class");
             updateSQL.setUniqueid(sat_sharematerial_classid);
             updateSQL.setSiteid(siteid);