Commit 653ee3a9 authored by 赵啸非's avatar 赵啸非

修改应用编码校验

parent dfb7f016
...@@ -117,6 +117,8 @@ public class SyncGovMatterDetailThread implements Runnable { ...@@ -117,6 +117,8 @@ public class SyncGovMatterDetailThread implements Runnable {
log.info("同步站点主题法人事项:" + JSON.toJSONString(frRest)); log.info("同步站点主题法人事项:" + JSON.toJSONString(frRest));
}else if(areaEntity.getAreaLevel()>3){ }else if(areaEntity.getAreaLevel()>3){
//街道,镇,乡 //街道,镇,乡
Rest<String> themeTownRest = siteThemeService.syncTownThemeBySiteId(siteEntity, context);
log.info("同步乡镇站点主题:" + JSON.toJSONString(themeTownRest));
} }
......
...@@ -206,7 +206,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -206,7 +206,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
@Override @Override
protected void validData(AppEntity entity, Context context) throws AppException { protected void validData(AppEntity entity, Context context) throws AppException {
if(ObjectUtils.isEmpty(entity.getAppCode())){ if (ObjectUtils.isEmpty(entity.getAppCode())) {
throw new AppException("应用编码不能为空!"); throw new AppException("应用编码不能为空!");
} }
super.validData(entity, context); super.validData(entity, context);
...@@ -218,7 +218,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -218,7 +218,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
Long siteId = entity.getSiteId(); Long siteId = entity.getSiteId();
String appCode = entity.getAppCode(); String appCode = entity.getAppCode();
int count = this.count(new AppQuery().siteId(siteId).appCode(appCode), context); int count = this.count(new AppQuery().siteId(siteId).appCode(appCode), context);
if(count>0){ if (count > 0) {
throw new AppException("当前站点已存在应用编码"); throw new AppException("当前站点已存在应用编码");
} }
super.saveBefore(entity, context); super.saveBefore(entity, context);
...@@ -232,7 +232,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -232,7 +232,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
versionEntity.setAppId(entity.getId()); versionEntity.setAppId(entity.getId());
versionEntity.setAppName(entity.getAppName()); versionEntity.setAppName(entity.getAppName());
versionEntity.setVersion(entity.getVersion()); versionEntity.setVersion(entity.getVersion());
versionEntity.setNotes("应用初始创建!"); versionEntity.setNotes("".equals(entity.getNotes()) ? "应用初始创建!" : entity.getNotes());
versionEntity.setFileName(entity.getFileName()); versionEntity.setFileName(entity.getFileName());
versionEntity.setFilePath(entity.getFilePath()); versionEntity.setFilePath(entity.getFilePath());
versionEntity.setDistributeFilePath(entity.getDistributeFilePath()); versionEntity.setDistributeFilePath(entity.getDistributeFilePath());
......
...@@ -73,13 +73,13 @@ public class SiteThemeServiceImpl extends AbstractCRUDServiceImpl<SiteThemeDao, ...@@ -73,13 +73,13 @@ public class SiteThemeServiceImpl extends AbstractCRUDServiceImpl<SiteThemeDao,
String areaCode = siteEntity.getAreaCode(); String areaCode = siteEntity.getAreaCode();
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("areaCode", areaCode); params.put("areaCode", areaCode);
Rest<String> townRest = buildTheme(siteId, DxTypeEnum.个人服务.getValue(), url, params, context); Rest<String> townRest = buildTwonTheme(siteId, url, params, context);
if (townRest.getCode() != YesNoEnum.YES.getValue() ) { if (townRest.getCode() != YesNoEnum.YES.getValue() ) {
log.info("服务结果:" + JSON.toJSONString(townRest)); log.info("服务结果:" + JSON.toJSONString(townRest));
return Rest.fail("同步主题失败!"); return Rest.fail("同步乡镇主题失败!");
} }
return Rest.ok("当前站点同步添加主题成功!"); return Rest.ok("当前站点同步乡镇添加主题成功!");
} }
private Rest<String> buildTheme(Long siteId, String userType, String url, Map<String, String> params, Context context) { private Rest<String> buildTheme(Long siteId, String userType, String url, Map<String, String> params, Context context) {
...@@ -117,15 +117,12 @@ public class SiteThemeServiceImpl extends AbstractCRUDServiceImpl<SiteThemeDao, ...@@ -117,15 +117,12 @@ public class SiteThemeServiceImpl extends AbstractCRUDServiceImpl<SiteThemeDao,
private Rest<String> buildTwonTheme(Long siteId, String url, Map<String, String> params, Context context) { private Rest<String> buildTwonTheme(Long siteId, String url, Map<String, String> params, Context context) {
Rest<Map<String, String>> rest = MatterTypeHtmlParseUtil.getTownThemeList(params, url); Rest<Map<String, String>> rest = MatterTypeHtmlParseUtil.getTownThemeList(params, url);
if (rest.getCode() == YesNoEnum.YES.getValue() && rest.getData().keySet().size() > 0) { if (rest.getCode() == YesNoEnum.YES.getValue() && rest.getData().keySet().size() > 0) {
//删除部门中属于政务部门的
// deptService.syncDeptBySiteId(siteId, context);
Map<String, String> data = rest.getData(); Map<String, String> data = rest.getData();
for (Map.Entry<String, String> item : data.entrySet()) { for (Map.Entry<String, String> item : data.entrySet()) {
String[] vals = item.getKey().split("&"); String[] vals = item.getKey().split("&");
String themeCode = vals[0]; String themeCode = vals[0];
String userType = vals[1]; String userType = vals[1];
String themeName = item.getValue(); String themeName = item.getValue();
int count = this.count(new SiteThemeQuery().siteId(siteId).userType(userType).themeCode(themeCode), context); int count = this.count(new SiteThemeQuery().siteId(siteId).userType(userType).themeCode(themeCode), context);
if (count == 0) { if (count == 0) {
SiteThemeEntity siteThemeEntity = new SiteThemeEntity(); SiteThemeEntity siteThemeEntity = new SiteThemeEntity();
......
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