...
|
...
|
@@ -13,6 +13,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/infrastructure/excel"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/infrastructure/starrocks"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/infrastructure/utils"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
...
|
...
|
@@ -311,6 +312,39 @@ func (querySetService *QuerySetService) SearchQuerySet(ctx *domain.Context, sear |
|
|
return nil, factory.FastError(err)
|
|
|
}
|
|
|
|
|
|
if len(searchQuerySetQuery.MatchName) > 0 {
|
|
|
mapQuerySet := (domain.QuerySets(querySets)).ToMap()
|
|
|
tmpQuerySets := make([]*domain.QuerySet, 0)
|
|
|
for _, item := range querySets {
|
|
|
if strings.Contains(item.Name, searchQuerySetQuery.MatchName) {
|
|
|
tmpQuerySets = append(tmpQuerySets, item)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
tmpParentQuerySets := make([]*domain.QuerySet, 0)
|
|
|
mapTmpParentQuerySets := (domain.QuerySets(tmpQuerySets)).ToMap()
|
|
|
for _, item := range tmpQuerySets {
|
|
|
var parentId = item.ParentId
|
|
|
for {
|
|
|
if parentId <= 0 {
|
|
|
break
|
|
|
}
|
|
|
v, ok := mapQuerySet[parentId]
|
|
|
if !ok {
|
|
|
break
|
|
|
}
|
|
|
if _, ok := mapTmpParentQuerySets[v.QuerySetId]; !ok {
|
|
|
mapTmpParentQuerySets[v.QuerySetId] = v
|
|
|
tmpParentQuerySets = append(tmpParentQuerySets, v)
|
|
|
}
|
|
|
parentId = v.ParentId
|
|
|
}
|
|
|
}
|
|
|
|
|
|
tmpQuerySets = append(tmpQuerySets, tmpParentQuerySets...)
|
|
|
querySets = tmpQuerySets
|
|
|
}
|
|
|
|
|
|
var result = dto.NewQuerySetDtoList(querySets)
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
...
|
...
|
|