feat&refactor: 2026-09-22 半成品业务模型重构与功能完善
- 重构半成品流转逻辑:进度权威源改为 workpiece.currentStationNo,新增 completedText 快照字段,废除 doneProcessCodes - 清理物料品类中半成品类型,存量数据幂等清理,调整物料管理方式文案为批次/序列号 - 新增日排产状态专用更新接口,修复工单工艺校验逻辑 - 新增物料档案代理接口、深路径文件下载接口 - 优化前端界面文案与工位选择逻辑,补充追溯页半成品流转展示 - 调整WMS端物料品类校验与入库接口契约 - 新增/更新数据库表结构与实体类代码
This commit is contained in:
@@ -296,6 +296,14 @@ func applyColumnPatches(ctx context.Context) {
|
||||
slog.Warn("补齐列失败(可忽略): " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 2026-09-22 物料品类收编:半成品不是物料品类(是工件状态,由库存 category=2 承载)=====
|
||||
// 物料档案不再允许 item_type=2,幂等清理存量半成品品类行(重复执行删 0 行,无害)。
|
||||
if res, err := rawDB.ExecContext(ctx, `DELETE FROM materials WHERE item_type=2`); err != nil {
|
||||
slog.Warn("清理 item_type=2 物料失败(可忽略): " + err.Error())
|
||||
} else if n, err := res.RowsAffected(); err == nil && n > 0 {
|
||||
slog.Info(fmt.Sprintf("物料品类清理:已删除半成品品类(item_type=2)物料档案 %d 行", n))
|
||||
}
|
||||
}
|
||||
|
||||
// DropAllTables 删除 public schema 下全部表(CASCADE 连带索引/序列/外键约束)。
|
||||
|
||||
Reference in New Issue
Block a user