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
06610fdf
Commit
06610fdf
authored
Jul 16, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-07-16 设备管理优化根据用户角色查询用户所属公司用户
parent
36abee8b
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
97 additions
and
14 deletions
+97
-14
DdynamicEnum.java
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
+1
-1
ServiceHGSB001.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB001.java
+1
-1
ServiceHGSB002.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB002.java
+1
-1
ServiceHGSB002A.java
...java/com/baosight/hggp/hg/sb/service/ServiceHGSB002A.java
+3
-3
ServiceHGSB003.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB003.java
+1
-1
ServiceHGSB004.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB004.java
+1
-1
ServiceHGSB004B.java
...java/com/baosight/hggp/hg/sb/service/ServiceHGSB004B.java
+2
-2
ServiceHGSB005.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB005.java
+2
-2
ServiceHGXSUser.java
...java/com/baosight/hggp/hg/xs/service/ServiceHGXSUser.java
+28
-1
XSOG0801.xml
src/main/java/com/baosight/xservices/xs/og/sql/XSOG0801.xml
+7
-0
HGSB001.js
src/main/webapp/HG/SB/HGSB001.js
+13
-1
HGSB002.js
src/main/webapp/HG/SB/HGSB002.js
+10
-0
HGSB003.js
src/main/webapp/HG/SB/HGSB003.js
+9
-0
HGSB004.js
src/main/webapp/HG/SB/HGSB004.js
+9
-0
HGSB005.js
src/main/webapp/HG/SB/HGSB005.js
+9
-0
No files found.
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
View file @
06610fdf
...
...
@@ -279,7 +279,7 @@ public enum DdynamicEnum {
put
(
"orgType"
,
OrgTypeEnum
.
COMPANY
.
getCode
());
}}),
USER_ID_BOX_BLOCK_ID
(
"user_block_id"
,
"loginName"
,
"userName"
,
"XSOG0801.queryUserByOrgIdBack"
),
USER_ID_BOX_BLOCK_ID
(
"user_block_id"
,
"loginName"
,
"userName"
,
"
companyCode"
,
"
XSOG0801.queryUserByOrgIdBack"
),
/**
* 模块:工序编码
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB001.java
View file @
06610fdf
...
...
@@ -45,7 +45,7 @@ public class ServiceHGSB001 extends ServiceEPBase {
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
GROUP_RECORD_BLOCK_ID
));
//角色公司
List
<
String
>
roleCompanyCode
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
Org
.
FIELD_ORG_ID
,
roleCompanyCode
);
qarma
.
put
(
HGSB001
.
FIELD_COMPANY_CODES
,
roleCompanyCode
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
USER_ID_BOX_BLOCK_ID
),
qarma
);
}
catch
(
Exception
e
){
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败!"
);
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB002.java
View file @
06610fdf
...
...
@@ -44,7 +44,7 @@ public class ServiceHGSB002 extends ServiceEPBase {
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
GROUP_RECORD_BLOCK_ID
));
//角色公司
List
<
String
>
roleCompanyCode
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
Org
.
FIELD_ORG_ID
,
roleCompanyCode
);
qarma
.
put
(
HGSB001
.
FIELD_COMPANY_CODES
,
roleCompanyCode
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
USER_ID_BOX_BLOCK_ID
),
qarma
);
}
catch
(
Exception
e
){
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB002A.java
View file @
06610fdf
...
...
@@ -36,12 +36,12 @@ public class ServiceHGSB002A extends ServiceEPBase {
String
companyCode
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB001
.
FIELD_COMPANY_CODE
);
String
groupCode
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB002A
.
FIELD_GROUP_CODE
);
inInfo
=
super
.
query
(
inInfo
,
HGSB002A
.
QUERY
,
new
HGSB002A
());
Map
qarma
=
new
HashMap
();
/*
Map qarma = new HashMap();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
GROUP_RECORD_BLOCK_ID
)
,
qarma
);
}
*/
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
GROUP_RECORD_BLOCK_ID
));
//CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
DEVICE_CODE_BOX_BLOCK_ID
),
new
HashMap
<
String
,
Object
>(){{
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB003.java
View file @
06610fdf
...
...
@@ -45,7 +45,7 @@ public class ServiceHGSB003 extends ServiceEPBase {
EiInfoUtils
.
addBlock
(
outInfo
,
"roleCompany"
,
UserSessionUtils
.
getRoleCompany
(),
Company
.
class
);
//角色公司
List
<
String
>
roleCompanyCode
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
Org
.
FIELD_ORG_ID
,
roleCompanyCode
);
qarma
.
put
(
HGSB001
.
FIELD_COMPANY_CODES
,
roleCompanyCode
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
USER_ID_BOX_BLOCK_ID
),
qarma
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
DEVICE_CODE_BOX_BLOCK_ID
));
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB004.java
View file @
06610fdf
...
...
@@ -43,7 +43,7 @@ public class ServiceHGSB004 extends ServiceEPBase {
Map
<
String
,
Object
>
qarma
=
new
HashMap
<>();
EiInfoUtils
.
addBlock
(
outInfo
,
"roleCompany"
,
UserSessionUtils
.
getRoleCompany
(),
Company
.
class
);
List
<
String
>
roleCompanyCode
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
Org
.
FIELD_ORG_ID
,
roleCompanyCode
);
qarma
.
put
(
HGSB001
.
FIELD_COMPANY_CODES
,
roleCompanyCode
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
USER_ID_BOX_BLOCK_ID
),
qarma
);
}
catch
(
Exception
e
){
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB004B.java
View file @
06610fdf
...
...
@@ -41,8 +41,8 @@ public class ServiceHGSB004B extends ServiceEPBase {
Map
<
String
,
Object
>
qarma
=
new
HashMap
<>();
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
GROUP_RECORD_BLOCK_ID
));
EiInfoUtils
.
addBlock
(
inInfo
,
"roleCompany"
,
UserSessionUtils
.
getRoleCompany
(),
Company
.
class
);
List
<
String
>
orgIds
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
Org
.
FIELD_ORG_ID
,
orgIds
);
List
<
String
>
roleCompanyCode
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
HGSB001
.
FIELD_COMPANY_CODES
,
roleCompanyCode
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
USER_ID_BOX_BLOCK_ID
),
qarma
);
}
catch
(
Exception
e
){
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB005.java
View file @
06610fdf
...
...
@@ -44,8 +44,8 @@ public class ServiceHGSB005 extends ServiceEPBase {
EiInfoUtils
.
addBlock
(
outInfo
,
"roleCompany"
,
UserSessionUtils
.
getRoleCompany
(),
Company
.
class
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
GROUP_RECORD_BLOCK_ID
));
//角色公司
List
<
String
>
orgIds
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
Org
.
FIELD_ORG_ID
,
orgIds
);
List
<
String
>
roleCompanyCode
=
HGSBTools
.
getRoleCompanyCode
();
qarma
.
put
(
HGSB001
.
FIELD_COMPANY_CODES
,
roleCompanyCode
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
USER_ID_BOX_BLOCK_ID
),
qarma
);
}
catch
(
Exception
e
){
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
...
...
src/main/java/com/baosight/hggp/hg/xs/service/ServiceHGXSUser.java
View file @
06610fdf
package
com
.
baosight
.
hggp
.
hg
.
xs
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.xs.domain.User
;
...
...
@@ -64,6 +65,32 @@ public class ServiceHGXSUser extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"用户管理"
,
operType
=
"查询"
,
operDesc
=
"用户所属公司所有用户"
)
public
EiInfo
queryOrgUserBox
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
queryMap
.
put
(
"accountCode"
,
UserSessionUtils
.
getAccountCode
());
Object
isSplicingSymbol
=
queryMap
.
get
(
"isSplicingSymbol"
);
List
<
DdynamicEnum
>
list
=
new
ArrayList
<>();
list
.
add
(
DdynamicEnum
.
USER_ID_BOX_BLOCK_ID
);
if
(
isSplicingSymbol
!=
null
){
CommonMethod
.
initBlock
(
inInfo
,
list
,
queryMap
,
true
);
}
else
{
CommonMethod
.
initBlock
(
inInfo
,
list
,
queryMap
,
false
);
}
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"查询企业失败"
);
}
return
inInfo
;
}
/**
* 查询用户下拉框
*
* @param inInfo
* @return
*/
public
EiInfo
queryComboBox
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
...
...
@@ -76,7 +103,7 @@ public class ServiceHGXSUser extends ServiceBase {
}
return
inInfo
;
}
/**
* 查询用户的企业下拉框
*
...
...
src/main/java/com/baosight/xservices/xs/og/sql/XSOG0801.xml
View file @
06610fdf
...
...
@@ -137,6 +137,7 @@
t1.ORG_ID AS "orgId",
t1.ORG_ENAME AS "orgEname",
t1.ORG_CNAME AS "orgCname",
t1.COMPANY_CODE AS "companyCode",
t2.rec_create_time AS "recCreateTime",
t2.USER_ID AS userId FROM ${platSchema}.txsog01 t1 LEFT JOIN ${platSchema}.txsog02 t2 ON t1.ORG_ID = t2.ORG_ID
INNER JOIN ${platSchema}.xs_user xu ON t2.USER_ID = xu.USER_ID
...
...
@@ -145,6 +146,12 @@
<isNotEmpty
prepend=
"AND"
property=
"accountCode"
>
t1.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
"AND"
property=
"companyCode"
>
t1.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty
prepend=
"AND"
property=
"companyCodes"
>
t1.COMPANY_CODE IN
<iterate
property=
"companyCodes"
open=
"("
close=
")"
conjunction=
","
>
#companyCodes[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
"AND"
property=
"orgCname"
>
t1.ORG_CNAME LIKE ('%$orgCname$%')
</isNotEmpty>
...
...
src/main/webapp/HG/SB/HGSB001.js
View file @
06610fdf
...
...
@@ -2,6 +2,7 @@ $(function () {
var
companyCodeBox
=
__eiInfo
.
getBlock
(
"roleCompany"
).
getMappedRows
();
var
groupCodeBox
=
__eiInfo
.
getBlock
(
"group_record_block_id"
).
getMappedRows
();
var
userIdBox
=
__eiInfo
.
getBlock
(
"user_block_id"
).
getMappedRows
();
$
(
".row"
).
children
().
attr
(
"class"
,
"col-md-3"
);
...
...
@@ -112,7 +113,18 @@ $(function () {
},{
field
:
"deviceCode"
,
title
:
"设备编码"
,
},{
field
:
"deviceUserId"
,
title
:
"设备负责人"
,
filter
:
function
(
option
)
{
let
companyCode
=
option
.
model
[
'companyCode'
];
if
(
companyCode
){
return
_
.
filter
(
userIdBox
,
function
(
item
)
{
return
item
[
"param1Field"
]
==
companyCode
;
})
}
return
option
.
values
},
}
],
exportGrid
:
{
...
...
src/main/webapp/HG/SB/HGSB002.js
View file @
06610fdf
...
...
@@ -4,6 +4,7 @@ $(function () {
var
groupCodeBox
=
__eiInfo
.
getBlock
(
"group_record_block_id"
).
getMappedRows
();
var
userIdBox
=
__eiInfo
.
getBlock
(
"user_block_id"
).
getMappedRows
();
$
(
".row"
).
children
().
attr
(
"class"
,
"col-md-3"
);
$
(
"#QUERY"
).
on
(
"click"
,
query
);
...
...
@@ -128,6 +129,15 @@ $(function () {
},
{
field
:
"planUserId"
,
title
:
"计划人"
,
filter
:
function
(
option
)
{
let
companyCode
=
option
.
model
[
'companyCode'
];
if
(
companyCode
){
return
_
.
filter
(
userIdBox
,
function
(
item
)
{
return
item
[
"param1Field"
]
==
companyCode
;
})
}
return
option
.
values
},
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
userIdBox
.
length
;
i
++
)
{
if
(
userIdBox
[
i
][
'valueField'
]
===
dataItem
[
'planUserId'
]){
...
...
src/main/webapp/HG/SB/HGSB003.js
View file @
06610fdf
...
...
@@ -111,6 +111,15 @@ $(function () {
},*/
{
field
:
"applyUserId"
,
title
:
"申请人"
,
filter
:
function
(
option
)
{
let
companyCode
=
option
.
model
[
'companyCode'
];
if
(
companyCode
){
return
_
.
filter
(
userIdBox
,
function
(
item
)
{
return
item
[
"param1Field"
]
==
companyCode
;
})
}
return
option
.
values
},
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
userIdBox
.
length
;
i
++
)
{
if
(
userIdBox
[
i
][
'valueField'
]
===
dataItem
[
'applyUserId'
]){
...
...
src/main/webapp/HG/SB/HGSB004.js
View file @
06610fdf
...
...
@@ -93,6 +93,15 @@ $(function () {
},
{
field
:
"inspecUserId"
,
title
:
"点检人"
,
filter
:
function
(
option
)
{
let
companyCode
=
option
.
model
[
'companyCode'
];
if
(
companyCode
){
return
_
.
filter
(
userIdBox
,
function
(
item
)
{
return
item
[
"param1Field"
]
==
companyCode
;
})
}
return
option
.
values
},
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
userIdBox
.
length
;
i
++
)
{
if
(
userIdBox
[
i
][
'valueField'
]
===
dataItem
[
'inspecUserId'
]){
...
...
src/main/webapp/HG/SB/HGSB005.js
View file @
06610fdf
...
...
@@ -84,6 +84,15 @@ $(function () {
},
{
field
:
"upkeepUserId"
,
title
:
"保养人"
,
filter
:
function
(
option
)
{
let
companyCode
=
option
.
model
[
'companyCode'
];
if
(
companyCode
){
return
_
.
filter
(
userIdBox
,
function
(
item
)
{
return
item
[
"param1Field"
]
==
companyCode
;
})
}
return
option
.
values
},
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
userIdBox
.
length
;
i
++
)
{
if
(
userIdBox
[
i
][
'valueField'
]
===
dataItem
[
'upkeepUserId'
]){
...
...
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