|
@@ -95,8 +95,12 @@ public class AuthInfoServiceImpl implements AuthInfoService {
|
|
@Transactional
|
|
@Transactional
|
|
protected void saveAuthInfo(AppInfo appInfo, AuthEnum authEnum) {
|
|
protected void saveAuthInfo(AppInfo appInfo, AuthEnum authEnum) {
|
|
List<OrgInfo> orgInfoList = solarService.getOrgList();
|
|
List<OrgInfo> orgInfoList = solarService.getOrgList();
|
|
- List<TSAuth> tsAuthList = new ArrayList<>();
|
|
|
|
- Set<Long> orgIdsSet = new HashSet<>();
|
|
|
|
|
|
+ List<TSAuth> tsAuthList = null;
|
|
|
|
+ Set<Long> orgIdsSet = null;
|
|
|
|
+ if (Objects.nonNull(orgInfoList) && orgInfoList.size() > 0) {
|
|
|
|
+ tsAuthList = new ArrayList<>();
|
|
|
|
+ orgIdsSet = new HashSet<>();
|
|
|
|
+ }
|
|
for (OrgInfo o : orgInfoList) {
|
|
for (OrgInfo o : orgInfoList) {
|
|
orgIdsSet.add(o.getId());
|
|
orgIdsSet.add(o.getId());
|
|
if (authEnum == AuthEnum.OFF_LINE) {
|
|
if (authEnum == AuthEnum.OFF_LINE) {
|
|
@@ -106,9 +110,11 @@ public class AuthInfoServiceImpl implements AuthInfoService {
|
|
}
|
|
}
|
|
commonCacheService.updateAuthInfoCache(o.getId());
|
|
commonCacheService.updateAuthInfoCache(o.getId());
|
|
}
|
|
}
|
|
- QueryWrapper<TSAuth> tsAuthQueryWrapper = new QueryWrapper<>();
|
|
|
|
- tsAuthQueryWrapper.lambda().in(TSAuth::getSchoolId, orgIdsSet);
|
|
|
|
- tsAuthService.remove(tsAuthQueryWrapper);
|
|
|
|
- tsAuthService.saveOrUpdateBatch(tsAuthList);
|
|
|
|
|
|
+ if (Objects.nonNull(tsAuthList) && tsAuthList.size() > 0 && Objects.nonNull(orgIdsSet) && orgIdsSet.size() > 0) {
|
|
|
|
+ QueryWrapper<TSAuth> tsAuthQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tsAuthQueryWrapper.lambda().in(TSAuth::getSchoolId, orgIdsSet);
|
|
|
|
+ tsAuthService.remove(tsAuthQueryWrapper);
|
|
|
|
+ tsAuthService.saveOrUpdateBatch(tsAuthList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|