Browse Source

小程序设计实景列表收藏逻辑调整

eganwu 1 year ago
parent
commit
21cfb313cd

+ 21 - 24
src/custom/restcontroller/webmanage/saletool/sharematerial/DesignPic.java

@@ -119,11 +119,11 @@ public class DesignPic extends Controller {
 
 
         Rows attRows = getAttachmentUrl("sat_sharematerial", sat_sharematerialid);
-        attRows.sortby("sequence","linksid");
+        attRows.sortby("sequence", "linksid");
         detailRow.put("attinfos", attRows);
         detailRow.putIfAbsent("areaname", "");
         detailRow.putIfAbsent("checkdate", "");
-        detailRow.put("appleturl", userInfo.getWechatAppPage("marketingtool","DesignImgsUrl") + sat_sharematerialid);
+        detailRow.put("appleturl", userInfo.getWechatAppPage("marketingtool", "DesignImgsUrl") + sat_sharematerialid);
         if (StringUtils.isBlank(detailRow.getString("panoramaurl"))) {
             detailRow.put("ispanorama", 0);
         } else {
@@ -250,7 +250,7 @@ public class DesignPic extends Controller {
 
 
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, sat_sharematerial,
-                        "sat_sharematerialid",  "status", "type", "commentcount", "likecount", "collectcount", "sequence", "createby", "createdate", "checkdate", "renderingsclass","panoramaurl")
+                        "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");
@@ -273,7 +273,7 @@ public class DesignPic extends Controller {
         RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
         for (Row row : rows) {
             Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
-            attinfosRows.sortby("sequence","linksid");
+            attinfosRows.sortby("sequence", "linksid");
             row.put("attinfos", attinfosRows);
             row.putIfAbsent("checkdate", "");
             if (StringUtils.isBlank(row.getString("panoramaurl"))) {
@@ -281,7 +281,7 @@ public class DesignPic extends Controller {
             } else {
                 row.put("ispanorama", 1);
             }
-            row.put("appleturl", userInfo.getWechatAppPage("marketingtool","DesignImgsUrl") + row.getString("sat_sharematerialid"));
+            row.put("appleturl", userInfo.getWechatAppPage("marketingtool", "DesignImgsUrl") + row.getString("sat_sharematerialid"));
             if (row.getInteger("type") == 4) {
                 row.put("typestr", "设计");
             }
@@ -341,33 +341,30 @@ public class DesignPic extends Controller {
                 where.append(")");
 
             }
-            if (whereObject.containsKey("iscollect") && !"".equals(whereObject.getString("iscollect"))) {
-                if (whereObject.getString("iscollect").equals("1")) {
+
+        }
+        boolean iscollect = content.getBooleanValue("iscollect");
+        if (!iscollect) {
+            if (content.getLongValue("isnationwide") == 1) {
+                where.append(" and (");
+                where.append("t1.isnationwide ='").append(content.getString("isnationwide")).append("' ");
+                where.append(")");
+            } else {
+                if (usertype == 21 || usertype == 22) {
                     where.append(" and (");
-                    where.append(" t1.sat_sharematerialid in (SELECT ownerid from sys_datacollect WHERE ownertable='sat_sharematerial' and type=1 and siteid='" + siteid + "' and userid=" + userid + ")");
+                    where.append("t1.sys_enterpriseid ='" + sys_enterpriseid + "' ");
                     where.append(")");
                 }
-
-
             }
-
-        }
-
-        if (content.getLongValue("isnationwide") == 1) {
+        } else {
             where.append(" and (");
-            where.append("t1.isnationwide ='").append(content.getString("isnationwide")).append("' ");
+            where.append(" t1.sat_sharematerialid in (SELECT ownerid from sys_datacollect WHERE ownertable='sat_sharematerial' and type=1 and siteid='" + siteid + "' and userid=" + userid + ")");
             where.append(")");
-        } else {
-            if (usertype == 21 || usertype == 22) {
-                where.append(" and (");
-                where.append("t1.sys_enterpriseid ='" + sys_enterpriseid + "' ");
-                where.append(")");
-            }
         }
 
 
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, sat_sharematerial,
-                        "sat_sharematerialid",  "title_c", "commentcount", "likecount", "collectcount", "createuserid", "createby", "createdate")
+                        "sat_sharematerialid", "title_c", "commentcount", "likecount", "collectcount", "createuserid", "createby", "createdate")
                 .setTableAlias("t1");
         querySQL.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and t2.type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
         querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t3", "t3.sys_enterpriseid=t1.sys_enterpriseid and t3.siteid=t1.siteid"
@@ -388,7 +385,7 @@ public class DesignPic extends Controller {
         RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
         for (Row row : rows) {
             Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
-            attinfosRows.sortby("sequence","linksid");
+            attinfosRows.sortby("sequence", "linksid");
             row.put("attinfos", attinfosRows);
             row.put("headpic", getHeadPic(row.getLong("createuserid")));
 
@@ -449,7 +446,7 @@ public class DesignPic extends Controller {
         RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
         for (Row row : rows) {
             Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
-            attinfosRows.sortby("sequence","linksid");
+            attinfosRows.sortby("sequence", "linksid");
             row.put("attinfos", attinfosRows);
         }