Commit 9da7db52 authored by “yiyousong”'s avatar “yiyousong”
parents 24591d64 e6d7b8ac
......@@ -44,6 +44,7 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
sitePdu.setId(1L);
Rest<List<SitePdu>> siteRest = siteFeign.getFlatSitesBySiteId(sitePdu);
if (siteRest.getCode() == YesNoEnum.YES.getValue()) {
log.info("总数量:{}",siteRest.getData().size());
siteRest.getData().forEach(site -> {
SiteMatterPdu siteMatterPdu = new SiteMatterPdu();
siteMatterPdu.setPage(1);
......@@ -51,6 +52,7 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
Rest<RespData<List<SiteMatterPdu>>> siteMatterRest = siteMatterFeign.list(siteMatterPdu);
if (siteMatterRest.getCode() == YesNoEnum.YES.getValue()) {
//删除后新增
log.info("事项总数量:{}",siteMatterRest.getData().getData().size());
List<SheetMatterEntity> sheetMatterEntities = siteMatterRest.getData().getData().stream().map(siteMatter -> {
SheetMatterEntity sheetMatterEntity = new SheetMatterEntity();
sheetMatterEntity.initAttrValue();
......@@ -67,12 +69,15 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
if (!ObjectUtils.isEmpty(sheetMatterEntities)) {
sheetMatterService.getDao().delete(new SheetMatterQuery().siteId(site.getId()));
log.info("新增数量:{}",sheetMatterEntities.size());
List<List<SheetMatterEntity>> partition = ListUtil.partition(sheetMatterEntities, 500);
for (List<SheetMatterEntity> matterEntities : partition) {
sheetMatterService.save(matterEntities);
}
}
}else{
log.info("请求错误,code:{}",siteMatterRest.getCode());
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment