ERP/RESTART_REQUIRED.md
zzh c11a70fdf2 修复采购需求计算和返修记录上传功能
- 修复采购需求计算时工厂匹配问题
  - calculate_purchase_demand: 添加工厂参数并按工厂过滤期初库存
  - calculate_all_purchase_demand: 添加工厂参数并按工厂过滤期初库存
  - calculate_purchase_demand_from_orders: 修复INSERT语句字段顺序
  - recalculate_purchase_demand: 添加工厂参数并按工厂过滤期初库存

- 修复返修记录上传页面按钮无响应问题
  - 修正isUploadPage判断逻辑,使事件监听器正确绑定
  - 图片上传、提交、清空按钮现在可以正常工作

- 添加数据库到Git仓库
  - 修改.gitignore允许server/data.db被提交
  - 包含所有生产数据和配置
2026-04-08 11:24:26 +08:00

44 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 🔄 需要重启服务器
## 修复内容
已修复以下问题:
### 1. 期初库存导入
- ✅ 支持同一物料编码在不同工厂独立存在
- ✅ 导入时按 `(material_code, factory)` 组合检查是否存在
### 2. 采购需求计算
-`calculate_purchase_demand` - 添加工厂参数,按工厂匹配期初库存
-`calculate_all_purchase_demand` - 添加工厂参数,按工厂匹配期初库存
-`calculate_purchase_demand_from_orders` - 修复INSERT语句字段顺序factory字段放在最后
### 3. 数据备份恢复
- ✅ 导入Excel前自动备份
- ✅ 批量删除前自动备份
- ✅ 恢复数据前自动备份
- ✅ 前端添加"📦 数据恢复"功能
## 重启后需要做的事
1. **删除错误的采购需求记录**
- 需求单 D20260401105945062 及其他使用旧代码生成的记录
- 这些记录的期初库存字段不正确
2. **重新计算采购需求**
- 使用修复后的代码重新计算
- 验证期初库存字段正确匹配工厂
3. **验证修复效果**
- 铨宝的"6*6*7.5支架 TS-1166VW"期初库存应该是 0
- 友辉的"6*6*7.5支架 TS-1166VW"期初库存应该是 995
## 如何重启
```bash
cd /home/hyx/work/生产管理系统
# 停止当前服务器Ctrl+C 或 kill 进程)
# 然后重新启动
python3 server/app.py
```