feat: 核心业务实体扩充(混产模板/产品BOM/试制记录)、WMS 库存检验增强与前端通用能力
- MES 新增实体:混产模板、产品BOM、产品工艺物料、试制记录(schema + ent 生成码 + logic/handler/前端页) - WMS 实体增强:检验记录、库存、半成品重构;新增序列号库存与短缺代报 - AGV 与产能:AGV 手动点位与链路、物料守卫、短缺预测、原因字典 - 前端通用能力:新增下一步引导组件 NextStepBar,统一帮助文档/布局/请求拦截与操作列 - 工位终端:界面与各 handler 调整(api/store/绑定/PLC/拧紧/上报等) - 配置与文档:更新 mes-api.yaml、WMS README 及案例/产线API/问题记录/项目说明/流程说明
This commit is contained in:
@@ -40,7 +40,7 @@ func internalDisplayHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
snInStock, _ := ctx.EntClient.Inventory.Query().Where(inventory.SnModeEQ(snModeSN), inventory.StatusIn("在库", "锁定")).Count(ctx0())
|
||||
snOut, _ := ctx.EntClient.Inventory.Query().Where(inventory.SnModeEQ(snModeSN), inventory.StatusEQ("出库")).Count(ctx0())
|
||||
// 半成品统计:统一库存主表 category=2(semi_finisheds 已收编废弃)
|
||||
// 在制品统计:统一库存主表 category=2(semi_finisheds 已收编废弃)
|
||||
semiInStock, _ := ctx.EntClient.Inventory.Query().Where(inventory.CategoryEQ(invCatSemi), inventory.StatusEQ("在库")).Count(ctx0())
|
||||
// 成品在库统计:category=3
|
||||
finishedInStock, _ := ctx.EntClient.Inventory.Query().Where(inventory.CategoryEQ(invCatFinished), inventory.StatusIn("在库", "锁定")).Count(ctx0())
|
||||
@@ -248,7 +248,7 @@ func internalDisplayAnalyticsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
// 库龄分档阈值来自基础设置 display.age.buckets(默认 30/90/180,基础设置页可改,保存即生效)
|
||||
ageTh := AgeBucketsFromConfig(ctx)
|
||||
mm := map[int]int{} // 类型:1结构件/2电气件/3其他
|
||||
it := map[int]int{} // 物料类别:1原材料/2半成品/3成品
|
||||
it := map[int]int{} // 物料类别:1原材料/2在制品/3成品
|
||||
age := [4]int{} // 0-a / a+1-b / b+1-c / c+ 天
|
||||
if invs, e := ctx.EntClient.Inventory.Query().
|
||||
Where(inventory.QuantityGT(0), inventory.StatusIn("在库", "锁定")).All(ctx0()); e == nil {
|
||||
@@ -278,7 +278,7 @@ func internalDisplayAnalyticsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
},
|
||||
"itemType": []displayNamedQty{
|
||||
{Key: 1, Name: "原材料", Qty: it[1]},
|
||||
{Key: 2, Name: "半成品", Qty: it[2]},
|
||||
{Key: 2, Name: "在制品", Qty: it[2]},
|
||||
{Key: 3, Name: "成品", Qty: it[3]},
|
||||
},
|
||||
"ageBuckets": []displayNamedQty{
|
||||
@@ -450,7 +450,8 @@ type finishedInboundRequest struct {
|
||||
ProductStatus string `json:"productStatus"` // 已通过/部分通过/返修
|
||||
RelatedStandard string `json:"relatedStandard"` // 相关标准(试验方案号)
|
||||
TestRecordNo string `json:"testRecordNo"` // 试验记录单号
|
||||
RecordedBy string `json:"recordedBy"` // 记录员(手工入库必填;MES 回流可空)
|
||||
RecordedBy string `json:"recordedBy"` // 记录员展示名(2026-11-13 起前端只读,由服务端按登录人覆写;MES 回流可空)
|
||||
RecordedByID int64 `json:"recordedById"` // 记录员 user_id(取自 JWT X-UserID,服务端强制写入)
|
||||
RecordDate string `json:"recordDate"` // 记录日期 YYYY-MM-DD(可空;手工入库默认今天)
|
||||
Remark string `json:"remark"` // 备注(手工入库用;MES 回流留空走默认文案)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user