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
6038b534
Commit
6038b534
authored
May 09, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.admin不做数据权限验证
parent
4cf786de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
60 deletions
+5
-60
ServiceHGPZ009.java
.../java/com/baosight/hggp/hg/pz/service/ServiceHGPZ009.java
+2
-58
SqlMapDaoLogProxy.java
...sight/iplat4j/core/data/ibatis/dao/SqlMapDaoLogProxy.java
+3
-2
No files found.
src/main/java/com/baosight/hggp/hg/pz/service/ServiceHGPZ009.java
View file @
6038b534
...
...
@@ -12,7 +12,6 @@ import com.baosight.hggp.util.AssertUtils;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ProjectInfo
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
...
@@ -113,7 +112,6 @@ public class ServiceHGPZ009 extends ServiceBase {
* @param resultRows
*/
private
void
checkSaveData
(
List
<
Map
>
resultRows
)
{
// 数据校验
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HGPZ009
fPz009
=
new
HGPZ009
();
fPz009
.
fromMap
(
resultRows
.
get
(
i
));
...
...
@@ -158,34 +156,6 @@ public class ServiceHGPZ009 extends ServiceBase {
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation
(
operModul
=
"配置管理"
,
operType
=
"新增"
,
operDesc
=
"新增"
)
public
EiInfo
insert
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 数据校验
this
.
checkSaveData
(
resultRows
);
// 数据写入
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HGPZ009
fPz009
=
new
HGPZ009
();
fPz009
.
fromMap
(
resultRows
.
get
(
i
));
this
.
add
(
fPz009
);
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"新增失败"
);
}
return
inInfo
;
}
/**
* 用户关联角色
*
* @param hgpz009
...
...
@@ -196,7 +166,7 @@ public class ServiceHGPZ009 extends ServiceBase {
inInfoRowMap
.
put
(
"memberId"
,
userId
);
inInfoRowMap
.
put
(
"memberName"
,
hgpz009
.
getAccountName
());
// TODO 该用户组固定不能修改,代码中其他地方有写死的地方
inInfoRowMap
.
put
(
"parentId"
,
"companyManage"
);
inInfoRowMap
.
put
(
"parentId"
,
CommonConstant
.
Field
.
COMPANY_MANAGE
);
inInfoRowMap
.
put
(
"parentName"
,
"企业管理员"
);
inInfoRowMap
.
put
(
"memberType"
,
"USER"
);
EiInfo
inInfo
=
new
EiInfo
();
...
...
@@ -215,7 +185,6 @@ public class ServiceHGPZ009 extends ServiceBase {
* @param fPz009
*/
private
void
insertOrg
(
HGPZ009
fPz009
)
{
List
<
Map
>
newRows
=
new
ArrayList
<>();
Map
row
=
new
HashMap
();
row
.
put
(
"orgId"
,
fPz009
.
getAccountCode
());
row
.
put
(
"orgEname"
,
fPz009
.
getAccountCode
());
...
...
@@ -229,6 +198,7 @@ public class ServiceHGPZ009 extends ServiceBase {
row
.
put
(
"factoryName"
,
""
);
row
.
put
(
"companyCode"
,
fPz009
.
getAccountCode
());
row
.
put
(
"companyName"
,
fPz009
.
getAccountName
());
List
<
Map
>
newRows
=
new
ArrayList
<>();
newRows
.
add
(
row
);
EiInfo
call
=
new
EiInfo
();
call
.
set
(
"list"
,
newRows
);
...
...
@@ -240,32 +210,6 @@ public class ServiceHGPZ009 extends ServiceBase {
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"企业管理"
,
operType
=
"修改"
,
operDesc
=
"修改操作"
)
public
EiInfo
update
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 数据校验
this
.
checkSaveData
(
resultRows
);
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HGPZ009
hppz009
=
new
HGPZ009
();
hppz009
.
fromMap
(
resultRows
.
get
(
i
));
DaoUtils
.
update
(
HGPZ009
.
UPDATE
,
hppz009
);
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据修改成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"修改失败"
);
}
return
inInfo
;
}
/**
* 删除操作
*
* @param inInfo
...
...
src/main/java/com/baosight/iplat4j/core/data/ibatis/dao/SqlMapDaoLogProxy.java
View file @
6038b534
...
...
@@ -200,9 +200,10 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
* @param parameters
*/
private
void
setDataAuth
(
String
name
,
Object
parameters
)
{
// 需要过滤部分sql name,否则会形成死循环
// 需要过滤部分sql name,否则会形成死循环;admin账户不需要校验
String
loginName
=
UserSessionUtils
.
getLoginName
();
String
[]
serviceFilter
=
{
"HGXSUser"
,
"HGXSOrg"
,
"HGXSUserGroup"
,
"HGPZ009.query"
,
"HGPZ010.query"
};
if
(
StringUtils
.
startsWithAny
(
name
,
serviceFilter
))
{
if
(
StringUtils
.
startsWithAny
(
name
,
serviceFilter
)
||
"admin"
.
equalsIgnoreCase
(
loginName
)
)
{
return
;
}
// 是否启用数据权限
...
...
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