//返回主画面Json_Current Model NG public JsonResult DRAQ127_AllStatus2(string DeviceId) { String str = "select * from RealTimePlantData where LineID= '" + DeviceId + "'"; RealTimePlantData list_Select_Real_Time_Data = db.Sel_RealTimePlantData(str); int[] j = { list_Select_Real_Time_Data.cap, list_Select_Real_Time_Data.ESR, list_Select_Real_Time_Data.Voltage }; ViewBag.MaxData2 = j.Max(); return(Json(new { msg = "success", data = list_Select_Real_Time_Data, data2 = j.Max() }, JsonRequestBehavior.AllowGet)); }
public ActionResult BigScreen() { string DeviceId = Request["DeviceId"]; ViewBag.DeviceId = DeviceId; string SqlCon_PCC = ConfigurationManager.ConnectionStrings["PCC" + DeviceId + "ConnectionString"].ToString(); //查询RealTimePlantData表当前型号的数据 String str = "select * from RealTimePlantData where LineID= '" + DeviceId + "'"; RealTimePlantData list_Select_Real_Time_Data = db.Sel_RealTimePlantData(str); int[] j = { list_Select_Real_Time_Data.cap, list_Select_Real_Time_Data.ESR, list_Select_Real_Time_Data.Voltage }; ViewBag.MaxData2 = j.Max(); //赋值ViewBag.Select_Real_Time_Data当前型号的数据 ViewBag.Select_Real_Time_Data = list_Select_Real_Time_Data; ViewBag.Now_Model = list_Select_Real_Time_Data.DutMode; //查询最近生产的5种型号每月产量Latest Monthly Output&NG Top 5 string str_select_top5_monthly_output = "select * from EveryMonthInfo nolock"; List <Monthly_OutputAndNG> list_Monthly_OutputAndNG = db_draq127.select_top5_monthly_output(SqlCon_PCC, str_select_top5_monthly_output); //查询最近生产的5种型号每天产量Latest Daily Output&NG Top 5 string str_select_top5_daily_output = "select * from EverydayInfo nolock"; List <EveryDay_OutputAndNG> list_Everyday_OutputAndNG = db_draq127.select_top5_daily_output(SqlCon_PCC, str_select_top5_daily_output); //2019年12月-现场没看出问题,家里调试好像是周日看数据有问题,所以更新 //查询当前一周内数据Order Progress This Week //DateTime dt = DateTime.Now; //当前时间 //DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))); //本周周一 //DateTime endWeek = startWeek.AddDays(6); //本周周日 //string startDay = startWeek.Year.ToString() + "-" + startWeek.Month.ToString() + "-" + startWeek.Day.ToString(); //string endDay = endWeek.Year.ToString() + "-" + endWeek.Month.ToString() + "-" + endWeek.Day.ToString(); //String str_Monthly_Order_Info2 = "select * from DayInfoHistory nolock where RecordTime BETWEEN '" + startDay + "' and '" + endDay + "' and LineID='" + DeviceId + "'"; //2020年2月-过年在家周日看数据好像有问题,所以更新 //查询当前一周内数据Order Progress This Week DateTime dt = DateTime.Now; //当前时间 int count = dt.DayOfWeek - DayOfWeek.Monday; if (count == -1) { count = 6; } DateTime startWeek = dt.AddDays(-count); //本周周一 DateTime endWeek = startWeek.AddDays(7); //本周周日 DateTime endWeek2 = startWeek.AddDays(5); //本周周日 string startDay = startWeek.Year.ToString() + "-" + startWeek.Month.ToString() + "-" + startWeek.Day.ToString(); string endDay = endWeek.Year.ToString() + "-" + endWeek.Month.ToString() + "-" + endWeek.Day.ToString(); String str_Monthly_Order_Info2 = "select * from DayInfoHistory nolock where RecordTime BETWEEN '" + startDay + "' and '" + endDay + "' and LineID='" + DeviceId + "'"; List <DayInfoHistory> list_Monthly_Order_Info_List = db_Single_station.Monthly_Order_Infos_List(SqlCon_PCC, str_Monthly_Order_Info2); return(View(Tuple.Create(list_Monthly_OutputAndNG, list_Everyday_OutputAndNG, list_Monthly_Order_Info_List))); }