|
@@ -140,8 +140,10 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
//校验营业执照信息
|
|
|
checkTsign(dto.getTsignCode());
|
|
|
//修改产品
|
|
|
- setIdByApply(tenantId, dto.getProductInfo(), dto.getProductInfo()::setTenantId,
|
|
|
- tenantProductInfoService::updateTenantProduct);
|
|
|
+ if (Objects.nonNull(dto.getProductInfo())) {
|
|
|
+ setIdByApply(tenantId, dto.getProductInfo(), dto.getProductInfo()::setTenantId,
|
|
|
+ tenantProductInfoService::updateTenantProduct);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Date now = new Date();
|
|
@@ -151,7 +153,9 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
this.updateById(tenantInfo);
|
|
|
|
|
|
//修改机构配置
|
|
|
- setIdByApply(tenantId, dto.getConfig(), dto.getConfig()::setTenantId, tenantConfigService::updateConfig);
|
|
|
+ if (Objects.nonNull(dto.getConfig())) {
|
|
|
+ setIdByApply(tenantId, dto.getConfig(), dto.getConfig()::setTenantId, tenantConfigService::updateConfig);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -267,8 +271,8 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
// 创建账号、用户信息、用户和角色关系
|
|
|
createUser(tenantInfo, orgId, Lists.newArrayList(roleId));
|
|
|
//建立角色和菜单关系数据
|
|
|
- Lists.partition(collectMenuId, 50)
|
|
|
- .forEach(idList -> employeeService.batchInsertRoleMenu(roleId, idList, tenantId));
|
|
|
+ Lists.partition(collectMenuId, 50)
|
|
|
+ .forEach(idList -> employeeService.batchInsertRoleMenu(roleId, idList, tenantId));
|
|
|
//创建资产信息
|
|
|
TenantAssetsInfo assetsInfo = new TenantAssetsInfo();
|
|
|
assetsInfo.setTenantId(tenantId);
|
|
@@ -489,9 +493,15 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
* @param action 需要执行的操作
|
|
|
*/
|
|
|
private <T> void setIdByApply(Integer tenantId, T clazz, Consumer<Integer> setOption, Consumer<T> action) {
|
|
|
- Optional.ofNullable(tenantId)
|
|
|
- .ifPresent(setOption);
|
|
|
- action.accept(clazz);
|
|
|
+ Optional.ofNullable(clazz)
|
|
|
+ .filter(c -> Objects.nonNull(setOption))
|
|
|
+ .filter(c -> Objects.nonNull(action))
|
|
|
+ .filter(c -> Objects.nonNull(tenantId))
|
|
|
+ .map(c -> {
|
|
|
+ setOption.accept(tenantId);
|
|
|
+ return c;
|
|
|
+ })
|
|
|
+ .ifPresent(action);
|
|
|
}
|
|
|
|
|
|
/**
|