示例#1
0
        public ResultVM GetPowerData(HttpContext context)
        {
            var vm = new ResultVM();

            vm.hasError = false;
            var Line = context.Request.Params["Line"];
            var list = KanbanEnergyLoader.GetPowerData(Line);

            vm.data = JsonSerializeHelper.SerializeObject(list);
            return(vm);
        }
示例#2
0
        public ResultVM GetEnergyAlarm(HttpContext context)
        {
            var vm = new ResultVM();

            vm.hasError = false;
            var Line  = context.Request.Params["Line"];
            var msg   = KanbanEnergyLoader.GetEnergyAlarm(Line);
            var total = KanbanProcessLoader.GetTotal(Line);

            vm.data = total + msg;
            return(vm);
        }
示例#3
0
        public ResultVM GetZhengQi(HttpContext context)
        {
            var vm = new ResultVM();

            vm.hasError = false;
            var Line = context.Request.Params["Line"];
            var list = new List <VM_ENERGY_COLLECT>();

            list = KanbanEnergyLoader.GettZhengQiData(Line, "");
            var data = new List <VM_ENERGY>();

            var dates = list.Select(a => a.CollectDate).Distinct().ToList();

            foreach (var d in dates)
            {
                var item = data.Where(a => a.name == d).FirstOrDefault();
                if (item == null)
                {
                    item      = new VM_ENERGY();
                    item.name = d;

                    var dlist = list.Where(a => a.CollectDate == d).OrderBy(b => b.Line).ToList();
                    item.data = new Decimal[dlist.Count];
                    for (int i = 0; i < dlist.Count; i++)
                    {
                        item.data[i] = dlist[i].DataValue;
                    }
                    data.Add(item);
                }
                else
                {
                }
            }

            vm.data = JsonSerializeHelper.SerializeObject(data);

            return(vm);
        }