using FineUIPro; using FineUIPro.iWareWms; using iWareCommon.Common.Entity; using iWareLog.LOG.EnumType; using iWareLog.LOG.Service; using iWareWms.Code.Excel.Service; using System; using System.Collections.Generic; namespace iWareWms.View.LOG.ReceiveMsgLog { public partial class ReceiveMsgLog : PageBase { protected override Grid GetGrid() { return ReceiveMsgLogGrid; } protected override FineUIPro.DropDownList GetPageSizeDropDownList() { return ddlPageSize; } protected override List GetDataSource(int pageIndex, int pageSize, out string msg, out int totalNum, out int currentPage) { var receive = ReceiveMsgLogService.GetInstance().QueryByParam(new QueryParam { Search = new Dictionary { { "InterfaceName", tbInterfaceName.Text.Trim() }, { "RequestStr", tbRequestStr.Text.Trim() }, { "ResponseStr", tbResponseStr.Text.Trim() } }, Geqd = new Dictionary { { "ReceiveTime", (DateTime)fromDate.SelectedDate } }, Ltd = new Dictionary { { "ReceiveTime", ((DateTime)toDate.SelectedDate).AddDays(1) } }, PageIndex = pageIndex, PageSize = pageSize }, out msg, out totalNum, out currentPage); var res = new List(); receive.ForEach(x => res.Add(x)); return res; } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var today = DateTime.Today; fromDate.SelectedDate = today.AddDays(-6); toDate.SelectedDate = today; Query(1); } } /// /// 改变Type显示信息 /// /// /// /// protected string GetType(object type) { return ((EReceiveType)type).ToString(); } protected override void GetPath(object userName) { string msg; var receive = ReceiveMsgLogService.GetInstance().QueryByParam(new QueryParam { Search = new Dictionary { { "InterfaceName", tbInterfaceName.Text.Trim() }, { "RequestStr", tbRequestStr.Text.Trim() }, { "ResponseStr", tbResponseStr.Text.Trim() } }, Geqd = new Dictionary { { "ReceiveTime", (DateTime)fromDate.SelectedDate } }, Ltd = new Dictionary { { "ReceiveTime", ((DateTime)toDate.SelectedDate).AddDays(1) } }, }, out msg); var datas = new List(); receive.ForEach(x => datas.Add(x)); var path = ExcelService.GetInstance().ToExcel(iWareWms.Code.Common.Entity.CacheEntity.WorkBookDict["接收报文日志"], new Dictionary> { { "接收报文日志", datas } }, out msg); Session["ExcelPath"] = path; } protected override Window GetWindow() { return Window2; } protected override FineUIPro.Timer GetTimer() { return timer1; } } }