Commit 72d30ae5 authored by 赵啸非's avatar 赵啸非

添加区域树

parent f40d7445
...@@ -245,6 +245,49 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se ...@@ -245,6 +245,49 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
} }
/**
* 站点事项数据更新
*
* @return
*/
@PostMapping("/matter/update")
public String matterUpdate(@RequestBody SiteEntity siteEntity) {
JSONObject ret = new JSONObject();
int code = VALUE_RESULT_SUCCESS;
SetupProjectEntity setupProject = this.service.get(siteEntity.getId());
if(ObjectUtils.isEmpty(setupProject)) throw new AppException("未找到项目信息");
if(ObjectUtils.isEmpty(setupProject.getSiteId())) throw new AppException("请同步更新站点信息");
try {
HashMap<String, String> params = new HashMap<>();
params.put("areaCode", siteEntity.getAreaCode());
String resp = HttpUtil.post("http://127.0.0.1:11078/base/area/genSubAreaByAreaName", JSON.toJSONString(params));
Rest rest = JSON.parseObject(resp, Rest.class);
if (YesNoEnum.YES.getValue() == rest.getCode()) {
ret.put(KEY_RESULT_MSG, "子区域更新成功");
SetupProjectEntity setupProjectEntity = new SetupProjectEntity();
setupProjectEntity.setId(siteEntity.getId());
setupProjectEntity.setAreaCode(siteEntity.getAreaCode());
this.service.update(setupProjectEntity);
}
ret.put(KEY_RESULT_MSG, "子区域更新失败");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
log.error("子区域更新失败失败", e);
ret.put(KEY_RESULT_MSG, e.getMessage());
}
ret.put(KEY_RESULT_CODE, code);
return ret.toJSONString();
}
/** /**
* 创建站点 * 创建站点
* *
...@@ -301,7 +344,6 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se ...@@ -301,7 +344,6 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
ua.setDestDirectory(destDir); ua.setDestDirectory(destDir);
ua.extract(); ua.extract();
projectPath = this.publishPath + "/app/"; projectPath = this.publishPath + "/app/";
//解压资源文件 //解压资源文件
sourcePath = this.publishPath + "/temp/project/" + 基础服务.getValue() + "/other.tar.gz"; sourcePath = this.publishPath + "/temp/project/" + 基础服务.getValue() + "/other.tar.gz";
...@@ -313,8 +355,14 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se ...@@ -313,8 +355,14 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
destDir.mkdirs(); destDir.mkdirs();
ua.setDestDirectory(destDir); ua.setDestDirectory(destDir);
ua.extract(); ua.extract();
//todo 更新门户站点信息,用户站点树等 //todo 更新门户站点信息,用户站点树等 user/initData
JSONObject json = new JSONObject();
json.put("siteIds", siteAddRest.getData().getId());
json.put("areaCodes", siteAddRest.getData().getAreaCode());
json.put("areaNames", siteAddRest.getData().getAreaName());
String portalResp = HttpUtil.post("http://127.0.0.1:11078/portal/base/user/initData", json.toJSONString());
log.info("门户站点更新返回:{}", portalResp);
} else { } else {
throw new AppException("站点添加失败! " + rest.getMsg()); throw new AppException("站点添加失败! " + rest.getMsg());
......
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