Browse Source

附件排序调整

eganwu 1 year ago
parent
commit
337c48138e

BIN
lib/yos.core-2.4.14-sources.jar → lib/yos.core-2.4.17-sources.jar


BIN
lib/yos.core-2.4.14.jar → lib/yos.core-2.4.17.jar


+ 3 - 2
src/custom/restcontroller/webmanage/saletool/fad/Fad.java

@@ -135,7 +135,7 @@ public class Fad extends Controller {
 
         QuerySQL querySQ = SQLFactory.createQuerySQL(this, sa_fad)
                 .setTableAlias("t1");
-        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sa_fad' and type=1 and t2.ownerid=t1.sa_fadid and t2.userid='" + userid + "'");
+        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sa_fad' and t2.type=1 and t2.ownerid=t1.sa_fadid and t2.userid='" + userid + "'");
         querySQ.addQueryFields("iscollect", "CASE WHEN t2.sys_datacollectid>0 THEN 1 ELSE 0 END");
         querySQ.setSiteid(siteid);
         querySQ.setWhere("sa_fadid", sa_fadid);
@@ -145,6 +145,7 @@ public class Fad extends Controller {
 
 
         Rows attRows = getAttachmentUrl(sa_fad, sa_fadid);
+        attRows.sortby("sequence","linksid");
         detailRow.put("attinfos", attRows);
         detailRow.put("appleturl", FadHelper.getAppletUrl(this, "FadUrl", "单品小程序链接") + sa_fadid);
 
@@ -154,7 +155,7 @@ public class Fad extends Controller {
         attachmentQuery.setWhere("ownertable", ownertable);
         attachmentQuery.setWhere("ownerid", sa_fadid);
         attachmentQuery.setWhere("usetype", ownertable);
-        attachmentQuery.setOrderBy("t1.sequence");
+        attachmentQuery.setOrderBy("t1.sequence,t1.linksid");
         Rows attachmentRows = attachmentQuery.query();
 
 

+ 15 - 11
src/custom/restcontroller/webmanage/saletool/sharematerial/DesignPic.java

@@ -94,10 +94,10 @@ public class DesignPic extends Controller {
                         "sat_sharematerialid", "createuserid", "createby", "createdate", "changeby", "changedate", "checkby", "checkdate", "sys_enterpriseid", "title", "type", "sequence", "status"
                         , "title_c", "renderingsclass", "isnationwide", "collectcount", "likecount", "commentcount", "panoramaurl")
                 .setTableAlias("t1");
-        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
+        querySQ.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 + "'");
         querySQ.addJoinTable(JOINTYPE.left, "sys_enterprise", "t3", "t3.sys_enterpriseid=t1.sys_enterpriseid and t3.siteid=t1.siteid"
                 , "enterprisename");
-        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
+        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and t4.type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
         querySQ.addQueryFields("iscollect", "CASE WHEN t2.sys_datacollectid>0 THEN 1 ELSE 0 END");
         querySQ.addQueryFields("islike", "CASE WHEN t4.sys_datacollectid>0 THEN 1 ELSE 0 END");
         querySQ.setSiteid(siteid);
@@ -119,6 +119,7 @@ public class DesignPic extends Controller {
 
 
         Rows attRows = getAttachmentUrl("sat_sharematerial", sat_sharematerialid);
+        attRows.sortby("sequence","linksid");
         detailRow.put("attinfos", attRows);
         detailRow.putIfAbsent("areaname", "");
         detailRow.putIfAbsent("checkdate", "");
@@ -134,7 +135,7 @@ public class DesignPic extends Controller {
         attachmentQuery.setWhere("ownertable", ownertable);
         attachmentQuery.setWhere("ownerid", sat_sharematerialid);
         attachmentQuery.setWhere("usetype", ownertable);
-        attachmentQuery.setOrderBy("t1.sequence");
+        attachmentQuery.setOrderBy("t1.sequence,t1.linksid");
         Rows attachmentRows = attachmentQuery.query();
 
 
@@ -269,8 +270,9 @@ public class DesignPic extends Controller {
         // 附件
         RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
         for (Row row : rows) {
-            Rows Rows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
-            row.put("attinfos", Rows);
+            Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
+            attinfosRows.sortby("sequence","linksid");
+            row.put("attinfos", attinfosRows);
             row.putIfAbsent("checkdate", "");
             if (StringUtils.isBlank(row.getString("panoramaurl"))) {
                 row.put("ispanorama", 0);
@@ -357,10 +359,10 @@ public class DesignPic extends Controller {
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, sat_sharematerial,
                         "sat_sharematerialid", "title", "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 type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
+        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"
                 , "enterprisename", "sys_enterpriseid");
-        querySQL.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
+        querySQL.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and t4.type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
         querySQL.addQueryFields("iscollect", "CASE WHEN t2.sys_datacollectid>0 THEN 1 ELSE 0 END");
         querySQL.addQueryFields("islike", "CASE WHEN t4.sys_datacollectid>0 THEN 1 ELSE 0 END");
         querySQL.setSiteid(siteid);
@@ -374,8 +376,9 @@ public class DesignPic extends Controller {
         // 附件
         RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
         for (Row row : rows) {
-            Rows Rows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
-            row.put("attinfos", Rows);
+            Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
+            attinfosRows.sortby("sequence","linksid");
+            row.put("attinfos", attinfosRows);
             row.put("headpic", getHeadPic(row.getLong("createuserid")));
 
 
@@ -434,8 +437,9 @@ public class DesignPic extends Controller {
         // 附件
         RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
         for (Row row : rows) {
-            Rows Rows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
-            row.put("attinfos", Rows);
+            Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
+            attinfosRows.sortby("sequence","linksid");
+            row.put("attinfos", attinfosRows);
         }
 
 

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

@@ -120,6 +120,7 @@ public class EquipmentResourceLibrary extends Controller {
         if (rows.isNotEmpty()) {
             detailRow = rows.get(0);
             Rows attRows = getAttachmentUrl("sat_sharematerial", sat_sharematerialid);
+            attRows.sortby("sequence","linksid");
             detailRow.put("attinfos", attRows);
             detailRow.putIfAbsent("checkdate", "");
             if (detailRow.getInteger("type") == 1) {
@@ -140,7 +141,7 @@ public class EquipmentResourceLibrary extends Controller {
         attachmentQuery.setWhere("ownertable", ownertable);
         attachmentQuery.setWhere("ownerid", sat_sharematerialid);
         attachmentQuery.setWhere("usetype", ownertable);
-        attachmentQuery.setOrderBy("t1.sequence");
+        attachmentQuery.setOrderBy("t1.sequence,t1.linksid");
         System.err.println(attachmentQuery.getSQL());
         Rows attachmentRows = attachmentQuery.query();
 
@@ -252,8 +253,9 @@ public class EquipmentResourceLibrary extends Controller {
         // 附件
         RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
         for (Row row : rows) {
-            Rows Rows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
-            row.put("attinfos", Rows);
+            Rows attRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
+            attRows.sortby("sequence","linksid");
+            row.put("attinfos", attRows);
             row.putIfAbsent("checkdate", "");
             if (row.getInteger("type") == 1) {
                 row.put("typestr", "图片");

+ 3 - 2
src/custom/restcontroller/webmanage/saletool/sharematerial/Renderings.java

@@ -92,7 +92,7 @@ public class Renderings extends Controller {
 
         QuerySQL querySQ = SQLFactory.createQuerySQL(this, "sat_sharematerial")
                 .setTableAlias("t1");
-        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
+        querySQ.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 + "'");
         querySQ.addQueryFields("iscollect", "CASE WHEN t2.sys_datacollectid>0 THEN 1 ELSE 0 END");
         querySQ.setWhere("sat_sharematerialid", sat_sharematerialid);
 
@@ -100,6 +100,7 @@ public class Renderings extends Controller {
         Row detailRow = rows.isNotEmpty() ? rows.get(0) : new Row();
 
         Rows attRows = getAttachmentUrl("sat_sharematerial", sat_sharematerialid);
+        attRows.sortby("sequence","linksid");
         detailRow.put("attinfos", attRows);
         detailRow.putIfAbsent("checkdate", "");
         detailRow.put("appleturl", Parameter.get("CaseImgsUrl") + sat_sharematerialid);
@@ -114,7 +115,7 @@ public class Renderings extends Controller {
         attachmentQuery.setWhere("ownertable", ownertable);
         attachmentQuery.setWhere("ownerid", sat_sharematerialid);
         attachmentQuery.setWhere("usetype", ownertable);
-        attachmentQuery.setOrderBy("t1.sequence");
+        attachmentQuery.setOrderBy("t1.sequence,t1.linksid");
         Rows attachmentRows = attachmentQuery.query();