增加序列号接口
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.SerialNumbers;
|
||||
using WMS.Web.Core.Help;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
@@ -91,6 +92,42 @@ namespace WMS.Web.Repositories
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据序列号搜索信息
|
||||
/// </summary>
|
||||
/// <param name="serialNumber"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<SerialNumbersResponse> Get(string serialNumber)
|
||||
{
|
||||
var materials_result = await _erpService.BillQueryForMaterial();
|
||||
if (!materials_result.IsSuccess)
|
||||
return null;
|
||||
var materials = materials_result.Data.ToList();
|
||||
|
||||
var customer_result = await _erpService.BillQueryForCustomer();
|
||||
if (!customer_result.IsSuccess)
|
||||
return null;
|
||||
var customers = customer_result.Data.ToList();
|
||||
|
||||
var s = await _context.SerialNumbers
|
||||
.FirstOrDefaultAsync(f => serialNumber.Equals(f.SerialNumber));
|
||||
if (s == null) return null;
|
||||
SerialNumbersResponse respone = new SerialNumbersResponse()
|
||||
{
|
||||
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.MaterialId),
|
||||
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.MaterialId),
|
||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.MaterialId),
|
||||
CompleteCartonTime = s.CompleteCartonTime,
|
||||
InStockTime = s.InStockTime.DateToStringSeconds(),
|
||||
OutStockTime = s.OutStockTime.DateToStringSeconds(),
|
||||
PurchaseBillNo = s.PurchaseBillNo,
|
||||
SalBillNo = s.SalBillNo,
|
||||
Customer = _erpBasicDataExtendService.GetCustomerName(customers, s.CustomerId),
|
||||
SerialNumber = s.SerialNumber
|
||||
};
|
||||
return respone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据序列号查询
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user