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); }
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); }
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); }