...
|
...
|
@@ -31,69 +31,85 @@ func (l *SearchTableByModuleLogic) SearchTableByModule(req *types.SearchTableByM |
|
|
var batchError errorx.BatchError
|
|
|
fx.Parallel(func() {
|
|
|
mResp, err := l.getTableByLocal([]string{bytelib.MainTable, bytelib.SubTable, bytelib.SideTable})
|
|
|
if err == nil {
|
|
|
result["导入模块"] = mResp
|
|
|
} else {
|
|
|
list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
Token: req.Token,
|
|
|
TableTypes: []string{bytelib.MainTable, bytelib.SubTable, bytelib.SideTable},
|
|
|
Module: bytelib.ModuleChartTemplate, // TODO:字库更新完改为只查 bytelib.ModuleChartTemplate
|
|
|
})
|
|
|
if err != nil {
|
|
|
batchError.Add(err)
|
|
|
}
|
|
|
result["导入模块"] = newList(list)
|
|
|
}
|
|
|
result["导入模块"] = mResp
|
|
|
//if err == nil {
|
|
|
// result["导入模块"] = mResp
|
|
|
//} else {
|
|
|
// list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
// Token: req.Token,
|
|
|
// TableTypes: []string{bytelib.MainTable, bytelib.SubTable, bytelib.SideTable},
|
|
|
// Module: bytelib.ModuleChartTemplate, // TODO:字库更新完改为只查 bytelib.ModuleChartTemplate
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// batchError.Add(err)
|
|
|
// }
|
|
|
// result["导入模块"] = newList(list)
|
|
|
//}
|
|
|
}, func() {
|
|
|
mResp, err := l.getTableByLocal([]string{bytelib.SchemaTable})
|
|
|
if err == nil {
|
|
|
result["拆解模块"] = mResp
|
|
|
} else {
|
|
|
list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
Token: req.Token,
|
|
|
TableTypes: []string{bytelib.SchemaTable},
|
|
|
Module: bytelib.ModuleQuerySetCenter,
|
|
|
ReturnGroupItem: true,
|
|
|
})
|
|
|
if err != nil {
|
|
|
batchError.Add(err)
|
|
|
}
|
|
|
result["拆解模块"] = newList(list)
|
|
|
}
|
|
|
result["拆解模块"] = mResp
|
|
|
//if err == nil {
|
|
|
// result["拆解模块"] = mResp
|
|
|
//} else {
|
|
|
// list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
// Token: req.Token,
|
|
|
// TableTypes: []string{bytelib.SchemaTable},
|
|
|
// Module: bytelib.ModuleQuerySetCenter,
|
|
|
// ReturnGroupItem: true,
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// batchError.Add(err)
|
|
|
// }
|
|
|
// result["拆解模块"] = newList(list)
|
|
|
//}
|
|
|
}, func() {
|
|
|
mResp, err := l.getTableByLocal([]string{bytelib.CalculateItem})
|
|
|
if err == nil {
|
|
|
result["计算项"] = mResp
|
|
|
} else {
|
|
|
list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
Token: req.Token,
|
|
|
TableTypes: []string{bytelib.CalculateItem},
|
|
|
Module: bytelib.ModuleCalculateCenter,
|
|
|
ReturnGroupItem: true,
|
|
|
ExcludeTables: []int{0},
|
|
|
})
|
|
|
if err != nil {
|
|
|
batchError.Add(err)
|
|
|
}
|
|
|
result["计算项"] = newList(list)
|
|
|
}
|
|
|
result["计算项"] = mResp
|
|
|
//if err == nil {
|
|
|
// result["计算项"] = mResp
|
|
|
//} else {
|
|
|
// list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
// Token: req.Token,
|
|
|
// TableTypes: []string{bytelib.CalculateItem},
|
|
|
// Module: bytelib.ModuleCalculateCenter,
|
|
|
// ReturnGroupItem: true,
|
|
|
// ExcludeTables: []int{0},
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// batchError.Add(err)
|
|
|
// }
|
|
|
// result["计算项"] = newList(list)
|
|
|
//}
|
|
|
}, func() {
|
|
|
mResp, err := l.getTableByLocal([]string{bytelib.CalculateSet})
|
|
|
if err == nil {
|
|
|
result["计算集"] = mResp
|
|
|
} else {
|
|
|
list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
Token: req.Token,
|
|
|
TableTypes: []string{bytelib.CalculateSet},
|
|
|
Module: bytelib.ModuleCalculateCenter,
|
|
|
ReturnGroupItem: true,
|
|
|
ExcludeTables: []int{0},
|
|
|
})
|
|
|
if err != nil {
|
|
|
batchError.Add(err)
|
|
|
}
|
|
|
result["计算集"] = newList(list)
|
|
|
}
|
|
|
result["计算集"] = mResp
|
|
|
//if err == nil {
|
|
|
// result["计算集"] = mResp
|
|
|
//} else {
|
|
|
// list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{
|
|
|
// Token: req.Token,
|
|
|
// TableTypes: []string{bytelib.CalculateSet},
|
|
|
// Module: bytelib.ModuleCalculateCenter,
|
|
|
// ReturnGroupItem: true,
|
|
|
// ExcludeTables: []int{0},
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// batchError.Add(err)
|
|
|
// }
|
|
|
// result["计算集"] = newList(list)
|
|
|
//}
|
|
|
})
|
|
|
if err = batchError.Err(); err != nil {
|
|
|
logx.Error(err)
|
...
|
...
|
@@ -132,6 +148,7 @@ func (l *SearchTableByModuleLogic) getTableByLocal(modules []string) (types.Sear |
|
|
Name: item.Name,
|
|
|
ParentId: item.ParentId,
|
|
|
Flag: item.Flag,
|
|
|
IsLocal: item.IsLocal,
|
|
|
})
|
|
|
}
|
|
|
return response, nil
|
...
|
...
|
|