From 660bf9c52491878547a605f35b10a1c7c52aaa1a Mon Sep 17 00:00:00 2001 From: cjy Date: Thu, 25 Jul 2024 09:32:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E8=88=B1=E8=B4=A7=E7=89=A9=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Method/BookingGoodsStatusConfigService.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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));