|
|
@@ -471,6 +471,50 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
|
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 更具id查询商品信息 |
|
|
|
/// </summary> |
|
|
|
/// <param name="ids"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<List<GoodsInfoBaseView>> GetGoodsList(List<string> ids) |
|
|
|
{ |
|
|
|
var res = await _db.Queryable<BPA_GoodsInfo>() |
|
|
|
.Where((a) => a.IsDeleted == 0 && ids.Contains(a.Id)) |
|
|
|
.OrderBy(a => a.CreateAt, OrderByType.Desc) |
|
|
|
.Select((a) => new GoodsInfoBaseView |
|
|
|
{ |
|
|
|
Id = a.Id, |
|
|
|
Code = a.Code, |
|
|
|
Name = a.Name, |
|
|
|
Price = a.Price, |
|
|
|
ImgUrl = a.ImgUrl, |
|
|
|
Status = a.Status, |
|
|
|
GoodsTypeId = a.GoodsTypeId, |
|
|
|
GoodsTypeName = SqlFunc.Subqueryable<BPA_GoodsType>().Where(s => s.Id == a.GoodsTypeId && s.IsDeleted == 0).Select(s => s.Name), |
|
|
|
Remark = a.Descritption, |
|
|
|
// CreateAt = a.CreateAt, |
|
|
|
GoodsUintId = a.GoodsUintId, |
|
|
|
IsAttrubute = a.IsAttrubute, |
|
|
|
GoodsUintName = SqlFunc.Subqueryable<BPA_GoodsUint>().Where(s => s.Id == a.GoodsUintId && s.IsDeleted == 0).Select(s => s.Name), |
|
|
|
//GoodsAttributeList = new List<GoodsAttributeList>() |
|
|
|
}).ToListAsync(); |
|
|
|
|
|
|
|
foreach (var item in res) |
|
|
|
{ |
|
|
|
if (!item.IsAttrubute) |
|
|
|
{ |
|
|
|
item.GoodsAttributeList = await _goodsAttributeService.GetByNameAttribute("默认属性"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
item.GoodsAttributeList = await _goodsAttributeService.GetByGoodsIdAttribute(item.Id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<bool> ExportGood(IFormFile file) |
|
|
|
{ |
|
|
|
bool isReplace = true; |
|
|
|