Ver código fonte

非空异常处理

ingredientmanage
zhaoy 5 meses atrás
pai
commit
d80cf370cc
1 arquivos alterados com 9 adições e 7 exclusões
  1. +9
    -7
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs

+ 9
- 7
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs Ver arquivo

@@ -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), GoodsUintName = SqlFunc.Subqueryable<BPA_GoodsUint>().Where(s => s.Id == a.GoodsUintId && s.IsDeleted == 0).Select(s => s.Name),
//GoodsAttributeList = new List<GoodsAttributeList>() //GoodsAttributeList = new List<GoodsAttributeList>()
}).FirstAsync(); }).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; return res;
} }
public async Task<bool> ExportGood(IFormFile file) public async Task<bool> ExportGood(IFormFile file)


Carregando…
Cancelar
Salvar