|
|
@@ -206,15 +206,15 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services |
|
|
|
/// </summary> |
|
|
|
/// <param name="ids"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<bool> DeleteGoods(string[] ids) |
|
|
|
public async Task<bool> DeleteGoods(DeleteGoodsDto dto) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
SqlSugarDb.Db.BeginTran(); |
|
|
|
var goods = SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().Where(x => ids.Contains(x.Id)).ToList(); |
|
|
|
var goods = SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().Where(x => dto.Ids.Contains(x.Id)).ToList(); |
|
|
|
if (goods == null) throw Oops.Oh(ErrorCodeEnum.Code1008); |
|
|
|
var goodsbom = SqlSugarDb.Db.Queryable<BPA_GoodsBom>().Where(x => ids.Contains( x.Goods_Id)).ToList(); |
|
|
|
var goodsTechnology = SqlSugarDb.Db.Queryable<BPA_GoodsTechnologyAction>().Where(x => ids.Contains(x.GoodsId)).ToList(); |
|
|
|
var goodsbom = SqlSugarDb.Db.Queryable<BPA_GoodsBom>().Where(x => dto.Ids.Contains( x.Goods_Id)).ToList(); |
|
|
|
var goodsTechnology = SqlSugarDb.Db.Queryable<BPA_GoodsTechnologyAction>().Where(x => dto.Ids.Contains(x.GoodsId)).ToList(); |
|
|
|
await SqlSugarDb.Db.Deleteable(goodsbom).ExecuteCommandAsync(); |
|
|
|
await SqlSugarDb.Db.Deleteable(goodsTechnology).ExecuteCommandAsync(); |
|
|
|
var res = await SqlSugarDb.Db.Deleteable(goods).ExecuteCommandAsync(); |
|
|
@@ -281,9 +281,16 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services |
|
|
|
/// 查询商品属性 |
|
|
|
/// </summary> |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList() |
|
|
|
public async Task<List<GoodsAttributeVewDto>> GetGoodsAttributeList(GoodsIdDto dto) |
|
|
|
{ |
|
|
|
var goodstypeid = ""; |
|
|
|
var goods=SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().WhereIF(!string.IsNullOrWhiteSpace(dto.GoodsId), x => x.Id == dto.GoodsId).First(); |
|
|
|
if (goods != null) |
|
|
|
{ |
|
|
|
goodstypeid = goods.GoodsTypeId; |
|
|
|
} |
|
|
|
var res = await SqlSugarDb.Db.Queryable<BPA_GoodsAttribute>() |
|
|
|
.WhereIF(!string.IsNullOrEmpty(goodstypeid),x=>x.GoodsTypeId== goodstypeid) |
|
|
|
.OrderBy(a => a.CreateAt, OrderByType.Desc) |
|
|
|
.Select(a => new GoodsAttributeVewDto |
|
|
|
{ |
|
|
@@ -330,7 +337,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services |
|
|
|
DeviceId = s[t].Key, |
|
|
|
WarehousrTemplateId = sf1[t].Key, |
|
|
|
GoodsAttributeId = string.Join(',', sdw), |
|
|
|
DeviceName = Devicelist?.FirstOrDefault(x => x.Id == s[t].Key).DeviceName + "【" + nane + "】", |
|
|
|
TechnologyName = Devicelist?.FirstOrDefault(x => x.Id == s[t].Key).DeviceName + "【" + nane + "】", |
|
|
|
Data = s[t].AsQueryable().ToList(), |
|
|
|
}; |
|
|
|
goodsTechnologyActionListViews.Add(item); |
|
|
|