|
|
@ -50,8 +50,8 @@ namespace ProductionSystem_Service
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public TestResut2Res Query(TestResut2Vm vm)
|
|
|
|
public TestResut2Res Query(TestResut2Vm vm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int totalRecord = 0;
|
|
|
|
int totalRecord = 0;
|
|
|
|
var iq= db.Queryable<T_Result2>().
|
|
|
|
var iq= db.Queryable<T_Result2>().
|
|
|
|
WhereIF(!string.IsNullOrEmpty(vm.ProductType), x => x.ProductType == vm.ProductType)
|
|
|
|
WhereIF(!string.IsNullOrEmpty(vm.ProductType), x => x.ProductType == vm.ProductType)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(vm.ProductCode),x=>x.ProductBarcode == vm.ProductCode)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(vm.ProductCode),x=>x.ProductBarcode == vm.ProductCode)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(vm.BeginTime),x=>x.CreateTime>=Convert.ToDateTime(vm.BeginTime))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(vm.BeginTime),x=>x.CreateTime>=Convert.ToDateTime(vm.BeginTime))
|
|
|
@ -59,10 +59,7 @@ namespace ProductionSystem_Service
|
|
|
|
.OrderByDescending(x => x.CreateTime)
|
|
|
|
.OrderByDescending(x => x.CreateTime)
|
|
|
|
.ToPageList(vm.PageIndex,vm.PageSize, ref totalRecord);
|
|
|
|
.ToPageList(vm.PageIndex,vm.PageSize, ref totalRecord);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int totalPage = (totalRecord + vm.PageSize - 1) / vm.PageSize;
|
|
|
|
int totalPage = (totalRecord + vm.PageSize - 1) / vm.PageSize;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TestResut2Res testResut2Res = new TestResut2Res();
|
|
|
|
TestResut2Res testResut2Res = new TestResut2Res();
|
|
|
|
testResut2Res.Total= totalPage;
|
|
|
|
testResut2Res.Total= totalPage;
|
|
|
|
testResut2Res.Data = iq;
|
|
|
|
testResut2Res.Data = iq;
|
|
|
|