222
schangxiang@126.com
2025-09-29 f782248da68c035aae12f902f29d828e9867abb0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using FineUIPro;
using FineUIPro.iWareWms;
using iWareCommon.Common.Entity;
using iWareCommon.Common.EnumType;
using iWareLog.LOG.Service;
using iWareWms.Code.Common.Entity;
using iWareWms.Code.Excel.Service;
using System;
using System.Collections.Generic;
 
namespace iWareWms.View.LOG.FailSentMessage
{
    public partial class FailSentMessage : PageBase
    {
        protected override Grid GetGrid()
        {
            return FailSentMessageGrid;
        }
 
        protected override FineUIPro.DropDownList GetPageSizeDropDownList()
        {
            return ddlPageSize;
        }
 
        protected override List<object> GetDataSource(int pageIndex, int pageSize, out string msg, out int totalNum, out int currentPage)
        {
            var message = FailSentMessageService.GetInstance().QueryByParam(new QueryParam
            {
                Search = new Dictionary<string, object> { { "Url", tbUrl.Text.Trim() }, { "RequestStr", tbRequestStr.Text.Trim() }, { "ResMsg", tbResMsg.Text.Trim() } },
                Geqd = new Dictionary<string, object> { { "CreateTime", (DateTime)fromDate.SelectedDate } },
                Ltd = new Dictionary<string, object> { { "CreateTime", ((DateTime)toDate.SelectedDate).AddDays(1) } },
                PageIndex = pageIndex,
                PageSize = pageSize
            }, out msg, out totalNum, out currentPage);
 
            var res = new List<object>();
 
            message.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);
            }
 
 
        }
        /// <summary>
        /// 改变Type显示信息
        /// </summary>
        /// <param name="workLabel"></param>
        /// <returns></returns>
        protected string GetYesOrNo(object obj)
        {
            return ((EYesOrNo)obj).ToString();
        }
 
        protected override void GetPath(object userName)
        {
            string msg;
            var message = FailSentMessageService.GetInstance().QueryByParam(new QueryParam
            {
                Search = new Dictionary<string, object> { { "Url", tbUrl.Text.Trim() }, { "RequestStr", tbRequestStr.Text.Trim() }, { "ResMsg", tbResMsg.Text.Trim() } },
                Geqd = new Dictionary<string, object> { { "CreateTime", (DateTime)fromDate.SelectedDate } },
                Ltd = new Dictionary<string, object> { { "CreateTime", ((DateTime)toDate.SelectedDate).AddDays(1) } },
            }, out msg);
            var datas = new List<object>();
            message.ForEach(x => datas.Add(x));
            var path = ExcelService.GetInstance().ToExcel(CacheEntity.WorkBookDict["发送失败的日志"], new Dictionary<string, List<object>> { { "发送失败的日志", datas } }, out msg);
            Session["ExcelPath"] = path;
        }
 
        protected override Window GetWindow()
        {
            return Window2;
        }
 
        protected override FineUIPro.Timer GetTimer()
        {
            return timer1;
        }
 
        //protected override void GridRowCommand(object sender, GridCommandEventArgs e)
        //{
        //    base.GridRowCommand(sender, e);
        //    if (e.CommandName == "ReSend")
        //    {
        //        string msg;
 
 
        //        Alert.ShowInTop(FailSentMessageService.GetInstance().ReSend(Convert.ToInt32((GetGrid().DataKeys[e.RowIndex][0].ToString())), out msg) ? "重发成功" : msg);
        //        Query(GetGrid().PageIndex + 1);
                
        //    }
           
        //}
 
    }
}