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
a6dcfc58
Commit
a6dcfc58
authored
Aug 21, 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
eafa54a0
054afc56
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
108 additions
and
45 deletions
+108
-45
CommonConstant.java
.../java/com/baosight/hggp/core/constant/CommonConstant.java
+6
-0
UserSessionUtils.java
...ava/com/baosight/hggp/core/security/UserSessionUtils.java
+2
-2
HGWD002.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD002.xml
+2
-7
ServiceHGXSUser.java
...java/com/baosight/hggp/hg/xs/service/ServiceHGXSUser.java
+34
-0
HGXSDataAuth.xml
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml
+28
-0
HGXSOrg.xml
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSOrg.xml
+2
-2
SqlMapDaoLogProxy.java
...sight/iplat4j/core/data/ibatis/dao/SqlMapDaoLogProxy.java
+4
-2
ServiceXSOG0800.java
...com/baosight/xservices/xs/og/service/ServiceXSOG0800.java
+4
-4
ServiceXSOG0801.java
...com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
+2
-6
ServiceXSOG0801A.java
...om/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
+4
-5
ServiceXSOG0801B.java
...om/baosight/xservices/xs/og/service/ServiceXSOG0801B.java
+6
-3
XSOG01.xml
src/main/java/com/baosight/xservices/xs/og/sql/XSOG01.xml
+11
-14
ServiceXS0710.java
...java/com/baosight/xservices/xs/service/ServiceXS0710.java
+1
-0
ServiceXS3002.java
...java/com/baosight/xservices/xs/service/ServiceXS3002.java
+1
-0
sqlmap-config.xml
src/main/resources/resources/ibatis/sqlmap-config.xml
+1
-0
No files found.
src/main/java/com/baosight/hggp/core/constant/CommonConstant.java
View file @
a6dcfc58
...
...
@@ -33,6 +33,10 @@ public class CommonConstant {
// 否
public
static
final
Integer
NO_0
=
0
;
// 是
public
static
final
String
YES_S1
=
"1"
;
// 否
public
static
final
String
NO_S0
=
"0"
;
// 是
public
static
final
String
YES
=
"Y"
;
// 否
public
static
final
String
NO
=
"N"
;
...
...
@@ -88,6 +92,8 @@ public class CommonConstant {
public
static
final
String
PROJ_ID
=
"projId"
;
// 企业管理员
public
static
final
String
COMPANY_MANAGE
=
"companyManage"
;
// ADMIN
public
static
final
String
ADMIN
=
"ADMIN"
;
}
/**
...
...
src/main/java/com/baosight/hggp/core/security/UserSessionUtils.java
View file @
a6dcfc58
...
...
@@ -40,9 +40,9 @@ public class UserSessionUtils extends UserSession {
*/
public
static
User
getUser
()
{
EiInfo
eiInfo
=
new
EiInfo
();
eiInfo
.
set
(
"
userId"
,
UserSession
.
getUserId
());
eiInfo
.
set
(
"
loginName"
,
UserSession
.
getLoginName
());
eiInfo
.
set
(
EiConstant
.
serviceName
,
"HGXSUser"
);
eiInfo
.
set
(
EiConstant
.
methodName
,
"getUser"
);
eiInfo
.
set
(
EiConstant
.
methodName
,
"getUser
ByLogin
"
);
EiInfo
outInfo
=
XLocalManager
.
call
(
eiInfo
);
// -1表示报错
if
(
outInfo
.
getStatus
()
==
-
1
)
{
...
...
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD002.xml
View file @
a6dcfc58
...
...
@@ -6,7 +6,6 @@
A.ID as "id",
A.ACCOUNT_CODE as "accountCode",
<!-- 企业编码 -->
A.DEP_CODE as "depCode",
<!-- 部门编码 -->
A.DELETE_FLAG as "deleteFlag",
<!-- 0-未删除,1-已删除 -->
A.COMPANY_CODE as "companyCode",
<!-- 公司编码 -->
A.COMPANY_NAME as "companyName",
<!-- 公司名称 -->
A.PROJ_CODE as "projCode",
<!-- 项目编码 -->
...
...
@@ -24,15 +23,11 @@
<sql
id=
"condition"
>
AND A.DELETE_FLAG = 0
AND B.BIZ_TYPE = 'WD'
<include
refid=
"HGXSDataAuth.authConditionA"
/>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
A.ID = #id#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"depCode"
>
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
A.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
...
...
src/main/java/com/baosight/hggp/hg/xs/service/ServiceHGXSUser.java
View file @
a6dcfc58
...
...
@@ -60,6 +60,40 @@ public class ServiceHGXSUser extends ServiceBase {
}
/**
* 获取用户信息
*
* @param eiInfo
* @return
*/
public
EiInfo
getUserByLogin
(
EiInfo
eiInfo
)
{
EiInfo
outInfo
=
new
EiInfo
();
int
status
=
0
;
String
msg
=
""
;
try
{
String
loginName
=
eiInfo
.
getString
(
"loginName"
);
if
(
StringUtils
.
isNotEmpty
(
loginName
))
{
Map
map
=
new
HashMap
();
map
.
put
(
"loginName"
,
loginName
);
List
<
User
>
users
=
dao
.
query
(
"HGXSUser.query"
,
map
);
if
(
users
!=
null
&&
users
.
size
()
>
0
)
{
status
=
1
;
msg
=
"用户存在!"
;
outInfo
.
set
(
"result"
,
users
.
get
(
0
));
}
else
{
msg
=
"用户信息不存在!"
;
}
}
else
{
msg
=
"传入用户名不能为空!"
;
}
outInfo
.
setStatus
(
status
);
outInfo
.
setMsg
(
msg
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
outInfo
,
e
,
"平台调用用户信息异常"
);
}
return
outInfo
;
}
/**
* 查询用户下拉框
*
* @param inInfo
...
...
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml
View file @
a6dcfc58
...
...
@@ -3,6 +3,9 @@
<sqlMap
namespace=
"HGXSDataAuth"
>
<sql
id=
"authCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<!-- 无权限时使用 -->
<isNotEmpty
prepend=
" AND "
property=
"authDepCode"
>
DEP_CODE = #authDepCode#
...
...
@@ -24,4 +27,29 @@
</isNotEqual>
</sql>
<sql
id=
"authConditionA"
>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<!-- 无权限时使用 -->
<isNotEmpty
prepend=
" AND "
property=
"authDepCode"
>
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual
prepend=
" AND "
property=
"authCombination"
compareValue=
"1"
>
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"authDepCodes"
>
#authDepCodes[]#
</iterate>
)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual
prepend=
" AND "
property=
"authCombination"
compareValue=
"1"
>
<isNotEmpty
property=
"authOnlyPeople"
>
A.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty
property=
"authDepCodes"
>
A.DEP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"authDepCodes"
>
#authDepCodes[]#
</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
</sqlMap>
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSOrg.xml
View file @
a6dcfc58
...
...
@@ -4,9 +4,9 @@
<sql
id=
"condition"
>
AND IS_DELETED = '0'
<isNotE
mpty
prepend=
" AND "
property=
"accountCode
"
>
<isNotE
qual
prepend=
" AND "
property=
"accountCode"
compareValue=
"ADMIN
"
>
ACCOUNT_CODE = #accountCode#
</isNotE
mpty
>
</isNotE
qual
>
<isNotEmpty
prepend=
" AND "
property=
"orgEname"
>
ORG_ENAME = #orgEname#
</isNotEmpty>
...
...
src/main/java/com/baosight/iplat4j/core/data/ibatis/dao/SqlMapDaoLogProxy.java
View file @
a6dcfc58
...
...
@@ -190,7 +190,9 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
if
(
StringUtils
.
startsWithAny
(
name
,
serviceFilter
))
{
return
;
}
((
Map
)
parameters
).
put
(
"accountCode"
,
UserSessionUtils
.
getAccountCode
());
// 本来是BUG,避免业务代码改动依然保持原逻辑ADMIN时依然置空
String
accountCode
=
UserSessionUtils
.
getAccountCode
();
((
Map
)
parameters
).
put
(
"accountCode"
,
CommonConstant
.
Field
.
ADMIN
.
equals
(
accountCode
)
?
""
:
accountCode
);
}
/**
...
...
@@ -211,7 +213,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
return
;
}
String
authEnable
=
PlatApplicationContext
.
getProperty
(
"iplat4j.page.auth.enable"
);
if
(
StringUtils
.
isNotBlank
(
authEnable
)
&&
CommonConstant
.
YesNo
.
NO_0
.
equals
(
authEnable
))
{
if
(
StringUtils
.
isNotBlank
(
authEnable
)
&&
CommonConstant
.
YesNo
.
NO_
S
0
.
equals
(
authEnable
))
{
return
;
}
// 当前用户所有角色
...
...
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0800.java
View file @
a6dcfc58
package
com
.
baosight
.
xservices
.
xs
.
og
.
service
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.xs.domain.Org
;
import
com.baosight.hggp.hg.xs.tools.HGXSTools
;
...
...
@@ -36,7 +37,7 @@ public class ServiceXSOG0800 extends TreeService {
HashMap
<
String
,
String
>
map
=
new
HashMap
();
List
<
HashMap
>
list
=
new
ArrayList
();
String
accountCode
=
UserSessionUtils
.
getAccountCode
();
if
(
StringUtils
.
isEmpty
(
accountCode
))
{
if
(
StringUtils
.
isEmpty
(
accountCode
)
||
CommonConstant
.
Field
.
ADMIN
.
equals
(
accountCode
)
)
{
map
.
put
(
"label"
,
"root"
);
map
.
put
(
"text"
,
"组织机构"
);
}
else
{
...
...
@@ -57,9 +58,8 @@ public class ServiceXSOG0800 extends TreeService {
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"node"
,
parentLabel
);
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if
(!
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
()))
{
queryMap
.
put
(
"accountCode"
,
UserSessionUtils
.
getAccountCode
());
}
queryMap
.
put
(
"accountCode"
,
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
())
?
CommonConstant
.
Field
.
ADMIN
:
UserSessionUtils
.
getAccountCode
());
List
<
Map
>
ret
=
this
.
dao
.
query
(
"XSOG01.queryOrganiation"
,
queryMap
,
0
,
-
999999
);
Map
parentOrgMap
=
new
HashMap
();
...
...
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
View file @
a6dcfc58
...
...
@@ -4,11 +4,8 @@ import com.baosight.hggp.core.constant.CommonConstant;
import
com.baosight.hggp.core.enums.OrgTypeEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ009
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.xs.domain.Org
;
import
com.baosight.hggp.hg.xs.tools.HGXSTools
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.StringUtils
;
...
...
@@ -412,9 +409,8 @@ public class ServiceXSOG0801 extends ServiceBase {
inInfo
.
set
(
"inqu_status-0-orgType"
,
inInfo
.
get
(
"inqu_status2-0-orgType"
));
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if
(!
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
()))
{
inInfo
.
set
(
"inqu_status-0-accountCode"
,
UserSessionUtils
.
getAccountCode
());
}
inInfo
.
set
(
"inqu_status-0-accountCode"
,
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
())
?
CommonConstant
.
Field
.
ADMIN
:
UserSessionUtils
.
getAccountCode
());
EiInfo
outInfo
=
super
.
query
(
inInfo
,
"XSOG01.query"
,
new
XSOG01
());
r2Block
.
setRows
(
outInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
());
outInfo
.
addBlock
(
r2Block
);
...
...
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
View file @
a6dcfc58
...
...
@@ -85,15 +85,14 @@ public class ServiceXSOG0801A extends ServiceEPBase {
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
query
Row
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
parentOrgId
=
MapUtils
.
getString
(
query
Row
,
"parentOrgId"
);
Map
query
Map
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
parentOrgId
=
MapUtils
.
getString
(
query
Map
,
"parentOrgId"
);
if
(
""
.
equals
(
parentOrgId
))
{
return
inInfo
;
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if
(!
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
()))
{
queryRow
.
put
(
"accountCode"
,
UserSessionUtils
.
getAccountCode
());
}
queryMap
.
put
(
"accountCode"
,
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
())
?
CommonConstant
.
Field
.
ADMIN
:
UserSessionUtils
.
getAccountCode
());
inInfo
=
super
.
query
(
inInfo
,
"XSOG01.query"
,
new
XSOG01
());
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
...
...
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801B.java
View file @
a6dcfc58
...
...
@@ -17,6 +17,7 @@ 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
com.baosight.xservices.xs.og.domain.XSOG01
;
import
com.baosight.xservices.xs.util.LoginUserDetails
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -76,12 +77,14 @@ public class ServiceXSOG0801B extends ServiceEPBase {
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
query
Row
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
orgId
=
MapUtils
.
getString
(
query
Row
,
"orgId"
);
Map
query
Map
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
orgId
=
MapUtils
.
getString
(
query
Map
,
"orgId"
);
if
(
""
.
equals
(
orgId
))
{
return
inInfo
;
}
queryRow
.
put
(
"accountCode"
,
UserSessionUtils
.
getAccountCode
());
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
queryMap
.
put
(
"accountCode"
,
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
())
?
CommonConstant
.
Field
.
ADMIN
:
UserSessionUtils
.
getAccountCode
());
inInfo
=
super
.
query
(
inInfo
,
"XSOG01.query"
,
new
XSOG01
());
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
...
...
src/main/java/com/baosight/xservices/xs/og/sql/XSOG01.xml
View file @
a6dcfc58
<?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=
"XSOG01"
>
<select
id=
"queryOrgInfo"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
<select
id=
"queryOrgInfo"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT
ORG_ID as "orgId",
<!-- 组织ID -->
ORG_ENAME as "orgEname",
<!-- 组织编码 -->
...
...
@@ -125,9 +123,8 @@
ORDER BY ORG_ENAME,SORT_INDEX ASC
</select>
<!--条件查询组织机构-->
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
<!-- 条件查询组织机构 -->
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT
ORG_ID as "orgId",
<!-- 组织ID -->
ORG_ENAME as "orgEname",
<!-- 组织编码 -->
...
...
@@ -161,13 +158,13 @@
<isNotEmpty
prepend=
" AND "
property=
"orgType"
>
ORG_TYPE like ('%$orgType$%')
</isNotEmpty>
<isNotE
mpty
prepend=
" AND "
property=
"accountCode
"
>
<isNotE
qual
prepend=
" AND "
property=
"accountCode"
compareValue=
"ADMIN
"
>
ACCOUNT_CODE = #accountCode#
</isNotE
mpty
>
</isNotE
qual
>
ORDER BY SORT_INDEX ASC
</select>
<!--
条件查询组织机构
-->
<!--
条件查询组织机构
-->
<select
id=
"count"
parameterClass=
"java.util.HashMap"
resultClass=
"int"
>
SELECT COUNT(1)
FROM ${platSchema}.TXSOG01
...
...
@@ -188,9 +185,9 @@
<isNotEmpty
prepend=
" AND "
property=
"orgType"
>
ORG_TYPE like ('%$orgType$%')
</isNotEmpty>
<isNotE
mpty
prepend=
" AND "
property=
"accountCode
"
>
<isNotE
qual
prepend=
" AND "
property=
"accountCode"
compareValue=
"ADMIN
"
>
ACCOUNT_CODE = #accountCode#
</isNotE
mpty
>
</isNotE
qual
>
</select>
<!-- 根据id查询组织机构 -->
...
...
@@ -265,7 +262,7 @@
</isNotEmpty>
</select>
<!--
组织机构子节点树查询
-->
<!--
组织机构子节点树查询
-->
<select
id=
"queryOrganiation"
resultClass=
"java.util.HashMap"
>
SELECT
ORG_ID as "label",
...
...
@@ -282,9 +279,9 @@
<isNotEmpty
prepend=
" AND "
property=
"node"
>
PARENT_ORG_ID = #node#
</isNotEmpty>
<isNotE
mpty
prepend=
" AND "
property=
"accountCode
"
>
<isNotE
qual
prepend=
" AND "
property=
"accountCode"
compareValue=
"ADMIN
"
>
ACCOUNT_CODE = #accountCode#
</isNotE
mpty
>
</isNotE
qual
>
order by SORT_INDEX asc
</select>
...
...
src/main/java/com/baosight/xservices/xs/service/ServiceXS0710.java
View file @
a6dcfc58
...
...
@@ -20,6 +20,7 @@ import org.apache.commons.lang.StringUtils;
* @date:2024/1/26,11:26
*/
public
class
ServiceXS0710
extends
MenuTreeService
{
private
EiBlockMeta
eiMetadata
=
null
;
public
ServiceXS0710
()
{
...
...
src/main/java/com/baosight/xservices/xs/service/ServiceXS3002.java
View file @
a6dcfc58
...
...
@@ -36,6 +36,7 @@ import java.util.Map;
public
class
ServiceXS3002
extends
ServiceEPBase
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServiceXS3002
.
class
);
private
String
USER_TYPE
=
"USER"
;
public
ServiceXS3002
()
{
...
...
src/main/resources/resources/ibatis/sqlmap-config.xml
View file @
a6dcfc58
...
...
@@ -92,5 +92,6 @@
<!-- 文档库 -->
<sqlMap
resource=
"com/baosight/hggp/hg/wd/sql/HGWD001.xml"
/>
<sqlMap
resource=
"com/baosight/hggp/hg/wd/sql/HGWD002.xml"
/>
</sqlMapConfig>
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