This commit is contained in:
qianhao.xu
2023-11-14 14:30:14 +08:00
parent 57e9b714ae
commit 06f346ba66
7 changed files with 198 additions and 16 deletions

View File

@@ -0,0 +1,17 @@
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.op.DTO;
namespace ZR.Service.mes.pro.IService
{
public interface IProWorkplanService
{
public (List<ProWorkplan>,int) GetAllData(int pageNum, int pageSize, int year, int week, string partNumber, string color);
}
}

View File

@@ -0,0 +1,34 @@
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.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(IProWorkplanService), ServiceLifetime = LifeTime.Transient)]
public class ProWorkplanService : BaseService<ProWorkplan>, IProWorkplanService
{
public (List<ProWorkplan>, int) GetAllData(int pageNum, int pageSize, int year, int week, string partNumber, string color)
{
var predicate = Expressionable.Create<ProWorkplan>()
.AndIF(year > 0, it => it.Year == year)
.AndIF(week > 0, it => it.Week == week)
.AndIF(!string.IsNullOrEmpty(partNumber), it => it.Partnumber.Contains( partNumber))
.AndIF(!string.IsNullOrEmpty(color), it => it.Color.Contains(color))
.ToExpression();
int totalCount = 0;
List<ProWorkplan> proWorkplanList = Context.Queryable<ProWorkplan>().Where(predicate).ToPageList(pageNum, pageSize, ref totalCount);
return (proWorkplanList, totalCount);
}
}
}