Files
bj_power/bj_power_mes/internal/config/config.go
T
SunYF a2afd2f6dc feat: 五项目业务实现并对接完成
- MES(B): 工单/BOM/备料/工序字典/PLC下发/拧紧/扫码报工/半成品/AGV/追溯逻辑,WMS与海康RCS客户端,看板Redis缓存API(概览/设备/进度/报警/趋势)+SSE
- WMS(C): JWT滑动续签、Excel导入、盘点、内部API、种子数据、独立Postgres配置
- WMS客户端(E): Go网关8891反向代理+内嵌Vue3十页
- 工位终端(D): SQLite本地缓存+模拟拧紧源+内嵌Vue3页面
- Dashboard(A): 看板数据改接MES内部缓存API,SSE实时刷新+vite代理
- 清理各项目球形磨遗留代码,新增部署手册.md
2026-08-27 19:50:57 +08:00

76 lines
2.2 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 (
xlog "bj_power_mes/common/logx"
"bj_power_mes/internal/db"
"bj_power_mes/internal/plc"
"bjhardman.cn/bjhardman/mom"
"github.com/zeromicro/go-zero/core/stores/redis"
"github.com/zeromicro/go-zero/rest"
)
// MomConfig 扩展 MOM SDK 配置,增加启用开关 + 业务配置
type MomConfig struct {
Enable bool `json:",default=false"`
mom.MomConf
// InstoreType 入库类型 1:立库 2:平库
InstoreType int `json:",default=1"`
// EquipUploadHour 设备数据每日上传整点(0-23),上传前一日数据
EquipUploadHour int `json:",default=10"`
// EquipUploadDevices 上传范围 device_type 列表,留空则上传所有 OKUMA 设备
EquipUploadDeviceTypes []string `json:",optional"`
// StationDockMap MOM站台码 ↔ 内部接驳台号 映射表
// key=MOM stationCodestring),value=内部 dockNoint
// stationCode 格式: 9 + 两位产线编号 + 三位流水号 (如 901001 = 产线01, 1号接驳台)
StationDockMap map[string]int `json:",optional"`
}
type Config struct {
rest.RestConf
Logger xlog.LogConf
Auth struct {
AccessSecret string
AccessExpire int
RefreshExpire int
}
Upload struct {
Dir string `json:",default=./uploads"`
RetentionDays int `json:",default=30"`
}
Redis redis.RedisConf
Database db.DatabaseConf
Plc plc.PlcConf `json:"PLC"`
Mock struct {
Enable bool `json:",default=false"`
MockRun bool `json:",default=false"`
}
// WMS 服务(库存系统 C
Wms struct {
BaseURL string `json:",default=http://127.0.0.1:8890"`
Token string `json:",default=bj-power-internal-2026"` // X-API-TOKEN 写死内部 token
}
// 海康 RCS-2000 AGV 调度
AgvRcs struct {
Sim bool `json:",default=true"` // 模拟模式:不真正调 RCS,直接成功
BaseURL string `json:",optional"` // 如 http://192.168.1.210:8099
AppKey string `json:",optional"`
AppSecret string `json:",optional"`
Version string `json:",default=v1.0"` // 接口版本号,签名必填项之一
}
// 项目间内部 API(工位终端 D 等调用)写死 token
Internal struct {
Token string `json:",default=bj-power-internal-2026"`
}
Mom MomConfig `json:"MOM"`
}