油漆
This commit is contained in:
53
server/ZR.Service/mes/wms/WMlocationInfoService.cs
Normal file
53
server/ZR.Service/mes/wms/WMlocationInfoService.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
[AppService(ServiceType = typeof(IWMlocationInfoService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class WMlocationInfoService : BaseService<WmInfo>, IWMlocationInfoService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询库位信息
|
||||
/// </summary>
|
||||
/// <param name="warehouse_num"></param>
|
||||
/// <param name="locationcode"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public WmInfo Getlocationinfo(int warehouse_num, string locationcode)
|
||||
{
|
||||
return Context.Queryable<WmInfo>().Where(it=>it.WarehouseNum== warehouse_num && it.Location==locationcode).First();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取成品库库位信息
|
||||
/// </summary>
|
||||
/// <param name="shelf"></param>
|
||||
/// <param name="layer"></param>
|
||||
/// <param name="pageNum"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
public (List<WmInfo>, int) Getwminfo_product(string shelf, int layer, int pageNum, int pageSize)
|
||||
{
|
||||
int totalNum = 0;
|
||||
var predicate = Expressionable.Create<WmInfo>()
|
||||
.AndIF(!string.IsNullOrEmpty(shelf), it => it.Shelf.Contains(shelf))
|
||||
.AndIF(layer > 0, it => it.Layer == layer)
|
||||
.ToExpression();
|
||||
List<WmInfo> product_wminfoList = Context.Queryable<WmInfo>().Where(predicate).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
|
||||
return (product_wminfoList, totalNum);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user