62 lines
2.3 KiB
C#
62 lines
2.3 KiB
C#
using Infrastructure.Attribute;
|
|
using Microsoft.AspNetCore.Http.HttpResults;
|
|
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.qc.DTO;
|
|
using ZR.Model.MES.qu;
|
|
using ZR.Model.MES.wm;
|
|
using ZR.Service.mes.pro.IService;
|
|
using ZR.Service.mes.qu.IService;
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
namespace ZR.Service.mes.qu
|
|
{
|
|
[AppService(ServiceType = typeof(IQcRoughService), ServiceLifetime = LifeTime.Transient)]
|
|
public class QcRoughService : BaseService<QcRough>, IQcRoughService
|
|
{
|
|
|
|
public (List<Mr_QuRoughDTO>, int) GetStatisticslist(int pageNum, int pageSize, int year, int week, int date, int isSchedule)
|
|
{
|
|
var predicate = Expressionable.Create<WmMaterialrequisition>()
|
|
.AndIF(year > 0, wm => wm.Year == year)
|
|
.AndIF(week > 0, wm => wm.Week == week)
|
|
.AndIF(date > 0, wm => wm.Date == date)
|
|
.ToExpression();
|
|
|
|
int totalCount = 0;
|
|
|
|
//联表查询
|
|
List<Mr_QuRoughDTO> mr_QusList = Context.Queryable<WmMaterialrequisition>()
|
|
.LeftJoin<QcRough>((wm, qc) =>wm.Id==qc.FkMaterialrequisitionId)
|
|
.Where(predicate)
|
|
.Select((wm,qc) => new Mr_QuRoughDTO {
|
|
Id = qc.Id,
|
|
FkMaterialrequisitionId=qc.FkMaterialrequisitionId,
|
|
Workblankpartnumber=wm.Workblankpartnumber,
|
|
Requirenum=wm.Requirenum,
|
|
Status = wm.Status,
|
|
Year = wm.Year,
|
|
Week = wm.Week,
|
|
Date = wm.Date,
|
|
RequireNum= qc.RequireNum,
|
|
ActualNumber=qc.ActualNumber,
|
|
RandomRate = qc.RandomRate,
|
|
Oks = qc.Oks,
|
|
Ngs = qc.Ngs,
|
|
OksRatio = qc.OksRatio,
|
|
IsFeeding = qc.IsFeeding
|
|
})
|
|
.ToPageList(pageNum, pageSize, ref totalCount);
|
|
|
|
return (mr_QusList, totalCount);
|
|
}
|
|
}
|
|
}
|