Browse Source

非空异常处理

ingredientmanage
zhaoy 5 months ago
parent
commit
d80cf370cc
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs

+ 9
- 7
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs View File

@@ -462,15 +462,17 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
GoodsUintName = SqlFunc.Subqueryable<BPA_GoodsUint>().Where(s => s.Id == a.GoodsUintId && s.IsDeleted == 0).Select(s => s.Name),
//GoodsAttributeList = new List<GoodsAttributeList>()
}).FirstAsync();
if (!res.IsAttrubute)
if (res!=null)
{
res.GoodsAttributeList = await _goodsAttributeService.GetByNameAttribute("默认属性");
}
else
{
res.GoodsAttributeList = await _goodsAttributeService.GetByGoodsIdAttribute(res.Id);
if (!res.IsAttrubute)
{
res.GoodsAttributeList = await _goodsAttributeService.GetByNameAttribute("默认属性");
}
else
{
res.GoodsAttributeList = await _goodsAttributeService.GetByGoodsIdAttribute(res.Id);
}
}

return res;
}
public async Task<bool> ExportGood(IFormFile file)


Loading…
Cancel
Save