Files
bj_power/bj_power_mes/internal/config/config.go
T
SunYF 450a094f0e feat: 装配线看板修正、统一密钥Hardman_2026、操作日志追溯、日志按天存储
Dashboard 移除 CNC/清洗机等不存在设备,改为纯装配线看板(扫码枪+拧紧枪+人工);JWT/内部token统一为 Hardman_2026 写入各 etc/*.yaml,MES 建表 DSN 改读 yaml;event_log 增加 workOrderNo/operator,BOM/备料/PLC下发/拧紧/扫码报工/半成品/AGV 全链路埋点,日志页支持工单号/操作人筛选;MES/WMS 日志按天存储(dailyWriter),WMS SetWriter 用 logx.NewWriter 适配
2026-08-28 09:22:19 +08:00

76 lines
2.1 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=Hardman_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=Hardman_2026"`
}
Mom MomConfig `json:"MOM"`
}