Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
15696bae
Commit
15696bae
authored
Oct 12, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://git.pseer.com:8800/platform/hg-smart
into dev-ly
parents
c714a411
4ef69092
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
609 additions
and
12 deletions
+609
-12
pom.xml
pom.xml
+1
-1
ServiceXS40.java
...n/java/com/baosight/xservices/xs/service/ServiceXS40.java
+20
-0
ServiceXSAuthorizationManage.java
...ht/xservices/xs/service/ServiceXSAuthorizationManage.java
+558
-0
XS03.xml
src/main/java/com/baosight/xservices/xs/sql/XS03.xml
+2
-1
XS07.xml
src/main/java/com/baosight/xservices/xs/sql/XS07.xml
+2
-1
XS3002.jsp
src/main/webapp/XS/XS3002.jsp
+1
-1
XS3201.jsp
src/main/webapp/XS/XS3201.jsp
+20
-4
XS40.jsp
src/main/webapp/XS/XS40.jsp
+5
-4
No files found.
pom.xml
View file @
15696bae
...
...
@@ -15,7 +15,7 @@
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
war
</packaging>
<name>
hggp
</name>
<name>
hggp
_dev
</name>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
...
...
src/main/java/com/baosight/xservices/xs/service/ServiceXS40.java
View file @
15696bae
...
...
@@ -249,6 +249,26 @@ public class ServiceXS40 extends ServiceEPBase {
return
outInfo
;
}
public
EiInfo
updateForMemberGroups
(
EiInfo
inInfo
)
{
EiInfo
eiInfo
=
new
EiInfo
();
EiBlock
r1Block
=
inInfo
.
getBlock
(
"result1"
);
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
r1Block
.
getRows
());
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
++
i
)
{
Map
<
String
,
Object
>
inInfoRowMap
=
eiBlock
.
getRow
(
i
);
AssertUtils
.
isEmpty
(
MapUtils
.
getString
(
inInfoRowMap
,
"groupEname"
),
"角色英文名不能为空"
);
inInfoRowMap
.
put
(
"recRevisor"
,
UserSession
.
getUser
().
getUsername
());
inInfoRowMap
.
put
(
"recReviseTime"
,
DateUtils
.
curDateTimeStr14
());
}
eiInfo
.
addBlock
(
eiBlock
);
eiInfo
.
set
(
EiConstant
.
serviceId
,
"S_XS_20"
);
EiInfo
outInfo
=
XServiceManager
.
call
(
eiInfo
);
r1Block
.
setRows
(
outInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
());
outInfo
.
addBlock
(
r1Block
);
return
outInfo
;
}
public
EiInfo
deleteGroupFromTree
(
EiInfo
inInfo
)
{
String
groupId
=
(
String
)
inInfo
.
get
(
"groupId"
);
String
parentId
=
(
String
)
inInfo
.
get
(
"parentId"
);
...
...
src/main/java/com/baosight/xservices/xs/service/ServiceXSAuthorizationManage.java
0 → 100644
View file @
15696bae
package
com
.
baosight
.
xservices
.
xs
.
service
;
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.log.xeye.entity.XEyeEntity
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.core.service.soa.XEventManager
;
import
com.baosight.iplat4j.core.util.DateUtils
;
import
com.baosight.xservices.xs.common.AuthInfoManager
;
import
com.baosight.xservices.xs.util.XSServiceUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
/**
*
* @author:songx
* @date:2024/10/12,14:30
*/
public
class
ServiceXSAuthorizationManage
extends
ServiceEPBase
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ServiceXSAuthorizationManage
.
class
);
public
ServiceXSAuthorizationManage
()
{
}
public
EiInfo
insertAuthorization
(
EiInfo
inInfo
)
{
boolean
ignoreDuplicate
=
"true"
.
equals
(
inInfo
.
get
(
"ignoreDuplicate"
));
XSServiceUtils
.
apiDataHandleDecorator
(
inInfo
);
if
(
inInfo
.
getStatus
()
==
-
1
)
{
return
inInfo
;
}
else
{
StringBuilder
buffer
=
new
StringBuilder
();
StringBuilder
detail
=
new
StringBuilder
();
List
insertedAuthList
=
new
ArrayList
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
"result"
);
int
rowCount
=
eiBlock
.
getRowCount
();
List
errorMsgList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
rowCount
;
++
i
)
{
Map
<
String
,
Object
>
inInfoRowMap
=
eiBlock
.
getRow
(
i
);
String
subjectId
=
(
String
)
inInfoRowMap
.
get
(
"subjectId"
);
String
subjectEname
=
(
String
)
inInfoRowMap
.
get
(
"subjectEname"
);
String
subjectType
=
(
String
)
inInfoRowMap
.
get
(
"subjectType"
);
String
objectId
=
(
String
)
inInfoRowMap
.
get
(
"objectId"
);
String
objectEname
=
(
String
)
inInfoRowMap
.
get
(
"objectEname"
);
String
objectType
=
(
String
)
inInfoRowMap
.
get
(
"objectType"
);
String
operationType
=
(
String
)
inInfoRowMap
.
get
(
"operationType"
);
Object
recCreator
=
inInfoRowMap
.
get
(
"recCreator"
);
if
(
""
.
equals
(
subjectId
)
&
StringUtils
.
isBlank
(
subjectEname
)
||
""
.
equals
(
subjectType
)
||
""
.
equals
(
objectId
)
&
StringUtils
.
isBlank
(
objectEname
)
||
""
.
equals
(
objectType
)
||
""
.
equals
(
operationType
))
{
inInfo
.
setMsg
(
"新增第"
+
(
i
+
1
)
+
"条记录失败,授权主客体ID,类别及操作类别均不能为空\n"
);
inInfo
.
setStatus
(-
1
);
return
inInfo
;
}
if
(
recCreator
==
null
)
{
inInfo
.
setMsg
(
"新增第"
+
(
i
+
1
)
+
"条记录失败,新增操作人recCreator不能为空\n"
);
inInfo
.
setStatus
(-
1
);
return
inInfo
;
}
Map
<
String
,
String
>
queryMap
=
new
HashMap
();
queryMap
.
put
(
"subjectEname"
,
subjectEname
);
String
table
;
String
column
;
String
archiveFlag
;
String
recRevisor
;
if
(
StringUtils
.
isBlank
(
subjectId
))
{
byte
var24
=
-
1
;
switch
(
subjectType
.
hashCode
())
{
case
-
970063637
:
if
(
subjectType
.
equals
(
"USER_GROUP"
))
{
var24
=
1
;
}
break
;
case
2614219
:
if
(
subjectType
.
equals
(
"USER"
))
{
var24
=
0
;
}
}
switch
(
var24
)
{
case
0
:
table
=
"XS_USER"
;
column
=
"LOGIN_NAME"
;
archiveFlag
=
"USER_ID"
;
break
;
case
1
:
table
=
"XS_USER_GROUP"
;
column
=
"GROUP_ENAME"
;
archiveFlag
=
"ID"
;
break
;
default
:
table
=
""
;
column
=
""
;
archiveFlag
=
""
;
}
queryMap
.
put
(
"table"
,
table
);
queryMap
.
put
(
"conditionColumn"
,
column
);
queryMap
.
put
(
"valueColumn"
,
archiveFlag
);
List
subject
=
this
.
dao
.
query
(
"XS07.querySubjectByEname"
,
queryMap
);
if
(
subject
.
size
()
==
0
)
{
recRevisor
=
"新增第"
+
(
i
+
1
)
+
"条记录失败,传入的授权主体["
+
subjectEname
+
"]不存在\n"
;
if
(!
ignoreDuplicate
)
{
inInfo
.
setMsg
(
recRevisor
);
inInfo
.
setStatus
(-
1
);
inInfoRowMap
.
put
(
"subjectId"
,
""
);
inInfoRowMap
.
put
(
"objectId"
,
""
);
return
inInfo
;
}
errorMsgList
.
add
(
recRevisor
);
continue
;
}
subjectId
=
(
String
)((
Map
)
subject
.
get
(
0
)).
get
(
"subjectId"
);
inInfoRowMap
.
put
(
"subjectId"
,
subjectId
);
}
String
errorMsg
;
if
(
StringUtils
.
isBlank
(
objectId
))
{
byte
var36
=
-
1
;
switch
(
objectType
.
hashCode
())
{
case
-
973253906
:
if
(
objectType
.
equals
(
"RESOURCE_GROUP"
))
{
var36
=
1
;
}
break
;
case
441562126
:
if
(
objectType
.
equals
(
"RESOURCE"
))
{
var36
=
0
;
}
}
switch
(
var36
)
{
case
0
:
table
=
"XS_RESOURCE"
;
column
=
"RESOURCE_ENAME"
;
break
;
case
1
:
table
=
"XS_RESOURCE_GROUP"
;
column
=
"RESOURCE_GROUP_ENAME"
;
objectEname
=
objectEname
.
toUpperCase
();
break
;
default
:
table
=
""
;
column
=
""
;
}
queryMap
.
put
(
"objectEname"
,
objectEname
);
queryMap
.
put
(
"table"
,
table
);
queryMap
.
put
(
"conditionColumn"
,
column
);
List
object
=
this
.
dao
.
query
(
"XS07.queryObjectByEname"
,
queryMap
);
if
(
object
.
size
()
==
0
)
{
errorMsg
=
"新增第"
+
(
i
+
1
)
+
"条记录失败,传入的授权客体["
+
objectEname
+
"]不存在\n"
;
if
(!
ignoreDuplicate
)
{
inInfo
.
setMsg
(
"新增第"
+
(
i
+
1
)
+
"条记录失败,传入的授权客体["
+
objectEname
+
"]不存在\n"
);
inInfo
.
setStatus
(-
1
);
inInfoRowMap
.
put
(
"subjectId"
,
""
);
inInfoRowMap
.
put
(
"objectId"
,
""
);
return
inInfo
;
}
errorMsgList
.
add
(
errorMsg
);
continue
;
}
objectId
=
(
String
)((
Map
)
object
.
get
(
0
)).
get
(
"objectId"
);
inInfoRowMap
.
put
(
"objectId"
,
objectId
);
}
try
{
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
"subjectId"
,
subjectId
);
paramMap
.
put
(
"objectId"
,
objectId
);
paramMap
.
put
(
"operationType"
,
operationType
);
List
list
=
this
.
dao
.
query
(
"XS07.query"
,
paramMap
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
archiveFlag
=
"新增第"
+
(
i
+
1
)
+
"条记录失败,该授权信息已存在\n"
;
if
(!
ignoreDuplicate
)
{
inInfo
.
setMsg
(
archiveFlag
);
inInfo
.
setStatus
(-
1
);
inInfoRowMap
.
put
(
"subjectId"
,
""
);
inInfoRowMap
.
put
(
"objectId"
,
""
);
return
inInfo
;
}
errorMsgList
.
add
(
archiveFlag
);
}
else
{
inInfoRowMap
.
put
(
"recCreateTime"
,
DateUtils
.
curDateTimeStr14
());
archiveFlag
=
(
String
)
inInfoRowMap
.
get
(
"archiveFlag"
);
errorMsg
=
(
String
)
inInfoRowMap
.
get
(
"sortIndex"
);
if
(
null
==
archiveFlag
||
""
.
equals
(
archiveFlag
))
{
archiveFlag
=
"0"
;
inInfoRowMap
.
put
(
"archiveFlag"
,
archiveFlag
);
}
if
(
null
==
errorMsg
||
StringUtils
.
isBlank
(
errorMsg
))
{
inInfoRowMap
.
put
(
"sortIndex"
,
0
);
}
recRevisor
=
(
String
)
inInfoRowMap
.
get
(
"recRevisor"
);
String
recReviseTime
=
(
String
)
inInfoRowMap
.
get
(
"recReviseTime"
);
if
(!
""
.
equals
(
recRevisor
))
{
inInfoRowMap
.
put
(
"recRevisor"
,
" "
);
}
if
(!
""
.
equals
(
recReviseTime
))
{
inInfoRowMap
.
put
(
"recReviseTime"
,
" "
);
}
this
.
dao
.
insert
(
"XS07.insert"
,
inInfoRowMap
);
Map
map
=
new
HashMap
();
map
.
put
(
"subjectId"
,
subjectId
);
map
.
put
(
"objectId"
,
objectId
);
List
insertAuthList
=
this
.
dao
.
query
(
"XS07.query"
,
map
);
Map
insertAuthMap
=
(
Map
)
insertAuthList
.
get
(
0
);
insertedAuthList
.
add
(
insertAuthMap
);
String
subjectName
=
this
.
getSubjectName
(
subjectType
,
subjectId
);
String
objectName
=
this
.
getSubjectName
(
objectType
,
objectId
);
AuthInfoManager
.
clearSubjectAuth
(
subjectName
);
XEyeEntity
xEyeEntity
=
new
XEyeEntity
();
xEyeEntity
.
setLogId
(
"1104"
);
xEyeEntity
.
setLogName
(
"授予权限"
);
xEyeEntity
.
setInvokeInfo
(
recCreator
.
toString
()
+
"在"
+
DateUtils
.
curDateStr
(
"yyyy-MM-dd HH:mm:ss"
)
+
"为 "
+
subjectName
+
" 授予了访问 "
+
objectName
+
" 的权限"
);
xEyeEntity
.
setStatus
(
inInfo
.
getStatus
()
+
""
);
xEyeEntity
.
set
(
"x_xs_si"
,
subjectId
);
xEyeEntity
.
set
(
"x_xs_oi"
,
objectId
);
xEyeEntity
.
set
(
"x_xs_on"
,
inInfoRowMap
.
get
(
"recCreator"
));
xEyeEntity
.
set
(
"x_xs_sn"
,
subjectName
);
xEyeEntity
.
set
(
"x_xs_obn"
,
objectName
);
this
.
log
(
xEyeEntity
);
}
}
catch
(
Exception
var32
)
{
buffer
.
append
(
"新增第"
+
(
i
+
1
)
+
"条记录失败\n"
+
var32
.
getMessage
());
inInfo
.
setStatus
(-
1
);
detail
.
append
(
var32
.
getMessage
());
inInfoRowMap
.
put
(
"subjectId"
,
""
);
logger
.
error
(
var32
.
getMessage
());
inInfo
.
setMsg
(
detail
.
toString
());
return
inInfo
;
}
}
buffer
.
append
(
"新增"
).
append
(
rowCount
).
append
(
"条记录成功\n"
);
if
(
inInfo
.
getStatus
()
!=
-
1
)
{
inInfo
.
setStatus
(
1
);
}
inInfo
.
set
(
"errorMsgList"
,
errorMsgList
);
inInfo
.
setMsg
(
buffer
.
toString
());
inInfo
.
setDetailMsg
(
detail
.
toString
());
if
(
insertedAuthList
.
size
()
>
0
)
{
EiInfo
eiInfo
=
new
EiInfo
();
eiInfo
.
set
(
"list"
,
insertedAuthList
);
eiInfo
.
set
(
EiConstant
.
eventId
,
"E_XS_45"
);
EiInfo
outInfo
=
XEventManager
.
call
(
eiInfo
);
if
(
outInfo
.
getStatus
()
<
0
)
{
buffer
.
append
(
"新增授权失败\n"
).
append
(
outInfo
.
getMsg
());
inInfo
.
setStatus
(-
1
);
detail
.
append
(
outInfo
.
getDetailMsg
());
}
}
return
inInfo
;
}
}
public
EiInfo
deleteAuthorization
(
EiInfo
inInfo
)
{
boolean
ignoreDuplicate
=
"true"
.
equals
(
inInfo
.
get
(
"ignoreDuplicate"
));
XSServiceUtils
.
apiDataHandleDecorator
(
inInfo
);
if
(
inInfo
.
getStatus
()
==
-
1
)
{
return
inInfo
;
}
else
{
List
ExceptionInfoList
=
new
ArrayList
();
Boolean
ignoreError
=
"true"
.
equals
(
inInfo
.
getString
(
"ignoreError"
));
StringBuilder
buffer
=
new
StringBuilder
();
StringBuilder
detail
=
new
StringBuilder
();
List
deletedAuthList
=
new
ArrayList
();
List
errorMsgList
=
new
ArrayList
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
"result"
);
int
rowCount
=
eiBlock
.
getRowCount
();
int
i
;
for
(
i
=
0
;
i
<
rowCount
;
++
i
)
{
Map
<
String
,
Object
>
inInfoRowMap
=
eiBlock
.
getRow
(
i
);
String
subjectId
=
(
String
)
inInfoRowMap
.
get
(
"subjectId"
);
String
subjectEname
=
(
String
)
inInfoRowMap
.
get
(
"subjectEname"
);
String
subjectType
=
(
String
)
inInfoRowMap
.
get
(
"subjectType"
);
String
objectId
=
(
String
)
inInfoRowMap
.
get
(
"objectId"
);
String
objectEname
=
(
String
)
inInfoRowMap
.
get
(
"objectEname"
);
String
objectType
=
(
String
)
inInfoRowMap
.
get
(
"objectType"
);
String
operationType
=
(
String
)
inInfoRowMap
.
get
(
"operationType"
);
Object
recRevisor
=
inInfoRowMap
.
get
(
"recRevisor"
);
if
(!(
""
.
equals
(
subjectId
)
&
StringUtils
.
isBlank
(
subjectEname
))
&&
!
""
.
equals
(
subjectType
)
&&
!(
""
.
equals
(
objectId
)
&
StringUtils
.
isBlank
(
objectEname
))
&&
!
""
.
equals
(
objectType
)
&&
!
""
.
equals
(
operationType
))
{
if
(
recRevisor
==
null
)
{
if
(!
ignoreError
)
{
inInfo
.
setMsg
(
"新增第"
+
(
i
+
1
)
+
"条记录失败,删除操作人recRevisor不能为空\n"
);
inInfo
.
setStatus
(-
1
);
return
inInfo
;
}
ExceptionInfoList
.
add
(
"第"
+
(
i
+
1
)
+
"行数据异常:新增第"
+
(
i
+
1
)
+
"条记录失败,删除操作人recRevisor不能为空\n"
);
}
else
{
Map
<
String
,
String
>
queryMap
=
new
HashMap
();
queryMap
.
put
(
"subjectEname"
,
subjectEname
);
String
table
;
String
column
;
String
subjectName
;
if
(
StringUtils
.
isBlank
(
subjectId
))
{
byte
var26
=
-
1
;
switch
(
subjectType
.
hashCode
())
{
case
-
970063637
:
if
(
subjectType
.
equals
(
"USER_GROUP"
))
{
var26
=
1
;
}
break
;
case
2614219
:
if
(
subjectType
.
equals
(
"USER"
))
{
var26
=
0
;
}
}
switch
(
var26
)
{
case
0
:
table
=
"XS_USER"
;
column
=
"LOGIN_NAME"
;
subjectName
=
"USER_ID"
;
break
;
case
1
:
table
=
"XS_USER_GROUP"
;
column
=
"GROUP_ENAME"
;
subjectName
=
"ID"
;
break
;
default
:
table
=
""
;
column
=
""
;
subjectName
=
""
;
}
queryMap
.
put
(
"table"
,
table
);
queryMap
.
put
(
"conditionColumn"
,
column
);
queryMap
.
put
(
"valueColumn"
,
subjectName
);
List
subject
=
this
.
dao
.
query
(
"XS07.querySubjectByEname"
,
queryMap
);
if
(
subject
.
size
()
==
0
)
{
String
errorMsg
=
"新增第"
+
(
i
+
1
)
+
"条记录失败,传入的授权主体["
+
subjectEname
+
"]不存在\n"
;
if
(
ignoreDuplicate
)
{
errorMsgList
.
add
(
errorMsg
);
}
else
{
if
(!
ignoreError
)
{
inInfo
.
setMsg
(
errorMsg
);
inInfo
.
setStatus
(-
1
);
inInfoRowMap
.
put
(
"subjectId"
,
""
);
inInfoRowMap
.
put
(
"objectId"
,
""
);
return
inInfo
;
}
ExceptionInfoList
.
add
(
"第"
+
(
i
+
1
)
+
"行数据异常:"
+
errorMsg
);
}
continue
;
}
subjectId
=
(
String
)((
Map
)
subject
.
get
(
0
)).
get
(
"subjectId"
);
inInfoRowMap
.
put
(
"subjectId"
,
subjectId
);
}
String
errorMsg
;
if
(
StringUtils
.
isBlank
(
objectId
))
{
byte
var31
=
-
1
;
switch
(
objectType
.
hashCode
())
{
case
-
973253906
:
if
(
objectType
.
equals
(
"RESOURCE_GROUP"
))
{
var31
=
1
;
}
break
;
case
441562126
:
if
(
objectType
.
equals
(
"RESOURCE"
))
{
var31
=
0
;
}
}
switch
(
var31
)
{
case
0
:
table
=
"XS_RESOURCE"
;
column
=
"RESOURCE_ENAME"
;
break
;
case
1
:
table
=
"XS_RESOURCE_GROUP"
;
column
=
"RESOURCE_GROUP_ENAME"
;
objectEname
=
objectEname
.
toUpperCase
();
break
;
default
:
table
=
""
;
column
=
""
;
}
queryMap
.
put
(
"objectEname"
,
objectEname
);
queryMap
.
put
(
"table"
,
table
);
queryMap
.
put
(
"conditionColumn"
,
column
);
List
object
=
this
.
dao
.
query
(
"XS07.queryObjectByEname"
,
queryMap
);
if
(
object
.
size
()
==
0
)
{
errorMsg
=
"新增第"
+
(
i
+
1
)
+
"条记录失败,传入的授权客体["
+
objectEname
+
"]不存在\n"
;
if
(
ignoreDuplicate
)
{
errorMsgList
.
add
(
errorMsg
);
}
else
{
if
(!
ignoreError
)
{
inInfo
.
setMsg
(
errorMsg
);
inInfo
.
setStatus
(-
1
);
inInfoRowMap
.
put
(
"subjectId"
,
""
);
inInfoRowMap
.
put
(
"objectId"
,
""
);
return
inInfo
;
}
ExceptionInfoList
.
add
(
"第"
+
(
i
+
1
)
+
"行数据异常:"
+
errorMsg
);
}
continue
;
}
objectId
=
(
String
)((
Map
)
object
.
get
(
0
)).
get
(
"objectId"
);
inInfoRowMap
.
put
(
"objectId"
,
objectId
);
}
try
{
Map
map
=
new
HashMap
();
map
.
put
(
"subjectId"
,
subjectId
);
map
.
put
(
"objectId"
,
objectId
);
List
deleteAuthList
=
this
.
dao
.
query
(
"XS07.query"
,
map
);
if
(
deleteAuthList
.
size
()
>
0
)
{
Map
deleteAuthMap
=
(
Map
)
deleteAuthList
.
get
(
0
);
deletedAuthList
.
add
(
deleteAuthMap
);
this
.
dao
.
delete
(
"XS07.delete"
,
inInfoRowMap
);
subjectName
=
this
.
getSubjectName
(
subjectType
,
subjectId
);
errorMsg
=
this
.
getSubjectName
(
objectType
,
objectId
);
XEyeEntity
xEyeEntity
=
new
XEyeEntity
();
xEyeEntity
.
setLogId
(
"1105"
);
xEyeEntity
.
setLogName
(
"解除权限"
);
if
(
"ACCESS"
.
equals
(
operationType
))
{
operationType
=
"访问"
;
}
else
{
operationType
=
"管理"
;
}
AuthInfoManager
.
clearSubjectAuth
(
subjectName
);
xEyeEntity
.
setInvokeInfo
(
inInfoRowMap
.
get
(
"recRevisor"
)
+
"在"
+
DateUtils
.
curDateStr
(
"yyyy-MM-dd HH:mm:ss"
)
+
"解除了 "
+
subjectName
+
operationType
+
errorMsg
+
" 的权限"
);
xEyeEntity
.
setStatus
(
inInfo
.
getStatus
()
+
""
);
xEyeEntity
.
set
(
"x_xs_si"
,
subjectId
);
xEyeEntity
.
set
(
"x_xs_oi"
,
inInfoRowMap
.
get
(
"objectId"
));
xEyeEntity
.
set
(
"x_xs_on"
,
inInfoRowMap
.
get
(
"recRevisor"
));
xEyeEntity
.
set
(
"x_xs_sn"
,
subjectName
);
xEyeEntity
.
set
(
"x_xs_obn"
,
errorMsg
);
this
.
log
(
xEyeEntity
);
}
}
catch
(
Exception
var27
)
{
buffer
.
append
(
"删除第"
).
append
(
i
+
1
).
append
(
"条记录失败!原因:"
).
append
(
var27
.
getMessage
()).
append
(
"\n"
);
detail
.
append
(
var27
.
getMessage
());
inInfo
.
setStatus
(-
1
);
inInfo
.
setMsg
(
buffer
.
toString
());
logger
.
error
(
var27
.
getMessage
());
return
inInfo
;
}
}
}
else
{
if
(!
ignoreError
)
{
inInfo
.
setMsg
(
"删除第"
+
(
i
+
1
)
+
"条记录失败,授权主客体ID,类别及操作类别均不能为空\n"
);
inInfo
.
setStatus
(-
1
);
return
inInfo
;
}
ExceptionInfoList
.
add
(
"第"
+
(
i
+
1
)
+
"行数据异常:删除第"
+
(
i
+
1
)
+
"条记录失败,授权主客体ID,类别及操作类别均不能为空\n"
);
}
}
if
(
ExceptionInfoList
.
size
()
>
0
)
{
for
(
i
=
0
;
i
<
ExceptionInfoList
.
size
();
++
i
)
{
detail
.
append
(
ExceptionInfoList
.
get
(
i
));
}
buffer
.
append
(
"删除"
+
(
rowCount
-
ExceptionInfoList
.
size
())
+
"条记录成功\n"
);
}
else
{
buffer
.
append
(
"删除"
+
rowCount
+
"条记录成功\n"
);
}
if
(
inInfo
.
getStatus
()
!=
-
1
)
{
inInfo
.
setStatus
(
1
);
}
inInfo
.
set
(
"errorMsgList"
,
errorMsgList
);
inInfo
.
setMsg
(
buffer
.
toString
());
inInfo
.
setDetailMsg
(
detail
.
toString
());
if
(
deletedAuthList
.
size
()
>
0
)
{
EiInfo
eiInfo
=
new
EiInfo
();
eiInfo
.
set
(
"list"
,
deletedAuthList
);
eiInfo
.
set
(
EiConstant
.
eventId
,
"E_XS_46"
);
EiInfo
outInfo
=
XEventManager
.
call
(
eiInfo
);
if
(
outInfo
.
getStatus
()
<
0
)
{
buffer
.
append
(
"删除授权失败\n"
).
append
(
outInfo
.
getMsg
());
inInfo
.
setStatus
(-
1
);
detail
.
append
(
outInfo
.
getDetailMsg
());
}
}
return
inInfo
;
}
}
private
String
getSubjectName
(
String
subjectType
,
String
subjectId
)
throws
Exception
{
try
{
Map
map
=
new
HashMap
();
String
subjectName
=
null
;
List
subjectList
=
null
;
if
(
"RESOURCE"
.
equals
(
subjectType
))
{
map
.
put
(
"resourceId"
,
subjectId
);
subjectList
=
this
.
dao
.
query
(
"XS04.query"
,
map
);
if
(
CollectionUtils
.
isEmpty
(
subjectList
))
{
return
""
;
}
subjectName
=
((
Map
)
subjectList
.
get
(
0
)).
get
(
"resourceEname"
).
toString
();
}
else
if
(
"RESOURCE_GROUP"
.
equals
(
subjectType
))
{
map
.
put
(
"resourceGroupId"
,
subjectId
);
subjectList
=
this
.
dao
.
query
(
"XS05.query"
,
map
);
subjectName
=
((
Map
)
subjectList
.
get
(
0
)).
get
(
"resourceGroupEname"
).
toString
();
}
else
if
(
"USER_GROUP"
.
equals
(
subjectType
))
{
map
.
put
(
"groupId"
,
subjectId
);
subjectList
=
this
.
dao
.
query
(
"XS02.query"
,
map
);
subjectName
=
((
Map
)
subjectList
.
get
(
0
)).
get
(
"groupEname"
).
toString
();
}
else
if
(
"USER"
.
equals
(
subjectType
))
{
map
.
put
(
"userId"
,
subjectId
);
subjectList
=
this
.
dao
.
query
(
"XS01.query"
,
map
);
subjectName
=
((
Map
)
subjectList
.
get
(
0
)).
get
(
"loginName"
).
toString
();
}
else
{
subjectName
=
subjectId
;
}
return
subjectName
;
}
catch
(
IndexOutOfBoundsException
var6
)
{
throw
new
Exception
(
" Query type["
+
subjectType
+
"],id["
+
subjectId
+
"]fail!"
);
}
}
public
EiInfo
clearAuthorizationCache
(
EiInfo
inInfo
)
{
try
{
AuthInfoManager
.
clearAuthInfo
();
}
catch
(
Exception
var3
)
{
logger
.
error
(
var3
);
inInfo
.
setStatus
(-
1
);
inInfo
.
setMsg
(
var3
.
getMessage
());
}
return
inInfo
;
}
}
src/main/java/com/baosight/xservices/xs/sql/XS03.xml
View file @
15696bae
...
...
@@ -316,7 +316,8 @@
group_ename as "groupEname",
group_cname as "groupCname",
manage_group_ename as "manageGroupEname",
group_type as "groupType"
group_type as "groupType",
data_auth_type as "dataAuthType"
FROM ${platSchema}.XS_USER_GROUP where 1=1 and group_ename != 'ADMIN' and group_ename != 'root'
and group_ename != 'managerRoot'
<isNotEmpty
prepend=
" AND "
property=
"insertParentId"
>
...
...
src/main/java/com/baosight/xservices/xs/sql/XS07.xml
View file @
15696bae
...
...
@@ -93,7 +93,8 @@
t1.rec_revisor as "recRevisor",
t1.rec_revise_time as "recReviseTime",
t1.archive_flag as "archiveFlag",
t1.sort_index as "sortIndex"
t1.sort_index as "sortIndex",
t7.type as "resourceType"
FROM ${platSchema}.XS_AUTHORIZATION t1
LEFT JOIN ${platSchema}.XS_USER_GROUP t2 ON t1.subject_id=t2.ID
LEFT JOIN ${platSchema}.XS_USER t3 ON t1.subject_id = t3.USER_ID
...
...
src/main/webapp/XS/XS3002.jsp
View file @
15696bae
...
...
@@ -24,7 +24,7 @@
data-errorprompt=
"对不起,用户组英文名只能是32位英文字母或数字字符或下划线或@符"
/>
<EF:EFColumn
ename=
"groupCname"
cname=
"角色中文名"
required=
"true"
style=
"text-align:left;"
/>
<EF:EFComboColumn
ename=
"dataAuthType"
cname=
"查看数据范围"
width=
"110"
align=
"center"
required=
"true"
>
defaultValue=
"1"
required=
"true"
>
<EF:EFCodeOption
codeName=
"hggp.role.dataAuthType"
/>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"depCode"
cname=
"所属部门编码"
width=
"150"
align=
"center"
...
...
src/main/webapp/XS/XS3201.jsp
View file @
15696bae
...
...
@@ -176,10 +176,19 @@
<EF:EFInput type="hidden" cname="授权客体类型" ename="objectType" row="0"
blockId="inqu_status"
name="inqu_status-0-objectType" value=""/>
<EF:EFInput cname="授权中文名" ename="objectName" row="0" blockId="inqu_status"/>
<EF:EFInput cname="授权英文名" ename="objectEname" row="0" blockId="inqu_status"/>
<EF:EFInput cname="授权中文名" ename="objectName" row="0" blockId="inqu_status"
colWidth="4"/>
<EF:EFInput cname="授权英文名" ename="objectEname" row="0" blockId="inqu_status"
colWidth="4"/>
<EF:EFSelect cname="资源类型" ename="resourceType" row="0" blockId="inqu_status"
colWidth="4">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="页面" value="PAGE"/>
<EF:EFOption label="按钮" value="BUTTON"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result3" title="结果集">
<EF:EFGrid blockId="result3" autoDraw="no" autoBind="false"
queryMethod="queryResourceAndGroupByUserGroup"
deleteMethod="deleteResourceAndGroupByUserGroup"
...
...
@@ -188,13 +197,20 @@
hidden="true"/>
<EF:EFColumn ename="objectId" cname="授权客体id" readonly="true" hidden="true"/>
<EF:EFColumn ename="objectType" cname="授权客体类型" readonly="true" hidden="true"/>
<EF:EFColumn ename="objectName" cname="授权中文名" readonly="true"/>
<EF:EFColumn ename="objectEname" cname="授权英文名" readonly="true"/>
<EF:EFColumn ename="objectEname" cname="授权英文名" enable="false"/>
<EF:EFColumn ename="objectName" cname="授权中文名" enable="false"/>
<EF:EFComboColumn ename="resourceType" cname="资源类型" enable="false" width="80"
align="center">
<EF:EFOption label="" value=""/>
<EF:EFOption label="页面" value="PAGE"/>
<EF:EFOption label="按钮" value="BUTTON"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="操作类型" ename="operationType" sourceName="operationTypeList"
textField="desc" readonly="false"
valueField="name" style="text-align:center;" copy="true">
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
<%--<div id="resourceGroup" title="已授权资源组" value="RESOURCE_GROUP">
...
...
src/main/webapp/XS/XS40.jsp
View file @
15696bae
...
...
@@ -148,15 +148,16 @@
<EF:EFColumn ename="groupId" locked="true" cname="角色ID" hidden="true" primaryKey="true"/>
<EF:EFColumn ename="groupEname" cname="角色英文名" readonly="true"/>
<EF:EFColumn ename="groupCname" cname="角色中文名" readonly="true"/>
<EF:EFComboColumn ename="dataAuthType" cname="查看数据范围" width="110" align="center"
defaultValue="4" required="true" readonly="true">
<EF:EFCodeOption codeName="hggp.role.dataAuthType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="manageGroupEname" cname="管辖组英文名" style="text-align:left;" hidden="true"/>
<EF:EFColumn ename="manageGroupCname" cname="管辖组中文名" style="text-align:left;" readonly="true"
hidden="true"/>
<EF:EFComboColumn ename="groupType" cname="群组类型" valueField="valueField" textField="textField"
defaultValue="NORMAL" columnTemplate="#=textField#" align="center"
required="true"
hidden="true">
required="true" hidden="true">
<EF:EFCodeOption codeName="iplat.xs.userGroup"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sortIndex" cname="排序" style="text-align:right;" hidden="true"/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment