using Infrastructure.Attribute; using Microsoft.Extensions.DependencyInjection; using SqlSugar; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using ZR.Model.mes.pro; using ZR.Model.MES.qu; using ZR.Service.mes.pro.IService; using ZR.Service.mes.qu.IService; namespace ZR.Service.mes.qu { [AppService(ServiceType = typeof(IQuRoughService), ServiceLifetime = LifeTime.Transient)] public class QuRoughService : BaseService, IQuRoughService { public (List, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule) { var predicate = Expressionable.Create() .AndIF(year > 0, it => it.Year == year) .AndIF(week > 0, it => it.Week == week) .AndIF(date > 0, it => it.Date == date) .AndIF(date > 0, it => it.Wrokerorder_status==isSchedule) .ToExpression(); int totalCount = 0; List proWorkorderList = Context.Queryable().Where(predicate).ToPageList(pageNum, pageSize, ref totalCount); return (proWorkorderList, totalCount); } } }