Browse Source

fix:列表全选,然后过滤不选的数据,需要价格字段做区分

Roc 11 months ago
parent
commit
dd7351ca06
3 changed files with 15 additions and 14 deletions
  1. 1 1
      controllers/data_manage/edb_info.go
  2. 9 8
      models/data_manage/edb_info.go
  3. 5 5
      services/data/edb_info.go

+ 1 - 1
controllers/data_manage/edb_info.go

@@ -4025,7 +4025,7 @@ func (this *EdbInfoController) MoveEdbChartUser() {
 		return
 	}
 
-	err, errMsg := data.MoveEdbChart(req.Source, req.SubSource, req.UserId, req.NewUserId, req.IsSelectAll, req.DataIdList, req.Keyword, req.ClassifyId)
+	err, errMsg := data.MoveEdbChart(req.Source, req.SubSource, req.UserId, req.NewUserId, req.IsSelectAll, req.DataIdList, req.NoDataIdList, req.Keyword, req.ClassifyId)
 	if err != nil {
 		//br.Success = true
 		br.Msg = "移动失败"

+ 9 - 8
models/data_manage/edb_info.go

@@ -1608,14 +1608,15 @@ type MoveEdbChartListResp struct {
 
 // MoveEdbChartReq 转移指标/图表的请求
 type MoveEdbChartReq struct {
-	Source      int      `description:"来源id"`
-	SubSource   int      `description:"子来源id"`
-	DataIdList  []string `description:"指标/图表唯一id列表"`
-	NewUserId   int      `description:"新的创建人id"`
-	IsSelectAll bool     `description:"是否选择所有指标"`
-	ClassifyId  string   `description:"分类id,支持多选,用英文,隔开"`
-	Keyword     string   `description:"关键字"`
-	UserId      int      `description:"旧的创建人id"`
+	Source       int      `description:"来源id"`
+	SubSource    int      `description:"子来源id"`
+	DataIdList   []string `description:"指标/图表唯一id列表"`
+	NoDataIdList []string `description:"指标/图表唯一id列表"`
+	NewUserId    int      `description:"新的创建人id"`
+	IsSelectAll  bool     `description:"是否选择所有指标"`
+	ClassifyId   string   `description:"分类id,支持多选,用英文,隔开"`
+	Keyword      string   `description:"关键字"`
+	UserId       int      `description:"旧的创建人id"`
 }
 
 // MoveAllEdbChartReq 转移所有的指标/图表的请求

+ 5 - 5
services/data/edb_info.go

@@ -1974,7 +1974,7 @@ func GetMoveEdbChartList(source, subSource, userId int, keyword, classify string
 
 // MoveEdbChart 转移指标/图表创建人
 // @param source 来源 :1:手工数据指标 2:钢联化工数据库 3:ETA指标库 4:ETA预测指标 5:图库 6:ETA表格
-func MoveEdbChart(source, subSource, oldUserId, newUserId int, isSelectAll bool, dataId []string, keyword, classify string) (err error, errMsg string) {
+func MoveEdbChart(source, subSource, oldUserId, newUserId int, isSelectAll bool, dataId, noDataId []string, keyword, classify string) (err error, errMsg string) {
 	adminInfo, err := system.GetSysAdminById(newUserId)
 	if err != nil {
 		return
@@ -1983,9 +1983,9 @@ func MoveEdbChart(source, subSource, oldUserId, newUserId int, isSelectAll bool,
 	// 如果勾选全部数据,那么
 	if isSelectAll {
 		// 找出不要的指标ID列表
-		dataIdMap := make(map[string]string, 0)
-		for _, v := range dataId {
-			dataIdMap[v] = v
+		noDataIdMap := make(map[string]string, 0)
+		for _, v := range noDataId {
+			noDataIdMap[v] = v
 		}
 
 		// 需要转义的指标/图表ID列表
@@ -1997,7 +1997,7 @@ func MoveEdbChart(source, subSource, oldUserId, newUserId int, isSelectAll bool,
 			return
 		}
 		for _, v := range list {
-			if _, ok := dataIdMap[v.DataId]; !ok {
+			if _, ok := noDataIdMap[v.DataId]; !ok {
 				dataId = append(dataId, v.DataId)
 			}
 		}