浏览代码

装备资源库详情返回角色信息

eganwu 1 年之前
父节点
当前提交
20311bc6bd

+ 12 - 0
src/custom/restcontroller/webmanage/saletool/sharematerial/EquipmentResourceLibrary.java

@@ -96,6 +96,17 @@ public class EquipmentResourceLibrary extends Controller {
         sqlFactory.setSiteid(siteid);
         Rows rows = sqlFactory.query();
 
+
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_dataauths",
+                "roleid");
+        querySQL.addJoinTable(JOINTYPE.inner, "sys_role", "t2", "t1.roleid=t2.roleid and t1.siteid=t2.siteid",
+                "rolename");
+        querySQL.setTableAlias("t1");
+        querySQL.setWhere("t1.siteid", siteid);
+        querySQL.setWhere("t1.ownertable", "sat_sharematerial");
+        querySQL.setWhere("t1.ownerid", sat_sharematerialid);
+        Rows roleRows = querySQL.query();
+
         Row detailRow = new Row();
         if (rows.isNotEmpty()) {
             detailRow = rows.get(0);
@@ -111,6 +122,7 @@ public class EquipmentResourceLibrary extends Controller {
             if (detailRow.getInteger("type") == 3) {
                 detailRow.put("typestr", "图文");
             }
+            detailRow.put("role", roleRows.toArrayList("roleid", new ArrayList<Long>()));
         }