|
|
@ -141,7 +141,25 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
stream.Position = 0;
|
|
|
|
stream.Position = 0;
|
|
|
|
//将内存流转成List集合
|
|
|
|
//将内存流转成List集合
|
|
|
|
var list = await stream.QueryAsync<BookingStatusConfigExcelReq>();
|
|
|
|
var list = await stream.QueryAsync<BookingStatusConfigExcelReq>();
|
|
|
|
var configs = list.Adapt<BookingGoodsStatusConfig>();
|
|
|
|
var configs = new List<BookingGoodsStatusConfig>();
|
|
|
|
|
|
|
|
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<BookingGoodsStatusConfig>().Where(x=> codes.Contains(x.SystemCode)).Any()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult<string>.Failed("存在已有的系统编码,请检查");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//var configs = list.Adapt<BookingGoodsStatusConfig>();
|
|
|
|
await tenantDb.Insertable(configs).ExecuteCommandAsync();
|
|
|
|
await tenantDb.Insertable(configs).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("导入成功!", MultiLanguageConst.DataImportSuccess));
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("导入成功!", MultiLanguageConst.DataImportSuccess));
|
|
|
|