You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.9 KiB
57 lines
1.9 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using MESClassLibrary.BLL.Log;
|
|
using MESClassLibrary.DAL;
|
|
using MESClassLibrary.DAL.TruckBox;
|
|
using MESClassLibrary.Model;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
|
|
namespace MESClassLibrary.BLL.TruckBox
|
|
{
|
|
public class RetrospectSearchBll
|
|
{
|
|
RetrospectSearchDal da=new RetrospectSearchDal();
|
|
|
|
public string SearchInfoAll(string page, string pageSize, string barCode, string startTime, string endTime)
|
|
{
|
|
try
|
|
{
|
|
string jsonStr = "[]";
|
|
int total = 0;//总行数
|
|
|
|
List<RetrospectModel> list = null;
|
|
|
|
DataTable dt = da.SearchInfo(barCode, startTime, endTime);
|
|
if (dt != null && dt.Rows.Count > 0)
|
|
{
|
|
list = CommonTools.ConvertTo<RetrospectModel>(dt).ToList();
|
|
}
|
|
|
|
if (list != null && list.Count > 0)
|
|
{
|
|
total = list.Count;
|
|
int skipCount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pageSize);
|
|
list = list.Skip(skipCount).Take(Convert.ToInt32(pageSize)).ToList();
|
|
|
|
JsonDataModel<RetrospectModel> md = new JsonDataModel<RetrospectModel>();
|
|
md.total = total.ToString();
|
|
md.rows = list;
|
|
IsoDateTimeConverter timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
|
|
jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(md, Formatting.Indented, timeConverter);
|
|
}
|
|
|
|
return jsonStr;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|