Commit 925e8d5a by 宋祥

Merge branch 'dev-sx' of http://git.pseer.com/platform/hp-smart into dev

parents 08949142 589d79b3
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.baosight.iplat4j.common.ed.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
public class TEDPI10 extends DaoEPBase {
public String tree_ename = " ";
public String node_ename = " ";
public String node_cname = " ";
public Integer node_type = new Integer(0);
public String node_url = " ";
public String node_sort_id = " ";
public String node_param = " ";
public String node_image_path = " ";
public String node_source = " ";
public String rec_creator = " ";
public String rec_create_time = " ";
public String rec_revisor = " ";
public String rec_revise_time = " ";
public String archive_flag = " ";
public TEDPI10() {
this.initMetaData();
}
public void initMetaData() {
EiColumn eiColumn = new EiColumn("tree_ename");
eiColumn.setPrimaryKey(true);
eiColumn.setFieldLength(30);
eiColumn.setDescName("目录代码");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_ename");
eiColumn.setPrimaryKey(true);
eiColumn.setFieldLength(30);
eiColumn.setDescName("节点/页面代码");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_cname");
eiColumn.setFieldLength(80);
eiColumn.setDescName("节点/页面名称");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_type");
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(1);
eiColumn.setDescName("类型");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_url");
eiColumn.setFieldLength(200);
eiColumn.setDescName("页面载入路径");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_sort_id");
eiColumn.setFieldLength(20);
eiColumn.setDescName("排序");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_param");
eiColumn.setFieldLength(200);
eiColumn.setDescName("参数配置");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_image_path");
eiColumn.setFieldLength(200);
eiColumn.setDescName("图标路径");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("node_source");
eiColumn.setFieldLength(20);
eiColumn.setDescName("节点来源");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rec_creator");
eiColumn.setFieldLength(16);
eiColumn.setDescName("创建人");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rec_create_time");
eiColumn.setFieldLength(17);
eiColumn.setDescName("创建时间");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rec_revisor");
eiColumn.setFieldLength(16);
eiColumn.setDescName("修改人");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rec_revise_time");
eiColumn.setFieldLength(17);
eiColumn.setDescName("修改时间");
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("archive_flag");
eiColumn.setFieldLength(1);
eiColumn.setDescName("归档标记");
this.eiMetadata.addMeta(eiColumn);
}
public String getTree_ename() {
return this.tree_ename;
}
public void setTree_ename(String tree_ename) {
this.tree_ename = tree_ename;
}
public String getNode_ename() {
return this.node_ename;
}
public void setNode_ename(String node_ename) {
this.node_ename = node_ename;
}
public String getNode_cname() {
return this.node_cname;
}
public void setNode_cname(String node_cname) {
this.node_cname = node_cname;
}
public Integer getNode_type() {
return this.node_type;
}
public void setNode_type(Integer node_type) {
this.node_type = node_type;
}
public String getNode_url() {
return this.node_url;
}
public void setNode_url(String node_url) {
this.node_url = node_url;
}
public String getNode_sort_id() {
return this.node_sort_id;
}
public void setNode_sort_id(String node_sort_id) {
this.node_sort_id = node_sort_id;
}
public String getNode_param() {
return this.node_param;
}
public void setNode_param(String node_param) {
this.node_param = node_param;
}
public String getNode_image_path() {
return this.node_image_path;
}
public void setNode_image_path(String node_image_path) {
this.node_image_path = node_image_path;
}
public String getNode_source() {
return node_source;
}
public void setNode_source(String node_source) {
this.node_source = node_source;
}
public String getRec_creator() {
return this.rec_creator;
}
public void setRec_creator(String rec_creator) {
this.rec_creator = rec_creator;
}
public String getRec_create_time() {
return this.rec_create_time;
}
public void setRec_create_time(String rec_create_time) {
this.rec_create_time = rec_create_time;
}
public String getRec_revisor() {
return this.rec_revisor;
}
public void setRec_revisor(String rec_revisor) {
this.rec_revisor = rec_revisor;
}
public String getRec_revise_time() {
return this.rec_revise_time;
}
public void setRec_revise_time(String rec_revise_time) {
this.rec_revise_time = rec_revise_time;
}
public String getArchive_flag() {
return this.archive_flag;
}
public void setArchive_flag(String archive_flag) {
this.archive_flag = archive_flag;
}
public void fromMap(Map map) {
this.setTree_ename(StringUtils.defaultIfEmpty((String)map.get("tree_ename"), this.tree_ename));
this.setNode_ename(StringUtils.defaultIfEmpty((String)map.get("node_ename"), this.node_ename));
this.setNode_cname(StringUtils.defaultIfEmpty((String)map.get("node_cname"), this.node_cname));
this.setNode_type(NumberUtils.toInteger(map.get("node_type"), this.node_type));
this.setNode_url(StringUtils.defaultIfEmpty((String)map.get("node_url"), this.node_url));
this.setNode_sort_id(StringUtils.defaultIfEmpty((String)map.get("node_sort_id"), this.node_sort_id));
this.setNode_param(StringUtils.defaultIfEmpty((String)map.get("node_param"), this.node_param));
this.setNode_image_path(StringUtils.defaultIfEmpty((String)map.get("node_image_path"), this.node_image_path));
this.setNode_source(StringUtils.defaultIfEmpty((String)map.get("node_source"), this.node_source));
this.setRec_creator(StringUtils.defaultIfEmpty((String)map.get("rec_creator"), this.rec_creator));
this.setRec_create_time(StringUtils.defaultIfEmpty((String)map.get("rec_create_time"), this.rec_create_time));
this.setRec_revisor(StringUtils.defaultIfEmpty((String)map.get("rec_revisor"), this.rec_revisor));
this.setRec_revise_time(StringUtils.defaultIfEmpty((String)map.get("rec_revise_time"), this.rec_revise_time));
this.setArchive_flag(StringUtils.defaultIfEmpty((String)map.get("archive_flag"), this.archive_flag));
}
public Map toMap() {
Map map = new HashMap();
map.put("tree_ename", StringUtils.toString(this.tree_ename, this.eiMetadata.getMeta("tree_ename").getFieldLength(), this.eiMetadata.getMeta("tree_ename").getScaleLength()));
map.put("node_ename", StringUtils.toString(this.node_ename, this.eiMetadata.getMeta("node_ename").getFieldLength(), this.eiMetadata.getMeta("node_ename").getScaleLength()));
map.put("node_cname", StringUtils.toString(this.node_cname, this.eiMetadata.getMeta("node_cname").getFieldLength(), this.eiMetadata.getMeta("node_cname").getScaleLength()));
map.put("node_type", StringUtils.toString(this.node_type, this.eiMetadata.getMeta("node_type").getFieldLength(), this.eiMetadata.getMeta("node_type").getScaleLength()));
map.put("node_url", StringUtils.toString(this.node_url, this.eiMetadata.getMeta("node_url").getFieldLength(), this.eiMetadata.getMeta("node_url").getScaleLength()));
map.put("node_sort_id", StringUtils.toString(this.node_sort_id, this.eiMetadata.getMeta("node_sort_id").getFieldLength(), this.eiMetadata.getMeta("node_sort_id").getScaleLength()));
map.put("node_param", StringUtils.toString(this.node_param, this.eiMetadata.getMeta("node_param").getFieldLength(), this.eiMetadata.getMeta("node_param").getScaleLength()));
map.put("node_image_path", StringUtils.toString(this.node_image_path, this.eiMetadata.getMeta("node_image_path").getFieldLength(), this.eiMetadata.getMeta("node_image_path").getScaleLength()));
map.put("node_source", StringUtils.toString(this.node_source, this.eiMetadata.getMeta("node_source").getFieldLength(), this.eiMetadata.getMeta("node_source").getScaleLength()));
map.put("rec_creator", StringUtils.toString(this.rec_creator, this.eiMetadata.getMeta("rec_creator").getFieldLength(), this.eiMetadata.getMeta("rec_creator").getScaleLength()));
map.put("rec_create_time", StringUtils.toString(this.rec_create_time, this.eiMetadata.getMeta("rec_create_time").getFieldLength(), this.eiMetadata.getMeta("rec_create_time").getScaleLength()));
map.put("rec_revisor", StringUtils.toString(this.rec_revisor, this.eiMetadata.getMeta("rec_revisor").getFieldLength(), this.eiMetadata.getMeta("rec_revisor").getScaleLength()));
map.put("rec_revise_time", StringUtils.toString(this.rec_revise_time, this.eiMetadata.getMeta("rec_revise_time").getFieldLength(), this.eiMetadata.getMeta("rec_revise_time").getScaleLength()));
map.put("archive_flag", StringUtils.toString(this.archive_flag, this.eiMetadata.getMeta("archive_flag").getFieldLength(), this.eiMetadata.getMeta("archive_flag").getScaleLength()));
return map;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2009-10-22 9:29:53
Version : 1.0.1.V20070717
table comment : 项目菜单节点信息
tableName :${platSchema}.TEDPI10
TREE_ENAME VARCHAR2 NOT NULL,
NODE_ENAME VARCHAR2 NOT NULL,
NODE_CNAME VARCHAR2 NOT NULL,
NODE_TYPE NUMBER NOT NULL,
NODE_URL VARCHAR2 NOT NULL,
NODE_SORT_ID VARCHAR2 NOT NULL,
NODE_FUNC VARCHAR2 NOT NULL,
REC_CREATOR VARCHAR2 NOT NULL,
REC_CREATE_TIME VARCHAR2 NOT NULL,
REC_REVISOR VARCHAR2 NOT NULL,
REC_REVISE_TIME VARCHAR2 NOT NULL,
ARCHIVE_FLAG VARCHAR2 NOT NULL
-->
<sqlMap namespace="tedpi10">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.iplat4j.common.ed.domain.TEDPI10">
SELECT
rec_creator as "rec_creator",
rec_create_time as "rec_create_time",
rec_revisor as "rec_revisor",
rec_revise_time as "rec_revise_time",
archive_flag as "archive_flag",
tree_ename as "tree_ename",
node_ename as "node_ename",
node_cname as "node_cname",
node_type as "node_type",
node_url as "node_url",
node_sort_id as "node_sort_id" ,
node_param as "node_param" ,
node_image_path as "node_image_path",
node_source as "node_source"
FROM ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="tree_ename">
tree_ename = #tree_ename#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_ename">
node_ename = #node_ename#
</isNotEmpty>
</dynamic>
</select>
<insert id="insert">
INSERT INTO ${platSchema}.TEDPI10 (
rec_creator ,
rec_create_time,
rec_revisor ,
rec_revise_time,
archive_flag ,
tree_ename ,
node_ename ,
node_cname ,
node_type ,
node_url ,
node_sort_id ,
node_param ,
node_image_path,
node_source
) VALUES (
#rec_creator#,
#rec_create_time#,
#rec_revisor#,
#rec_revise_time#,
#archive_flag#,
#tree_ename#,
#node_ename#,
#node_cname#,
#node_type#,
#node_url#,
#node_sort_id# ,
#node_param# ,
#node_image_path#,
#node_source#
)
</insert>
<delete id="delete">
DELETE FROM ${platSchema}.TEDPI10
WHERE tree_ename = #tree_ename#
AND node_ename = #node_ename#
</delete>
<update id="update">
UPDATE ${platSchema}.TEDPI10 SET
rec_creator = #rec_creator#,
rec_create_time = #rec_create_time#,
rec_revisor = #rec_revisor#,
rec_revise_time = #rec_revise_time#,
archive_flag = #archive_flag#,
tree_ename = #tree_ename#,
node_ename = #node_ename#,
node_cname = #node_cname#,
node_type = #node_type#,
node_url = #node_url#,
node_sort_id = #node_sort_id# ,
node_param =#node_param# ,
node_image_path = #node_image_path#,
node_source = #node_source#
WHERE tree_ename = #tree_ename#
AND node_ename = #node_ename#
</update>
<select id="queryChildren" parameterClass="java.util.Map"
resultClass="com.baosight.iplat4j.common.ed.domain.TEDPI10">
SELECT
rec_creator as "rec_creator", <!-- 记录创建责任者-->
rec_create_time as "rec_create_time", <!-- 记录创建时刻 -->
rec_revisor as "rec_revisor", <!-- 记录修改责任者 -->
rec_revise_time as "rec_revise_time", <!-- 记录修改时刻 -->
archive_flag as "archive_flag", <!-- 归档标记 -->
tree_ename as "tree_ename", <!-- 节点树英文名 目录代码-->
node_ename as "node_ename", <!-- 节点英文名-->
node_cname as "node_cname", <!-- 节点中文名-->
node_type as "node_type", <!-- 节点类型-->
node_url as "node_url", <!-- 节点URL-->
node_sort_id as "node_sort_id" , <!-- 节点排序标识-->
node_param as "node_param" , <!-- 节点参数配置 -->
node_image_path as "node_image_path" <!-- 节点图片路径 -->
FROM ${platSchema}.TEDPI10 WHERE 1=1
<isNotEmpty prepend=" AND " property="tree_ename">
tree_ename = #tree_ename#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="node_cname">-->
<!--node_cname like '%$node_cname$%'-->
<!--</isNotEmpty>-->
<!--<isNotEmpty prepend=" AND " property="tree_ename">-->
<!--tree_ename = #tree_ename#-->
<!--</isNotEmpty>-->
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
node_sort_id asc
</isEmpty>
</dynamic>
</select>
<select id="queryIndexTree" resultClass="java.util.HashMap">
SELECT
t1.tree_ename as "parent",
t1.node_ename as "label",
t1.node_cname as "text",
t1.node_image_path as "imagePath",
t1.node_type as "leaf",
t1.node_param as "nodeParam",
t1.node_url as "nodeUrl",
t1.node_type as "node_type",
t2.is_auth as "isAuth"
FROM ${platSchema}.TEDPI10 t1
left join ${platSchema}.TEDFA00 t2 ON t2.form_ename = t1.node_ename
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="tree_ename">
t1.tree_ename = #tree_ename#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="treeEnameList">
t1.tree_ename in
<iterate property="treeEnameList" open="(" close=")" conjunction=",">
#treeEnameList[]#
</iterate>
</isNotEmpty>
</dynamic>
order by t1.NODE_SORT_ID asc,t1.tree_ename asc
</select>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="EDPI10">
<select id="query" resultClass="java.util.HashMap">
SELECT
rec_creator as "rec_creator",
rec_create_time as "rec_create_time",
rec_revisor as "rec_revisor",
rec_revise_time as "rec_revise_time",
archive_flag as "archive_flag",
tree_ename as "tree_ename",
node_ename as "node_ename",
node_cname as "node_cname",
node_type as "node_type",
node_url as "node_url",
node_sort_id as "node_sort_id" ,
node_param as "node_param",
node_image_path as "node_image_path",
node_source as "node_source"
FROM ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="tree_ename">
<!--tree_ename like ('$tree_ename$%')-->
tree_ename = (#tree_ename#)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_ename">
node_ename like ('%$node_ename$%')
<!--node_ename = (#node_ename#)-->
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_ename_equals">
node_ename = #node_ename_equals#
<!--node_ename = (#node_ename#)-->
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_cname">
node_cname like ('%$node_cname$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_type">
node_type = (#node_type#)
</isNotEmpty>
</dynamic>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
tree_ename asc, node_sort_id asc, node_ename asc
</isEmpty>
</dynamic>
</select>
<select id="countChild" resultClass="int">
SELECT
count(1)
FROM ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="tree_ename">
<!--tree_ename like ('$tree_ename$%')-->
tree_ename = (#tree_ename#)
</isNotEmpty>
</dynamic>
</select>
<update id="update" parameterClass="java.util.HashMap">
update ${platSchema}.TEDPI10 set
rec_revisor = #rec_revisor#,
rec_revise_time = #rec_revise_time#,
tree_ename = #tree_ename#,
node_cname = #node_cname#,
node_type = #node_type#,
node_url = #node_url#,
node_sort_id = #node_sort_id# ,
node_param = #node_param#,
node_image_path = #node_image_path#,
node_source = #node_source#
where node_ename = #node_ename# and tree_ename = #originPid#
</update>
<update id="reindex" parameterClass="java.util.HashMap">
update ${platSchema}.TEDPI10 set
node_sort_id = #node_sort_id#
where node_ename = #node_ename#
</update>
<select id="count" resultClass="int">
SELECT count(*)
FROM ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="tree_ename">
<!--tree_ename like ('$tree_ename$%')-->
tree_ename = (#tree_ename#)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_ename">
node_ename like ('%$node_ename$%')
<!--node_ename = (#node_ename#)-->
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_cname">
node_cname like ('%$node_cname$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_type">
node_type = (#node_type#)
</isNotEmpty>
</dynamic>
</select>
<select id="queryFunc" resultClass="java.util.HashMap">
SELECT
rec_creator as "rec_creator",
rec_create_time as "rec_create_time",
rec_revisor as "rec_revisor",
rec_revise_time as "rec_revise_time",
archive_flag as "archive_flag",
tree_ename as "tree_ename",
node_ename as "node_ename",
node_cname as "node_cname",
node_type as "node_type",
node_url as "node_url",
node_sort_id as "node_sort_id" ,
node_param as "node_param" ,
node_image_path as "node_image_path"
FROM ${platSchema}.TEDPI10 where 1=1
<isNotEmpty prepend=" AND " property="tree_ename">
tree_ename =#tree_ename#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_ename">
node_ename =#node_ename#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
tree_ename asc, node_sort_id asc, node_ename asc
</isEmpty>
</dynamic>
</select>
<select id="checkQuery" resultClass="java.util.HashMap">
SELECT
rec_creator as "rec_creator",
rec_create_time as "rec_create_time",
rec_revisor as "rec_revisor",
rec_revise_time as "rec_revise_time",
archive_flag as "archive_flag",
tree_ename as "tree_ename",
node_ename as "node_ename",
node_cname as "node_cname",
node_type as "node_type",
node_url as "node_url",
node_sort_id as "node_sort_id" ,
node_param as "node_param",
node_image_path as "node_image_path"
FROM ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="tree_ename">
tree_ename = #tree_ename#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_ename">
node_ename = #node_ename#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_cname">
node_cname like ('%$node_cname$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_type">
node_type = (#node_type#)
</isNotEmpty>
</dynamic>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
tree_ename asc, node_sort_id asc, node_ename asc
</isEmpty>
</dynamic>
</select>
<select id="queryForRecursiveChildPage" resultClass="java.util.HashMap">
WITH temp("LEVEL",parent, label, text, imagePath, leaf) AS
(
SELECT
0 as "LEVEL",
tree_ename AS "parent",
node_ename AS "label",
node_cname AS "text",
node_image_path AS "imagePath",
node_type AS "leaf"
FROM ${platSchema}.TEDPI10
WHERE NODE_ENAME = #node#
UNION ALL
SELECT
super."LEVEL" + 1,
CHILD.TREE_ENAME AS "parent",
CHILD.NODE_ENAME AS "label",
CHILD.node_cname AS "text",
CHILD.node_image_path AS "imagePath",
CHILD.node_type AS "leaf"
FROM TEMP
super, ${platSchema}.TEDPI10 CHILD
WHERE
super.label = CHILD.TREE_ENAME and super."LEVEL" <![CDATA[<]]> 3
)
SELECT
parent AS "parent",
label AS "label",
text AS "text",
imagePath AS "imagePath",
leaf AS "leaf"
FROM temp
WHERE leaf = '1'
</select>
<select id="checkTreeEname" parameterClass="com.baosight.iplat4j.common.ed.domain.TEDPI10"
resultClass="int">
SELECT COUNT(*) FROM ${platSchema}.TEDPI10 WHERE 1=1
<isNotEmpty prepend=" AND " property="tree_ename">
tree_ename = #tree_ename#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="node_ename">
node_ename = #node_ename#
</isNotEmpty>
</select>
<!-- 查询当前节点子节点-->
<select id="queryChildInfo" resultClass="java.util.HashMap">
SELECT NODE_ENAME as "memberId",TREE_ENAME as "parentId" FROM ${platSchema}.TEDPI10 WHERE TREE_ENAME = #parentId#
</select>
<!-- 查询当前节点父节点-->
<select id="queryParentInfo" resultClass="java.util.HashMap">
SELECT NODE_ENAME as "memberId",TREE_ENAME as "parentId" FROM ${platSchema}.TEDPI10 WHERE NODE_ENAME = #memberId#
</select>
</sqlMap>
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.baosight.iplat4j.ef.service;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.util.List;
import java.util.Map;
public class ServiceEF0000 extends ServiceEPBase {
private static String appCode;
public ServiceEF0000() {
}
public EiInfo query(EiInfo inInfo) {
String pEname = inInfo.getCellStr(EiConstant.queryBlock, 0, "node");
String source = inInfo.getCellStr(EiConstant.queryBlock, 0, "source");
inInfo.set("loginName", UserSession.getLoginName());
inInfo.set(EiConstant.serviceId, "S_XS_02");
inInfo.set("p", pEname);
// 1-PC端,2-APP端
inInfo.set("source", StringUtils.isBlank(source) ? "1" : source);
EiInfo outInfo = XServiceManager.call(inInfo);
EiBlock eiBlock = new EiBlock(pEname);
List list = (List) outInfo.get("result");
List i18nList = I18nMessages.getText(list);
eiBlock.addRows(i18nList);
outInfo.addBlock(eiBlock);
return outInfo;
}
/**
* 查询APP菜单
*
* @param inInfo
* @return
*/
public EiInfo queryApp(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("node", "APP");
// 2-APP端
queryMap.put("source", "2");
inInfo = query(inInfo);
// 组装返回值JSON
List<Map> resultRows = inInfo.getBlock("APP").getRows();
EiInfo outInfo = new EiInfo();
outInfo.set("menu", resultRows);
return outInfo;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.baosight.xservices.xs.authentication;
import com.baosight.iplat4j.core.cache.CacheManager;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.xservices.xs.util.LoginUserDetails;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class AuthenticationInfo {
private static Map<String, Object> userBelongToGroups = new ConcurrentHashMap();
private static Map<String, Object> userManagerGroups = new ConcurrentHashMap();
private static Map<String, Object> resourceBelongToGroups = new ConcurrentHashMap();
private static Map<String, Object> userParentGroups = new ConcurrentHashMap();
public static Map<String, Object> userAuthentication = new ConcurrentHashMap();
public static Map<String, Object> authenticationByParam = new ConcurrentHashMap();
private static Map<String, Object> userAuthPages = new ConcurrentHashMap();
public static Map<String, Object> userAuthMenuPages = new ConcurrentHashMap();
public static Map<String, Object> userAuthenticationOfResource = new ConcurrentHashMap();
public static Map<String, Object> userManageAuthentication = new ConcurrentHashMap();
public static final String SUBJECT_PARENT_CACHE = "iplat:security:subjectParentCache";
public static final String SUBJECT_CACHE = "iplat:security:subjectCache";
public static final String SUBJECT_RESOURCE_CACHE = "iplat:security:subjectResourceCache";
public static final String SUBJECT_PAGE_CACHE = "iplat:security:subjectPageCache";
public static final String UNAUTH_PAGE_BUTT_CACHE = "iplat:security:unAuthPageButtCache";
public static final String USER_CACHE = "iplat:security:userCache";
private static final String KEY_GROUP_THRESHOLD = "xservices.security.cache.groupCountThreshold";
private static final int DEFAULT_GROUP_THRESHOLD = 20;
private static Map<String, String> param = null;
private static final Logger logger = LogManager.getLogger(AuthenticationInfo.class);
public AuthenticationInfo() {
}
public static String getSubjectId(String subjectType, String subjectName) {
String memberId = null;
Map paramMap = new HashMap();
new ArrayList();
String subjectParam = null;
String resultParam = null;
String checkSqlId = null;
byte var9 = -1;
switch(subjectType.hashCode()) {
case -970063637:
if (subjectType.equals("USER_GROUP")) {
var9 = 1;
}
break;
case 2614219:
if (subjectType.equals("USER")) {
var9 = 0;
}
}
switch(var9) {
case 0:
subjectParam = "loginName";
resultParam = "userId";
checkSqlId = "XSUser.query";
break;
case 1:
subjectParam = "loginName";
resultParam = "groupId";
checkSqlId = "XSUserManage.queryUserGroup";
break;
default:
subjectParam = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".subjectNameParam");
resultParam = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".subjectIdParam");
checkSqlId = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".checkSqlId");
}
if (StringUtils.isNotEmpty(subjectParam) && StringUtils.isNotEmpty(resultParam) && StringUtils.isNotEmpty(checkSqlId)) {
paramMap.put(subjectParam, subjectName);
List members = getDao().query(checkSqlId, paramMap);
if (members.size() < 1) {
memberId = null;
} else {
memberId = ((Map)members.get(0)).get(resultParam).toString();
}
return memberId;
} else {
throw new PlatException("当前授权类型主体配置缺失,请检查");
}
}
public static Map<String, Object> getUserBelongToGroups(String loginName) {
userBelongToGroups = CacheManager.getCache("iplat:security:subjectParentCache");
getUserBelongToGroupsList(loginName);
return userBelongToGroups;
}
public static List getUserBelongToGroupsList(String loginName) {
return getSubjectParentList("loginName", loginName, "XSAuthorization.queryUserGroupsByLoginName");
}
private static List getSubjectParentList(String paramKey, String paramVal, String sqlId) {
List result = (List)CacheManager.getCacheValue("iplat:security:subjectParentCache", paramVal, () -> {
param = new HashMap();
param.put(paramKey, paramVal);
return getResultList(sqlId, param);
});
return result;
}
public static Map<String, Object> getResourceBelongToGroups(String resourceEname) {
param = new HashMap();
param.put("resourceEname", resourceEname);
getResultList("XSAuthorization.queryResourceGroupsByResourceEname", param, resourceBelongToGroups, resourceEname);
return resourceBelongToGroups;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getUserParentGroupsByGroupEname(String groupEname) {
Map returnMap = new HashMap();
List result = getUserParentGroupsByGroupEnameList(groupEname);
returnMap.put(groupEname, result);
return returnMap;
}
public static List getUserParentGroupsByGroupEnameList(String groupEname) {
param = new HashMap();
param.put("groupEname", groupEname);
return getResultList("XSAuthorization.queryUserParentGroups", param);
}
public static Map<String, Object> getUserManagerGroups(String loginName) {
param = new HashMap();
param.put("loginName", loginName);
getResultList("XSAuthorization.queryUserManagerGroups", param, userManagerGroups, loginName);
return userManagerGroups;
}
public static Map<String, Object> getUserManageAuthentication(String loginName) {
long startTime = System.currentTimeMillis();
Map param = new HashMap();
param.put("loginName", loginName);
List authManagerList = getDao().query("XSAuthorization.getAllManageResource", param);
userManageAuthentication.put(loginName, authManagerList);
long endTime = System.currentTimeMillis();
System.out.println("getUserManageAuthentication使用时间:" + (endTime - startTime) + "毫秒");
return userManageAuthentication;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getAuthenticationByParam(String subjectName, String subjectType) {
Map resultMap = null;
if (subjectType.equals("USER")) {
resultMap = getUserAuthentication(subjectName);
} else if (subjectType.equals("USER_GROUP")) {
List result = getAuthenticationByParamList(subjectName, subjectType);
authenticationByParam.put(subjectName, result);
resultMap = authenticationByParam;
}
return resultMap;
}
public static List getAuthenticationByParamList(String subjectName, String subjectType) {
List resultList = null;
if (subjectType.equals("USER")) {
resultList = getUserAuthenticationList(subjectName);
} else if (subjectType.equals("USER_GROUP")) {
List result = new ArrayList();
List parentGroupList = null;
String subjectId = "";
Map paramMap = new HashMap();
List subjectList = null;
getUserParentGroupsByGroupEname(subjectName);
parentGroupList = (List)userParentGroups.get(subjectName);
paramMap.put("groupEname", subjectName);
subjectList = getDao().query("XSUserManage.queryUserGroup", paramMap);
if (null != parentGroupList && parentGroupList.size() > 0) {
for(int i = 0; i < parentGroupList.size(); ++i) {
String parentSubjectId = (String)((Map)parentGroupList.get(i)).get("groupId");
String parentSubjectEnamed = (String)((Map)parentGroupList.get(i)).get("groupEname");
List list = getCachedSubjectAuthList(parentSubjectId, parentSubjectEnamed);
result.addAll(list);
}
}
if (null != subjectList && subjectList.size() > 0) {
subjectId = ((Map)subjectList.get(0)).get("groupId").toString();
}
List list = getCachedSubjectAuthList(subjectId, subjectName);
result.addAll(list);
resultList = result;
}
return (List)resultList;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getOldAuthenticationByParam(String subjectName, String subjectType) {
if (subjectType.equals("USER")) {
return getUserAuthentication(subjectName);
} else {
String key = "";
List result = new ArrayList();
List parentGroupList = null;
String subjectId = "";
Map paramMap = new HashMap();
String paramKey = "resourceGroupEname";
List subjectList = null;
String subjectKey = "resourceGroupId";
if (subjectType.equals("USER_GROUP")) {
getUserParentGroupsByGroupEname(subjectName);
parentGroupList = (List)userParentGroups.get(subjectName);
key = "groupId";
paramKey = "groupEname";
paramMap.put(paramKey, subjectName);
subjectList = getDao().query("XSUserManage.queryUserGroup", paramMap);
subjectKey = "groupId";
} else if (subjectType.equals("RESOURCE")) {
getResourceBelongToGroups(subjectName);
parentGroupList = (List)resourceBelongToGroups.get(subjectName);
key = "resourceGroupId";
paramKey = "resourceEname";
paramMap.put(paramKey, subjectName);
subjectList = getDao().query("XSResourceManage.queryResource", paramMap);
subjectKey = "resourceId";
} else {
paramMap.put(paramKey, subjectName);
subjectList = getDao().query("XSResourceManage.queryResourceGroup", paramMap);
}
if (null != parentGroupList && parentGroupList.size() > 0) {
for(int i = 0; i < parentGroupList.size(); ++i) {
Map map = new HashMap();
map.put("subjectId", ((Map)parentGroupList.get(i)).get(key));
List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map);
result.addAll(list);
}
}
if (null != subjectList && subjectList.size() > 0) {
subjectId = ((Map)subjectList.get(0)).get(subjectKey).toString();
}
Map map = new HashMap();
map.put("subjectId", subjectId);
List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map);
result.addAll(list);
Map retMap = new HashMap();
retMap.put(subjectName, result);
return retMap;
}
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getUserAuthentication(String loginName) {
List result = getUserAuthenticationList(loginName);
userAuthentication.put(loginName, result);
return userAuthentication;
}
public static List getUserAuthenticationList(String loginName) {
return getSubjectAuthenticationList(loginName, "USER");
}
public static List getSubjectAuthenticationList(String subjectName, String subjectType) {
long startTime = System.currentTimeMillis();
long endTime = System.currentTimeMillis();
long executionTime = endTime - startTime;
logger.info("getUserAuthenticationList:getUserBelongToGroups(loginName);Time:" + executionTime);
long startTime2 = System.currentTimeMillis();
String subjectId = getSubjectId(subjectType, subjectName);
userBelongToGroups = CacheManager.getCache("iplat:security:subjectParentCache");
long endTime2 = System.currentTimeMillis();
long executionTime2 = endTime2 - startTime2;
logger.info("getUserAuthenticationList:getSubjectId(loginName);Time:" + executionTime2);
long startTime1 = System.currentTimeMillis();
String resultParam = null;
List userGroupsList = null;
byte var20 = -1;
switch(subjectType.hashCode()) {
case 2614219:
if (subjectType.equals("USER")) {
var20 = 0;
}
default:
switch(var20) {
case 0:
userGroupsList = getUserBelongToGroupsList(subjectName);
resultParam = "userId";
break;
default:
resultParam = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".subjectIdParam");
String subjectParam = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".subjectNameParam");
String parentGroupSqlId = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".parentGroupSqlId");
userGroupsList = getSubjectParentList(subjectParam, subjectName, parentGroupSqlId);
}
long endTime1 = System.currentTimeMillis();
long executionTime1 = endTime1 - startTime1;
logger.info("getUserAuthenticationList:List userGroupsList = getUserBelongToGroupsList(loginName);Time:" + executionTime1);
long startTime3 = System.currentTimeMillis();
List result = new ArrayList();
if (userGroupsList != null && userGroupsList.size() > 0) {
int groupThreshold;
try {
groupThreshold = PlatApplicationContext.getAllProperties().containsKey("xservices.security.cache.groupCountThreshold") ? Integer.parseInt(PlatApplicationContext.getProperty("xservices.security.cache.groupCountThreshold")) : 20;
} catch (NumberFormatException | NullPointerException var41) {
groupThreshold = 20;
}
List groupListAuthList;
if (userGroupsList.size() > groupThreshold) {
List paramUserGroupList = new ArrayList(userGroupsList);
groupListAuthList = (List)CacheManager.getCacheValue("iplat:security:userCache", subjectName, () -> {
return getGroupListAuthList(paramUserGroupList);
});
} else {
groupListAuthList = getGroupListAuthList(userGroupsList);
}
result.addAll(groupListAuthList);
}
long endTime3 = System.currentTimeMillis();
long executionTime3 = endTime3 - startTime3;
logger.info("getUserAuthenticationList:groupListAuthList = getGroupListAuthList(userGroupsList);Time:" + executionTime3);
long startTime4 = System.currentTimeMillis();
List list = getCachedSubjectAuthList(subjectId, subjectName);
result.addAll(list);
long endTime4 = System.currentTimeMillis();
long executionTime4 = endTime4 - startTime3;
logger.info("getUserAuthenticationList:List list = getCachedSubjectAuthList(userId, loginName);Time:" + executionTime4);
for(int k = 0; k < result.size(); ++k) {
Map resultMap = (Map)result.get(k);
resultMap.put(resultParam, subjectId);
}
long endTime5 = System.currentTimeMillis();
long executionTime5 = endTime5 - startTime;
logger.info("getUserAuthenticationList:TotalTime:" + executionTime5);
return result;
}
}
private static List getGroupListAuthList(List userGroupsList) {
Set resultGroupIds = new HashSet();
List resultGroups = new ArrayList();
for(int i = 0; i < userGroupsList.size(); ++i) {
String subjectId = (String)((Map)userGroupsList.get(i)).get("groupId");
String groupEname = (String)((Map)userGroupsList.get(i)).get("groupEname");
List list = getCachedSubjectAuthList(subjectId, groupEname);
Iterator var7 = list.iterator();
while(var7.hasNext()) {
Object cacheVal = var7.next();
if (cacheVal instanceof Map) {
String authSubjectId = (String)((Map)cacheVal).get("subjectId");
String authObjectId = (String)((Map)cacheVal).get("objectId");
String resourceMemberId = (String)((Map)cacheVal).get("resourceMemberId");
String resultGroupId = authSubjectId + "#" + authObjectId + "#" + (resourceMemberId == null ? "" : resourceMemberId);
if (!resultGroupIds.contains(resultGroupId)) {
resultGroups.add(cacheVal);
resultGroupIds.add(resultGroupId);
}
}
}
}
resultGroupIds.clear();
return resultGroups;
}
private static List getCachedSubjectAuthList(String subjectId, String subjectEname) {
List list = (List)CacheManager.getCacheValue("iplat:security:subjectCache", subjectEname, () -> {
Map map = new HashMap();
map.put("subjectId", subjectId);
return getResultList("XSAuthorization.queryDirectResourceAuthzBySubjectId", map);
});
return list;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getOldUserAuthentication(String loginName) {
getUserBelongToGroups(loginName);
List userGroupsList = (List)userBelongToGroups.get(loginName);
Map userDetails = LoginUserDetails.getLoginUserDetails(loginName);
List result = new ArrayList();
if (userGroupsList != null && userGroupsList.size() > 0) {
for(int i = 0; i < userGroupsList.size(); ++i) {
Map map = new HashMap();
map.put("subjectId", ((Map)userGroupsList.get(i)).get("groupId"));
List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map);
result.addAll(list);
}
}
Map map = new HashMap();
map.put("subjectId", userDetails.get("userId"));
List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map);
for(int k = 0; k < result.size(); ++k) {
Map resultMap = (Map)list.get(k);
resultMap.put("userId", userDetails.get("userId"));
}
result.addAll(list);
Map retMap = new HashMap();
retMap.put(loginName, result);
return retMap;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getUserAuthenticationOfResource(String loginName) {
List result = getUserAuthenticationOfResourceList(loginName);
userAuthenticationOfResource.put(loginName, result);
return userAuthenticationOfResource;
}
public static List getUserAuthenticationOfResourceList(String loginName) {
Map<String, Object> userBelongToGroups = getUserBelongToGroups(loginName);
List userGroupsList = (List)userBelongToGroups.get(loginName);
List<Map> result = new ArrayList();
Map userDetails = LoginUserDetails.getLoginUserDetails(loginName);
List userAuthList = getCachedSubjectResList((String)userDetails.get("userId"), loginName);
Set<String> resEnameSet = new HashSet();
filterAuthResourceList(result, resEnameSet, userAuthList);
if (userGroupsList != null && userGroupsList.size() > 0) {
for(int i = 0; i < userGroupsList.size(); ++i) {
String groupId = (String)((Map)userGroupsList.get(i)).get("groupId");
String groupEname = (String)((Map)userGroupsList.get(i)).get("groupEname");
List list = getCachedSubjectResList(groupId, groupEname);
filterAuthResourceList(result, resEnameSet, list);
}
}
sortResorceList(result);
return result;
}
private static void sortResorceList(List<Map> result) {
result.sort((map1, map2) -> {
String key1 = map1.get("resourceEname").toString() + map1.get("operationType").toString();
String key2 = map2.get("resourceEname").toString() + map2.get("operationType").toString();
return key1.compareTo(key2);
});
}
private static void filterAuthResourceList(List result, Set<String> resEnameSet, List list) {
Iterator var3 = list.iterator();
while(var3.hasNext()) {
Object resultObj = var3.next();
String resEname = (String)((Map)resultObj).get("resourceEname");
String operationType = (String)((Map)resultObj).get("operationType");
String key = resEname + "@" + operationType;
if (!resEnameSet.contains(key)) {
result.add(resultObj);
resEnameSet.add(key);
}
}
}
private static List<Map> clearButtonOfResource(List<Map> list) {
List<Map> result = new ArrayList();
if (null != list && list.size() > 0) {
for(int i = 0; i < list.size(); ++i) {
Map<String, String> map = (Map)list.get(i);
if (!"BUTTON".equals(map.get("RESOURCETYPE")) && !"BUTTON".equals(map.get("resourceType"))) {
result.add(map);
}
}
}
return result;
}
private static List getCachedSubjectResList(String subjectId, String subjectEname) {
List<Map> list = (List)CacheManager.getCacheValue("iplat:security:subjectResourceCache", subjectEname, () -> {
Map map = new HashMap();
map.put("subjectId", subjectId);
return getResultList("XSAuthorization.queryDirectResourceAuthBySubjectId", map);
});
List<Map> listUnAuthed = getAllUnAuthPageButt();
List newList2 = (List)Stream.concat(list.stream(), listUnAuthed.stream()).collect(Collectors.toList());
return newList2;
}
public static List getAllUnAuthPageButt() {
List<Map> list = (List)CacheManager.getCacheValue("iplat:security:unAuthPageButtCache", "unAuthPageButtCache", () -> {
List resultList = getResultList("XSAuthorization.queryAllUnAuthPageButt", new HashMap());
return resultList;
});
return list;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getOldUserAuthenticationOfResource(String loginName) {
Map res = CacheManager.getCache("iplat:security:userResourceCache");
Map userDetails = LoginUserDetails.getLoginUserDetails(loginName);
List result = new ArrayList();
Map map = new HashMap();
map.put("subjectId", userDetails.get("userId"));
List list = getResultList("XSAuthorization.queryAllResourceAuthBySubjectId", map);
result.addAll(list);
res.put(loginName, result);
return res;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getUserAuthMenuPages(String p, String loginName) {
List menuAndPageListForTree = getUserAuthMenuPagesList(p, loginName, null);
userAuthMenuPages.put(loginName, menuAndPageListForTree);
return userAuthMenuPages;
}
public static List getUserAuthMenuPagesList(String p, String loginName, String source) {
List result = null;
p = !org.apache.commons.lang.StringUtils.isEmpty(p) && !"$".equals(p) ? p : "root";
Map paramsMap = new HashMap();
paramsMap.put("loginName", loginName);
List adminGroups = getDao().query("XSAuthorization.queryForUserAdmin", paramsMap);
if (adminGroups != null && adminGroups.size() > 0) {
paramsMap.put("node", p);
paramsMap.put("nodeSource", source);
result = getResultList("XSMenu.query", paramsMap);
} else {
Map map = new HashMap();
map.put("node", p);
map.put("nodeSource", source);
List ret = getResultList("XSMenu.query", map);
List pageAuthList = getUserAuthPagesList(loginName);
List menuList = new ArrayList();
List pageList = new ArrayList();
for(int i = 0; i < ret.size(); ++i) {
Map retMap = (Map)ret.get(i);
if ("1".equals(retMap.get("leaf").toString())) {
pageList.add(retMap);
} else {
menuList.add(retMap);
}
}
List menuAndPageListForTree = new ArrayList();
for(int i = 0; i < ret.size(); ++i) {
Map retResultMap = (Map)ret.get(i);
BigDecimal retLeaf = (BigDecimal)retResultMap.get("leaf");
BigDecimal menuDecimal = new BigDecimal("2");
BigDecimal leafDecimal = new BigDecimal("1");
if (retLeaf != null && menuDecimal.equals(retLeaf)) {
Map paramMap = new HashMap();
paramMap.put("node", retResultMap.get("label").toString());
List childPageForMenu = getDao().query("XSMenu.queryForRecursiveChildPage", paramMap);
boolean flag = false;
if (childPageForMenu != null && childPageForMenu.size() > 0) {
label85:
for(int j = 0; j < pageAuthList.size(); ++j) {
Map pageAuthMap = (Map)pageAuthList.get(j);
for(int k = 0; k < childPageForMenu.size(); ++k) {
Map childPageMap = (Map)childPageForMenu.get(k);
if (childPageMap.get("label").toString().equals(pageAuthMap.get("label").toString())) {
flag = true;
break label85;
}
}
}
}
if (flag) {
menuAndPageListForTree.add(retResultMap);
}
} else if (retLeaf != null && leafDecimal.equals(retLeaf)) {
boolean pageFlag = false;
for(int k = 0; k < pageAuthList.size(); ++k) {
Map pageAuthMap = (Map)pageAuthList.get(k);
if (pageAuthMap.get("label").toString().equals(retResultMap.get("label").toString())) {
pageFlag = true;
}
}
if (pageFlag) {
menuAndPageListForTree.add(retResultMap);
}
}
}
result = menuAndPageListForTree;
}
List newResult = new ArrayList();
for(int i = 0; i < ((List)result).size(); ++i) {
if (((Map)((List)result).get(i)).get("show_flag") == null || ((Map)((List)result).get(i)).get("show_flag").equals("1")) {
newResult.add(((List)result).get(i));
}
}
return newResult;
}
public static List getUserAllAuthMenuPagesList(String loginName) {
long startTime = System.currentTimeMillis();
List result = new ArrayList();
Map paramsMap = new HashMap();
paramsMap.put("loginName", loginName);
List adminGroups = getDao().query("XSAuthorization.queryForUserAdmin", paramsMap);
long endTime = System.currentTimeMillis();
long executionTime = endTime - startTime;
logger.info("getUserAllAuthMenuPagesList:List adminGroups = getDao().query(\"XSAuthorization.queryForUserAdmin\", paramsMap);Time:" + executionTime);
long endTime5;
long endTime2;
long executionTime5;
if (adminGroups != null && adminGroups.size() > 0) {
endTime5 = System.currentTimeMillis();
result = getResultList("XSMenu.query", paramsMap);
executionTime5 = System.currentTimeMillis();
endTime2 = executionTime5 - endTime5;
logger.info("getUserAllAuthMenuPagesList:getResultList(\"XSMenu.query\", paramsMap);Time:" + endTime2);
} else {
endTime5 = System.currentTimeMillis();
Map map = new HashMap();
List ret = getResultList("XSMenu.query", map);
endTime2 = System.currentTimeMillis();
long executionTime2 = endTime2 - endTime5;
logger.info("getUserAllAuthMenuPagesList:getResultList(\"XSMenu.query\", paramsMap);Time:" + executionTime2);
long startTime3 = System.currentTimeMillis();
List pageAuthList = getUserAuthPagesList(loginName);
long endTime3 = System.currentTimeMillis();
long executionTime3 = endTime3 - startTime3;
logger.info("getUserAllAuthMenuPagesList:List pageAuthList = getUserAuthPagesList(loginName);Time:" + executionTime3);
long startTime4 = System.currentTimeMillis();
List menuList = new ArrayList();
List pageList = new ArrayList();
for(int i = 0; i < ret.size(); ++i) {
Map retMap = (Map)ret.get(i);
if ("1".equals(retMap.get("leaf").toString())) {
pageList.add(retMap);
} else {
menuList.add(retMap);
}
}
Map authPageMap = new HashMap();
for(int i = 0; i < pageAuthList.size(); ++i) {
String label = (String)((Map)pageAuthList.get(i)).get("label");
authPageMap.put(label, pageAuthList.get(i));
}
Map menuMap = new HashMap();
for(int i = 0; i < menuList.size(); ++i) {
String label = (String)((Map)menuList.get(i)).get("label");
menuMap.put(label, menuList.get(i));
}
Map pageResultMap = new HashMap();
Map menuResultMap = new HashMap();
int i;
Map entity;
for(i = 0; i < pageList.size(); ++i) {
entity = (Map)pageList.get(i);
String isAuth = (String)entity.get("isAuth");
String label = (String)entity.get("label");
if ("0".equals(isAuth) || authPageMap.get(label) != null) {
pageResultMap.put(label, entity);
String parent = (String)entity.get("parent");
menuResultMap = setMenuResultMap(parent, (Map)menuResultMap, menuMap);
}
}
for(i = 0; i < ret.size(); ++i) {
entity = (Map)ret.get(i);
if (((Map)menuResultMap).get(entity.get("label")) != null || pageResultMap.get(entity.get("label")) != null) {
((List)result).add(ret.get(i));
}
}
long endTime4 = System.currentTimeMillis();
long executionTime4 = endTime4 - startTime4;
logger.info("getUserAllAuthMenuPagesList:my_set_resultTime:" + executionTime4);
}
endTime5 = System.currentTimeMillis();
executionTime5 = endTime5 - startTime;
logger.info("getUserAllAuthMenuPagesList:totalTime:" + executionTime5);
return (List)result;
}
private static Map setMenuResultMap(String parentLabel, Map menuResultMap, Map<String, Map> menuMap) {
Map menu = (Map)menuMap.get(parentLabel);
if (menu != null && menuResultMap.get(parentLabel) == null) {
menuResultMap.put(parentLabel, menu);
String parent = (String)menu.get("parent");
menuResultMap = setMenuResultMap(parent, menuResultMap, menuMap);
}
return menuResultMap;
}
/** @deprecated */
@Deprecated
public static Map<String, Object> getUserAuthPages(String loginName) {
List pageAuthList = getUserAuthPagesList(loginName);
userAuthPages.put(loginName, pageAuthList);
return userAuthPages;
}
public static List getUserAuthPagesList(String loginName) {
long startTime = System.currentTimeMillis();
List authList = getUserAuthenticationList(loginName);
long endTime = System.currentTimeMillis();
long executionTime = endTime - startTime;
logger.info("getUserAuthPagesList:List authList = getUserAuthenticationList(loginName);Time:" + executionTime);
long startTime1 = System.currentTimeMillis();
List pageList = new ArrayList();
List ret = getResultList("XSMenu.query", new HashMap());
long endTime1 = System.currentTimeMillis();
long executionTime1 = endTime1 - startTime1;
logger.info("getUserAuthPagesList:List ret = getResultList(\"XSMenu.query\", new HashMap());Time:" + executionTime1);
List pageAuthList = new ArrayList();
int i;
Map pageMap;
for(i = 0; i < ret.size(); ++i) {
pageMap = (Map)ret.get(i);
if ("1".equals(pageMap.get("leaf").toString())) {
pageList.add(pageMap);
}
}
if (pageList.size() > 0) {
for(i = 0; i < pageList.size(); ++i) {
pageMap = (Map)pageList.get(i);
String nodeEname = pageMap.get("label").toString();
String isAuth = (String)pageMap.get("isAuth");
boolean flag = false;
if (null != isAuth && "1".equals(isAuth)) {
for(int j = 0; j < authList.size(); ++j) {
Map authMap = (Map)authList.get(j);
if (authMap.get("objectName") != null && nodeEname.equals(authMap.get("objectName").toString()) && authMap.get("resourceType") != null && "PAGE".equals(authMap.get("resourceType").toString()) || authMap.get("resourceEname") != null && authMap.get("resourceMemberType") != null && nodeEname.equals(authMap.get("resourceEname").toString()) && "PAGE".equals(authMap.get("resourceMemberType").toString())) {
flag = true;
}
}
} else {
flag = true;
}
if (flag) {
pageAuthList.add(pageMap);
}
}
}
long endTime2 = System.currentTimeMillis();
long executionTime2 = endTime2 - startTime;
logger.info("getUserAuthPagesList:TotalTime:" + executionTime2);
return pageAuthList;
}
public static List getResultList(String sqlMap, Map params) {
List resultList = getDao().query(sqlMap, params, 0, -999999);
return resultList;
}
/** @deprecated */
public static Map<String, Object> getResultList(String sqlMap, Map params, Map result, String subjectName) {
if (params == null) {
params = new HashMap();
}
List resultList = getResultList(sqlMap, (Map)params);
result.put(subjectName, resultList);
return result;
}
public static List getUserAuthenticationPageOfResource(String loginName) {
Map<String, Object> userBelongToGroups = getUserBelongToGroups(loginName);
List userGroupsList = (List)userBelongToGroups.get(loginName);
List<Map> result = new ArrayList();
Map userDetails = LoginUserDetails.getLoginUserDetails(loginName);
List userAuthList = getCachedSubjectPageList((String)userDetails.get("userId"), loginName);
Set<String> resEnameSet = new HashSet();
filterAuthResourceList(result, resEnameSet, userAuthList);
if (userGroupsList != null && userGroupsList.size() > 0) {
for(int i = 0; i < userGroupsList.size(); ++i) {
String groupId = (String)((Map)userGroupsList.get(i)).get("groupId");
String groupEname = (String)((Map)userGroupsList.get(i)).get("groupEname");
List list = getCachedSubjectPageList(groupId, groupEname);
filterAuthResourceList(result, resEnameSet, list);
}
}
List<Map> pageList = clearButtonOfResource(result);
sortResorceList(pageList);
return pageList;
}
private static List getCachedSubjectPageList(String subjectId, String subjectEname) {
List list = (List)CacheManager.getCacheValue("iplat:security:subjectPageCache", subjectEname, () -> {
Map map = new HashMap();
map.put("subjectId", subjectId);
return getResultList("XSAuthorization.queryDirectResourcePageBySubjectId", map);
});
List listUnAuthed = getAllUnAuthPageButt();
List newList2 = (List)Stream.concat(list.stream(), listUnAuthed.stream()).collect(Collectors.toList());
return newList2;
}
private static Dao getDao() {
return (Dao)PlatApplicationContext.getBean("dao");
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.baosight.xservices.xs.impl;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.xservices.xs.ISecurityAuthorization;
import com.baosight.xservices.xs.authentication.AuthenticationInfo;
import com.baosight.xservices.xs.util.LoginUserDetails;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class SecurityAuthorizationStandardImpl implements ISecurityAuthorization {
private static final Logger logger = LogManager.getLogger(SecurityAuthorizationStandardImpl.class);
private static Dao dao = (Dao)PlatApplicationContext.getApplicationContext().getBean("dao");
private static final String RESULT_TRUE = "true";
private static final String RESULT_FALSE = "false";
public SecurityAuthorizationStandardImpl() {
}
public EiInfo hasPermission(EiInfo eiInfo) {
long startTime = System.currentTimeMillis();
EiInfo outInfo = new EiInfo();
new HashMap();
int status = 0;
String msg = "";
String subjectName = eiInfo.get("subjectName") == null ? null : eiInfo.get("subjectName").toString();
String subjectType = eiInfo.get("subjectType") == null ? null : eiInfo.get("subjectType").toString();
String objectName = eiInfo.get("objectName") == null ? null : eiInfo.get("objectName").toString();
String objectType = eiInfo.get("objectType") == null ? null : eiInfo.get("objectType").toString();
String operationType = eiInfo.get("operationType") == null ? null : eiInfo.get("operationType").toString();
try {
boolean exists = false;
if (subjectName != null && subjectType != null && objectName != null && objectType != null && operationType != null) {
List authList = null;
String loginName = eiInfo.getString("loginName");
if (loginName != null && LoginUserDetails.isUserAdmin(loginName)) {
status = 1;
msg = "管理员组成员拥有所有资源权限";
outInfo.setStatus(status);
outInfo.setMsg(msg);
return outInfo;
}
if ("USER".equals(subjectType)) {
if (LoginUserDetails.isUserAdmin(subjectName)) {
status = 1;
msg = "管理员组成员拥有所有资源权限";
outInfo.setStatus(status);
outInfo.setMsg(msg);
return outInfo;
}
authList = AuthenticationInfo.getUserAuthenticationList(subjectName);
} else if ("USER_GROUP".equals(subjectType)) {
authList = AuthenticationInfo.getAuthenticationByParamList(subjectName, subjectType);
} else {
authList = AuthenticationInfo.getSubjectAuthenticationList(subjectName, subjectType);
}
exists = this.elementPermissionExists(subjectType, objectName, objectType, operationType, exists, authList);
if (exists) {
msg = "类型为:" + subjectType + "的授权主体" + subjectName + "拥有类型为:" + objectType + "的授权客体" + objectName + "的" + operationType + "权限";
status = 1;
} else {
msg = "类型为:" + subjectType + "的授权主体" + subjectName + "没有类型为:" + objectType + "的授权客体" + objectName + "的" + operationType + "权限";
}
} else {
msg = "传入授权主体,授权客体,资源类别或操作类别不能为空!";
}
logger.info(msg);
} catch (Exception var16) {
logger.error(var16.getMessage());
msg = var16.getMessage();
status = -1;
}
outInfo.setStatus(status);
outInfo.setMsg(msg);
long endTime = System.currentTimeMillis();
System.out.println("hasPermission使用时间:" + (endTime - startTime) + "毫秒");
return outInfo;
}
public EiInfo hasPermissionList(EiInfo eiInfo) {
long startTime = System.currentTimeMillis();
EiInfo outInfo = new EiInfo();
int status = 0;
String msg = "";
String subjectName = eiInfo.get("subjectName") == null ? null : eiInfo.get("subjectName").toString();
String subjectType = eiInfo.get("subjectType") == null ? null : eiInfo.get("subjectType").toString();
String operationType = eiInfo.get("operationType") == null ? null : eiInfo.get("operationType").toString();
List objectList = (List)eiInfo.get("list");
try {
if (subjectName != null && subjectType != null) {
List authList = null;
boolean isAdmin = false;
String loginName = eiInfo.getString("loginName");
if (loginName != null && LoginUserDetails.isUserAdmin(loginName)) {
isAdmin = true;
}
if ("USER".equals(subjectType)) {
if (LoginUserDetails.isUserAdmin(subjectName)) {
isAdmin = true;
}
authList = AuthenticationInfo.getUserAuthenticationList(subjectName);
} else {
authList = AuthenticationInfo.getAuthenticationByParamList(subjectName, subjectType);
}
for(Iterator var14 = objectList.iterator(); var14.hasNext(); logger.info(msg)) {
Map objectMap = (Map)var14.next();
String objectName = objectMap.get("objectName") == null ? null : objectMap.get("objectName").toString();
String objectType = objectMap.get("objectType") == null ? null : objectMap.get("objectType").toString();
boolean exists = false;
if (objectName != null && objectType != null && operationType != null) {
if (isAdmin) {
exists = true;
objectMap.put("result", "true");
} else {
exists = this.elementPermissionExists(subjectType, objectName, objectType, operationType, exists, authList);
objectMap.put("result", exists ? "true" : "false");
}
}
if (exists) {
msg = "类型为:" + subjectType + "的授权主体" + subjectName + "拥有类型为:" + objectType + "的授权客体" + objectName + "的" + operationType + "权限";
status = 1;
} else {
msg = "传入授权主体,授权客体,资源类别或操作类别不能为空!";
}
}
}
} catch (Exception var19) {
logger.error(var19.getMessage());
msg = var19.getMessage();
status = -1;
}
outInfo.set("list", objectList);
outInfo.setStatus(status);
outInfo.setMsg(msg);
long endTime = System.currentTimeMillis();
System.out.println("hasListPermission使用时间:" + (endTime - startTime) + "毫秒");
return outInfo;
}
private boolean elementPermissionExists(String subjectType, String objectName, String objectType, String operationType, boolean exists, List authList) {
if (authList != null && authList.size() > 0) {
int i;
Map resultMap;
if (subjectType.equals("USER")) {
for(i = 0; i < authList.size(); ++i) {
resultMap = (Map)authList.get(i);
if (resultMap.get("objectName") != null && objectName.equals(resultMap.get("objectName").toString()) && resultMap.get("resourceType") != null && objectType.equals(resultMap.get("resourceType").toString()) || resultMap.get("resourceEname") != null && resultMap.get("resourceMemberType") != null && resultMap.get("resourceEname").toString().equals(objectName) && resultMap.get("resourceMemberType").toString().equals(objectType)) {
exists = isExists(operationType, exists, resultMap);
if (exists) {
break;
}
}
}
} else {
for(i = 0; i < authList.size(); ++i) {
resultMap = (Map)authList.get(i);
if (resultMap.get("objectName") != null && objectName.equals(resultMap.get("objectName").toString()) && resultMap.get("resourceType") != null && objectType.equals(resultMap.get("resourceType").toString()) || resultMap.get("resourceEname") != null && resultMap.get("resourceMemberType") != null && objectName.equals(resultMap.get("resourceEname").toString()) && objectType.equals(resultMap.get("resourceMemberType").toString())) {
exists = isExists(operationType, exists, resultMap);
if (exists) {
break;
}
}
}
}
}
return exists;
}
private static boolean isExists(String operationType, boolean exists, Map resultMap) {
if ("VISIT".equals(operationType)) {
Object mapOperationType = resultMap.get("operationType");
if ("VISIT".equals(mapOperationType) || "ACCESS".equals(mapOperationType)) {
exists = true;
}
} else if (operationType.equals(resultMap.get("operationType"))) {
exists = true;
}
return exists;
}
public boolean isUserAdmin(String loginName) {
boolean flag = false;
Map map = new HashMap();
map.put("loginName", loginName);
List result = dao.query("XSAuthorization.queryForUserAdmin", map);
return result != null && result.size() > 0;
}
public EiInfo getAuthMenuTreeList(EiInfo eiInfo) {
String loginName = eiInfo.get("loginName") == null ? null : eiInfo.get("loginName").toString();
String p = eiInfo.get("p") == null ? null : eiInfo.get("p").toString();
String source = eiInfo.get("source") == null ? null : eiInfo.get("source").toString();
String msg = "";
int status = 0;
List result = null;
try {
if (loginName != null && p != null) {
result = AuthenticationInfo.getUserAuthMenuPagesList(p, loginName, source);
if (result.size() < 1) {
msg = "该用户没有授权的菜单页面";
} else {
msg = "该用户拥有授权的菜单页面";
status = 1;
}
} else {
msg = "传入的用户登录名以及树节点不能为空";
}
} catch (Exception var8) {
logger.error(var8.getMessage());
status = -1;
msg = var8.getMessage();
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
eiInfo.set("result", result);
return eiInfo;
}
public EiInfo getAllAuthMenuTreeList(EiInfo eiInfo) {
String loginName = eiInfo.get("loginName") == null ? null : eiInfo.get("loginName").toString();
String msg = "";
int status = 0;
List result = null;
try {
if (loginName != null) {
result = AuthenticationInfo.getUserAllAuthMenuPagesList(loginName);
if (result.size() < 1) {
msg = "该用户没有授权的菜单页面";
} else {
msg = "该用户拥有授权的菜单页面";
status = 1;
}
} else {
msg = "传入的用户登录名不能为空";
}
} catch (Exception var7) {
logger.error(var7.getMessage());
status = -1;
msg = var7.getMessage();
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
eiInfo.set("result", result);
return eiInfo;
}
public EiInfo getUserGroups(EiInfo eiInfo) {
Map resultGroup = new HashMap();
Map map = new HashMap();
map.put("loginName", eiInfo.get("loginName").toString());
List resultList = dao.query("XSAuthorization.queryForUserParentGroups", map);
resultGroup.put("result", resultList);
eiInfo.setAttr(resultGroup);
return eiInfo;
}
public EiInfo getUserGroupsByResourceEname(EiInfo eiInfo) {
String objectEname = eiInfo.get("resourceEname") == null ? null : eiInfo.get("resourceEname").toString();
Map map = new HashMap();
List result = null;
String msg = "";
boolean var6 = false;
byte status;
try {
if (objectEname != null) {
map.put("objectEname", objectEname);
map.put("subjectType", "USER_GROUP");
map.put("operationType", "ACCESS");
result = dao.query("XS07.query", map);
status = 1;
} else {
msg = "传入的资源英文名不能为空!";
status = 1;
}
} catch (Exception var8) {
logger.error(var8.getMessage());
status = -1;
msg = var8.getMessage();
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
eiInfo.set("result", result);
return eiInfo;
}
public EiInfo getResourceGroups(EiInfo eiInfo) {
Map resultGroup = new HashMap();
Map map = new HashMap();
map.put("resourceEname", eiInfo.get("resourceEname").toString());
List resultList = dao.query("XSAuthorization.queryForResParentGroups", map);
resultGroup.put("result", resultList);
eiInfo.setAttr(resultGroup);
return eiInfo;
}
public EiInfo isGroupMemberExists(EiInfo eiInfo) {
Map<String, Object> result = new HashMap();
Map map = new HashMap();
String memberType = eiInfo.get("memberType").toString();
map.put("memberName", eiInfo.get("memberName").toString());
map.put("memberType", memberType);
List resultList = null;
if ("USER".equals(memberType)) {
resultList = dao.query("XSAuthorization.queryForUserMemberExists", map);
} else if ("USER_GROUP".equals(memberType)) {
resultList = dao.query("XSAuthorization.queryForUserGroupMemberExists", map);
}
String exists = " ";
int status = -1;
if (null != resultList && 0 != resultList.size()) {
exists = "存在";
status = 1;
} else {
exists = "不存在";
}
String msg = exists + "用户为" + eiInfo.get("memberName").toString() + "用户类型为" + eiInfo.get("memberType").toString() + " 的群组成员";
logger.info(msg);
result.put("status", Integer.valueOf(status));
result.put("msg", msg);
eiInfo.setAttr(result);
return eiInfo;
}
public EiInfo isResourceGroupMemberExists(EiInfo eiInfo) {
Map<String, Object> result = new HashMap();
Map map = new HashMap();
String memberType = eiInfo.get("memberType").toString();
map.put("memberName", eiInfo.get("memberName").toString());
map.put("memberType", memberType);
List resultList = null;
if ("1".equals(memberType)) {
resultList = dao.query("XSAuthorization.queryForResourceMemberExists", map);
} else {
resultList = dao.query("XSAuthorization.queryForResourceGroupMemberExists", map);
}
String typeName = "0".equals(memberType) ? "资源组" : "资源";
String exists = " ";
int status = -1;
if (null != resultList && 0 != resultList.size()) {
exists = "存在";
status = 1;
} else {
exists = "不存在";
}
String msg = exists + "名称为" + eiInfo.get("memberName").toString() + "资源类型为 " + typeName + " 的群组成员";
logger.info(msg);
result.put("status", Integer.valueOf(status));
result.put("msg", msg);
eiInfo.setAttr(result);
return eiInfo;
}
public EiInfo getUserGroupsByLoginName(EiInfo eiInfo) {
String msg = "";
int status = -1;
List resultList = null;
String loginName = eiInfo.getString("loginName");
if (loginName != null) {
Map map = new HashMap();
map.put("loginName", loginName);
resultList = dao.query("XSAuthorization.queryUserGroupsByLoginName", map);
if (null != resultList && resultList.size() > 0) {
status = 1;
msg = "该用户所在分组存在";
} else {
msg = "该用户所在分组不存在";
status = 0;
}
} else {
msg = "传入用户名不能为空";
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
eiInfo.set("result", resultList);
return eiInfo;
}
public EiInfo getUserMemberGroups(EiInfo eiInfo) {
String msg = "";
int status = -1;
List resultList = null;
String groupId = eiInfo.getString("groupId");
if (null != groupId && !" ".equals(groupId)) {
Map map = new HashMap();
map.put("groupId", groupId);
resultList = dao.query("XSAuthorization.queryUserMemberGroups", map);
if (null != resultList && resultList.size() > 0) {
msg = "该用户组存在子组";
status = 1;
} else {
msg = "该用户组不存在子组";
status = 0;
}
} else {
msg = "传入的用户组ID不能为空";
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
eiInfo.set("result", resultList);
return eiInfo;
}
public EiInfo getResGroups(EiInfo eiInfo) {
String msg = "";
int status = -1;
List resultList = null;
String resourceId = eiInfo.getString("resourceId");
if (resourceId != null) {
Map map = new HashMap();
map.put("resourceId", resourceId);
resultList = dao.query("XSAuthorization.queryResGroups", map);
if (null != resultList && resultList.size() > 0) {
status = 1;
msg = "该资源所在分组存在";
} else {
msg = "该资源所在分组不存在";
status = 0;
}
} else {
msg = "传入资源ID不能为空";
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
eiInfo.set("result", resultList);
return eiInfo;
}
public EiInfo getResMemberGroups(EiInfo eiInfo) {
String msg = "";
int status = -1;
List resultList = null;
String resourceGroupId = eiInfo.getString("resourceGroupId");
if (null != resourceGroupId && !" ".equals(resourceGroupId)) {
Map map = new HashMap();
map.put("resourceGroupId", resourceGroupId);
resultList = dao.query("XSAuthorization.queryResMemberGroups", map);
if (null != resultList && resultList.size() > 0) {
msg = "该资源组存在子组";
status = 1;
} else {
msg = "该资源组不存在子组";
status = 0;
}
} else {
msg = "传入的资源组ID不能为空";
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
eiInfo.set("result", resultList);
return eiInfo;
}
public EiInfo getUserAuthenticationByUserId(EiInfo eiInfo) {
String msg = "";
int status = 0;
String userId = eiInfo.getString("userId");
String loginName = eiInfo.getString("loginName");
try {
HashMap paramMap;
List resultList;
if (null != userId && !"".equals(userId)) {
paramMap = new HashMap();
paramMap.put("userId", userId);
resultList = dao.query("XS01.query", paramMap);
if (resultList != null && resultList.size() > 0) {
loginName = ((Map)resultList.get(0)).get("loginName").toString();
}
}
if (StringUtils.isNotEmpty(loginName)) {
resultList = AuthenticationInfo.getUserAuthenticationOfResourceList(loginName);
String resourceType = eiInfo.getString("resourceType");
if (StringUtils.isNotEmpty(resourceType)) {
resultList = (List) resultList.stream().filter((res) -> {
return resourceType.equals(((Map) res).get("resourceType"));
}).collect(Collectors.toList());
}
int size = resultList.size();
if (null != resultList && size > 0) {
status = 1;
msg = "该用户存在授权的资源权限信息!";
eiInfo.set("result", resultList);
eiInfo.set("count", resultList.size());
} else {
msg = "该用户没有授权的资源权限信息!";
}
} else {
msg = "传入的用户ID或者账号不能为空,且必须有效!";
status = -1;
}
} catch (Exception var10) {
logger.error(var10.getMessage());
status = -1;
msg = var10.getMessage();
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
return eiInfo;
}
public EiInfo getPageAuthenticationByLoginName(EiInfo eiInfo) {
String msg = "";
int status = 0;
String loginName = eiInfo.get("loginName").toString();
try {
if (null != loginName && !"".equals(loginName)) {
List resultList = null;
resultList = AuthenticationInfo.getUserAuthenticationPageOfResource(loginName);
int size = resultList.size();
if (null != resultList && size > 0) {
status = 1;
msg = "该用户存在授权的资源权限信息!";
eiInfo.set("result", resultList);
} else {
msg = "该用户没有授权的资源权限信息!";
}
} else {
msg = "传入的用户名loginName不能为空!";
status = -1;
}
} catch (Exception var7) {
logger.error(var7.getMessage());
status = -1;
msg = var7.getMessage();
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
return eiInfo;
}
}
......@@ -111,8 +111,10 @@
t7.TYPE = #resourceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subjectName">
(t2.group_cname like ('%$subjectName$%') or t3.user_name like ('%$subjectName$%') or t4.resource_group_cname
like ('%$subjectName$%') or t5.resource_ename like ('%$subjectName$%') )
(t2.group_cname like ('%$subjectName$%')
or t3.user_name like ('%$subjectName$%')
or t4.resource_group_cname like ('%$subjectName$%')
or t5.resource_ename like ('%$subjectName$%') )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="objectName">
(t6.resource_group_cname like concat('%', #objectName#, '%')
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="XSMenu">
<select id="query" resultClass="java.util.HashMap">
SELECT
t1.tree_ename as "parent",
t1.node_ename as "label",
t1.node_cname as "text",
t1.node_image_path as "imagePath",
t1.node_type as "leaf",
t1.node_param as "nodeParam",
t1.node_url as "nodeUrl",
t2.is_auth as "isAuth",
t4.show_flag as "show_flag",
COALESCE(t3.OPEN_TYPE,'0') as "openType"
FROM ${platSchema}.TEDPI10 t1
left join ${platSchema}.TEDFA00 t2 ON t2.form_ename = t1.node_ename
left join ${platSchema}.TEDFA62 t3 ON t3.form_ename = t1.node_ename
left join ${platSchema}.TEDPI10_EX t4 ON t1.node_ename = t4.node_ename AND t1.tree_ename = t4.tree_ename
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="node">
t1.tree_ename = #node#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="nodeSource">
t1.node_source = #nodeSource#
</isNotEmpty>
</dynamic>
order by t1.NODE_SORT_ID asc,t1.tree_ename asc
</select>
<select id="queryNode" resultClass="java.util.HashMap">
SELECT
tree_ename as "parent",
node_ename as "label",
node_cname as "text",
node_image_path as "imagePath",
node_param as "nodeParam",
node_url as "nodeUrl",
node_type as "leaf"
FROM ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="node">
tree_ename = #node#
</isNotEmpty>
</dynamic>
order by NODE_SORT_ID asc
</select>
<select id="queryNodeByProject" resultClass="java.util.HashMap">
SELECT
tree_ename as "parent",
node_ename as "label",
node_cname as "text",
node_image_path as "imagePath",
node_param as "nodeParam",
node_url as "nodeUrl",
node_type as "leaf"
FROM ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="node">
tree_ename = #node#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="project_prefix">
($project_prefix$)
</isNotEmpty>
</dynamic>
order by NODE_SORT_ID asc
</select>
<select id="queryRecursivePage" resultClass="java.util.HashMap">
SELECT
tree_ename as "parent",
node_ename as "label",
node_cname as "text",
node_image_path as "imagePath",
node_param as "nodeParam",
node_url as "nodeUrl",
node_type as "leaf"
FROM ( SELECT * FROM ${platSchema}.TEDPI10 START WITH tree_ename='$node$' CONNECT BY PRIOR node_ename=tree_ename
) WHERE node_type=1
</select>
<select id="getParent" resultClass="java.util.HashMap">
SELECT
tree_ename as "parent",
node_ename as "label",
node_cname as "text",
node_image_path as "imagePath",
node_param as "nodeParam",
node_url as "nodeUrl",
node_type as "leaf"
FROM ${platSchema}.TEDPI10 where node_ename in (
select distinct tree_ename from ${platSchema}.TEDPI10
<dynamic prepend="WHERE">
<isNotEmpty prepend=" AND " property="node">
node_ename = #node#
</isNotEmpty>
</dynamic>
)
</select>
<select id="queryPK" resultClass="java.util.HashMap">
SELECT
tree_ename as "parent",
node_ename as "label",
node_cname as "text",
node_image_path as "imagePath",
node_param as "nodeParam",
node_url as "nodeUrl",
node_type as "leaf"
FROM ${platSchema}.TEDPI10 WHERE tree_ename = #parent# AND node_ename = #node#
</select>
<select id="getNodes" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT
tree_ename as "parent",
node_ename as "label",
node_cname as "text",
node_image_path as "imagePath",
node_param as "nodeParam",
node_url as "nodeUrl",
node_type as "leaf"
FROM ${platSchema}.TEDPI10 WHERE 1=1
<isNotEmpty prepend=" AND " property="label">
node_ename like '%$label$%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="text">
node_cname like '%$text$%'
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
</sqlMap>
$(function () {
function reloadAfter(func){
setTimeout(func, 500);
}
IPLATUI.EFTree = {
"categoryTree": {
dragAndDrop:true,
select: function (e) {
var _data = this.dataItem(e.node);
// $('#inqu_status-0-TREE_ENAME').val(_data.id);
$('#inqu_status-0-tree_ename').val(_data.id);
resultGrid.dataSource.page(1);
},
drop: function (e) {
var tree = this;
var ei = new EiInfo();
var sourceModel = this.dataItem(e.sourceNode);
var destinationNode = this.dataItem(e.destinationNode);
ei.set("from", sourceModel.pid);
ei.set("to", destinationNode.pid);
ei.set("sourceId", sourceModel.id);
ei.set("destinationId", destinationNode.id);
ei.set("position", e.dropPosition);
ei.set("toIndex", destinationNode.index);
if (sourceModel.id === destinationNode.id) {
e.preventDefault();
return ;
}
EiCommunicator.send("EDPI10", "moveTree", ei, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
IPLAT.progress($("#tree"), true);
NotificationUtil("节点【" + sourceModel.text + "】移动到【" + destinationNode.text + "】之【" +
(e.dropPosition === "over" ? "内" : (e.dropPosition === "before" ? "前" : "后"))
// e.dropPosition
+ "】成功");
if (e.dropPosition === "over") {
reloadAfter(function () {
tree.reload(destinationNode.id);// 刷新移动节点的父节点
IPLAT.progress($("#tree"), false);
});
// tree.reload(sourceModel.id);
} else if (sourceModel.pid !== destinationNode.pid) {
// 越级移动
reloadAfter(function (){
tree.reload(destinationNode.pid);
tree.reload(sourceModel.id);
IPLAT.progress($("#tree"), false);
})
} else {
reloadAfter(function (){
tree.reload(sourceModel.pid);
IPLAT.progress($("#tree"), false);
})
}
} else {
NotificationUtil(ei);
e.preventDefault();
}
}, onFail: function (ei) {
// 调用异常
NotificationUtil("调用失败,原因[" + ei + "]", "error");
}
},{async: false});
// $('#inqu_status-0-TREE_ENAME').val(_data.id);
$('#inqu_status-0-tree_ename').val(destinationNode.pid);
resultGrid.dataSource.page(1);
},
}
};
$("#QUERY").on("click", function (e) {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid = {
"result": {
loadComplete:function (e){
$("#DELETE_RECURSION").click(function () {
IPLAT.confirm({
message:'递归删除当前节点下所有菜单,请确定',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("EDPI10","recursiveDelete",post,{
onSuccess:function (ei) {
NotificationUtil(ei);
if (ei.getStatus() >= 0) {
resultGrid.dataSource.query();
}
}
});
}
})
});
},
dataBinding: function (e) {
var treeEname = $("#inqu_status-0-tree_ename").val();
for (var i = 0, length = e.items.length; i < length; i++) {
var model = e.items[i];
if (model.isNew()) {
model.tree_ename = treeEname;
}
}
},
onSuccess: function (ei) {
if (ei.type === "create" || ei.type === "destroy" || ei.type === "update") {
var info = ei.eiInfo;
var pid = info.get("node_pid");
$("#categoryTree").data("kendoTreeView").reload(pid);
}
}
}
};
IPLATUI.EFIconPickerColumn = {
"result": {
"afterSetValue": function (e) {
var value = e.value;
var model = e.model;
var field = e.field;
model.set(field, "css:" + value);
}
}
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<EF:EFPage>
<div class="row">
<div class="col-md-3">
<EF:EFRegion title="系统菜单树" id="tree">
<EF:EFTree bindId="categoryTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf"
serviceName="EDPI25" methodName="query" style="height:550px;">
</EF:EFTree>
</EF:EFRegion>
</div>
<div class="col-md-9">
<EF:EFRegion title="查询区" id="inqu">
<div class="row">
<EF:EFInput blockId="inqu_status" ename="tree_ename" cname="节点树代码" colWidth="5"
row="0"/>
<EF:EFInput blockId="inqu_status" ename="node_ename" cname="节点/页面代码" colWidth="5" row="0"
configFunc="efcascadeselect.getEiInfo(ef.get('inqu_status-0-node_ename'))"/>
</div>
<div class="row">
<EF:EFInput blockId="inqu_status" ename="node_cname" cname="节点/页面名称" colWidth="5" row="0"/>
<EF:EFSelect blockId="inqu_status" optionLabel="全部" ename="node_type" cname="类型" row="0"
colWidth="5" template="#=valueField#-#=textField#"
valueTemplate="#=valueField#-#=textField#">
<EF:EFOptions blockId="nodeTypeDesc" textField="node_type_desc"
valueField="node_type"/>
</EF:EFSelect>
<div class="col-md-2" style="text-align: right" id="edpi10"></div>
</div>
</EF:EFRegion>
<EF:EFRegion title="记录集" id="result">
<EF:EFGrid blockId="result" autoDraw="no" autoBind="false">
<EF:EFColumn ename="tree_ename" cname="节点树代码" enable="false" width="100" required="true"
primaryKey="true" readonly="true" locked="true"/>
<EF:EFColumn ename="node_ename" cname="节点/页面代码" width="120" required="true"
readonly="true" locked="true"/>
<EF:EFColumn ename="node_cname" cname="节点/页面名称" width="120" required="true"/>
<EF:EFComboColumn ename="node_type" cname="类型" width="120" required="true"
blockName="nodeTypeDesc" valueField="node_type"
textField="node_type_desc" defaultValue="1"/>
<EF:EFColumn ename="node_url" cname="页面载入路径" width="100"/>
<EF:EFComboColumn ename="node_source" cname="节点来源" width="80" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.edpi.nodeSource"/>
</EF:EFComboColumn>
<EF:EFColumn ename="node_sort_id" cname="排序" width="60" required="true"/>
<EF:EFColumn ename="node_param" cname="参数配置" width="100"/>
<EF:EFIconPickerColumn ename="node_image_path" cname="图标路径"/>
<%-- <EF:EFColumn ename="node_image_path" cname="图标路径" width="100"/>--%>
<EF:EFColumn ename="rec_creator" cname="创建者" width="80" enable="false" align="center"/>
<EF:EFColumn ename="rec_create_time" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"
dateFormat="yyyy-MM-dd HH:mm:ss" displayType="datetime" readonly="true"/>
<EF:EFColumn ename="rec_revisor" cname="修改者" enable="false" width="80" align="center"/>
<EF:EFColumn ename="rec_revise_time" cname="修改时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"
dateFormat="yyyy-MM-dd HH:mm:ss" displayType="datetime" readonly="true"/>
<EF:EFColumn ename="archive_flag" cname="归档标记" enable="false" width="80" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
$(function () {
var window1 = $("#authSubject");
var window2 = $("#menuPageAuth");
$(window).load(function () {
resultGrid.setEiInfo(__eiInfo);
$(".k-grid-add").attr("disabled", true);
});
$("#REFRESHCACHE").on("click", function (e) {
var eiInfo = new EiInfo();
EiCommunicator.send("XSAuthorization", "clearAuthCache", eiInfo, {
onSuccess: function (ei) {
IPLAT.alert(ei.getMsg());
}, onFail: function (ei) {
IPLAT.alert("清空缓存错误!" + ei.getMsg());
}
});
});
$(document.body).on("click", "#QUERY", function (e) {
$("#inqu_status-0-objectEname").val('');
resultGrid.dataSource.page(1);
});
IPLATUI.EFTree = {
"groupsTree": {
select: function (e) {
var _data = this.dataItem(e.node);
var leaf = _data.leaf;
if (leaf == false) {
$(".k-grid-add").attr("disabled", false);
$("[name = 'inqu_status-0-objectEname']").val(_data.label);
$("[name = 'inqu_status-0-subjectType']").val('USER_GROUP');
IPLAT.EFSelect.text('#inqu_status-0-subjectType', "用户组");
$("#objectCname").val(_data.label);
$("#inqu_status-0-subjectId").val('');
$("#inqu_status-0-objectEname").val(_data.label);
resultGrid.dataSource.page(1);
} else {
$(".k-grid-add").attr("disabled", true);
$("#inqu_status-0-subjectId").val('root');
resultGrid.dataSource.page(1);
}
},
ROOT: {label: "root", text: "系统菜单", leaf: true}
}
};
IPLATUI.EFGrid = {
"result": {
beforeAdd: function (e) {
e.preventDefault();
var tree = $("#groupsTree").data("kendoTreeView");
var treeNode = $("#groupsTree_tv_active").children()[0];
var childLength = treeNode.children.length;
var childIndex = 0;
if (childLength == 2) {
childIndex = 1;
}
var node = tree.findByText(treeNode.children[childIndex].innerText);
var data = tree.dataItem(node[0]);
if (data.leaf == true) {
IPLAT.alert("只能为页面或按钮进行授权!请先选择页面或者按钮!");
} else {
var objectName = $("#objectCname").val();
window2.data("kendoWindow").refresh({
url: IPLATUI.CONTEXT_PATH + "/web/XS0707?objectName=" + objectName
});
window2.data("kendoWindow").open();
$("#menuPageAuth_wnd_title").css({"text-align": "justify", "font-size": "14px", "color": "#FFF"});
$("#menuPageAuth_wnd_title").html("正在为: [" + data.text + "] 分配用户组");
}
},
onSave: function (e) {
var rows = resultGrid.getCheckedRows();
var subjectId = $("#inqu_status-0-subjectId").val();
for (var j = 0; j < rows.length; j++) {
var rowModel = rows[j];
if (rowModel.isNew()) {
rowModel.set("subjectId", subjectId);
}
}
},
loadComplete: function (grid) {
grid.dataSource.bind("requestEnd", function (e) {
var response = e.response;
var type = e.type;
// grid 触发 增,删 ,改 时候对tree 进行更新
if (e.type == "create" || e.type == "update" || e.type == "destroy") {
var tree = $("#groupsTree").data("kendoTreeView");
var ajaxEi = EiInfo.parseJSONObject(response);
var result = ajaxEi.getBlock("result");
var rows = result.getMappedRows();
for (var i = 0; i < rows.length; i++) {
var node = rows[i];
// 找到父亲节点
var pNode = tree.dataSource.get(node['subjectId']);
// 防止pNode节点找不到
if (pNode) {
// 重新设置flag , 这样才能其节点重新使其到服务器获取数据
pNode.loaded(false);
// 重新加载
pNode.load();
}
}
}
})
},
onDelete: function (e) {
if (resultGrid.getCheckedRows().length == 0) {
IPLAT.alert("请勾选数据!");
e.preventDefault();
}
}
},
"resultA": {
loadComplete: function (grid) {
$("#ef_popup_gridA_commit").on("click", function (e) {
var checkRows = grid.getCheckedRows();
if (checkRows.length > 0) {
var eiInfo = new EiInfo();
var block = new EiBlock("result");
block.getBlockMeta().addMeta(new EiColumn("subjectId"));
block.getBlockMeta().addMeta(new EiColumn("subjectType"));
block.getBlockMeta().addMeta(new EiColumn("objectType"));
block.getBlockMeta().addMeta(new EiColumn("operationType"));
var objectName = $("#inqu_status-0-objectCname").val();
eiInfo.set("objectName", objectName);
for (var i = 0; i < checkRows.length; i++) {
var model = checkRows[i];
block.setCell(i, "subjectId", model.get("groupId"));
block.setCell(i, "subjectType", "USER_GROUP");
block.setCell(i, "objectType", "RESOURCE");
block.setCell(i, "operationType", "ACCESS");
}
eiInfo.addBlock(block);
EiCommunicator.send("XS07", "insertUserGroupAuth", eiInfo, {
onSuccess: function (ei) {
if (-1 == ei.getStatus()) {
IPLAT.alert(ei.getMsg());
} else {
IPLAT.alert(ei.getMsg());
if(objectName != null && objectName != ""){
$("[name = 'inqu_status-0-objectName']").val(objectName);
}
resultGrid.dataSource.page(1);
}
}, onFail: function (ei) {
IPLAT.alert(ei.getMsg());
}
});
window1.data("kendoWindow").close();
} else {
IPLAT.alert("没有选中数据");
}
});
}
}
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage>
<div class="row" style="margin: 0 -10px;">
<div class="col-md-4">
<EF:EFRegion title="系统菜单树" id="tree" fitHeight="true">
<EF:EFTree bindId="groupsTree" ename="node" textField="text" valueField="label" hasChildren="leaf"
serviceName="XS0705" methodName="query"
style="height:435px;" >
</EF:EFTree>
</EF:EFRegion>
</div>
<div class="col-md-8">
<EF:EFRegion title="查询区" id="inqu">
<div class="row" >
<EF:EFInput type="hidden" cname="授权主体ID" ename="subjectId" row="0" blockId="inqu_status"/>
<EF:EFInput type="hidden" ename="objectCname" row ="0" blockId="inqu_status"/>
<EF:EFInput type="hidden" cname="授权类别" ename="operationType" row="0" blockId="inqu_status" value="ACCESS"/>
<EF:EFInput row="0" blockId="inqu_status" ename="objectEname" cname="授权客体名称" type="hidden"/>
<%--<EF:EFInput cname="授权主体名称" ename="subjectName" row="0" blockId="inqu_status"/>--%>
<div class="col-xs-4">
<div class="form-group">
<label class="col-md-5 control-label">
授权主体名称
</label>
<div class="col-md-7">
<input name="inqu_status-0-subjectName" data-query="gt" class="k-textbox input-time query-need"
placeholder="请输入授权主体名称" />
</div>
</div>
</div>
<EF:EFSelect blockId="inqu_status" cname="授权主体类别" ename="subjectType" row="0" defaultValue="全部" colWidth="4" ratio="5:7">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="iplat.xs.subjectType" textField="label" valueField="value"/>
</EF:EFSelect>
<%-- <EF:EFInput cname="授权客体名称" ename="objectName" row="0" blockId="inqu_status"/>--%>
<div class="col-xs-4">
<div class="form-group">
<label class="col-md-5 control-label">
授权客体名称
</label>
<div class="col-md-7">
<input name="inqu_status-0-objectName" data-query="gt" class="k-textbox input-time query-need"
placeholder="请输入授权客体名称" />
</div>
</div>
</div>
<EF:EFSelect blockId="inqu_status" cname="授权客体类别" colWidth="4" ename="objectType" row="0" defaultValue="全部" ratio="5:7">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.objectType" textField="label" valueField="value"/>
</EF:EFSelect>
<div class="col-xs-8" style="text-align: right" id="inqu_inside"></div>
</div>
</EF:EFRegion>
<EF:EFInput ename="objectCname" cname="授权主体名称" type="hidden"/>
<EF:EFRegion title="记录集" id="result" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="false">
<EF:EFColumn ename="subjectId" cname="授权主体ID" hidden="true"/>
<%--<EF:EFPopupColumn ename="subjectName" cname="授权主体名称" style="text-align:left;" resultId="result" popupType="ServiceGrid"
readonly="true" columnEnames="subjectName,subjectTypeName" serviceName="XS07"
columnCnames="授权主体名称,授权主体类别" methodName="queryForGridSubject" valueField="subjectName"
backFillFieldIds="subjectId,subjectName,subjectType" backFillColumnIds="subjectId,subjectName,subjectType"/>--%>
<EF:EFColumn ename="subjectName" cname="授权主体名称" readonly="true" locked="true"/>
<EF:EFComboColumn enable="false" cname="授权主体类别" locked="true" ename="subjectType"
defaultValue="USER" style="text-align:center;">
<EF:EFCodeOption codeName="iplat.xs.subjectType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="objectId" cname="授权客体ID" hidden="true"/>
<%--<EF:EFPopupColumn ename="objectName" cname="授权客体名称" style="text-align:left;" resultId="result" popupType="ServiceGrid"
readonly="true" columnEnames="objectName,objectTypeName" serviceName="XS07"
columnCnames="授权客体名称,授权客体类别" methodName="queryForGridObject" valueField="objectName"
backFillFieldIds="objectId,objectName,objectType" backFillColumnIds="objectId,objectName,objectType"/>--%>
<EF:EFColumn ename="objectName" cname="授权客体名称" readonly="true" locked="true"/>
<EF:EFComboColumn enable="false" cname="授权客体类别" locked="true" ename="objectType"
defaultValue="RESOURCE" style="text-align:center;">
<EF:EFCodeOption codeName="xs.og.objectType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="操作类型" ename="operationType" readonly="true"
defaultValue="ACCESS" style="text-align:center;">
<EF:EFCodeOption codeName="services.xs.operationType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sortIndex" cname="排序" style="text-align:center;"/>
<EF:EFColumn ename="recCreator" cname="创建人" style="text-align:center;" readonly="true"/>
<EF:EFColumn ename="recCreateTime" cname="创建时间" editType="datetime" readonly="true" displayType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']" style="text-align:center;"/>
<EF:EFColumn ename="recRevisor" cname="修改人" style="text-align:center;" readonly="true"/>
<EF:EFColumn ename="recReviseTime" cname="修改时间" readonly="true" editType="datetime" displayType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']" style="text-align:center;"/>
<EF:EFColumn ename="archiveFlag" cname="归档标记" style="text-align:center;"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
<EF:EFWindow id="authSubject" width="58%" top="100px" left="280px">
<div id="ef_popup_gridA" >
<EF:EFRegion id="inquA" title="查询条件" type="query" efRegionShowClear="true" efRegionSave="true">
<div class="row">
<div class="col-xs-2 control-label">
<span>用户组英文名</span>
</div>
<div class="col-xs-2">
<EF:EFInput ename="inqu_status-0-groupEname" cname="用户组英文名" inline="true"/>
</div>
<div class="col-xs-3 control-label">
<span>用户组中文名</span>
</div>
<div class="col-xs-2">
<EF:EFInput ename="inqu_status-0-groupCname" cname="用户组中文名" inline="true"/>
</div>
<div class="col-xs-2" style="text-align: right" id="inqua_inside"></div>
</div>
</EF:EFRegion>
<EF:EFRegion id="resultA" title="记录集">
<div class="text-right">
<EF:EFButton cname="确定" ename="ef_popup_gridA_commit"></EF:EFButton>
</div>
<EF:EFGrid blockId="resultA" queryMethod="queryForGridSubject" autoDraw="false">
<EF:EFColumn ename="groupId" locked="true" cname="群组ID" hidden="true" primaryKey="true"/>
<EF:EFColumn ename="groupEname" locked="true" cname="群组英文名" readonly="true" width="300"/>
<EF:EFColumn ename="groupCname" cname="群组中文名" readonly="true" width="300"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</EF:EFWindow>
<EF:EFWindow id="menuPageAuth" url="${ctx}/web/XS0707" width="78%" top="80px" left="120px"></EF:EFWindow>
</EF:EFPage>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment