Commit 1f2c0c37 authored by yangyang's avatar yangyang

refactor(tcm): 更新单位信息逻辑

- 移除了异步执行更新单位信息的代码 - 恢复了同步执行更新单位信息的逻辑 - 注释掉了获取请求上下文信息的代码
parent 52be956f
...@@ -1163,26 +1163,35 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -1163,26 +1163,35 @@ public class TzBaseEnterpriseInfoServiceImpl
} }
private void updateCompanyInfo(Map<String, Object> map, CompanyModel updateModel) { private void updateCompanyInfo(Map<String, Object> map, CompanyModel updateModel) {
String token = RequestContext.getToken(); // String token = RequestContext.getToken();
String appKey = RequestContext.getAppKey(); // String appKey = RequestContext.getAppKey();
String product = RequestContext.getProduct(); // String product = RequestContext.getProduct();
CompletableFuture.runAsync(() -> { // CompletableFuture.runAsync(() -> {
//
RequestContext.setToken(token); // RequestContext.setToken(token);
RequestContext.setAppKey(appKey); // RequestContext.setAppKey(appKey);
RequestContext.setProduct(product); // RequestContext.setProduct(product);
//
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(String.valueOf(map.get("superviseOrgCode"))).getResult(); // HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(String.valueOf(map.get("superviseOrgCode"))).getResult();
// 目前平台返回key为compnay(存在拼写错误) // // 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class); // CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
updateModel.setParentId(parentModel.getSequenceNbr()); // updateModel.setParentId(parentModel.getSequenceNbr());
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.update(updateModel, updateModel.getSequenceNbr()); // FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.update(updateModel, updateModel.getSequenceNbr());
if (companyResult == null || companyResult.getStatus() != 200) { // if (companyResult == null || companyResult.getStatus() != 200) {
log.error("更新单位错误: {}", companyResult); // log.error("更新单位错误: {}", companyResult);
throw new BadRequest("更新单位失败!"); // throw new BadRequest("更新单位失败!");
} // }
}); // });
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(String.valueOf(map.get("superviseOrgCode"))).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
updateModel.setParentId(parentModel.getSequenceNbr());
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.update(updateModel, updateModel.getSequenceNbr());
if (companyResult == null || companyResult.getStatus() != 200) {
log.error("更新单位错误: {}", companyResult);
throw new BadRequest("更新单位失败!");
}
} }
private void handleUnitType(Map<String, Object> map, RegUnitInfo regUnitInfo, AgencyUserModel agencyUserModel) { private void handleUnitType(Map<String, Object> map, RegUnitInfo regUnitInfo, AgencyUserModel agencyUserModel) {
......
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