using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QMAPP.MESReport.Web.Models.LineQTY;
using QMAPP.Common.Web.Controllers;
using QMFrameWork.WebUI.Attribute;
using QMFrameWork.Data;
using QMAPP.Entity;
using QMAPP.ServicesAgent;
using QMFrameWork.WebUI.DataSource;
using QMFrameWork.Common.Serialization;
using QMAPP.MESReport.Entity.LineQTY;
using System.Collections;
using System.Reflection;
using QMFrameWork.ServiceInterface;
using System.Data.SqlClient;
using System.Data;
using QMAPP.Common.Web.Util;
using QMFrameWork.WebUI.QMEChart;
using QMFrameWork.WebUI.QMEChart.Data;
using QMAPP.MESReport.Web.Models;
using QMAPP.MESReport.BLL.LineQTY;
using System.Text;
namespace QMAPP.MESReport.Web.Controllers
{
///
/// 节拍统计
/// 于子清
/// 2017-10-30
///
public class ProduceCycleTimeController : QController
{
///
///
///
///
public ActionResult Index()
{
ProduceCycleTimeVModel seachModel = new ProduceCycleTimeVModel();
seachModel.START_DATE = DateTime.Now.Date.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss");
seachModel.END_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
return View(seachModel);
}
#region 异步刷新TABLE
///
/// 异步刷新TABLE
///
///
///
public ActionResult GetTable(string MACHINECODDE, string START_DATE, string END_DATE)
{
ServiceAgent wcfAgent = this.GetServiceAgent();
ProduceCycleTimeDModel condition = new ProduceCycleTimeDModel();
condition.MACHINECODDE = MACHINECODDE;
condition.START_DATE = START_DATE;
condition.END_DATE = END_DATE;
List nli = new List();
try
{
#region wcf服务统一接口
var dataResult = wcfAgent.InvokeServiceFunction>>("ProduceCycleTimeBLL_GetAllList", condition);
nli = dataResult.Result;
#endregion
}
catch (Exception ex)
{
throw ex;
}
string sss = GetHTMLStr(nli);
return Json(sss);
}
#endregion
#region 拼接字符串
///
/// 拼接字符串
///
///
public string GetHTMLStr(List nli)
{
StringBuilder html = new StringBuilder();
if (nli == null)
{
return "没有数据";
}
//拼接表头
html.Append("
设备编号
");
foreach (ProduceCycleTimeDModel item in nli)
{
html.Append("