wxw
2025-05-12 c2dc3bd2569f8398e2710aca2685bb3115c77eb0
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using BLL.DAL;
using Common;
using Json;
using Lib;
using Model;
 
namespace wms.Areas.Wcs.Controllers
{
    public class TaskMonitorController : MasterPage
    {
        // GET: Wcs/TaskMonitor
        [LoginFilter]
        public ActionResult Index()
        {
            ViewBag.Title = "任务监控";
            ViewBag.AccessList = LocalHelper.GetDictionaryCodeHtml("Access");
            ViewBag.DepotsRow = LocalHelper.GetDepotsNumHtml2("DepotsRow");
            ViewBag.DepotsColumn = LocalHelper.GetDepotsNumHtml2("DepotsColumn");
            ViewBag.DepotsLayer = LocalHelper.GetDepotsNumHtml2("DepotsLayer");
            
            return View();
        }
    }
 
    public class TaskMonitorAjaxController : AjaxPage
    {
        [HttpPost]
        public ActionResult GetTaskList()
        {
            var dd = Request["ajaxdata"];
            var models = new JavaScriptSerializer().Deserialize<AjaxGetTaskList>(dd);
 
            if (models != null)
            {
                DAL_TaskMonitor provider = new DAL_TaskMonitor();
                PageInfo pageInfo = new PageInfo() { PageIndex = models.pageIndex, PageSize = models.pageSize };
                List<WCSTasks> entity = provider.GetList(models, ref pageInfo).ToList();
 
                string json = JsonHelper.IListToJson(entity, "List");
                string pjson = ConvertJson.Serializer(pageInfo);
 
                ReturnJson.AddProperty("Result", new JsonObject(json));
                ReturnJson.AddProperty("PageInfo", new JsonObject(pjson));
                ReturnJson.AddProperty("Code", 1);
                ReturnJson.AddProperty("Message", "响应成功");
 
                return Content(this.ReturnJson.ToString());
            }
            return Content(null);
        }
 
        public ActionResult GetTaskMonitorList()
        {
            var dd = Request["ajaxdata"];
            var models = new JavaScriptSerializer().Deserialize<AjaxGetTaskDetailList>(dd);
 
            if (models != null)
            {
                DAL_TaskMonitor provider = new DAL_TaskMonitor();
                PageInfo pageInfo = new PageInfo() { PageIndex = models.pageIndex, PageSize = models.pageSize };
                List<WCSTasksMonitor> entity = provider.GetDetailList(models, ref pageInfo).ToList();
 
                string json = JsonHelper.IListToJson(entity, "List");
                string pjson = ConvertJson.Serializer(pageInfo);
 
                ReturnJson.AddProperty("Result", new JsonObject(json));
                ReturnJson.AddProperty("PageInfo", new JsonObject(pjson));
                ReturnJson.AddProperty("Code", 1);
                ReturnJson.AddProperty("Message", "响应成功");
 
                return Content(this.ReturnJson.ToString());
            }
            return Content(null);
        }
 
 
 
        public ActionResult CompleteTaskMonitor()
        {
            string dd = Request["list"];
            ArrayList models = new JavaScriptSerializer().Deserialize<ArrayList>(dd);
            string[] list = (string[])models.ToArray(typeof(string));
            if (models != null)
            {
                DAL_TaskMonitor provider = new DAL_TaskMonitor();
                bool value = provider.TaskMonitorComplete(list);
 
                if (value)
                {
                    ReturnJson.AddProperty("Code", 1);
                    ReturnJson.AddProperty("Message", "完成成功");
                }
                else
                {
                    ReturnJson.AddProperty("Code", -1);
                    ReturnJson.AddProperty("Message", "完成失败");
                }
 
                return Content(this.ReturnJson.ToString());
            }
            return Content(null);
        }
 
        public ActionResult CancelTaskMonitor()
        {
            string dd = Request["list"];
            ArrayList models = new JavaScriptSerializer().Deserialize<ArrayList>(dd);
            string[] list = (string[])models.ToArray(typeof(string));
            if (models != null)
            {
                DAL_TaskMonitor provider = new DAL_TaskMonitor();
                bool value = provider.TaskMonitorCancel(list);
 
                if (value)
                {
                    ReturnJson.AddProperty("Code", 1);
                    ReturnJson.AddProperty("Message", "取消成功");
                }
                else
                {
                    ReturnJson.AddProperty("Code", -1);
                    ReturnJson.AddProperty("Message", "取消失败");
                }
 
                return Content(this.ReturnJson.ToString());
            }
            return Content(null);
        }
    }
 
 
}