fuwencai 4 éve
szülő
commit
d1638c069b
1 módosított fájl, 3 hozzáadás és 4 törlés
  1. 3 4
      service/deduplication.go

+ 3 - 4
service/deduplication.go

@@ -247,7 +247,9 @@ func (service *DeduplicationService) DataDeduplicateAndSave(data *deduplication.
 	err := orm.Table(tableName).Cols("info_id").Where(selectSql, valueList...).Find(&rs)
 	existInfoIdMap := map[string]bool{}
 	existIdList := []string{}
+	existIdMap := map[string]bool{}
 	for _, v := range rs {
+		existIdMap[v.InfoId] = true
 		if existInfoIdMap[v.InfoId] {
 			continue
 		}else {
@@ -266,10 +268,7 @@ func (service *DeduplicationService) DataDeduplicateAndSave(data *deduplication.
 	}
 
 
-	existIdMap := map[string]bool{}
-	for _, v := range rs {
-		existIdMap[v.InfoId] = true
-	}
+
 	// 新增
 	var insertList []entity.Deduplication
 	for _, id := range infoIdList {