Commit 61436563 authored by wenwen.tang's avatar wenwen.tang 😕

docs(memory): 记录 push + 同步部署 + 线上台账迁移(e21a96c3)

parent e21a96c3
...@@ -392,3 +392,28 @@ env -u http_proxy -u https_proxy -u HTTP_PROXY -u HTTPS_PROXY git push origin ma ...@@ -392,3 +392,28 @@ env -u http_proxy -u https_proxy -u HTTP_PROXY -u HTTPS_PROXY git push origin ma
账单按免租跳过(8-9 月命中 / 挪到 11 月不命中)· 表头与 datalist · 批量暂存(不弹框)· 放弃还原 · 账单按免租跳过(8-9 月命中 / 挪到 11 月不命中)· 表头与 datalist · 批量暂存(不弹框)· 放弃还原 ·
一次确认落盘 · 整批撤销 · 服务端 428 闸门 · 无 JS 报错 一次确认落盘 · 整批撤销 · 服务端 428 闸门 · 无 JS 报错
- 真实 `data/` 除迁移那一次写入外零改动(所有 UI 回归均走沙箱) - 真实 `data/` 除迁移那一次写入外零改动(所有 UI 回归均走沙箱)
---
## 第九轮:push + 同步部署 + **线上台账迁移**(10-13 15:0x)
- 提交 `e21a96c` → push `cae0872..e21a96c`(`git push` 需 `env -u http_proxy …` 绕代理)
- 部署 ⚠️ **deploy_git.py 必须用 venv python**(`…/envs/default/Scripts/python.exe`):
3.13.12 里**没有 paramiko**,直接跑报 `ModuleNotFoundError`。
`sync` 全绿:容器 Up、HTTP 200、85 行 × 31 列、企微 `authorized`(Bot 租金机器人 / 唐文文)
- **线上数据文件当初仍是 36 列** —— 数据挂在 `$REMOTE_DIR`(不在 repo 内),
`sync` 只更代码、**不动数据** → 必须手动在容器里跑迁移:
`docker exec rentos python /app/tools/migrate_rentfree_type.py`(先干跑)`--apply`(落盘)
- 迁移结果:删 AD~AI(165 个存量值)· 新增 AK · 回填 **7 行**「首N月免租」
= 302/303/315(L=0.5)+ **801/802/1101/1115(L=2.0,本地快照里没有)**
→ 备份 `data/tables/.backup/rent_parking.20261013-150555.json`
- 免租窗口核对(线上实算,全部正确):
801/802 `2024-01-01~2024-03-01` · 1101/1115 `2025-10-01~2025-12-01` ·
315 `2026-01-01~2026-01-16` · 302 `2026-08-16~2026-08-31` · 303 `2026-09-01~2026-09-16`
(0.5 月 = 15 天,符合口径)——窗口均在历史区间,故当前预览 `rentfree_rows=0` 属正常
- ⚠️ **发现线上被人工操作过**:线上台账 `updated_at` 曾到 14:09、批次由 5 → **7**
(elec 3 + rent_parking 4,已发送单据 14)、8F/11F 多了 `L=2.0`。
→ 本机 `data/tables/rent_parking.json` 是**旧快照**,与线上有差;**一律以线上为准**。
- ⚠️ `rentfree.windows()` 的返回键是 **`begin` / `end`**(不是 from/to),另有 `months`/`year`/`type`/`key`
- 本轮未 push/部署前已确认:`rentfree` 只作**标注**(`rent_preview` 的每行/每单据 `rentfree` + 前端「免租期内」标签),
**不参与 `billable` 判定** → 回填再多行也不会自动停单,风险可控
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
- `首N月免租`:窗口 `[I, I+L月)`,含起始不含结束;0.5 月 = 15 天 - `首N月免租`:窗口 `[I, I+L月)`,含起始不含结束;0.5 月 = 15 天
- `每年8-9月免租`:合约期 `[I, J]` 内每个自然年 `[max(该年08-01, I), min(该年10-01, J+1天))`(跨年裁剪) - `每年8-9月免租`:合约期 `[I, J]` 内每个自然年 `[max(该年08-01, I), min(该年10-01, J+1天))`(跨年裁剪)
- `hit()` 按时点;`overlaps()` 按账单期间交集(「每年8-9月」必需,通知日通常早于该期) - `hit()` 按时点;`overlaps()` 按账单期间交集(「每年8-9月」必需,通知日通常早于该期)
- ⚠️ `windows()` 返回键是 **`begin`/`end`**(非 from/to),另有 `type`/`months`/`year`/`key`
- 另有 `types()` / `windows()` / `active()` / `describe()` / `strip()` - 另有 `types()` / `windows()` / `active()` / `describe()` / `strip()`
## 名册(`data/config.json`,唯一入口 `rentos/directory.py`) ## 名册(`data/config.json`,唯一入口 `rentos/directory.py`)
...@@ -79,8 +80,12 @@ ...@@ -79,8 +80,12 @@
- `start.bat [safe] [端口]` / `stop.bat [端口]`;`notify.enabled=True` 时双击 `start.bat` **会开定时发送** - `start.bat [safe] [端口]` / `stop.bat [端口]`;`notify.enabled=True` 时双击 `start.bat` **会开定时发送**
→ **会话内启动一律 `start.bat safe`** → **会话内启动一律 `start.bat safe`**
- 云端 `http://192.168.68.121:8899/`(admin / 1989@rent05),容器 `rentos`,root / 12345678 - 云端 `http://192.168.68.121:8899/`(admin / 1989@rent05),容器 `rentos`,root / 12345678
- **主用 Git 同步**:`RENTOS_SSH_PASSWORD=... python tools/deploy_git.py sync`(setup/pull/build/run/status/logs) - **主用 Git 同步**(⚠️ **必须用 venv python** `…/envs/default/Scripts/python.exe`,3.13.12 无 paramiko):
`RENTOS_SSH_PASSWORD=12345678 …python tools/deploy_git.py sync`(setup/pull/build/run/status/logs)
- push 需绕代理:`env -u http_proxy -u https_proxy -u HTTP_PROXY -u HTTPS_PROXY git push`
- 代码落 `/opt/rentos/repo`,与数据同级独立 → `git reset --hard` **不碰线上数据** - 代码落 `/opt/rentos/repo`,与数据同级独立 → `git reset --hard` **不碰线上数据**
- ⚠️ **sync 只更代码、不动数据** → 凡改列模型/加列的迁移,**部署后必须在容器里手动再跑一次**
(如 `docker exec rentos python /app/tools/migrate_rentfree_type.py` 先干跑再加 `--apply`)
- 构建必须在**仓库根**:`docker build -f deploy/Dockerfile -t rentos:latest .`,构建期零联网; - 构建必须在**仓库根**:`docker build -f deploy/Dockerfile -t rentos:latest .`,构建期零联网;
**切勿 `docker build … | tail`**(吞掉失败会拿旧镜像重启) **切勿 `docker build … | tail`**(吞掉失败会拿旧镜像重启)
- 服务器**无 Python 3** → 迁移只能 `docker exec rentos python /app/tools/xxx.py` - 服务器**无 Python 3** → 迁移只能 `docker exec rentos python /app/tools/xxx.py`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment