落地报价模板主账与后台:合同映射、灌种 SQL/脚本、智能体填表,并补测服运维探针与合同文档对齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-09-14 14:09:45 +08:00
co-authored by Cursor
parent 8bdf4990a2
commit a70bce3c8f
138 changed files with 7239 additions and 1085 deletions
+4 -36
View File
@@ -1,4 +1,4 @@
# 持久拉起主账:由 WMI 启动 cmd 循环,SSH 断开后仍存活。禁止动现网 8080。
# Persistently start inquiry ledger on 8180 via WMI. Never touch prod 8080.
$ErrorActionPreference = 'Stop'
$Root = 'E:\wwwroot\inquiry-new'
$Www = 'E:\wwwroot'
@@ -7,6 +7,7 @@ $LogDir = Join-Path $Root 'logs'
$CfgDir = Join-Path $Root 'config'
$IncomingJar = 'C:\Users\ytd_extdev_0903\incoming\jeecg-system-start-3.5.3.jar'
$IncomingCfg = 'C:\Users\ytd_extdev_0903\incoming\ledger-config.zip'
$IncomingInner = 'C:\Users\ytd_extdev_0903\incoming\_remote_run_ledger_inner.ps1'
$Java = 'C:\yutongda\tools\jdk8\bin\java.exe'
New-Item -ItemType Directory -Force -Path $Root, $LogDir, $CfgDir, (Join-Path $Www 'ops') | Out-Null
@@ -16,40 +17,8 @@ if (-not (Test-Path $Java)) { throw 'java missing' }
if (Test-Path $IncomingCfg) {
Expand-Archive -Path $IncomingCfg -DestinationPath $CfgDir -Force
}
$inner = @'
$ErrorActionPreference = "Stop"
Get-Content "E:\wwwroot\.env" | ForEach-Object {
$line = $_.Trim()
if (-not $line -or $line.StartsWith("#")) { return }
$i = $line.IndexOf("=")
if ($i -lt 1) { return }
Set-Item -Path ("Env:" + $line.Substring(0, $i).Trim()) -Value $line.Substring($i + 1).Trim().Trim('"')
}
if (-not $env:YTD_REDIS_PASSWORD -and $env:REDIS_URL) {
if ($env:REDIS_URL -match "redis://:([^@]+)@") { $env:YTD_REDIS_PASSWORD = $Matches[1] }
elseif ($env:REDIS_URL -match "redis://[^:]+:([^@]+)@") { $env:YTD_REDIS_PASSWORD = $Matches[1] }
}
if (-not $env:YTD_REDIS_HOST) { $env:YTD_REDIS_HOST = "10.206.0.14" }
if (-not $env:YTD_REDIS_PORT) { $env:YTD_REDIS_PORT = "6379" }
if (-not $env:YTD_REDIS_DB) { $env:YTD_REDIS_DB = "1" }
$env:LEDGER_PORT = "8180"
$Java = "C:\yutongda\tools\jdk8\bin\java.exe"
$Jar = "E:\wwwroot\inquiry-new\jeecg-system-start-3.5.3.jar"
Set-Location "E:\wwwroot\inquiry-new"
$arg = @(
"-jar", $Jar,
"--spring.profiles.active=inquiry",
"--server.port=8180",
"--spring.config.additional-location=optional:file:./config/",
"--cas.prefixUrl=http://127.0.0.1/cas-disabled",
"--jeecg.loginCaptchaEnabled=false"
)
if ($env:YTD_REDIS_USERNAME) { $arg += ("--spring.redis.username=" + $env:YTD_REDIS_USERNAME) }
& $Java @arg
'@
$innerPath = Join-Path $Www 'ops\run-ledger-inner.ps1'
Set-Content -Path $innerPath -Value $inner -Encoding UTF8
if (-not (Test-Path $IncomingInner)) { throw "missing $IncomingInner" }
Copy-Item $IncomingInner (Join-Path $Www 'ops\run-ledger-inner.ps1') -Force
$cmd = @"
@echo off
@@ -63,7 +32,6 @@ goto loop
$cmdPath = Join-Path $Www 'ops\run-ledger.cmd'
Set-Content -Path $cmdPath -Value $cmd -Encoding ASCII
# 只停 inquiry-new 的 java
Get-CimInstance Win32_Process -Filter "Name='java.exe'" | ForEach-Object {
if ($_.CommandLine -and $_.CommandLine -like '*inquiry-new*jeecg-system-start*') {
Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue