Browse Source

我的设计实景列表

eganwu 1 year ago
parent
commit
f20d8fcf4d

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

@@ -6528,6 +6528,11 @@ public class R {
         public static class v1 {
         }
     }
+
+    public static class ID2024052413361402 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 53 - 0
src/custom/restcontroller/webmanage/saletool/sharematerial/DesignPic.java

@@ -396,6 +396,59 @@ public class DesignPic extends Controller {
         return getSucReturnObject().setData(rows).toString();
     }
 
+    @API(title = "我的设计实景", apiversion = R.ID2024052413361402.v1.class)
+    public String myList() throws YosException {
+        /*
+          过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and (");
+                where.append("t1.title like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.title_c like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+            if (whereObject.containsKey("type") && !"".equals(whereObject.getString("type"))) {
+                where.append(" and (");
+                where.append("t1.type ='").append(whereObject.getString("type")).append("' ");
+                where.append(")");
+            }
+
+
+        }
+
+
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, sat_sharematerial,
+                        "sat_sharematerialid", "status", "type", "commentcount", "likecount", "collectcount", "sequence", "createby", "createdate", "checkdate", "renderingsclass", "panoramaurl")
+                .setTableAlias("t1");
+        querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t3", "t3.sys_enterpriseid=t1.sys_enterpriseid and t3.siteid=t1.siteid"
+                , "enterprisename", "sys_enterpriseid");
+        querySQL.addQueryFields("title", "CASE WHEN length(t1.title)=0  THEN t1.title_c ELSE t1.title END");
+        querySQL.setSiteid(siteid);
+        querySQL.setWhere("createuserid", userid);
+        querySQL.setWhere("classid", 5);
+        querySQL.setWhere(where.toString());
+        querySQL.setOrderBy(pageSorting).setPage(pageSize, pageNumber);
+        Rows rows = querySQL.query();
+
+
+        ArrayList<Long> ids = rows.toArrayList("sat_sharematerialid", new ArrayList<>());
+        // 附件
+        RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
+        for (Row row : rows) {
+            Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
+            attinfosRows.sortby("sequence", "linksid");
+            row.put("attinfos", attinfosRows);
+            row.putIfAbsent("checkdate", "");
+        }
+
+
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+
     @API(title = "全景720列表", apiversion = R.ID20240417154702.v1.class)
     public String panoramalist() throws YosException {
         /*