Mazq bugfix 231031 See merge request dcuc-tjdsj/auth-service!250
@@ -169,4 +169,10 @@ public interface IAuthOrgInfoFacade {
@RequestParam("unitClass") String unitClass,
@RequestParam("roleLevel") String roleLevel);
+ /**
+ * 重构内存树
+ * @return
+ */
+ @GetMapping("reInitTrees")
+ ResponseStatus reInitTrees();
}
@@ -146,4 +146,11 @@ public interface IAuthOrgBusiness {
* @return
*/
List<OrgTreeNodeDTO> getCalQuotaTree(String userId, String orgId, String unitClass, String roleLevel);
+
+ * 机构树重新构建
@@ -306,6 +306,12 @@ public class AuthOrgBusinessImpl implements IAuthOrgBusiness {
return resultTreeNodes;
+ @Override
+ public ResponseStatus reInitTrees() {
+ authOrgTreeService.reInitTrees(false);
+ return ResponseStatus.success();
+ }
@Override
public List<AuthOrgDTO> getByOrgCodes(List<String> orgCodes) {
List<AuthOrgInfo> orgInfos = authOrgInfoService.getOrgByCodes(orgCodes);
@@ -104,4 +104,9 @@ public class AuthOrgInfoFacade implements IAuthOrgInfoFacade {
return authOrgBusiness.getCalQuotaTree(userId, orgId, unitClass, roleLevel);
+ return authOrgBusiness.reInitTrees();
@@ -34,7 +34,7 @@ public interface AuthUserOrgRelRepository extends BaseRepository<AuthUserOrgRel,
@Modifying
@NativeQuery("update t_auth_user_org_rel r inner join t_auth_org_info o on r.org_code = o.code " +
- "set r.org_id = o.id where r.deleted = '0' and o.deleted = '0' and r.org_code is not null and r.org_id is null")
+ "set r.org_id = o.id where o.deleted = '0' and r.org_code is not null and r.org_id is null")
void updateOrgInfoInUser();
/**
@@ -504,6 +504,7 @@ public class AuthOrgTreeServiceImpl implements IAuthOrgTreeService {
.stream()
.filter(Objects::nonNull)
.map(treeNodeMap::get)
+ .filter(Objects::nonNull)
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(childNodes)) {
childIds.addAll(childNodes.stream()