feat: AGV点位锁与缓存迁移 + 工位终端去离线队列 + WMS出入库增强

【MES】
- AGV点位/线路点位/AGV任务/工单 ent schema 重构(全量重生成 ent 代码)
- 新增派车锁 agv_point_lock.go:目标点位占用即拒车,JBT21 库房接驳台卸货后保持锁定待库管手动解锁
- 新增进程内 TTL 缓存 cache.go,由 Redis 看板缓存迁移至内存(singleflight 防击穿,去除外部依赖)
- AGV 三段链安全机制、车辆状态/接驳台左右互换、补料损耗闭环完善
- 来料检/工序卡/工单/质检/日排产/AGV 前端与帮助文档更新
- 新增 migrations/、sql/ 目录

【WMS】
- 出库、Excel 导出、物料、路由处理增强
- 配置与 DB 初始化调整;基础数据/成品入库/入库前端调整

【工位终端】
- 移除离线同步队列(syncer 包、sync.go、SyncQueueDialog.vue),改为实时直连上报 MES(断网即失败报错),以本人身份操作
- 本地 SQLite 仅保留操作日志 + 内置账号 + 登录态;保留空闲自动登出

【文档】
- 删除 AGV海康litev1.5.md;案例.md 更新
This commit is contained in:
SunYF
2026-11-07 15:06:00 +08:00
parent 1d1dc1bdd8
commit 5e2640c13a
118 changed files with 4040 additions and 3594 deletions
+16 -5
View File
@@ -17,16 +17,18 @@ type LinePoint struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
// FEED上料位/STATION工位/CACHE缓存位/DOCK接驳台/END末端
// STATION工位/STOP主线停靠位(不缓存)/CACHE主线缓存位(可缓存)/END末端;FEED上料位已废弃删除
PointType string `json:"pointType,omitempty"`
// 点位编号:IN上料位 / 1~10工位 / C1~C8缓存位 / 1-R1接驳台 / END-U上排末端 / END-D下排末端
// 点位编号:1~10工位 / C1~C15主线位置(C1/C4/C7/C10/C13/C15=停靠位,其余=缓存位)/ END-U上排末端 / END-D下排末端
PointNo string `json:"pointNo,omitempty"`
// 点位名称
Label string `json:"label,omitempty"`
// 传送带顺序(上料位→工位→末端,用于相邻缓存位判定)
// 传送带顺序(上料位→主线C1~C15→末端,用于相邻缓存位判定)
Seq int `json:"seq,omitempty"`
// 所属工位号(DOCK/CACHE 归属;0=无)
// 所属工位号(归属;0=无)
StationNo int `json:"stationNo,omitempty"`
// 是否可缓存(主线位置属性:C2/C3/C5/C6/C8/C9/C11/C12/C14=true;停靠位/工位/末端=false)
Cacheable bool `json:"cacheable,omitempty"`
// 当前存放工件SN(空=空闲)
CurrentSn string `json:"currentSn,omitempty"`
// 当前工件所属工单号
@@ -43,7 +45,7 @@ func (*LinePoint) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case linepoint.FieldOccupied:
case linepoint.FieldCacheable, linepoint.FieldOccupied:
values[i] = new(sql.NullBool)
case linepoint.FieldID, linepoint.FieldSeq, linepoint.FieldStationNo:
values[i] = new(sql.NullInt64)
@@ -102,6 +104,12 @@ func (_m *LinePoint) assignValues(columns []string, values []any) error {
} else if value.Valid {
_m.StationNo = int(value.Int64)
}
case linepoint.FieldCacheable:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field cacheable", values[i])
} else if value.Valid {
_m.Cacheable = value.Bool
}
case linepoint.FieldCurrentSn:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field currentSn", values[i])
@@ -177,6 +185,9 @@ func (_m *LinePoint) String() string {
builder.WriteString("stationNo=")
builder.WriteString(fmt.Sprintf("%v", _m.StationNo))
builder.WriteString(", ")
builder.WriteString("cacheable=")
builder.WriteString(fmt.Sprintf("%v", _m.Cacheable))
builder.WriteString(", ")
builder.WriteString("currentSn=")
builder.WriteString(_m.CurrentSn)
builder.WriteString(", ")