|
@@ -198,6 +198,48 @@ public class LongPicText extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "小程序长图文详情", apiversion = R.ID20240408131902.v1.class)
|
|
|
+ public String miniAppDetail() throws YosException {
|
|
|
+ String ownertable = "sat_sharematerial";
|
|
|
+ Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
|
|
|
+
|
|
|
+ QuerySQL querySQ = SQLFactory.createQuerySQL(this, "sat_sharematerial"
|
|
|
+ ,"sat_sharematerialid","sharepagecontrol","type","title")
|
|
|
+ .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);
|
|
|
+
|
|
|
+ QuerySQL attachmentQuery = SQLFactory.createQuerySQL(this, "sys_attachment_links").setTableAlias("t1");
|
|
|
+ attachmentQuery.setSiteid(siteid);
|
|
|
+ attachmentQuery.setWhere("ownertable", ownertable);
|
|
|
+ attachmentQuery.setWhere("ownerid", sat_sharematerialid);
|
|
|
+ attachmentQuery.setWhere("usetype", ownertable);
|
|
|
+ Rows attachmentRows = attachmentQuery.query();
|
|
|
+
|
|
|
+ ArrayList<Long> ids = attachmentRows.toArrayList("attachmentid", new ArrayList<>());
|
|
|
+
|
|
|
+ RowsMap attRowsMap = Attachment.get(this, ids).toRowsMap("attachmentid");
|
|
|
+
|
|
|
+ for (Row row : attachmentRows) {
|
|
|
+ Rows attPicRows = new Rows();
|
|
|
+ Rows tempAttRows = attRowsMap.getOrDefault(row.getString("attachmentid"), new Rows());
|
|
|
+ for (Row tempAttRow : tempAttRows) {
|
|
|
+ if (tempAttRow.getString("ownertable").equals(ownertable)) {
|
|
|
+ attPicRows.add(tempAttRow);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ row.put("attinfos", attPicRows);
|
|
|
+ }
|
|
|
+
|
|
|
+ detailRow.put("attinfos_pic", attachmentRows);
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(detailRow).toString();
|
|
|
+ }
|
|
|
+
|
|
|
// @API(title = "长图文图片列表", apiversion = R.ID20240329145502.v1.class)
|
|
|
// public String piclist() throws YosException {
|
|
|
//
|