ref: v3变更,,完成整合,同步v2.2508.4 -250902

This commit is contained in:
TsMask
2025-09-06 11:17:18 +08:00
parent 382bc311e6
commit 10cf6bbd2a
36 changed files with 527 additions and 478 deletions

View File

@@ -295,20 +295,20 @@ func (r TraceTask) traceNeTask(neInfo neModel.NeInfo, task model.TraceTask) erro
}
// DeleteByIds 批量删除信息
func (r TraceTask) DeleteByIds(id int64, coreUid string) (int64, error) {
func (r TraceTask) DeleteByIds(ids []int64, coreUid string) (int64, error) {
// 检查是否存在
rows := r.traceTaskRepository.SelectByIds([]int64{id})
if len(rows) != 1 {
return 0, fmt.Errorf("not data")
arr := r.traceTaskRepository.SelectByIds(ids)
if len(arr) != len(ids) {
return 0, fmt.Errorf("not match id")
}
for _, v := range rows {
for _, v := range arr {
if v.CoreUID != coreUid {
return 0, fmt.Errorf("data not match, id: %d", v.ID)
}
}
// 删除数据同时给网元发送停止任务
for _, v := range rows {
for _, v := range arr {
// 删除数据
r.traceDataRepository.DeleteByTraceId(v.TraceId)
@@ -332,7 +332,7 @@ func (r TraceTask) DeleteByIds(id int64, coreUid string) (int64, error) {
}
}
num := r.traceTaskRepository.DeleteByIds([]int64{id})
num := r.traceTaskRepository.DeleteByIds(ids)
return num, nil
}