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
6d41ed2b
Commit
6d41ed2b
authored
Mar 15, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.删除组织时逻辑错误修正
parent
67529a31
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
21 deletions
+41
-21
ServiceXSOG0801.java
...com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
+41
-21
No files found.
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801.java
View file @
6d41ed2b
...
...
@@ -12,6 +12,8 @@ import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import
com.baosight.hpjx.hp.xs.domain.Org
;
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.iplat4j.common.ed.domain.TEDCM01
;
import
com.baosight.iplat4j.core.data.dao.DaoFactory
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
...
...
@@ -197,12 +199,6 @@ public class ServiceXSOG0801 extends ServiceBase {
for
(
int
i
=
0
;
i
<
deleteList
.
size
();
++
i
)
{
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRow
(
i
).
put
(
"orgId"
,
orgId
);
// 清空组织机构下面人员的工人关系
Org
org
=
HPXSTools
.
XsOrg
.
get
(
orgId
);
// 校验是否存在进行中的任务
this
.
checkExistsTask
(
org
.
getOrgId
(),
org
.
getOrgCname
(),
org
.
getOrgType
());
// 清除用工关系
clearHp013
(
org
.
getOrgId
(),
org
.
getOrgType
());
}
call
.
set
(
"list"
,
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
());
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_91"
);
...
...
@@ -327,39 +323,60 @@ public class ServiceXSOG0801 extends ServiceBase {
return
outInfo
;
}
/**
* 删除组织机构
*
* @param inInfo
* @return
*/
public
EiInfo
deleteOrgByEname
(
EiInfo
inInfo
)
{
EiBlock
block
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
List
rows
=
block
.
getRows
();
rows
.
forEach
((
m
)
->
{
Map
row
=
(
Map
)
m
;
try
{
List
<
Map
>
rows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
rows
.
forEach
((
row
)
->
{
row
.
put
(
"recRevisor"
,
UserSession
.
getLoginName
());
String
orgId
=
MapUtils
.
getString
(
row
,
"orgEname"
);
// 清空组织机构下面人员的工人关系
Org
org
=
HPXSTools
.
XsOrg
.
get
(
orgId
);
// 校验是否存在进行中的任务
this
.
checkExistsTask
(
org
.
getOrgId
(),
org
.
getOrgCname
(),
org
.
getOrgType
());
// 清除用工关系
clearHp013
(
org
.
getOrgId
(),
org
.
getOrgType
());
});
EiInfo
call
=
new
EiInfo
();
call
.
set
(
"list"
,
rows
);
call
.
set
(
EiConstant
.
serviceId
,
"S_XS_88"
);
EiInfo
result
=
XServiceManager
.
call
(
call
);
if
(
result
.
getStatus
()
>
0
)
{
for
(
int
i
=
0
;
i
<
rows
.
size
();
++
i
)
{
Map
param
=
(
Map
)
rows
.
get
(
i
);
inInfo
=
XServiceManager
.
call
(
call
);
if
(
inInfo
.
getStatus
()
>
0
)
{
for
(
int
i
=
0
;
i
<
rows
.
size
();
++
i
)
{
Map
param
=
(
Map
)
rows
.
get
(
i
);
List
orgs
=
this
.
dao
.
query
(
"XSOG01.queryOrgInfo"
,
param
);
for
(
int
j
=
0
;
j
<
orgs
.
size
();
++
j
)
{
for
(
int
j
=
0
;
j
<
orgs
.
size
();
++
j
)
{
Map
memberMap
=
new
HashMap
();
memberMap
.
put
(
"orgId"
,
((
Map
)
orgs
.
get
(
j
)).
get
(
"orgId"
));
memberMap
.
put
(
"orgId"
,
((
Map
)
orgs
.
get
(
j
)).
get
(
"orgId"
));
this
.
dao
.
delete
(
"XSOG02.deleteRelationByOrgId"
,
memberMap
);
}
}
}
return
result
;
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"删除失败"
);
}
return
inInfo
;
}
/**
* 删除组织及子节点
*
* @param inInfo
* @return
*/
public
EiInfo
deleteOrgAndChildrenById
(
EiInfo
inInfo
)
{
EiBlock
block
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
try
{
List
<
Map
>
rows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
Map
idMap
=
new
HashMap
();
int
sum
=
0
;
for
(
int
i
=
0
;
i
<
block
.
getRowCount
();
++
i
)
{
String
orgId
=
block
.
getCell
(
i
,
"orgId"
).
toString
();
for
(
int
i
=
0
;
i
<
rows
.
size
();
++
i
)
{
String
orgId
=
rows
.
get
(
i
).
get
(
"orgId"
).
toString
();
Map
orgIdMap
=
new
HashMap
();
orgIdMap
.
put
(
"orgId"
,
orgId
);
List
orgIdChildList
=
this
.
dao
.
query
(
"XSOG01.queryOrgChild"
,
orgIdMap
);
...
...
@@ -383,6 +400,9 @@ public class ServiceXSOG0801 extends ServiceBase {
}
}
inInfo
.
setMsg
(
"删除["
+
sum
+
"]条记录成功"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"删除失败"
);
}
return
inInfo
;
}
...
...
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