refactor: 重构产线工位与备料流程,移除冗余字段

1. 移除工单、工件、日排产中的冗余工位组合/接驳台字段
2. 新增工位接驳台编码字段与唯一约束,关联WMS接驳台主数据
3. 重构日排产为工位产量分配模式,替代原接驳台列表
4. 新增备料单工位级字段与分批出库支持
5. 移除定时同步可生产数量,改为WMS实时拉取接口
6. 过滤操作日志,排除登录/退出相关日志
7. 调整仪表盘工序展示逻辑为今日派工路线
8. 新增接驳台维护菜单与基础数据
This commit is contained in:
SunYF
2026-09-19 07:50:21 +08:00
parent 543655d441
commit 37f10d3a13
156 changed files with 4489 additions and 1285 deletions
+8 -2
View File
@@ -370,6 +370,10 @@ func aggregateMaterialSummary(ctx *svc.ServiceContext, a materialSummaryArgs) ([
q = q.Where(inventory.CategoryEQ(invCatSemi))
} else if a.Category == "3" {
q = q.Where(inventory.CategoryEQ(invCatFinished))
} else {
// 半成品是自产中间品,不计入库存体系(不参与常规库存汇总/缺货预警统计),
// 其流转在「半成品管理」单独记录;未显式指定品类时,汇总口径一律排除半成品。
q = q.Where(inventory.CategoryNEQ(invCatSemi))
}
all, err := q.Order(ent.Desc("created_at"), ent.Desc("id")).All(ctx0())
@@ -687,8 +691,9 @@ func buildZoneSummary(ctx *svc.ServiceContext) ([]zoneSummRow, error) {
zoneCreatedAtMap[z.ZoneCode] = z.CreatedAt
}
// 区域汇总属常规库存汇总口径,排除半成品(半成品单独记录,不并入库存体系)
rows, err := ctx.EntClient.Inventory.Query().
Where(inventory.StatusIn("在库", "锁定")).All(ctx0())
Where(inventory.StatusIn("在库", "锁定"), inventory.CategoryNEQ(invCatSemi)).All(ctx0())
if err != nil {
return nil, err
}
@@ -1026,8 +1031,9 @@ type shortageRow struct {
// 可用量口径与出库门禁一致:在库/锁定 且质量状态非 不合格/待退。
func shortageHandler(ctx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// 缺货预警只统计纳入库存体系的品类:半成品为自产中间品、不参与常规库存统计,故排除。
mats, err := ctx.EntClient.Material.Query().
Where(material.SafetyStockGT(0), material.IsActiveEQ(true)).
Where(material.SafetyStockGT(0), material.IsActiveEQ(true), material.ItemTypeNEQ(2)).
All(ctx0())
if err != nil {
fail(w, http.StatusInternalServerError, err.Error())