Browse Source

后厨商品下载优化20241113

kitchenmanage
gwbvipvip 1 month ago
parent
commit
14726a34f9
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs

+ 13
- 1
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs View File

@@ -2494,7 +2494,19 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
var stopInfo = JsonConvert.DeserializeObject<ResultSAASManageDto<StoreDto>>(HttpHelper.HttpGet(url, null, dic, "application/json"));
if (stopInfo?.data == null)
throw Oops.Oh("店铺不存在!");
var goodInfoList = exportDto.GoodId != null ? await _db.Queryable<BPA_GoodsInfo>().Where(t => t.Id == exportDto.GoodId).ToListAsync() : await _db.Queryable<BPA_GoodsInfo>().Where(t => exportDto.GoodsId.Contains(t.Id)).ToListAsync();
var goodInfoList = new List<BPA_GoodsInfo>();
if (exportDto.GoodsId.Any())
goodInfoList = await _db.Queryable<BPA_GoodsInfo>().Where(t => exportDto.GoodsId.Contains(t.Id)).ToListAsync();
else
{
if (exportDto.GoodId != null)
goodInfoList = await _db.Queryable<BPA_GoodsInfo>().Where(t => t.Id == exportDto.GoodId).ToListAsync();
else
{
var goodIds = await _db.Queryable<BPA_GoodsTechnologyAction>().Where(t => t.DeviceId == exportDto.DeviceId).Select(q => q.GoodsId).Distinct().ToListAsync();
goodInfoList = await _db.Queryable<BPA_GoodsInfo>().Where(t => goodIds.Contains(t.Id)).ToListAsync();
}
}
if (goodInfoList.Count == 0)
{
var templateUrl = "https://bpa.oss-cn-chengdu.aliyuncs.com/hkerp/test/goods//商品模版.xlsx";


Loading…
Cancel
Save