diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 78e8eb85f..732e10625 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2381,6 +2381,7 @@ func StoreSkuNamePriceList2Map(ctx *jxcontext.Context, storeSkuNamePriceList []* } func GetCellIntoStruct(rowNum int, row []string, sheetParam *SheetParam, storeSkuNamePrice *model.StoreSkuNamePrice) (errMsg string) { + var nameMap = make(map[string]string) for k, cell := range row { if k == sheetParam.OutSkuIDCol { if IsChineseChar(cell) { @@ -2399,6 +2400,14 @@ func GetCellIntoStruct(rowNum int, row []string, sheetParam *SheetParam, storeSk } } storeSkuNamePrice.NameIDGroup = cellReplace + nameIDs := strings.Split(cellReplace, ",") + for _, v := range nameIDs { + if nameMap[v] != "" { + return fmt.Sprintf("Excel中含有重复的nameID![%v]列,[%v]行,nameID [%v]", k+1, rowNum+1, v) + } else { + nameMap[v] = v + } + } } if k == sheetParam.SkuPriceCol { if IsChineseChar(cell) {