diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingGoodsStatusConfigService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingGoodsStatusConfigService.cs index 206659fb..3dca6051 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingGoodsStatusConfigService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingGoodsStatusConfigService.cs @@ -141,7 +141,25 @@ namespace DS.WMS.Core.Op.Method stream.Position = 0; //将内存流转成List集合 var list = await stream.QueryAsync(); - var configs = list.Adapt(); + var configs = new List(); + foreach (var item in list) + { + var config = new BookingGoodsStatusConfig() + { + SystemCode = item.SystemCode, + StatusName = item.StatusName, + StatusColor = item.StatusColor, + Note = item.Note, + OrderNo = item.OrderNo, + }; + configs.Add(config); + } + var codes = configs.Select(c => c.SystemCode).ToList(); + if (tenantDb.Queryable().Where(x=> codes.Contains(x.SystemCode)).Any()) { + + return DataResult.Failed("存在已有的系统编码,请检查"); + } + //var configs = list.Adapt(); await tenantDb.Insertable(configs).ExecuteCommandAsync(); return await Task.FromResult(DataResult.Failed("导入成功!", MultiLanguageConst.DataImportSuccess));