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;
import
com.baosight.hpjx.core.enums.OrgTypeEnum
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
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.sc.domain.HPSC005B
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
...
...
@@ -12,6 +13,7 @@ import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.hpjx.util.StringUtils
;
import
com.baosight.iplat4j.common.ed.domain.TEDCM01
;
import
com.baosight.iplat4j.core.data.dao.DaoFactory
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
...
...
@@ -304,38 +306,45 @@ public class ServiceXSOG0801 extends ServiceBase {
* @return
*/
public
EiInfo
insertUserByOrgId
(
EiInfo
inInfo
)
{
String
errorMsg
=
""
;
List
insertList
=
new
ArrayList
();
List
<
Map
>
rows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
int
i
=
0
;
i
<
rows
.
size
();
++
i
)
{
Map
row
=
rows
.
get
(
i
);
Map
map
=
new
HashMap
();
map
.
put
(
"userId"
,
row
.
get
(
"userId"
));
List
<
XSOG02
>
userResults
=
dao
.
query
(
"XSOG02.queryByOrgIdAndUserId"
,
map
);
if
(
userResults
.
size
()
>
0
)
{
errorMsg
=
errorMsg
+
"\n添加用户["
+
row
.
get
(
"loginName"
)
+
"]失败,选择用户已为其他组织机构成员"
;
}
else
{
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
setCell
(
i
,
"recCreator"
,
UserSession
.
getLoginName
());
insertList
.
add
(
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRow
(
i
));
try
{
String
errorMsg
=
""
;
List
insertList
=
new
ArrayList
();
List
<
Map
>
rows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
int
i
=
0
;
i
<
rows
.
size
();
++
i
)
{
Map
row
=
rows
.
get
(
i
);
// 厂区工人不能同时存在多个组
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"userId"
,
row
.
get
(
"userId"
));
List
<
HPPZ013
>
dbPz013s
=
dao
.
query
(
HPPZ013
.
QUERY
,
queryMap
);
if
(
dbPz013s
.
size
()
>
0
)
{
// 用户是工人时,只能有一个组织
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
();
call
.
set
(
"list"
,
insertList
);
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_90"
);
EiInfo
outInfo
=
XServiceManager
.
call
(
call
);
if
(
!
""
.
equals
(
errorMsg
))
{
if
(
StringUtils
.
isNotBlank
(
errorMsg
))
{
outInfo
.
addMsg
(
errorMsg
);
outInfo
.
setStatus
(
0
);
outInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
}
return
outInfo
;
}
catch
(
Exception
e
){
LogUtils
.
setMsg
(
inInfo
,
e
,
"添加失败"
);
}
return
inInfo
;
}
/**
...
...
@@ -736,30 +745,34 @@ public class ServiceXSOG0801 extends ServiceBase {
}
public
EiInfo
queryUserDetailTemplateImpl
(
EiInfo
inInfo
)
{
Map
param
=
new
HashMap
();
param
.
put
(
"codesetCode"
,
inInfo
.
get
(
"codesetCode"
));
param
.
put
(
"projectName"
,
"XSERVICES"
);
String
gridBlockId
=
(
String
)
inInfo
.
get
(
"gridBlockId"
);
Map
attr
=
inInfo
.
getBlock
(
gridBlockId
).
getAttr
();
int
limit
=
(
Integer
)
attr
.
get
(
"limit"
);
int
offset
=
(
Integer
)
attr
.
get
(
"offset"
);
List
result
=
DaoFactory
.
getPlatSqlDao
().
query
(
"EDCM01.query"
,
param
,
0
,
-
999999
);
int
end
=
offset
+
limit
;
int
size
=
result
.
size
();
int
actualEndIndex
=
Math
.
min
(
end
,
size
);
if
(
offset
>
size
)
{
result
=
new
ArrayList
();
}
else
{
result
=
result
.
subList
(
offset
,
actualEndIndex
);
try
{
Map
param
=
new
HashMap
();
param
.
put
(
"codesetCode"
,
inInfo
.
get
(
"codesetCode"
));
param
.
put
(
"projectName"
,
"XSERVICES"
);
String
gridBlockId
=
(
String
)
inInfo
.
get
(
"gridBlockId"
);
Map
attr
=
inInfo
.
getBlock
(
gridBlockId
).
getAttr
();
int
limit
=
(
Integer
)
attr
.
get
(
"limit"
);
int
offset
=
attr
.
get
(
"offset"
)
==
null
?
0
:
(
Integer
)
attr
.
get
(
"offset"
);
List
result
=
DaoFactory
.
getPlatSqlDao
().
query
(
"EDCM01.query"
,
param
,
0
,
-
999999
);
int
end
=
offset
+
limit
;
int
size
=
result
.
size
();
int
actualEndIndex
=
Math
.
min
(
end
,
size
);
if
(
offset
>
size
)
{
result
=
new
ArrayList
();
}
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
,
"查询失败"
);
}
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
;
return
inInfo
;
}
public
EiInfo
queryUserMetadataImpl
(
EiInfo
inInfo
)
{
...
...
src/main/webapp/HP/PZ/HPPZ013.jsp
View file @
d341d9f1
...
...
@@ -5,7 +5,7 @@
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<EF:EFPage
title=
"
用工
管理"
>
<EF:EFPage
title=
"
工人
管理"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
<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