feat: 参数配置重置示例数据是记一次操作日志
This commit is contained in:
@@ -15,13 +15,16 @@ import (
|
||||
|
||||
// NewPtNeConfigDataService 实例化服务层
|
||||
var NewPtNeConfigDataService = &PtNeConfigDataService{
|
||||
ptNeConfigDataRepository: repository.NewPtNeConfigDataRepository,
|
||||
neConfigService: neService.NewNeConfigImpl,
|
||||
neInfoService: neService.NewNeInfoImpl,
|
||||
ptNeConfigDataLogRepository: repository.NewPtNeConfigDataLogRepository,
|
||||
ptNeConfigDataRepository: repository.NewPtNeConfigDataRepository,
|
||||
neConfigService: neService.NewNeConfigImpl,
|
||||
neInfoService: neService.NewNeInfoImpl,
|
||||
}
|
||||
|
||||
// PtNeConfigDataService 服务层处理
|
||||
type PtNeConfigDataService struct {
|
||||
// 实训教学_网元参数配置数据变更日志
|
||||
ptNeConfigDataLogRepository repository.IPtNeConfigDataLogRepository
|
||||
// 实训教学_网元参数配置表
|
||||
ptNeConfigDataRepository repository.IPtNeConfigDataRepository
|
||||
// 网元参数配置可用属性值服务
|
||||
@@ -171,6 +174,19 @@ func (r *PtNeConfigDataService) ResetAsDefault(operaUserName, stubType, neType,
|
||||
ParamJson: v.ParamJson,
|
||||
DeptId: deptId,
|
||||
})
|
||||
// 保留变更日志
|
||||
changeLog := model.PtNeConfigDataLog{
|
||||
CreateBy: operaUserName,
|
||||
StubType: stubType,
|
||||
NeType: v.NeType,
|
||||
ParamName: v.ParamName,
|
||||
ParamDisplay: v.ParamDisplay,
|
||||
ParamType: v.ParamType,
|
||||
OperaType: 0,
|
||||
ParamJsonOld: "[]",
|
||||
ParamJsonNew: v.ParamJson,
|
||||
}
|
||||
r.ptNeConfigDataLogRepository.Insert(changeLog)
|
||||
}
|
||||
// 更新
|
||||
if len(hasItems) == 1 {
|
||||
@@ -180,6 +196,19 @@ func (r *PtNeConfigDataService) ResetAsDefault(operaUserName, stubType, neType,
|
||||
item.ParamJson = v.ParamJson
|
||||
item.DeptId = deptId
|
||||
r.Update(item)
|
||||
// 保留变更日志
|
||||
changeLog := model.PtNeConfigDataLog{
|
||||
CreateBy: operaUserName,
|
||||
StubType: hasItems[0].StubType,
|
||||
NeType: v.NeType,
|
||||
ParamName: v.ParamName,
|
||||
ParamDisplay: v.ParamDisplay,
|
||||
ParamType: v.ParamType,
|
||||
OperaType: 0,
|
||||
ParamJsonOld: hasItems[0].ParamJson,
|
||||
ParamJsonNew: v.ParamJson,
|
||||
}
|
||||
r.ptNeConfigDataLogRepository.Insert(changeLog)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user