214 lines
7.3 KiB
Plaintext
214 lines
7.3 KiB
Plaintext
<%@ WebHandler Language="C#" Class="ProPlanMana_OrderImport" %>
|
||
|
||
using System;
|
||
using System.Web;
|
||
using System.Data;
|
||
|
||
public class ProPlanMana_OrderImport : IHttpHandler
|
||
{
|
||
public void ProcessRequest(HttpContext context)
|
||
{
|
||
context.Response.ContentType = "text/plain";
|
||
string type = HttpContext.Current.Request["type"];
|
||
string responseText = "";
|
||
switch (type)
|
||
{
|
||
|
||
///导出excel
|
||
case "dataoutexcel":
|
||
responseText = outexcel();
|
||
break;
|
||
//工位号查询查询
|
||
case "OpnameSelect":
|
||
responseText = OpnameSelect();
|
||
break;
|
||
//过站信息查询
|
||
case "dataEngineArriveLeaveSelect":
|
||
responseText = dataEngineArriveLeaveSelect();
|
||
break;
|
||
//查询发动机号
|
||
case "engineidSelect":
|
||
responseText = engineidSelect();
|
||
break;
|
||
//查询订单号
|
||
case "orderNumSelect":
|
||
responseText = orderNumSelect();
|
||
break;
|
||
|
||
|
||
}
|
||
context.Response.Write(responseText);
|
||
}
|
||
/// <summary>
|
||
///发动机号查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string engineidSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string dtStartTime = HttpContext.Current.Request["startdate"];
|
||
string dtEndTime = HttpContext.Current.Request["enddate"];
|
||
bool orderNum_isCheck = Convert.ToBoolean(HttpContext.Current.Request["checkbox_orderNum"]);
|
||
string orderNum = HttpContext.Current.Request["orderNum"];
|
||
MES_SPC.QualityData.GetCrossData_EngineID(dtStartTime, dtEndTime, orderNum_isCheck, orderNum, out dt);
|
||
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
|
||
/// <summary>
|
||
///订单号查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string orderNumSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string dtStartTime = HttpContext.Current.Request["startdate"];
|
||
string dtEndTime = HttpContext.Current.Request["enddate"];
|
||
MES_SPC.QualityData.GetEngineArriveLeave_OrderNum(dtStartTime, dtEndTime, out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
|
||
/// <summary>
|
||
///测量项目查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string projectSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string opName = HttpContext.Current.Request["opName"];
|
||
string position = HttpContext.Current.Request["position"];
|
||
MES_SPC.QualityData.GetItemName(opName, position, out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
/// <summary>
|
||
///测量位置查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string positionSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string opName = HttpContext.Current.Request["opName"];
|
||
MES_SPC.QualityData.GetShaftName(opName, out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
/// <summary>
|
||
///工位查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string OpnameSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
MES_SPC.CraftMana_step.OpnameSelect(out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
/// <summary>
|
||
///机型查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string enginetypeSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
MES_SPC.QualityData.GetEngineType_Data_Small(out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 导出excel
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string outexcel()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string startdate = HttpContext.Current.Request["startdate"];
|
||
string enddate = HttpContext.Current.Request["enddate"];
|
||
|
||
bool checkbox_enginetype = Convert.ToBoolean(HttpContext.Current.Request["checkbox_enginetype"]);
|
||
string enginetype = HttpContext.Current.Request["enginetype"];
|
||
|
||
|
||
bool checkbox_opname = Convert.ToBoolean(HttpContext.Current.Request["checkbox_opname"]);
|
||
string opName = HttpContext.Current.Request["opName"];
|
||
|
||
bool checkbox_opnameN = Convert.ToBoolean(HttpContext.Current.Request["checkbox_opnameN"]);
|
||
string opNameN = HttpContext.Current.Request["opNameN"];
|
||
|
||
bool checkbox_engineid = Convert.ToBoolean(HttpContext.Current.Request["checkbox_engineid"]);
|
||
string engineid = HttpContext.Current.Request["engineid"];
|
||
|
||
bool orderNum_isCheck = Convert.ToBoolean(HttpContext.Current.Request["checkbox_orderNum"]);
|
||
string orderNum = HttpContext.Current.Request["orderNum"];
|
||
|
||
MES_SPC.QualityData_EngineArriveLeaveSelect.SelectEngineArriveLeaveReport(
|
||
checkbox_engineid, engineid,
|
||
checkbox_opname, opName, checkbox_opnameN, opNameN, orderNum_isCheck, orderNum,
|
||
startdate, enddate,
|
||
out dt);
|
||
if (dt != null)
|
||
{
|
||
if (dt.Rows.Count > 0)
|
||
{
|
||
dt.TableName = "测量数据发动机在线状态";
|
||
|
||
for (int i = 0; i < dt.Rows.Count; i++)
|
||
{
|
||
dt.Rows[i]["序号"] = (i + 1).ToString("000000");
|
||
}
|
||
|
||
CommonFunction.ExcelTable(dt);
|
||
|
||
}
|
||
}
|
||
return "";
|
||
}
|
||
/// <summary>
|
||
/// 过站信息查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string dataEngineArriveLeaveSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
int PageCount = 0;
|
||
int ItemCount = 0;
|
||
int page = Convert.ToInt32(HttpContext.Current.Request["page"]);//请求的当前页码
|
||
int rows1 = Convert.ToInt32(HttpContext.Current.Request["rows"]);//请求一页显示的数据条数。
|
||
string startdate = HttpContext.Current.Request["startdate"];
|
||
string enddate = HttpContext.Current.Request["enddate"];
|
||
|
||
bool checkbox_opname = Convert.ToBoolean(HttpContext.Current.Request["checkbox_opname"]);
|
||
string opName = HttpContext.Current.Request["opName"];
|
||
|
||
bool checkbox_opnameN = Convert.ToBoolean(HttpContext.Current.Request["checkbox_opnameN"]);
|
||
string opNameN = HttpContext.Current.Request["opNameN"];
|
||
|
||
|
||
bool checkbox_engineid = Convert.ToBoolean(HttpContext.Current.Request["checkbox_engineid"]);
|
||
string engineid = HttpContext.Current.Request["engineid"];
|
||
|
||
bool orderNum_isCheck = Convert.ToBoolean(HttpContext.Current.Request["checkbox_orderNum"]);
|
||
string orderNum = HttpContext.Current.Request["orderNum"];
|
||
|
||
MES_SPC.QualityData_EngineArriveLeaveSelect.Select_engineArriveLeave(startdate, enddate,
|
||
checkbox_engineid, engineid,
|
||
checkbox_opname, opName, checkbox_opnameN, opNameN,orderNum_isCheck,orderNum,
|
||
page, rows1, out PageCount, out ItemCount,
|
||
out dt);
|
||
|
||
string text = JsonHelper.CreateJsonParameters(dt, true, ItemCount);//这句话是将json数据对象化,并且返回数据总条数
|
||
return text;
|
||
}
|
||
|
||
|
||
public bool IsReusable
|
||
{
|
||
get
|
||
{
|
||
return false;
|
||
}
|
||
}
|
||
} |