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, IWMlocationInfoService { /// /// 查询库位信息 /// /// /// /// /// public WmInfo Getlocationinfo(int warehouse_num, string locationcode) { return Context.Queryable().Where(it=>it.WarehouseNum== warehouse_num && it.Location==locationcode).First(); } /// /// 获取成品库库位信息 /// /// /// /// /// /// public (List, int) Getwminfo_product(string shelf, int layer, int pageNum, int pageSize) { int totalNum = 0; var predicate = Expressionable.Create() .AndIF(!string.IsNullOrEmpty(shelf), it => it.Shelf.Contains(shelf)) .AndIF(layer > 0, it => it.Layer == layer) .ToExpression(); List product_wminfoList = Context.Queryable().Where(predicate).ToPageList(pageNum, pageSize, ref totalNum); return (product_wminfoList, totalNum); } } }