Commit 44a233f1 authored by tianbo's avatar tianbo

refactor(tcm): 修复企业信息更新逻辑并添加数据刷新事件

- 修复了企业管辖机构代码更新的比较逻辑 - 在企业信息更新后添加了数据刷新事件发布
parent c3838953
......@@ -1405,7 +1405,7 @@ public class TzBaseEnterpriseInfoServiceImpl
String oldSuperviseOrgCode = tzBaseEnterpriseInfo.getSuperviseOrgCode();
String newSuperviseOrgCode = companyModel.getOrgCode().replace("*" + companyModel.getCompanyOrgCode(), "");
// 更新 tz_base_enterprise_info。只有管辖机构有改动才更新
if (!newSuperviseOrgCode.equals(oldSuperviseOrgCode)) {
if (!newOrgCode.equals(oldOrgCode)) {
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(newSuperviseOrgCode).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
......@@ -1425,5 +1425,6 @@ public class TzBaseEnterpriseInfoServiceImpl
public void updateUnitOrgCode(TzBaseEnterpriseInfo tzBaseEnterpriseInfo, CompanyModel parentModel, String oldSuperviseOrgCode, String newSuperviseOrgCode, String oldOrgCode, String newOrgCode) {
tzBaseEnterpriseInfoMapper.updateSubCompanyOrgCode(parentModel.getCompanyName(), oldSuperviseOrgCode, newSuperviseOrgCode, oldOrgCode, newOrgCode, tzBaseEnterpriseInfo.getSequenceNbr());
tzBaseEnterpriseInfoMapper.updateUnitOrgCode(oldOrgCode, newOrgCode);
publisher.publish(new DataRefreshEvent(this, Collections.singletonList(tzBaseEnterpriseInfo.getSequenceNbr() + ""), DataRefreshEvent.DataType.enterprise.name(), DataRefreshEvent.Operation.UPDATE));
}
}
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