check_jar_classes.ps1 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. $ErrorActionPreference = "SilentlyContinue"
  2. # Check if his controllers exist in fs-company jar
  3. $jarPath = "d:\ylrz\ylrz_saas_his_scrm\fs-company\target\fs-company.jar"
  4. $tempDir = "$env:TEMP\jar_check2"
  5. if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force }
  6. New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
  7. # Use Expand-Archive for jar (it's a zip)
  8. Copy-Item $jarPath "$tempDir\check.jar" -Force
  9. Set-Location $tempDir
  10. # List all his controller classes in the jar
  11. Add-Type -AssemblyName System.IO.Compression.FileSystem
  12. $zip = [System.IO.Compression.ZipFile]::OpenRead("$tempDir\check.jar")
  13. $hisEntries = $zip.Entries | Where-Object { $_.FullName -match "his/controller/Fs.*Controller\.class" }
  14. Write-Output "=== HIS Controller classes in fs-company.jar ==="
  15. Write-Output "Total: $($hisEntries.Count)"
  16. foreach ($e in $hisEntries) {
  17. Write-Output $e.FullName
  18. }
  19. # Also check course, crm, live controllers
  20. Write-Output ""
  21. Write-Output "=== COURSE Controller classes ==="
  22. $courseEntries = $zip.Entries | Where-Object { $_.FullName -match "course/controller/.*Controller\.class" }
  23. Write-Output "Total: $($courseEntries.Count)"
  24. foreach ($e in $courseEntries) {
  25. Write-Output $e.FullName
  26. }
  27. Write-Output ""
  28. Write-Output "=== CRM Controller classes ==="
  29. $crmEntries = $zip.Entries | Where-Object { $_.FullName -match "crm/controller/.*Controller\.class" }
  30. Write-Output "Total: $($crmEntries.Count)"
  31. foreach ($e in $crmEntries) {
  32. Write-Output $e.FullName
  33. }
  34. Write-Output ""
  35. Write-Output "=== LIVE Controller classes ==="
  36. $liveEntries = $zip.Entries | Where-Object { $_.FullName -match "live/controller/.*Controller\.class" }
  37. Write-Output "Total: $($liveEntries.Count)"
  38. foreach ($e in $liveEntries) {
  39. Write-Output $e.FullName
  40. }
  41. Write-Output ""
  42. Write-Output "=== FASTGPT Controller classes ==="
  43. $fastEntries = $zip.Entries | Where-Object { $_.FullName -match "fastGpt/.*Controller\.class" -or $_.FullName -match "fastgpt/.*Controller\.class" }
  44. Write-Output "Total: $($fastEntries.Count)"
  45. foreach ($e in $fastEntries) {
  46. Write-Output $e.FullName
  47. }
  48. Write-Output ""
  49. Write-Output "=== QW Controller classes (from fs-admin-saas) ==="
  50. $qwEntries = $zip.Entries | Where-Object { $_.FullName -match "qw/controller/.*Controller\.class" }
  51. Write-Output "Total: $($qwEntries.Count)"
  52. foreach ($e in $qwEntries) {
  53. Write-Output $e.FullName
  54. }
  55. $zip.Dispose()
  56. Write-Output "Done"