|
|
@@ -1,126 +0,0 @@
|
|
|
-# Rename yudao-module-product to yudao-module-makeplan
|
|
|
-# Including folders, packages, API paths, and all references
|
|
|
-
|
|
|
-Write-Host "========================================" -ForegroundColor Cyan
|
|
|
-Write-Host "Starting module rename: product -> makeplan" -ForegroundColor Cyan
|
|
|
-Write-Host "========================================" -ForegroundColor Cyan
|
|
|
-
|
|
|
-# 1. Rename module folder
|
|
|
-Write-Host "`n[1/8] Renaming module folder..." -ForegroundColor Yellow
|
|
|
-if (Test-Path "yudao-module-product") {
|
|
|
- Rename-Item -Path "yudao-module-product" -NewName "yudao-module-makeplan"
|
|
|
- Write-Host "Module folder renamed successfully" -ForegroundColor Green
|
|
|
-} else {
|
|
|
- Write-Host "yudao-module-product folder not found" -ForegroundColor Red
|
|
|
- exit 1
|
|
|
-}
|
|
|
-
|
|
|
-# 2. Rename mapper folder
|
|
|
-Write-Host "`n[2/8] Renaming mapper folder..." -ForegroundColor Yellow
|
|
|
-if (Test-Path "mapper/product") {
|
|
|
- Rename-Item -Path "mapper/product" -NewName "mapper/makeplan"
|
|
|
- Write-Host "Mapper folder renamed successfully" -ForegroundColor Green
|
|
|
-}
|
|
|
-
|
|
|
-# 3. Rename Java package
|
|
|
-Write-Host "`n[3/8] Renaming Java package..." -ForegroundColor Yellow
|
|
|
-$javaPath = "yudao-module-makeplan/src/main/java/cn/iocoder/yudao/module"
|
|
|
-if (Test-Path "$javaPath/product") {
|
|
|
- Rename-Item -Path "$javaPath/product" -NewName "makeplan"
|
|
|
- Write-Host "Java package renamed successfully" -ForegroundColor Green
|
|
|
-}
|
|
|
-
|
|
|
-# 4. Update package references in Java files
|
|
|
-Write-Host "`n[4/8] Updating package references in Java files..." -ForegroundColor Yellow
|
|
|
-$javaFiles = Get-ChildItem -Path "yudao-module-makeplan" -Filter "*.java" -Recurse
|
|
|
-$count = 0
|
|
|
-foreach ($file in $javaFiles) {
|
|
|
- $content = Get-Content $file.FullName -Raw -Encoding UTF8
|
|
|
- $newContent = $content -replace 'cn\.iocoder\.yudao\.module\.product', 'cn.iocoder.yudao.module.makeplan'
|
|
|
- if ($content -ne $newContent) {
|
|
|
- Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8 -NoNewline
|
|
|
- $count++
|
|
|
- }
|
|
|
-}
|
|
|
-Write-Host "Updated $count Java files" -ForegroundColor Green
|
|
|
-
|
|
|
-# 5. Update pom.xml files
|
|
|
-Write-Host "`n[5/8] Updating pom.xml files..." -ForegroundColor Yellow
|
|
|
-$pomFiles = @(
|
|
|
- "pom.xml",
|
|
|
- "yudao-module-makeplan/pom.xml"
|
|
|
-)
|
|
|
-$count = 0
|
|
|
-foreach ($pomFile in $pomFiles) {
|
|
|
- if (Test-Path $pomFile) {
|
|
|
- $content = Get-Content $pomFile -Raw -Encoding UTF8
|
|
|
- $newContent = $content -replace 'yudao-module-product', 'yudao-module-makeplan'
|
|
|
- $newContent = $newContent -replace '<artifactId>product</artifactId>', '<artifactId>makeplan</artifactId>'
|
|
|
- $newContent = $newContent -replace '<module>yudao-module-product</module>', '<module>yudao-module-makeplan</module>'
|
|
|
- if ($content -ne $newContent) {
|
|
|
- Set-Content -Path $pomFile -Value $newContent -Encoding UTF8 -NoNewline
|
|
|
- $count++
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-Write-Host "Updated $count pom.xml files" -ForegroundColor Green
|
|
|
-
|
|
|
-# 6. Update mapper XML files
|
|
|
-Write-Host "`n[6/8] Updating mapper XML files..." -ForegroundColor Yellow
|
|
|
-$xmlFiles = Get-ChildItem -Path "yudao-module-makeplan" -Filter "*.xml" -Recurse
|
|
|
-$count = 0
|
|
|
-foreach ($file in $xmlFiles) {
|
|
|
- $content = Get-Content $file.FullName -Raw -Encoding UTF8
|
|
|
- $newContent = $content -replace 'cn\.iocoder\.yudao\.module\.product', 'cn.iocoder.yudao.module.makeplan'
|
|
|
- $newContent = $newContent -replace 'mapper/product/', 'mapper/makeplan/'
|
|
|
- if ($content -ne $newContent) {
|
|
|
- Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8 -NoNewline
|
|
|
- $count++
|
|
|
- }
|
|
|
-}
|
|
|
-Write-Host "Updated $count XML files" -ForegroundColor Green
|
|
|
-
|
|
|
-# 7. Update frontend API paths
|
|
|
-Write-Host "`n[7/8] Updating frontend API paths..." -ForegroundColor Yellow
|
|
|
-# Rename frontend API folder
|
|
|
-if (Test-Path "yudao-ui/yudao-ui-admin-vue3/src/api/product") {
|
|
|
- Rename-Item -Path "yudao-ui/yudao-ui-admin-vue3/src/api/product" -NewName "makeplan"
|
|
|
-}
|
|
|
-
|
|
|
-# Update frontend files
|
|
|
-$frontendFiles = Get-ChildItem -Path "yudao-ui/yudao-ui-admin-vue3/src" -Include "*.vue","*.ts","*.js" -Recurse
|
|
|
-$count = 0
|
|
|
-foreach ($file in $frontendFiles) {
|
|
|
- $content = Get-Content $file.FullName -Raw -Encoding UTF8
|
|
|
- $newContent = $content -replace '@/api/product/', '@/api/makeplan/'
|
|
|
- $newContent = $newContent -replace '/product/workorder-schedule', '/makeplan/workorder-schedule'
|
|
|
- if ($content -ne $newContent) {
|
|
|
- Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8 -NoNewline
|
|
|
- $count++
|
|
|
- }
|
|
|
-}
|
|
|
-Write-Host "Updated $count frontend files" -ForegroundColor Green
|
|
|
-
|
|
|
-# 8. Update application config files
|
|
|
-Write-Host "`n[8/8] Updating application config files..." -ForegroundColor Yellow
|
|
|
-$configFiles = Get-ChildItem -Path "yudao-server/src/main/resources" -Filter "application*.yaml" -Recurse
|
|
|
-$count = 0
|
|
|
-foreach ($file in $configFiles) {
|
|
|
- $content = Get-Content $file.FullName -Raw -Encoding UTF8
|
|
|
- $newContent = $content -replace 'yudao\.module\.product', 'yudao.module.makeplan'
|
|
|
- $newContent = $newContent -replace 'mapper/product/', 'mapper/makeplan/'
|
|
|
- if ($content -ne $newContent) {
|
|
|
- Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8 -NoNewline
|
|
|
- $count++
|
|
|
- }
|
|
|
-}
|
|
|
-Write-Host "Updated $count config files" -ForegroundColor Green
|
|
|
-
|
|
|
-Write-Host "`n========================================" -ForegroundColor Cyan
|
|
|
-Write-Host "Module rename completed!" -ForegroundColor Green
|
|
|
-Write-Host "========================================" -ForegroundColor Cyan
|
|
|
-Write-Host "`nNext steps:" -ForegroundColor Yellow
|
|
|
-Write-Host "1. Run: mvn clean install -DskipTests" -ForegroundColor White
|
|
|
-Write-Host "2. Start backend service" -ForegroundColor White
|
|
|
-Write-Host "3. Start frontend service" -ForegroundColor White
|
|
|
-Write-Host "4. Test work order schedule functionality" -ForegroundColor White
|