Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
bb39e31b
Commit
bb39e31b
authored
Jul 25, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新部门,异步更新关联名称
parent
8a869d7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
42 deletions
+64
-42
base-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
...mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
+64
-42
No files found.
base-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
View file @
bb39e31b
...
...
@@ -6,6 +6,7 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.xhx.common.code.SourceEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.Constant
;
...
...
@@ -21,17 +22,17 @@ import com.mortals.xhx.module.dept.service.DeptService;
import
com.mortals.xhx.module.matters.model.MattersDeptEntity
;
import
com.mortals.xhx.module.matters.model.MattersDeptQuery
;
import
com.mortals.xhx.module.matters.service.MattersDeptService
;
import
com.mortals.xhx.module.site.model.SiteBusinessEntity
;
import
com.mortals.xhx.module.site.model.SiteBusinessQuery
;
import
com.mortals.xhx.module.site.model.SiteEntity
;
import
com.mortals.xhx.module.site.model.*
;
import
com.mortals.xhx.module.site.service.SiteBusinessService
;
import
com.mortals.xhx.module.site.service.SiteMatterService
;
import
com.mortals.xhx.module.site.service.SiteService
;
import
com.mortals.xhx.module.window.model.WindowBusinessEntity
;
import
com.mortals.xhx.module.window.model.WindowBusinessQuery
;
import
com.mortals.xhx.module.window.model.WindowEntity
;
import
com.mortals.xhx.module.window.model.WindowQuery
;
import
com.mortals.xhx.module.window.model.*
;
import
com.mortals.xhx.module.window.service.WindowBusinessService
;
import
com.mortals.xhx.module.window.service.WindowMatterService
;
import
com.mortals.xhx.module.window.service.WindowService
;
import
com.mortals.xhx.module.workman.model.WorkmanEntity
;
import
com.mortals.xhx.module.workman.model.WorkmanQuery
;
import
com.mortals.xhx.module.workman.service.WorkmanService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -57,6 +58,12 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
private
MattersDeptService
mattersDeptService
;
@Autowired
private
WindowService
windowService
;
@Autowired
private
WorkmanService
workmanService
;
@Autowired
private
WindowMatterService
windowMatterService
;
@Autowired
private
SiteMatterService
siteMatterService
;
@Override
...
...
@@ -191,39 +198,9 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
@Override
public
Rest
<
Map
<
String
,
List
<
DeptVo
>>>
getBusinessByDept
(
DeptQuery
deptQuery
,
Context
context
)
{
List
<
DeptVo
>
businessDeptList
=
this
.
dao
.
getBusinessByDept
(
deptQuery
);
Map
<
String
,
List
<
DeptVo
>>
collect
=
businessDeptList
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getId
().
toString
()));
return
Rest
.
ok
(
collect
);
/* //查询部门窗口
List<WindowEntity> windowEntities = windowService.find(new WindowQuery().deptId(deptQuery.getId()));
//查询窗口业务
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
List<Long> windowList = windowEntities.stream().map(WindowEntity::getId).collect(Collectors.toList());
if (ObjectUtils.isEmpty(windowList)) {
return Rest.ok("窗口查询结果为空", Collections.EMPTY_LIST);
}
windowBusinessQuery.setWindowIdList(windowList);
List<WindowBusinessEntity> windowBusinessEntities = windowBusinessService.find(windowBusinessQuery);
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
List<Long> siteBusinessList = windowBusinessEntities.stream().map(WindowBusinessEntity::getSiteBusinessId).collect(Collectors.toList());
if (ObjectUtils.isEmpty(siteBusinessList)) {
return Rest.ok("站点业务查询结果为空", Collections.EMPTY_LIST);
}
siteBusinessQuery.setBusinessIdList(siteBusinessList);
List<SiteBusinessEntity> siteBusinessEntities = siteBusinessService.find(siteBusinessQuery);
BusinessQuery businessQuery = new BusinessQuery();
List<Long> businessList = siteBusinessEntities.stream().map(SiteBusinessEntity::getBusinessId).collect(Collectors.toList());
if (ObjectUtils.isEmpty(businessList)) {
return Rest.ok("业务查询结果为空", Collections.EMPTY_LIST);
}
businessQuery.setIdList(businessList);
List<BusinessEntity> businessEntities = businessService.find(businessQuery);*/
//return Rest.ok(businessEntities);
}
@Override
...
...
@@ -262,11 +239,56 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
*/
@Override
protected
void
updateAfter
(
DeptEntity
entity
,
Context
context
)
throws
AppException
{
List
<
WindowEntity
>
windowEntityList
=
windowService
.
find
(
new
WindowQuery
().
deptId
(
entity
.
getId
()));
windowEntityList
.
forEach
(
item
->
{
//异步更新
Runnable
runnable
=
new
Runnable
()
{
/**
*
*/
@Override
public
void
run
()
{
List
<
WindowEntity
>
windowEntityList
=
windowService
.
find
(
new
WindowQuery
().
deptId
(
entity
.
getId
())).
stream
().
map
(
item
->
{
item
.
setDeptName
(
entity
.
getName
());
});
return
item
;
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
windowEntityList
))
{
windowService
.
update
(
windowEntityList
,
context
);
}
List
<
WorkmanEntity
>
workmanEntityList
=
workmanService
.
find
(
new
WorkmanQuery
().
deptId
(
entity
.
getId
())).
stream
().
map
(
item
->
{
item
.
setDeptName
(
entity
.
getName
());
return
item
;
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
workmanEntityList
))
{
workmanService
.
update
(
workmanEntityList
,
context
);
}
List
<
WindowMatterEntity
>
windowMatterEntityList
=
windowMatterService
.
find
(
new
WindowMatterQuery
().
deptId
(
entity
.
getId
())).
stream
().
map
(
item
->
{
item
.
setDeptName
(
entity
.
getName
());
return
item
;
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
windowMatterEntityList
))
{
windowMatterService
.
update
(
windowMatterEntityList
,
context
);
}
List
<
SiteMatterEntity
>
siteMatterEntityList
=
siteMatterService
.
find
(
new
SiteMatterQuery
().
deptId
(
entity
.
getId
())).
stream
().
map
(
item
->
{
item
.
setDeptName
(
entity
.
getName
());
return
item
;
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
siteMatterEntityList
))
{
siteMatterService
.
update
(
siteMatterEntityList
,
context
);
}
}
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
super
.
updateAfter
(
entity
,
context
);
}
}
\ No newline at end of file
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