From a0c5949b3f78b4345784134f43b1cb7364fa2671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 12 Dec 2019 16:49:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AEExcel=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BA=AC=E8=A5=BF=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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) {