金蝶物料数据-开始使用
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using WMS.Web.Core.Dto.Erp;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
|
||||
namespace WMS.Web.Domain.Services.Public
|
||||
{
|
||||
/// <summary>
|
||||
/// erp基础数据:扩展服务
|
||||
/// </summary>
|
||||
public class ErpBasicDataExtendService: IErpBasicDataExtendService
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly ILoginService _loginService;
|
||||
private readonly IBasicsRepositories _basicsRepositories;
|
||||
|
||||
public ErpBasicDataExtendService(IMapper mapper, ILoginService loginService,
|
||||
IBasicsRepositories basicsRepositories)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_loginService = loginService;
|
||||
_basicsRepositories = basicsRepositories;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料名称
|
||||
/// </summary>
|
||||
/// <param name="erpMaterials"></param>
|
||||
/// <param name="materialId"></param>
|
||||
/// <returns></returns>
|
||||
public string GetMaterialName(List<ErpMaterialDto> erpMaterials,int materialId)
|
||||
{
|
||||
var mat= erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||
return mat == null ? "" : mat.MaterialName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料编码
|
||||
/// </summary>
|
||||
/// <param name="erpMaterials"></param>
|
||||
/// <param name="materialId"></param>
|
||||
/// <returns></returns>
|
||||
public string GetMaterialNumber(List<ErpMaterialDto> erpMaterials, int materialId)
|
||||
{
|
||||
var mat = erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||
return mat == null ? "" : mat.MaterialNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料规格型号
|
||||
/// </summary>
|
||||
/// <param name="erpMaterials"></param>
|
||||
/// <param name="materialId"></param>
|
||||
/// <returns></returns>
|
||||
public string GetMaterialSpecifications(List<ErpMaterialDto> erpMaterials, int materialId)
|
||||
{
|
||||
var mat = erpMaterials.Where(x => x.MaterialId == materialId).FirstOrDefault();
|
||||
return mat == null ? "" : mat.Specifications;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user