Commit 8381b95b authored by suhuiguang's avatar suhuiguang

fix(设备创建) : 事务回滚

1.回滚时,删除设备
parent 2c2fdba5
...@@ -2154,7 +2154,7 @@ public class DataDockServiceImpl { ...@@ -2154,7 +2154,7 @@ public class DataDockServiceImpl {
AgencyUserModel userModel = reginParams.getUserModel(); AgencyUserModel userModel = reginParams.getUserModel();
CompanyBo company = reginParams.getCompany(); CompanyBo company = reginParams.getCompany();
String orgBranchCode = equipInfo.getString("orgBranchCode"); String orgBranchCode = equipInfo.getString("orgBranchCode");
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(orgBranchCode).getResult(); HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(orgBranchCode.split("_").length > 1 ? orgBranchCode.split("_")[0] : "").getResult();
// 目前平台返回key为compnay(存在拼写错误) // 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(toJSONString(parentMessage.get("compnay")), CompanyModel.class); CompanyModel parentModel = JSON.parseObject(toJSONString(parentMessage.get("compnay")), CompanyModel.class);
String equListCode = Objects.toString(equipInfo.get("EQU_LIST"), null); String equListCode = Objects.toString(equipInfo.get("EQU_LIST"), null);
...@@ -2221,7 +2221,7 @@ public class DataDockServiceImpl { ...@@ -2221,7 +2221,7 @@ public class DataDockServiceImpl {
.setEndLatitudeLongitude(toJSONString(equipInfo.get("endLatitudeLongitude"))) .setEndLatitudeLongitude(toJSONString(equipInfo.get("endLatitudeLongitude")))
.setEquState(equState) .setEquState(equState)
.setEquCode(installationNoticeService.generateEquCode(equListCode, equCategoryCode, equDefineCode, new Date(), _receiveCompanyCode)) .setEquCode(installationNoticeService.generateEquCode(equListCode, equCategoryCode, equDefineCode, new Date(), _receiveCompanyCode))
.setOrgCompanyCode(parentModel.getCompanyCode()); .setOrgCompanyCode(Optional.ofNullable(parentModel).map(CompanyModel::getCompanyCode).orElse(null));
} }
/** /**
......
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