Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-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
hp-smart
Commits
d341d9f1
Commit
d341d9f1
authored
Mar 19, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.用户支持多组织机构
parent
857357d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
47 deletions
+60
-47
ServiceXSOG0801.java
...com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
+59
-46
HPPZ013.jsp
src/main/webapp/HP/PZ/HPPZ013.jsp
+1
-1
No files found.
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
View file @
d341d9f1
...
@@ -4,6 +4,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
...
@@ -4,6 +4,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import
com.baosight.hpjx.core.enums.OrgTypeEnum
;
import
com.baosight.hpjx.core.enums.OrgTypeEnum
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.pz.domain.HPPZ013
;
import
com.baosight.hpjx.hp.pz.tools.HPPZTools
;
import
com.baosight.hpjx.hp.pz.tools.HPPZTools
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005B
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005B
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
...
@@ -12,6 +13,7 @@ import com.baosight.hpjx.hp.xs.tools.HPXSTools;
...
@@ -12,6 +13,7 @@ import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.hpjx.util.StringUtils
;
import
com.baosight.iplat4j.common.ed.domain.TEDCM01
;
import
com.baosight.iplat4j.common.ed.domain.TEDCM01
;
import
com.baosight.iplat4j.core.data.dao.DaoFactory
;
import
com.baosight.iplat4j.core.data.dao.DaoFactory
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
...
@@ -304,38 +306,45 @@ public class ServiceXSOG0801 extends ServiceBase {
...
@@ -304,38 +306,45 @@ public class ServiceXSOG0801 extends ServiceBase {
* @return
* @return
*/
*/
public
EiInfo
insertUserByOrgId
(
EiInfo
inInfo
)
{
public
EiInfo
insertUserByOrgId
(
EiInfo
inInfo
)
{
String
errorMsg
=
""
;
try
{
List
insertList
=
new
ArrayList
();
String
errorMsg
=
""
;
List
<
Map
>
rows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
insertList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
rows
.
size
();
++
i
)
{
List
<
Map
>
rows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
Map
row
=
rows
.
get
(
i
);
for
(
int
i
=
0
;
i
<
rows
.
size
();
++
i
)
{
Map
map
=
new
HashMap
();
Map
row
=
rows
.
get
(
i
);
map
.
put
(
"userId"
,
row
.
get
(
"userId"
));
// 厂区工人不能同时存在多个组
List
<
XSOG02
>
userResults
=
dao
.
query
(
"XSOG02.queryByOrgIdAndUserId"
,
map
);
Map
queryMap
=
new
HashMap
();
if
(
userResults
.
size
()
>
0
)
{
queryMap
.
put
(
"userId"
,
row
.
get
(
"userId"
));
errorMsg
=
errorMsg
+
"\n添加用户["
+
row
.
get
(
"loginName"
)
+
"]失败,选择用户已为其他组织机构成员"
;
List
<
HPPZ013
>
dbPz013s
=
dao
.
query
(
HPPZ013
.
QUERY
,
queryMap
);
}
else
{
if
(
dbPz013s
.
size
()
>
0
)
{
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
setCell
(
i
,
"recCreator"
,
UserSession
.
getLoginName
());
// 用户是工人时,只能有一个组织
insertList
.
add
(
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRow
(
i
));
List
<
XSOG02
>
userResults
=
dao
.
query
(
"XSOG02.queryByOrgIdAndUserId"
,
queryMap
);
if
(
userResults
.
size
()
>
0
)
{
errorMsg
=
errorMsg
+
"\n添加用户["
+
row
.
get
(
"loginName"
)
+
"]失败,选择用户已为其他组织机构成员"
;
continue
;
}
}
row
.
put
(
"recCreator"
,
UserSession
.
getLoginName
());
insertList
.
add
(
row
);
}
if
(
insertList
.
size
()
==
0
)
{
inInfo
.
setMsg
(
errorMsg
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
return
inInfo
;
}
}
}
if
(
insertList
.
size
()
==
0
)
{
inInfo
.
setMsg
(
errorMsg
);
inInfo
.
setStatus
(-
1
);
return
inInfo
;
}
else
{
EiInfo
call
=
new
EiInfo
();
EiInfo
call
=
new
EiInfo
();
call
.
set
(
"list"
,
insertList
);
call
.
set
(
"list"
,
insertList
);
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_90"
);
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_90"
);
EiInfo
outInfo
=
XServiceManager
.
call
(
call
);
EiInfo
outInfo
=
XServiceManager
.
call
(
call
);
if
(
!
""
.
equals
(
errorMsg
))
{
if
(
StringUtils
.
isNotBlank
(
errorMsg
))
{
outInfo
.
addMsg
(
errorMsg
);
outInfo
.
addMsg
(
errorMsg
);
outInfo
.
setStatus
(
0
);
outInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
}
}
return
outInfo
;
return
outInfo
;
}
catch
(
Exception
e
){
LogUtils
.
setMsg
(
inInfo
,
e
,
"添加失败"
);
}
}
return
inInfo
;
}
}
/**
/**
...
@@ -736,30 +745,34 @@ public class ServiceXSOG0801 extends ServiceBase {
...
@@ -736,30 +745,34 @@ public class ServiceXSOG0801 extends ServiceBase {
}
}
public
EiInfo
queryUserDetailTemplateImpl
(
EiInfo
inInfo
)
{
public
EiInfo
queryUserDetailTemplateImpl
(
EiInfo
inInfo
)
{
Map
param
=
new
HashMap
();
try
{
param
.
put
(
"codesetCode"
,
inInfo
.
get
(
"codesetCode"
));
Map
param
=
new
HashMap
();
param
.
put
(
"projectName"
,
"XSERVICES"
);
param
.
put
(
"codesetCode"
,
inInfo
.
get
(
"codesetCode"
));
String
gridBlockId
=
(
String
)
inInfo
.
get
(
"gridBlockId"
);
param
.
put
(
"projectName"
,
"XSERVICES"
);
Map
attr
=
inInfo
.
getBlock
(
gridBlockId
).
getAttr
();
String
gridBlockId
=
(
String
)
inInfo
.
get
(
"gridBlockId"
);
int
limit
=
(
Integer
)
attr
.
get
(
"limit"
);
Map
attr
=
inInfo
.
getBlock
(
gridBlockId
).
getAttr
();
int
offset
=
(
Integer
)
attr
.
get
(
"offset"
);
int
limit
=
(
Integer
)
attr
.
get
(
"limit"
);
List
result
=
DaoFactory
.
getPlatSqlDao
().
query
(
"EDCM01.query"
,
param
,
0
,
-
999999
);
int
offset
=
attr
.
get
(
"offset"
)
==
null
?
0
:
(
Integer
)
attr
.
get
(
"offset"
);
int
end
=
offset
+
limit
;
List
result
=
DaoFactory
.
getPlatSqlDao
().
query
(
"EDCM01.query"
,
param
,
0
,
-
999999
);
int
size
=
result
.
size
();
int
end
=
offset
+
limit
;
int
actualEndIndex
=
Math
.
min
(
end
,
size
);
int
size
=
result
.
size
();
if
(
offset
>
size
)
{
int
actualEndIndex
=
Math
.
min
(
end
,
size
);
result
=
new
ArrayList
();
if
(
offset
>
size
)
{
}
else
{
result
=
new
ArrayList
();
result
=
result
.
subList
(
offset
,
actualEndIndex
);
}
else
{
result
=
result
.
subList
(
offset
,
actualEndIndex
);
}
EiInfo
outInfo
=
new
EiInfo
();
outInfo
.
setMsg
(
"查询成功,共"
+
result
.
size
()
+
"条记录"
);
outInfo
.
addBlock
((
String
)
inInfo
.
get
(
"gridBlockId"
)).
setRows
(
result
);
attr
.
put
(
"count"
,
size
);
outInfo
.
getBlock
((
String
)
inInfo
.
get
(
"gridBlockId"
)).
setAttr
(
attr
);
outInfo
.
getBlock
((
String
)
inInfo
.
get
(
"gridBlockId"
)).
setBlockMeta
((
new
TEDCM01
()).
eiMetadata
);
return
outInfo
;
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"查询失败"
);
}
}
return
inInfo
;
EiInfo
outInfo
=
new
EiInfo
();
outInfo
.
setMsg
(
"查询成功,共"
+
result
.
size
()
+
"条记录"
);
outInfo
.
addBlock
((
String
)
inInfo
.
get
(
"gridBlockId"
)).
setRows
(
result
);
attr
.
put
(
"count"
,
size
);
outInfo
.
getBlock
((
String
)
inInfo
.
get
(
"gridBlockId"
)).
setAttr
(
attr
);
outInfo
.
getBlock
((
String
)
inInfo
.
get
(
"gridBlockId"
)).
setBlockMeta
((
new
TEDCM01
()).
eiMetadata
);
return
outInfo
;
}
}
public
EiInfo
queryUserMetadataImpl
(
EiInfo
inInfo
)
{
public
EiInfo
queryUserMetadataImpl
(
EiInfo
inInfo
)
{
...
...
src/main/webapp/HP/PZ/HPPZ013.jsp
View file @
d341d9f1
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<EF:EFPage
title=
"
用工
管理"
>
<EF:EFPage
title=
"
工人
管理"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
<div
class=
"row"
>
<EF:EFSelect
cname=
"厂区"
blockId=
"inqu_status"
ename=
"factoryCode"
row=
"0"
colWidth=
"3"
filter=
"contains"
>
<EF:EFSelect
cname=
"厂区"
blockId=
"inqu_status"
ename=
"factoryCode"
row=
"0"
colWidth=
"3"
filter=
"contains"
>
...
...
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