2023-11-15 14:38:10 +08:00
|
|
|
|
using Infrastructure.Attribute;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2023-11-16 13:35:43 +08:00
|
|
|
|
using SqlSugar;
|
2023-11-15 14:38:10 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using ZR.Model.mes.md;
|
|
|
|
|
|
using ZR.Model.mes.pro;
|
|
|
|
|
|
using ZR.Service.mes.pro.IService;
|
|
|
|
|
|
using ZR.Service.MES.md.IService;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ZR.Service.mes.pro
|
|
|
|
|
|
{
|
|
|
|
|
|
[AppService(ServiceType = typeof(IProWorkorderService), ServiceLifetime = LifeTime.Transient)]
|
|
|
|
|
|
public class ProWorkorderService : BaseService<ProWorkorder>, IProWorkorderService
|
|
|
|
|
|
{
|
2023-11-16 13:35:43 +08:00
|
|
|
|
|
|
|
|
|
|
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, string isSchedule)
|
|
|
|
|
|
{
|
|
|
|
|
|
var predicate = Expressionable.Create<ProWorkorder>()
|
|
|
|
|
|
.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.Isarrange.Equals(isSchedule))
|
|
|
|
|
|
.ToExpression();
|
|
|
|
|
|
|
|
|
|
|
|
int totalCount = 0;
|
|
|
|
|
|
List<ProWorkorder> proWorkorderList = Context.Queryable<ProWorkorder>().Where(predicate).ToPageList(pageNum, pageSize, ref totalCount);
|
|
|
|
|
|
|
|
|
|
|
|
return (proWorkorderList, totalCount);
|
|
|
|
|
|
}
|
2023-11-15 14:38:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|