feat: 新增拧紧待签任务集中签字功能
新增了巡检终端的拧紧待签任务聚合查询和批量审核签字接口,支持检验员对拧紧任务进行第二签;在权限系统中新增对应按钮权限,前端页面新增指标选择下拉和绩效报表的上机记录页签,同时完善相关帮助文档和配置项。
This commit is contained in:
@@ -27,6 +27,8 @@ const (
|
||||
CfgExtrapCap = "producible.extrap.cap"
|
||||
// CfgLogRetention 事件日志保留天数,超过自动清理(0=不清理)
|
||||
CfgLogRetention = "eventlog.retention.days"
|
||||
// CfgPipelineCache 滚筒线缓存模式(1=启用缓存位并行流转,0=串行不缓存);预留配置,PLC 真机接入时生效
|
||||
CfgPipelineCache = "pipeline_cache"
|
||||
)
|
||||
|
||||
// startedAt 服务启动时刻(本机信息展示用)
|
||||
@@ -40,6 +42,7 @@ type SettingsVO struct {
|
||||
ExtrapWindow int `json:"extrapWindow"` // 外推均值窗口天数
|
||||
ExtrapCap int `json:"extrapCap"` // 外推封顶天数
|
||||
LogRetentionDays int `json:"logRetentionDays"` // 事件日志保留天数(0=不清理)
|
||||
PipelineCache int `json:"pipelineCache"` // 滚筒线缓存模式(1=缓存并行,0=串行;预留,PLC 真机接入时生效)
|
||||
|
||||
// 本机基础信息(只读)
|
||||
LocalIPs []string `json:"localIPs"` // 本机内网 IPv4 列表
|
||||
@@ -57,14 +60,16 @@ type SettingsReq struct {
|
||||
ExtrapWindow *int `json:"extrapWindow"`
|
||||
ExtrapCap *int `json:"extrapCap"`
|
||||
LogRetentionDays *int `json:"logRetentionDays"`
|
||||
PipelineCache *int `json:"pipelineCache"`
|
||||
}
|
||||
|
||||
// defaults 建议默认值(未配置时生效)
|
||||
var settingsDefaults = map[string]int{
|
||||
CfgDemandDays: 5,
|
||||
CfgExtrapWindow: 3,
|
||||
CfgExtrapCap: 365,
|
||||
CfgLogRetention: 0,
|
||||
CfgDemandDays: 5,
|
||||
CfgExtrapWindow: 3,
|
||||
CfgExtrapCap: 365,
|
||||
CfgLogRetention: 0,
|
||||
CfgPipelineCache: 0,
|
||||
}
|
||||
|
||||
// GetSettings 读取基础设置 + 本机信息。DB 读失败时按默认值返回(设置页必须能打开)。
|
||||
@@ -81,6 +86,7 @@ func (s *Service) GetSettings(ctx context.Context) (*SettingsVO, error) {
|
||||
ExtrapWindow: cfgIntFrom(kv, CfgExtrapWindow),
|
||||
ExtrapCap: cfgIntFrom(kv, CfgExtrapCap),
|
||||
LogRetentionDays: cfgIntFrom(kv, CfgLogRetention),
|
||||
PipelineCache: cfgIntFrom(kv, CfgPipelineCache),
|
||||
LocalIPs: localIPv4s(),
|
||||
ListenAddr: fmt.Sprintf("%s:%d", s.ctx.Config.Host, s.ctx.Config.Port),
|
||||
DBInfo: fmt.Sprintf("%s:%d/%s", s.ctx.Config.Database.Host, s.ctx.Config.Database.Port, s.ctx.Config.Database.Dbname),
|
||||
@@ -112,6 +118,7 @@ func (s *Service) SaveSettings(ctx context.Context, req SettingsReq, operator st
|
||||
{CfgExtrapWindow, req.ExtrapWindow, 1, 30, "排产支撑外推均值窗口天数"},
|
||||
{CfgExtrapCap, req.ExtrapCap, 30, 3650, "排产支撑外推封顶天数"},
|
||||
{CfgLogRetention, req.LogRetentionDays, 0, 3650, "事件日志保留天数(0=不清理)"},
|
||||
{CfgPipelineCache, req.PipelineCache, 0, 1, "滚筒线缓存模式(1=启用缓存位并行流转,0=串行不缓存);预留配置,PLC 真机接入时生效"},
|
||||
}
|
||||
for _, it := range items {
|
||||
if it.val == nil {
|
||||
|
||||
Reference in New Issue
Block a user