Files
bj_power/bj_power_workstation/internal/config/config.go
T
SunYF 5e2640c13a 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 更新
2026-11-07 15:06:00 +08:00

68 lines
3.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package config
import (
"bj_power_workstation/internal/tightening"
"github.com/zeromicro/go-zero/rest"
)
// AuthConfig JWT 登录鉴权配置
// go-zero conf 仅识别 json 标签(yaml/toml 统一转为 JSON 后按此映射)
type AuthConfig struct {
AccessSecret string `json:",default=Hardman_2026"`
AccessExpire int64 `json:",default=1800"` // 有效期(秒)
}
// MesConfig MES 服务地址(内部 API)
type MesConfig struct {
BaseURL string `json:",default=http://127.0.0.1:8888"`
}
// InternalConfig 项目间内部 API 写死 token(请求头 X-API-TOKEN)
type InternalConfig struct {
Token string `json:",default=Hardman_2026"`
}
// SqliteConfig 本地 SQLite 缓存库
type SqliteConfig struct {
Path string `json:",default=workstation.db"`
}
// StationConfig 工位配置:启动时由 yaml 加载到内存,固定本终端工位号。
// 一个工位一个终端,终端不允许修改工位;变更工位只能改配置并重启服务。
type StationConfig struct {
StationNo int `json:",default=1"` // 固定工位号,启动时校验范围
Dock string `json:",default="` // 固定本工位接驳台(AGV 点位编码,如 DOCK01;产线命名 左L/右R),叫料自动送达;工人不可选,仅运维改配置后重启生效。留空=未配置,叫料未选接驳台时明确报错
// 核实4:空闲无操作自动登出阈值(秒)。超时清登录态并失效 Bearer 凭证,
// 强制下一班/换班操作工重新登录,避免共享终端身份错位(张三未登出、李四直接用)。
// 应小于登录 JWT 有效期(AccessExpire),才能真正先于令牌过期拦截"忘了登出"的场景。
IdleLogoutSeconds int64 `json:",default=900"`
}
// PdfCacheConfig 工艺文件 PDF 本地预缓存目录
type PdfCacheConfig struct {
Dir string `json:",default=pdf_cache"` // 本地缓存目录;留空关闭缓存
}
// ScannerConfig 扫码中间件(键盘 HID 注入)开关配置。
// 启用后终端启动时监听 7757,接收网络型扫码枪(iData PAD / 新大陆手机)推送,
// 解析后模拟键盘注入当前光标窗口(任意输入框自动填入,前端无需轮询)。Enable=false 时不监听。
type ScannerConfig struct {
Enabled bool `json:",default=true"`
}
// TighteningConfig 拧紧枪控制器(阿特拉斯 Open Protocol)连接配置。
// Enable=false 时终端不走 OP 自动接收,仍由人工在界面录入扭矩值(兼容无控制器/调试环境)。
// 类型定义见 internal/tightening.TighteningConfig(config 直接复用,避免重复定义)。
type Config struct {
rest.RestConf
Auth AuthConfig `json:",optional"`
Mes MesConfig `json:",optional"`
Internal InternalConfig `json:",optional"`
Sqlite SqliteConfig `json:",optional"`
Station StationConfig `json:",optional"`
PdfCache PdfCacheConfig `json:",optional"`
Tightening tightening.TighteningConfig `json:",optional"`
Scanner ScannerConfig `json:",optional"`
}