Commit a4b3f411 authored by 廖旭伟's avatar 廖旭伟

事项同步bug修改

parent 10ad8ee3
......@@ -17,6 +17,7 @@ import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.service.SiteMatterService;
import com.mortals.xhx.module.site.service.SiteService;
......@@ -69,13 +70,18 @@ public class SyncGovMatterDetailThread implements Runnable {
@Override
public void run() {
log.info("同步站点事项开始.....");
// Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity, context);
// log.info("同步站点部门:" + JSON.toJSONString(deptRest));
Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity, context);
//log.info("同步站点部门:" + JSON.toJSONString(deptRest));
Rest<String> rest = siteService.syncMatterBySiteId(siteEntity, context);
//Rest<String> rest = Rest.ok();
AreaEntity areaEntity = areaService.getCache(siteEntity.getAreaCode());
log.info("同步事项列表:" + JSON.toJSONString(rest));
if (rest.getCode() == YesNoEnum.YES.getValue()) {
log.info("查询事项列表开始");
List<MatterEntity> matterEntityList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()).source(SourceEnum.政务网.getValue()));
log.info("查询事项列表结束");
List<MatterEntity> unSyncDetailMatterList = matterEntityList.stream()
.filter(f -> f.getHaveGetMatterInfo().equalsIgnoreCase("false"))
.collect(Collectors.toList());
......@@ -88,9 +94,14 @@ public class SyncGovMatterDetailThread implements Runnable {
}*/
//重新添加
if (ObjectUtils.isEmpty(siteEntities)) {
if (!ObjectUtils.isEmpty(siteEntities)) {
log.info("同步站点事项到站点.....");
for (SiteEntity site : siteEntities) {
//判断是否已经有站点事项,如果有则不添加
int count = siteMatterService.count(new SiteMatterQuery().siteId(site.getId()), null);
if (count > 0) {
continue;
}
List<SiteMatterEntity> siteMatterList = matterEntityList.stream().map(item -> {
return matterService.switchMatterToSiteMatter(item, site, context).getData();
}).filter(f -> f != null).collect(Collectors.toList());
......
package com.mortals.xhx.module.matter.model;
import java.util.*;
import java.util.List;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
......@@ -1694,7 +1692,7 @@ public class MatterEntity extends MatterVo {
@Override
public int hashCode() {
return this.getId().hashCode();
return Objects.hash(this.areaCode, this.matterNo);
}
@Override
......
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