feat: 全端体验与稳定性整改(帮助文档清理/收集式报错/操作列统一/托盘与WS通知/物料同步重推)
- 移除 bj_power_dashboard 旧 React 大屏源码(迁移至 2D SVG 方案) - MES/WMS/工位终端前端:清理 help.js 与 PageHelp 帮助文档,统一操作列与布局,接入请求拦截器 - 新增收集式校验错误弹窗(ErrorListDialog 统一拦截 3015,逐条列现象+建议) - 新增托盘程序(tray)与 WebSocket(ws) 实时通知模块(三端共用) - MES/WMS 物料档案新增同步状态字段,补齐双向失败重推与默认角色 seed - 工单/产能/产品工艺/日排产逻辑调整;拧紧枪按工位配置 - 新增迁移 SQL:扭矩按工位、sysconfig 序列修复 - 更新 技术约束/案例/部署手册/项目说明 等文档
This commit is contained in:
@@ -25,6 +25,8 @@ const (
|
||||
CfgDisplayAgeBuckets = "display.age.buckets" // 库龄分档阈值(天,逗号分隔 3 档,升序)
|
||||
// MES 对接(2026-11-02:页面可配,保存即生效;空=回退 yaml 配置)
|
||||
CfgMesBaseURL = "mes.base.url" // MES 服务地址(如 http://127.0.0.1:8888)
|
||||
// 新待办语音播报(问题8):0=关闭 1=开启;每台电脑各自读取、各自播报
|
||||
CfgVoiceNotify = "wms.voice.notify"
|
||||
)
|
||||
|
||||
var wmsSettingsDefaults = map[string]string{
|
||||
@@ -39,6 +41,7 @@ var wmsSettingsDefaults = map[string]string{
|
||||
CfgDisplayStockRefresh: "5",
|
||||
CfgDisplayCallsRefresh: "10",
|
||||
CfgDisplayAgeBuckets: "30,90,180",
|
||||
CfgVoiceNotify: "0",
|
||||
}
|
||||
|
||||
// SettingsVO WMS 基础设置视图(保存即生效)。
|
||||
@@ -54,6 +57,7 @@ type SettingsVO struct {
|
||||
DisplayCallsRefresh int `json:"displayCallsRefresh"` // 备料叫料池刷新间隔(秒)
|
||||
DisplayAgeBuckets string `json:"displayAgeBuckets"` // 库龄分档阈值(天,逗号分隔 3 档)
|
||||
MesBaseURL string `json:"mesBaseURL"` // MES 服务地址(空=用配置文件默认)
|
||||
VoiceNotify int `json:"voiceNotify"` // 新待办语音播报 0=关闭 / 1=开启
|
||||
}
|
||||
|
||||
func cfgStr(kv map[string]string, key, def string) string {
|
||||
@@ -104,6 +108,7 @@ func SettingsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
DisplayCallsRefresh: cfgInt(kv, CfgDisplayCallsRefresh, 10),
|
||||
DisplayAgeBuckets: cfgStr(kv, CfgDisplayAgeBuckets, wmsSettingsDefaults[CfgDisplayAgeBuckets]),
|
||||
MesBaseURL: strings.TrimRight(cfgStr(kv, CfgMesBaseURL, ""), "/"),
|
||||
VoiceNotify: cfgInt(kv, CfgVoiceNotify, 0),
|
||||
}
|
||||
ok(w, vo)
|
||||
}
|
||||
@@ -164,6 +169,10 @@ func SaveSettingsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
}
|
||||
if req.VoiceNotify != 0 && req.VoiceNotify != 1 {
|
||||
fail(w, http.StatusBadRequest, "新待办语音播报开关仅支持 0(关闭)/ 1(开启)")
|
||||
return
|
||||
}
|
||||
kv := map[string]string{
|
||||
CfgArchiveRemindDays: strconv.Itoa(req.ArchiveRemindDays),
|
||||
CfgArchiveBackupPath: strings.TrimSpace(req.ArchiveBackupPath),
|
||||
@@ -175,8 +184,9 @@ func SaveSettingsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
CfgDisplayStockRefresh: strconv.Itoa(req.DisplayStockRefresh),
|
||||
CfgDisplayCallsRefresh: strconv.Itoa(req.DisplayCallsRefresh),
|
||||
CfgDisplayAgeBuckets: strconv.Itoa(buckets[0]) + "," + strconv.Itoa(buckets[1]) + "," + strconv.Itoa(buckets[2]),
|
||||
CfgMesBaseURL: mesURL,
|
||||
}
|
||||
CfgMesBaseURL: mesURL,
|
||||
CfgVoiceNotify: strconv.Itoa(req.VoiceNotify),
|
||||
}
|
||||
for k, v := range kv {
|
||||
if err := upsertConfig(ctx, k, v, ""); err != nil {
|
||||
fail(w, http.StatusInternalServerError, err.Error())
|
||||
@@ -224,6 +234,7 @@ type DisplayConfigVO struct {
|
||||
RefreshSeconds int `json:"refreshSeconds"` // 概览刷新间隔(秒)
|
||||
CallsRefreshSeconds int `json:"callsRefreshSeconds"` // 备料叫料池刷新间隔(秒)
|
||||
AgeBuckets []int `json:"ageBuckets"` // 库龄分档阈值(天,3 档升序)
|
||||
VoiceNotify int `json:"voiceNotify"` // 新待办语音播报 0=关闭 / 1=开启(免登录供前端读取)
|
||||
}
|
||||
|
||||
// displayConfigHandler GET /api/display/config 大屏运行配置(免登录,与 overview 同组)。
|
||||
@@ -236,7 +247,8 @@ func displayConfigHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
RefreshSeconds: cfgInt(kv, CfgDisplayStockRefresh, 5),
|
||||
CallsRefreshSeconds: cfgInt(kv, CfgDisplayCallsRefresh, 10),
|
||||
AgeBuckets: AgeBucketsFromConfig(ctx),
|
||||
})
|
||||
VoiceNotify: cfgInt(kv, CfgVoiceNotify, 0),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user