erp物料数据在没有找的情况下重新找一遍
This commit is contained in:
@@ -18,13 +18,15 @@ namespace WMS.Web.Domain.Services.Public
|
||||
public class ErpBasicDataExtendService: IErpBasicDataExtendService
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IErpService _erpService;
|
||||
private readonly ILoginService _loginService;
|
||||
private readonly IBasicsRepositories _basicsRepositories;
|
||||
|
||||
public ErpBasicDataExtendService(IMapper mapper, ILoginService loginService,
|
||||
public ErpBasicDataExtendService(IMapper mapper, ILoginService loginService, IErpService erpService,
|
||||
IBasicsRepositories basicsRepositories)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_erpService = erpService;
|
||||
_loginService = loginService;
|
||||
_basicsRepositories = basicsRepositories;
|
||||
|
||||
@@ -39,7 +41,14 @@ namespace WMS.Web.Domain.Services.Public
|
||||
public string GetMaterialName(List<ErpMaterialDto> erpMaterials,int materialId)
|
||||
{
|
||||
var mat= erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||
return mat == null ? "" : mat.MaterialName;
|
||||
if (mat == null)
|
||||
{
|
||||
var result= _erpService.BillQueryForMaterial(materialId).Result;
|
||||
if (!result.IsSuccess)
|
||||
return "";
|
||||
return result.Data == null ? "" : result.Data.MaterialName;
|
||||
}
|
||||
return mat.MaterialName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -51,7 +60,14 @@ namespace WMS.Web.Domain.Services.Public
|
||||
public string GetMaterialNumber(List<ErpMaterialDto> erpMaterials, int materialId)
|
||||
{
|
||||
var mat = erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||
return mat == null ? "" : mat.MaterialNumber;
|
||||
if (mat == null)
|
||||
{
|
||||
var result = _erpService.BillQueryForMaterial(materialId).Result;
|
||||
if (!result.IsSuccess)
|
||||
return "";
|
||||
return result.Data == null ? "" : result.Data.MaterialNumber;
|
||||
}
|
||||
return mat.MaterialNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -63,7 +79,14 @@ namespace WMS.Web.Domain.Services.Public
|
||||
public string GetMaterialSpecifications(List<ErpMaterialDto> erpMaterials, int materialId)
|
||||
{
|
||||
var mat = erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||
return mat == null ? "" : mat.Specifications;
|
||||
if (mat == null)
|
||||
{
|
||||
var result = _erpService.BillQueryForMaterial(materialId).Result;
|
||||
if (!result.IsSuccess)
|
||||
return "";
|
||||
return result.Data == null ? "" : result.Data.Specifications;
|
||||
}
|
||||
return mat.Specifications;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user