docs(deployment): 更新部署手册和业务架构说明
- 更新MES和WMS服务端口配置说明 - 详细说明产线工位设备配置(扫码枪+拧紧枪) - 明确AGV配送和接驳台的模拟模式与真实对接方案 - 更新WMS中AGV配送默认模拟模式说明 - 完善厂内物流(AGV/接驳台)的业务架构约束 - 修订临时文档为详细的项目问题和解决方案规划
This commit is contained in:
@@ -69,6 +69,7 @@ func queryStockHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
zoneCode := r.URL.Query().Get("zoneCode")
|
||||
qualityStatus := r.URL.Query().Get("qualityStatus")
|
||||
manageMode := r.URL.Query().Get("manageMode") // 1/2/空=全部
|
||||
category := r.URL.Query().Get("category") // 1原材料/2半成品/3成品/空=全部(完工检 SN 拾取器按成品过滤)
|
||||
inboundNo := r.URL.Query().Get("inboundNo")
|
||||
startDate := r.URL.Query().Get("startDate") // 默认近3个月(由接口保证)
|
||||
endDate := r.URL.Query().Get("endDate")
|
||||
@@ -82,6 +83,7 @@ func queryStockHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
ZoneCode: zoneCode,
|
||||
QualityStatus: qualityStatus,
|
||||
ManageMode: manageMode,
|
||||
Category: category,
|
||||
InboundNo: inboundNo,
|
||||
StartDate: startDate,
|
||||
EndDate: endDate,
|
||||
@@ -703,23 +705,27 @@ func buildZoneSummary(ctx *svc.ServiceContext) ([]zoneSummRow, error) {
|
||||
qty int
|
||||
lastCreated int64
|
||||
}
|
||||
// 物料品类(itemType)映射:区域汇总「类型」列需按 itemType=4 补「其他」(需求24)。
|
||||
mats, _ := ctx.EntClient.Material.Query().All(ctx0())
|
||||
itemTypeMap := make(map[string]int, len(mats))
|
||||
for _, m := range mats {
|
||||
itemTypeMap[m.Code] = m.ItemType
|
||||
}
|
||||
agg := map[string]*aggInfo{} // key: zc|quality|type
|
||||
for _, inv := range rows {
|
||||
zc := inv.ZoneCode
|
||||
if zc == "" {
|
||||
zc = "未分区"
|
||||
}
|
||||
// 类型标签:批次 / 电气件 / 半成品 / 成品(统一主表收编后按品类细分)
|
||||
t := "批次"
|
||||
if inv.ManageMode == 2 {
|
||||
switch inv.Category {
|
||||
case invCatSemi:
|
||||
t = "半成品"
|
||||
case invCatFinished:
|
||||
t = "成品"
|
||||
default:
|
||||
t = "电气件"
|
||||
}
|
||||
// 类型标签口径统一按管理粒度(manageMode),并对 itemType=4「其他」品类单列(需求24):
|
||||
// itemType=4 → 其他(辅料/工装/试验设备);manageMode=2 → 电气件(SN);manageMode=1 → 结构件(批次)。
|
||||
// 不再混入半成品/成品品类(半成品已在上方排除;成品按 manageMode 归电气件/结构件),
|
||||
// 品类维度在「物料汇总/库存明细」的品类列查看,避免「类型」列口径混乱。
|
||||
t := "结构件"
|
||||
if itemTypeMap[inv.MaterialCode] == invItemOther {
|
||||
t = "其他"
|
||||
} else if inv.ManageMode == 2 {
|
||||
t = "电气件"
|
||||
}
|
||||
key := zc + "|" + inv.QualityStatus + "|" + t
|
||||
g, ok := agg[key]
|
||||
@@ -827,6 +833,18 @@ func lockStockHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
if item.MaterialCode == "" {
|
||||
continue
|
||||
}
|
||||
// 盘点冻结守卫(问题2):盘点期间锁定量亦冻结,禁止新锁定。
|
||||
if item.Sn != "" {
|
||||
if fno := frozenByStocktake(ctx, "", item.Sn, ""); fno != "" {
|
||||
fail(w, http.StatusConflict, "SN "+item.Sn+" 正在盘点单 "+fno+" 锁定中,盘点期间禁止锁定")
|
||||
return
|
||||
}
|
||||
} else if item.BatchNo != "" {
|
||||
if fno := frozenByStocktake(ctx, item.BatchNo, "", ""); fno != "" {
|
||||
fail(w, http.StatusConflict, "批次 "+item.BatchNo+" 正在盘点单 "+fno+" 锁定中,盘点期间禁止锁定")
|
||||
return
|
||||
}
|
||||
}
|
||||
// 电气件:锁 SN(原子:仅 在库 且 合格 才能锁)
|
||||
if item.Sn != "" {
|
||||
aff, err := ctx.EntClient.Inventory.Update().
|
||||
@@ -924,6 +942,21 @@ func unlockStockHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
// 盘点冻结守卫(问题2):盘点期间锁定量亦冻结,禁止解锁。
|
||||
// unlock 无事务且用 SaveX,故先全量校验再释放,避免部分解锁后中断造成不一致。
|
||||
for _, l := range locks {
|
||||
var fno string
|
||||
if l.TargetType == "SN" {
|
||||
fno = frozenByStocktake(ctx, "", l.TargetID, "")
|
||||
} else {
|
||||
fno = frozenByStocktake(ctx, l.TargetID, "", "")
|
||||
}
|
||||
if fno != "" {
|
||||
fail(w, http.StatusConflict, "目标 "+l.TargetID+" 正在盘点单 "+fno+" 锁定中,盘点期间禁止解锁")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
released := 0
|
||||
for _, l := range locks {
|
||||
// 还原批次锁定数 / SN 状态
|
||||
|
||||
Reference in New Issue
Block a user