# 找出未被当前 excludeFilters 覆盖的冲突 $excludedPatterns = @( "com\.fs\.framework\.web\.service\.UserDetailsServiceImpl", "com\.fs\.api\.controller\..*", "com\.fs\.web\.controller\..*", "com\.fs\.his\.controller\.FsFollowController", "com\.fs\.his\.controller\.FsFollowReportController", "com\.fs\.his\.controller\.FsUserOnlineStateController", "com\.fs\.his\.controller\.FsMaterialGroupController", "com\.fs\.his\.controller\.FsMaterialController", "com\.fs\.his\.controller\.FsUserOperationLogController", "com\.fs\.his\.controller\.FsDoctorController", "com\.fs\.his\.controller\.FsStoreOrderBillLogController", "com\.fs\.admin\.controller\..*", "com\.fs\.admin\.helper\..*", "com\.fs\.company\.controller\.chat\..*", "com\.fs\.chat\.controller\.FastGptRoleController", "com\.fs\.crm\.controller\..*", "com\.fs\.course\.controller\..*", "com\.fs\.qw\.controller\..*", "com\.fs\.live\.controller\..*", "com\.fs\.newAdv\.controller\..*", "com\.fs\.company\.controller\.hisStore\..*", "com\.fs\.user\.controller\..*", "com\.fs\.proxy\.controller\..*", "com\.fs\.fastGpt\.[^.]+", "com\.fs\.fastgptApi\.[^.]+", "com\.fs\.company\.controller\.transfer\..*", "com\.fs\.task\.[^.]+", "com\.fs\.ad\.controller\..*", "com\.fs\.third\.controller\..*", "com\.fs\.quartz\.saas\.QuartzSaaSConfig" ) $saasRoot = "d:\ylrz\ylrz_saas_his_scrm\fs-admin-saas\src\main\java\com\fs" $companyRoot = "d:\ylrz\ylrz_saas_his_scrm\fs-company\src\main\java\com\fs" # 收集 fs-company 自身的所有控制器映射路径 $companyMaps = @{} Get-ChildItem $companyRoot -Recurse -Filter "*Controller.java" | ForEach-Object { $content = Get-Content $_.FullName -Raw if ($content -match '@RequestMapping\("([^"]+)"\)') { $path = $Matches[1] $className = $_.BaseName $content -match '(?s)^package\s+([^;]+)' | Out-Null; $pkg = $Matches[1] $fqn = "$pkg.$className" $companyMaps[$path] = $fqn } } # 收集未被排除的冲突 $uncoveredConflicts = @() Get-ChildItem $saasRoot -Recurse -Filter "*Controller.java" | ForEach-Object { $content = Get-Content $_.FullName -Raw if ($content -match '@Profile\("admin"\)') { return } if ($content -match '@RequestMapping\("([^"]+)"\)') { $path = $Matches[1] $className = $_.BaseName $content -match '(?s)^package\s+([^;]+)' | Out-Null; $pkg = $Matches[1] $fqn = "$pkg.$className" # 检查是否被排除 $excluded = $false foreach ($pattern in $excludedPatterns) { if ($fqn -match $pattern) { $excluded = $true; break } } if (-not $excluded -and $companyMaps.ContainsKey($path)) { $uncoveredConflicts += "UNCOVERED: $fqn vs $($companyMaps[$path]) = $path" } } } "Found $($uncoveredConflicts.Count) uncovered conflicts:" $uncoveredConflicts | ForEach-Object { $_ }