Commit c49b6dee authored by 赵啸非's avatar 赵啸非

优化站点同步事项

parent 76021cf5
...@@ -76,9 +76,20 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao, ...@@ -76,9 +76,20 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
@Override @Override
public Rest<String> doMatterBySiteId(SiteEntity siteEntity, Context context) { public Rest<String> doMatterBySiteId(SiteEntity siteEntity, Context context) {
AreaEntity areaEntity = areaService.getCache(siteEntity.getAreaCode()); AreaEntity areaEntity = areaService.getCache(siteEntity.getAreaCode());
List<MatterEntity> govMatterList = new ArrayList<>(); // List<MatterEntity> govMatterList = new ArrayList<>();
List<DeptEntity> deptEntities = deptService.find(new DeptQuery().siteId(siteEntity.getId()).source(SourceEnum.政务网.getValue())); List<DeptEntity> deptEntities = deptService.find(new DeptQuery().siteId(siteEntity.getId()).source(SourceEnum.政务网.getValue()));
for (DeptEntity deptEntity : deptEntities) {
List<MatterEntity> govMatterList = deptEntities.parallelStream().flatMap(deptEntity -> {
HashMap<String, String> params = new HashMap<>();
params.put("areaCode", areaEntity.getAreaCode());
params.put("dxType", "6");
params.put("deptCode", deptEntity.getDeptNumber());
params.put("searchtext", "");
params.put("taskType", "");
List<MatterEntity> deptMatterList = this.getMatters(params, context);
return deptMatterList.stream();
}).collect(Collectors.toList());
/* for (DeptEntity deptEntity : deptEntities) {
HashMap<String, String> params = new HashMap<>(); HashMap<String, String> params = new HashMap<>();
params.put("areaCode", areaEntity.getAreaCode()); params.put("areaCode", areaEntity.getAreaCode());
params.put("dxType", "6"); params.put("dxType", "6");
...@@ -89,12 +100,11 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao, ...@@ -89,12 +100,11 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
if (!ObjectUtils.isEmpty(deptMatterList)) { if (!ObjectUtils.isEmpty(deptMatterList)) {
govMatterList.addAll(deptMatterList); govMatterList.addAll(deptMatterList);
} }
} }*/
//当前本地区事项全部事项 //当前本地区事项全部事项
List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode()));
Set<String> matterNoSet =matterList.parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
log.info("计算差集"); log.info("计算差集");
List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode()).source(SourceEnum.政务网.getValue()));
Set<String> matterNoSet =matterList.parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
List<MatterEntity> subList = this.subListSet(govMatterList, matterNoSet); List<MatterEntity> subList = this.subListSet(govMatterList, matterNoSet);
subList = subList.parallelStream().distinct().collect(Collectors.toList()); subList = subList.parallelStream().distinct().collect(Collectors.toList());
log.info("抓取事项总数:{} 需要添加事项数量:{}", govMatterList.size(), subList.size()); log.info("抓取事项总数:{} 需要添加事项数量:{}", govMatterList.size(), subList.size());
......
...@@ -124,7 +124,7 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao ...@@ -124,7 +124,7 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
@Override @Override
public Rest<String> doSyncSiteMatter(SiteEntity siteEntity, Context context) { public Rest<String> doSyncSiteMatter(SiteEntity siteEntity, Context context) {
List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode())); List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode()).source(SourceEnum.政务网.getValue()));
//查询站点事项相关 //查询站点事项相关
SiteEntity site = siteService.selectOne(new SiteQuery().areaCode(siteEntity.getAreaCode())); SiteEntity site = siteService.selectOne(new SiteQuery().areaCode(siteEntity.getAreaCode()));
if (!ObjectUtils.isEmpty(site)) { if (!ObjectUtils.isEmpty(site)) {
......
...@@ -83,6 +83,11 @@ ...@@ -83,6 +83,11 @@
and a.areaCode = #{condition.areaCode,jdbcType=VARCHAR} and a.areaCode = #{condition.areaCode,jdbcType=VARCHAR}
</if> </if>
</trim> </trim>
<trim prefixOverrides="and" prefix="">
<if test="condition.source!=null and condition.source!=''">
and a.source = #{condition.source,jdbcType=INTEGER}
</if>
</trim>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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