Commit f63215e5 authored by yangyang's avatar yangyang

feat(tcm): 更新企业注册逻辑

- 修改了企业类型判断逻辑,改为全部企业类型生成对接数据账号 - 添加了同步平台ORG_CODE的方法 - 优化了代码结构,提高了可读性和可维护性
parent 2aefe430
...@@ -1193,6 +1193,7 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -1193,6 +1193,7 @@ public class TzBaseEnterpriseInfoServiceImpl
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto(); TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto); BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto);
redisUtil.del(RedisKey.buildReginRoleKey(agencyUserModel.getUserId())); redisUtil.del(RedisKey.buildReginRoleKey(agencyUserModel.getUserId()));
this.asyncPlatformCompany(map, agencyUserModel);
return tzBaseEnterpriseInfoDto; return tzBaseEnterpriseInfoDto;
} else { } else {
return null; return null;
...@@ -1237,9 +1238,11 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -1237,9 +1238,11 @@ public class TzBaseEnterpriseInfoServiceImpl
regUnitInfo.setUnitTypeCode(unitTypeCodesStr); regUnitInfo.setUnitTypeCode(unitTypeCodesStr);
// 省内充装单位1231:生成对接数据账号 // 省内充装单位1231:生成对接数据账号
final String FILLING_UNIT_TYPE = RegUnitInfoServiceImpl.FILLING_UNIT_TYPE; // final String FILLING_UNIT_TYPE = RegUnitInfoServiceImpl.FILLING_UNIT_TYPE;
if (unitTypeCodes.contains(FILLING_UNIT_TYPE) // 20250701 改为全部企业类型生成对接数据账号@tianbo
&& (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide()))) { if (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide())) {
// if (unitTypeCodes.contains(FILLING_UNIT_TYPE)
// && (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide()))) {
if (ValidationUtil.isEmpty(regUnitInfo.getAppId())) { if (ValidationUtil.isEmpty(regUnitInfo.getAppId())) {
String appId = DesUtil.encode(regUnitInfo.getAdminUserId(), RegUnitInfoServiceImpl.SECRETKEY); String appId = DesUtil.encode(regUnitInfo.getAdminUserId(), RegUnitInfoServiceImpl.SECRETKEY);
...@@ -1307,4 +1310,10 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -1307,4 +1310,10 @@ public class TzBaseEnterpriseInfoServiceImpl
throw new BadRequest("单位更新失败"); throw new BadRequest("单位更新失败");
} }
} }
private void asyncPlatformCompany(Map<String, Object> map, AgencyUserModel agencyUserModel) {
// 同步平台ORG_CODE
System.out.println(map);
// Privilege.companyClient.update();
}
} }
...@@ -819,7 +819,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -819,7 +819,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
String adminUserId = userResult.getResult().getUserId(); String adminUserId = userResult.getResult().getUserId();
// 省内充装单位1231:生成对接数据账号 // 省内充装单位1231:生成对接数据账号
if (Arrays.asList(units).contains(FILLING_UNIT_TYPE) && (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide()))) { // if (Arrays.asList(units).contains(FILLING_UNIT_TYPE) && (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide()))) {
// 20250701 改为全部企业类型生成对接数据账号@tianbo
if (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide())) {
AgencyUserModel shadowUser = new AgencyUserModel(); AgencyUserModel shadowUser = new AgencyUserModel();
shadowUser.setUserId(adminUserId); shadowUser.setUserId(adminUserId);
String appId = DesUtil.encode(adminUserId, SECRETKEY); String appId = DesUtil.encode(adminUserId, SECRETKEY);
......
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