Commit ec2ed9e8 authored by yangyang's avatar yangyang

refactor(amos-boot-module-tcm): 优化更新单位信息逻辑- 移除了冗余的异步执行代码

- 简化了公司信息更新流程,直接使用 updateCompanyType 接口- 注释掉了未使用的父级公司查询和更新代码
parent 775b2361
......@@ -1163,35 +1163,21 @@ public class TzBaseEnterpriseInfoServiceImpl
}
private void updateCompanyInfo(Map<String, Object> map, CompanyModel updateModel) {
// String token = RequestContext.getToken();
// String appKey = RequestContext.getAppKey();
// String product = RequestContext.getProduct();
// CompletableFuture.runAsync(() -> {
//
// RequestContext.setToken(token);
// RequestContext.setAppKey(appKey);
// RequestContext.setProduct(product);
//
// 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("更新单位失败!");
// }
// });
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());
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.updateCompanyType(updateModel.getCompanyCode(), updateModel.getCompanyType());
if (companyResult == null || companyResult.getStatus() != 200) {
log.error("更新单位错误: {}", companyResult);
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) {
......
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