From 520bdcba17d90b07d7d63fdcdb0e98a2a0a87300 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期六, 03 十月 2026 19:30:25 +0800
Subject: [PATCH] fix(holiday): 快报表格改用带符号百分比并保留模板样式
---
pack-deploy.ps1 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/pack-deploy.ps1 b/pack-deploy.ps1
index 1e31977..0720fdc 100644
--- a/pack-deploy.ps1
+++ b/pack-deploy.ps1
@@ -9,7 +9,9 @@
鎵ц mvn clean package锛涙棤璁烘垚璐ラ兘杩樺師寮�鍙戞満鐪熷疄閰嶇疆
2) 瑙e帇 jar 妫�鏌ュ唴缃� application.yml锛氬繀椤诲叏鏄崰浣嶇锛堢姝� sk- 瀵嗛挜 / 鏄庢枃鍙d护锛夛紝涓嶅悎鏍肩洿鎺ヤ腑姝�
3) npm run build 閲嶅缓鍓嶇 dist锛堝彲 -SkipFrontend锛�
- 4) 缁勮瀹屾暣閮ㄧ讲鍖咃細backend(jar + application.yml + 鍚姩鑴氭湰 + docs + web) / frontend/dist / db / README
+ 4) 缁勮瀹屾暣閮ㄧ讲鍖咃細backend(jar + application.yml + 鍚姩鑴氭湰 + 鏈嶅姟鍖呰鍣� + docs + web) / frontend/dist / db / README
+ Windows 鏈嶅姟鍖呰鍣� WinSW锛氫紭鍏堢敤 deploy-templates\tools\winsw.exe 缂撳瓨锛堟牎楠� SHA-256锛夛紝
+ 缂哄け鏃惰嚜鍔ㄤ笅杞� v2.12.0 x64 鍒拌缂撳瓨鐩綍锛涢殢鍖呰緭鍑轰负 backend\trafficAudit.exe
5) 瀵圭粍瑁呭悗鐨勬暣鍖呭啀鎵竴閬嶆槑鏂囧瘑閽�
淇鑳屾櫙锛�2026-10-03锛夛細2026-10-02 鎵嬪伐浜у嚭鐨勫寘缂� application.yml / docs / db / 鍚姩鑴氭湰锛�
@@ -20,7 +22,8 @@
param(
[string]$OutRoot = '',
[switch]$SkipFrontend,
- [switch]$SkipBackend # 澶嶇敤宸插瓨鍦ㄧ殑 jar锛堜笉閲嶇紪璇戙�佷笉鍔ㄦ簮鐮侀厤缃級锛屼粎鐢ㄤ簬琛ュ叏/閲嶇粍鍙戝竷鍖�
+ [switch]$SkipBackend, # 澶嶇敤宸插瓨鍦ㄧ殑 jar锛堜笉閲嶇紪璇戙�佷笉鍔ㄦ簮鐮侀厤缃級锛屼粎鐢ㄤ簬琛ュ叏/閲嶇粍鍙戝竷鍖�
+ [switch]$SkipServiceWrapper # 涓嶆妸 WinSW 鏈嶅姟鍖呰鍣ㄦ墦杩涘寘锛堝嵆涓嶆彁渚涒�滄敞鍐屾垚 Windows 鏈嶅姟鈥濈殑寮�鏈鸿嚜鍚級
)
$ErrorActionPreference = 'Stop'
@@ -117,6 +120,40 @@
}
if (-not (Test-Path $webDist)) { throw "鏈壘鍒板墠绔骇鐗╋細$webDist锛堝幓鎺� -SkipFrontend 閲嶆柊鏋勫缓锛�" }
+# ---------- WinSW锛圵indows 鏈嶅姟鍖呰鍣級鍑嗗锛氭湰鍦扮紦瀛樹紭鍏堬紝缂哄け鏃朵粠瀹樻柟鍙戝竷椤典笅杞藉苟鏍¢獙 SHA-256 ----------
+# WinSW v2.12.0 瀹樻柟浜х墿鏈仛 Authenticode 绛惧悕锛屾墍浠ヤ互鍥哄畾 SHA-256 浣滀负瀹屾暣鎬ф牎楠屻��
+$winswUrl = 'https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW-x64.exe'
+$winswSha256 = '05B82D46AD331CC16BDC00DE5C6332C1EF818DF8CEEFCD49C726553209B3A0DA'
+$winswSrc = Join-Path $tplDir 'tools\winsw.exe'
+
+function Test-WinswCache {
+ param([string]$Path)
+ if (-not (Test-Path -LiteralPath $Path)) { return $false }
+ $hash = (Get-FileHash -LiteralPath $Path -Algorithm SHA256).Hash
+ if ($hash -ne $winswSha256) {
+ Write-Host (' 璀﹀憡锛歐inSW 缂撳瓨 SHA-256 涓嶅尮閰嶏紝灏嗛噸鏂颁笅杞斤紙鏈熸湜 {0}...锛屽疄闄� {1}...锛�' -f $winswSha256.Substring(0, 12), $hash.Substring(0, 12))
+ return $false
+ }
+ return $true
+}
+
+if ($SkipServiceWrapper) {
+ Write-Host ' 宸叉寜 -SkipServiceWrapper 璺宠繃锛氬寘鍐呬笉鍚� Windows 鏈嶅姟鏂瑰紡寮�鏈鸿嚜鍚�'
+} else {
+ if (-not (Test-WinswCache $winswSrc)) {
+ New-Item -ItemType Directory -Force -Path (Split-Path -Parent $winswSrc) | Out-Null
+ Write-Host ' 涓嬭浇 WinSW v2.12.0 x64 ...'
+ try {
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+ Invoke-WebRequest -Uri $winswUrl -OutFile $winswSrc -UseBasicParsing
+ } catch {
+ throw ("涓嬭浇 WinSW 澶辫触锛歿0}銆俙n璇锋墜鍔ㄤ笅杞� {1} 瀛樹负 {2} 鍚庨噸璇曪紝鎴栫敤 -SkipServiceWrapper 璺宠繃銆�" -f $_.Exception.Message, $winswUrl, $winswSrc)
+ }
+ if (-not (Test-WinswCache $winswSrc)) { throw "WinSW 鏍¢獙澶辫触锛屽凡涓鎵撳寘锛�$winswSrc" }
+ }
+ Write-Host (' WinSW 灏辩华锛圫HA-256 宸叉牎楠岋級锛歿0:N1} MB' -f ((Get-Item -LiteralPath $winswSrc).Length / 1MB))
+}
+
# ---------- [4/5] 缁勮瀹屾暣閮ㄧ讲鐩綍 ----------
Write-Host '[4/5] 缁勮閮ㄧ讲鐩綍...'
$stamp = Get-Date -Format 'yyyyMMdd'
@@ -129,6 +166,15 @@
Copy-Item (Join-Path $tplDir 'backend\application.yml') (Join-Path $dest 'backend') -Force
Copy-Item (Join-Path $tplDir 'backend\start-backend.cmd') (Join-Path $dest 'backend') -Force
Copy-Item (Join-Path $tplDir 'backend\start-backend.sh') (Join-Path $dest 'backend') -Force
+Copy-Item (Join-Path $tplDir 'backend\start-backend-service.cmd') (Join-Path $dest 'backend') -Force
+Copy-Item (Join-Path $tplDir 'backend\install-autostart.ps1') (Join-Path $dest 'backend') -Force
+if (-not $SkipServiceWrapper) {
+ # WinSW 瑕佹眰閰嶇疆鏂囦欢鍚嶄笌 exe 鍚屽悕锛歵rafficAudit.exe 璇诲悓鐩綍鐨� trafficAudit.xml
+ Copy-Item -LiteralPath $winswSrc (Join-Path $dest 'backend\trafficAudit.exe') -Force
+ Copy-Item (Join-Path $tplDir 'backend\trafficAudit.xml') (Join-Path $dest 'backend') -Force
+ Copy-Item (Join-Path $tplDir 'backend\install-service.ps1') (Join-Path $dest 'backend') -Force
+ Copy-Item (Join-Path $tplDir 'backend\install-service.cmd') (Join-Path $dest 'backend') -Force
+}
Copy-Item $webDist (Join-Path $dest 'frontend') -Recurse -Force
Copy-Item (Join-Path $tplDir 'frontend\nginx.conf.example') (Join-Path $dest 'frontend') -Force
Copy-Item (Join-Path $tplDir 'db\*.sql') (Join-Path $dest 'db') -Force
--
Gitblit v1.9.1