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

修改应用编码校验

parent fb97430a
...@@ -4,10 +4,12 @@ import cn.hutool.core.collection.ListUtil; ...@@ -4,10 +4,12 @@ import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.ManagerBaseApplication; import com.mortals.xhx.ManagerBaseApplication;
import com.mortals.xhx.common.code.DxTypeEnum; import com.mortals.xhx.common.code.DxTypeEnum;
import com.mortals.xhx.common.code.SourceEnum; import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.service.AreaService; import com.mortals.xhx.module.area.service.AreaService;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
...@@ -52,6 +54,8 @@ public class SyncGovMatterDetailThread implements Runnable { ...@@ -52,6 +54,8 @@ public class SyncGovMatterDetailThread implements Runnable {
private Context context; private Context context;
private ICacheService cacheService;
public SyncGovMatterDetailThread(SiteEntity siteEntity, Context context) { public SyncGovMatterDetailThread(SiteEntity siteEntity, Context context) {
this.siteEntity = siteEntity; this.siteEntity = siteEntity;
...@@ -63,6 +67,7 @@ public class SyncGovMatterDetailThread implements Runnable { ...@@ -63,6 +67,7 @@ public class SyncGovMatterDetailThread implements Runnable {
this.siteMatterService = SpringUtils.getBean(SiteMatterService.class); this.siteMatterService = SpringUtils.getBean(SiteMatterService.class);
this.siteThemeService = SpringUtils.getBean(SiteThemeService.class); this.siteThemeService = SpringUtils.getBean(SiteThemeService.class);
this.siteThemeMatterService = SpringUtils.getBean(SiteThemeMatterService.class); this.siteThemeMatterService = SpringUtils.getBean(SiteThemeMatterService.class);
this.cacheService = SpringUtils.getBean(ICacheService.class);
} }
@Override @Override
...@@ -120,13 +125,18 @@ public class SyncGovMatterDetailThread implements Runnable { ...@@ -120,13 +125,18 @@ public class SyncGovMatterDetailThread implements Runnable {
//街道,镇,乡 //街道,镇,乡
Rest<String> themeTownRest = siteThemeService.syncTownThemeBySiteId(siteEntity, context); Rest<String> themeTownRest = siteThemeService.syncTownThemeBySiteId(siteEntity, context);
log.info("同步乡镇站点主题:" + JSON.toJSONString(themeTownRest)); log.info("同步乡镇站点主题:" + JSON.toJSONString(themeTownRest));
siteThemeMatterService.deleteGovBySiteId(siteEntity.getId(), context); if (themeTownRest.getCode() == YesNoEnum.YES.getValue()) {
String dxType = DxTypeEnum.街道镇服务.getValue(); siteThemeMatterService.deleteGovBySiteId(siteEntity.getId(), context);
if (areaEntity.getAreaLevel() == 5) { String dxType = DxTypeEnum.街道镇服务.getValue();
dxType = DxTypeEnum.乡村服务.getValue(); if (areaEntity.getAreaLevel() == 5) {
dxType = DxTypeEnum.乡村服务.getValue();
}
Rest<String> townThemeRest = siteThemeMatterService.syncTownThemeMatterBySiteId(siteEntity, dxType, context);
log.info("同步站点乡镇主题事项:" + JSON.toJSONString(townThemeRest));
} else {
cacheService.hdel(RedisCacheKeys.getSyncMatterLockKey() + siteEntity.getAreaCode(), siteEntity.getAreaCode());
log.info("同步站点乡镇主题事项失败:" + themeTownRest.getData());
} }
Rest<String> townThemeRest = siteThemeMatterService.syncTownThemeMatterBySiteId(siteEntity, dxType, context);
log.info("同步站点乡镇主题事项:" + JSON.toJSONString(townThemeRest));
} }
log.info("同步站点事项结束....."); log.info("同步站点事项结束.....");
} }
......
...@@ -138,6 +138,7 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem ...@@ -138,6 +138,7 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
params.put("dxType", dxType); params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode()); params.put("areaCode", siteEntity.getAreaCode());
List<SiteThemeEntity> siteThemeEntities = siteThemeService.find(new SiteThemeQuery().siteId(siteEntity.getId())); List<SiteThemeEntity> siteThemeEntities = siteThemeService.find(new SiteThemeQuery().siteId(siteEntity.getId()));
int sum=0;
for (SiteThemeEntity item : siteThemeEntities) { for (SiteThemeEntity item : siteThemeEntities) {
params.put("theme", item.getThemeCode()); params.put("theme", item.getThemeCode());
params.put("userType", item.getUserType()); params.put("userType", item.getUserType());
...@@ -160,9 +161,10 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem ...@@ -160,9 +161,10 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
if (count != total) { if (count != total) {
log.info(String.format("获取数量异常,count:%s,total:%s,theme:%s", count, total, item.getThemeName())); log.info(String.format("获取数量异常,count:%s,total:%s,theme:%s", count, total, item.getThemeName()));
} }
sum+=count;
} }
} }
return Rest.ok("乡镇主题更新完成"); return Rest.ok("乡镇主题更新完成","更新条数:"+sum);
} }
@Override @Override
......
...@@ -86,7 +86,7 @@ Authorization: {{authToken}} ...@@ -86,7 +86,7 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"id":7 "id":26
} }
......
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