318 lines
12 KiB
Plaintext
318 lines
12 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 "dataMateralSelect":
|
||
responseText = dataMateralSelect();
|
||
break;
|
||
//二维码查询
|
||
case "OpnameSelect":
|
||
responseText = OpnameSelect();
|
||
break;
|
||
//发动机号查询查询2
|
||
case "EngineSelect":
|
||
responseText = EngineSelect();
|
||
break;
|
||
//过站信息查询
|
||
case "Select_repair":
|
||
responseText = Select_repair();
|
||
break;
|
||
//查询发动机号
|
||
case "engineidSelect":
|
||
responseText = engineidSelect();
|
||
break;
|
||
//查询订单号
|
||
case "orderNumberSelect":
|
||
responseText = orderNumSelect();
|
||
break;
|
||
//查询一维码
|
||
case "BarcodeBatchMaterialsSelect":
|
||
responseText = MaterialBatchSelect();
|
||
break;
|
||
//二维码查询
|
||
case "QRSelect":
|
||
responseText = QRSelect();
|
||
break;
|
||
|
||
|
||
}
|
||
context.Response.Write(responseText);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
///物料条码批次查询 2014-11-25
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string MaterialBatchSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string dtStartTime = HttpContext.Current.Request["startdate"];
|
||
string dtEndTime = HttpContext.Current.Request["enddate"];
|
||
string opname = HttpContext.Current.Request["opname"];
|
||
//string engine = HttpContext.Current.Request["engine"];
|
||
MES_SPC.QualityData_LineMaterial.GetMaterial_BarcodeBatchMaterials(dtStartTime, dtEndTime, opname, out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
/// <summary>
|
||
///二维码查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string QRSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string dtStartTime = HttpContext.Current.Request["startdate"];
|
||
string dtEndTime = HttpContext.Current.Request["enddate"];
|
||
bool EngineTypeID_isCheck = Convert.ToBoolean(HttpContext.Current.Request["checkbox_enginetype"]);
|
||
string EngineType = HttpContext.Current.Request["enginetype"];
|
||
bool Opname_isCheck = Convert.ToBoolean(HttpContext.Current.Request["checkbox_opname"]);
|
||
string Opname = HttpContext.Current.Request["opName"];
|
||
MES_SPC.QualityData.QRSelect(dtStartTime, dtEndTime, EngineTypeID_isCheck, EngineType, Opname_isCheck, Opname, 2, out dt);
|
||
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 物料数据查询
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string dataMateralSelect()
|
||
{
|
||
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_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_engineid = Convert.ToBoolean(HttpContext.Current.Request["checkbox_engineid"]);
|
||
string engineid = HttpContext.Current.Request["engineid"];
|
||
bool checkbox_materialname = Convert.ToBoolean(HttpContext.Current.Request["checkbox_materialname"]);
|
||
string materialname = HttpContext.Current.Request["materialname"];
|
||
bool checkbox_MaterialsBatchBarcode = Convert.ToBoolean(HttpContext.Current.Request["checkbox_BarcodeBatchMaterials"]);
|
||
string comboBox_MaterialsBatchBarcode = HttpContext.Current.Request["comboBox_BarcodeBatchMaterials"];
|
||
|
||
bool checkbox_QRcode = Convert.ToBoolean(HttpContext.Current.Request["checkbox_QRcode"]);
|
||
string QR_code = HttpContext.Current.Request["QR_code"];
|
||
|
||
MES_SPC.QualityData_LineMaterial.Select_material(startdate, enddate, checkbox_enginetype, enginetype,
|
||
checkbox_engineid, engineid, checkbox_materialname, materialname,
|
||
checkbox_opname, opName, checkbox_MaterialsBatchBarcode, comboBox_MaterialsBatchBarcode, checkbox_QRcode, QR_code,
|
||
page, rows1, out PageCount, out ItemCount,
|
||
out dt);
|
||
|
||
string text = JsonHelper.CreateJsonParameters(dt, true, ItemCount);//这句话是将json数据对象化,并且返回数据总条数
|
||
return text;
|
||
}
|
||
|
||
|
||
|
||
|
||
/// <summary>
|
||
///20150912
|
||
///根据二维码查询发动机号
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string OpnameSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
string dtStartTime = HttpContext.Current.Request["startdate"];
|
||
string dtEndTime = HttpContext.Current.Request["enddate"];
|
||
bool EngineTypeID_isCheck = Convert.ToBoolean(HttpContext.Current.Request["checkbox_enginetype"]);
|
||
string EngineType = HttpContext.Current.Request["enginetype"];
|
||
bool Opname_isCheck = Convert.ToBoolean(HttpContext.Current.Request["checkbox_opname"]);
|
||
string Opname = HttpContext.Current.Request["opName"];
|
||
MES_SPC.QualityData_LineMaterial.OpnameSelect(dtStartTime, dtEndTime, EngineTypeID_isCheck, EngineType, Opname_isCheck, Opname, out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
|
||
/// <summary>
|
||
///20150912
|
||
///根据一维码查询发动机号
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private string EngineSelect()
|
||
{
|
||
System.Data.DataTable dt = null;
|
||
MES_SPC.QualityData_LineMaterial.EngineSelect(out dt);
|
||
string text = JsonHelper.DataTableToJson(dt);
|
||
return text;
|
||
}
|
||
|
||
/// <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 EngineTypeID_isCheck = 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"];
|
||
MES_SPC.QualityData_LineMaterial.GetQualityData_EngineID_Small(dtStartTime, dtEndTime, EngineTypeID_isCheck, EngineType, checkbox_opname, opName,2, 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 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_engineid = Convert.ToBoolean(HttpContext.Current.Request["checkbox_engineid"]);
|
||
string engineid = HttpContext.Current.Request["engineid"];
|
||
bool checkbox_materialname = Convert.ToBoolean(HttpContext.Current.Request["checkbox_materialname"]);
|
||
string materialname = HttpContext.Current.Request["materialname"];
|
||
bool checkbox_MaterialsBatchBarcode = Convert.ToBoolean(HttpContext.Current.Request["checkbox_BarcodeBatchMaterials"]);
|
||
string comboBox_MaterialsBatchBarcode = HttpContext.Current.Request["comboBox_BarcodeBatchMaterials"];
|
||
|
||
bool checkbox_QRcode = Convert.ToBoolean(HttpContext.Current.Request["checkbox_QRcode"]);
|
||
string QR_code = HttpContext.Current.Request["QR_code"];
|
||
|
||
MES_SPC.QualityData_LineMaterial.SelectMaterialReport(
|
||
checkbox_engineid, engineid, checkbox_enginetype, enginetype, checkbox_materialname, materialname,
|
||
checkbox_opname, opName, checkbox_MaterialsBatchBarcode, comboBox_MaterialsBatchBarcode, checkbox_QRcode, QR_code,
|
||
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 Select_repair()
|
||
{
|
||
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"];
|
||
int radio_isgoodbad = Convert.ToInt32(HttpContext.Current.Request["radio_isgoodbad"]);
|
||
bool checkbox_engineid = Convert.ToBoolean(HttpContext.Current.Request["checkbox_engineid"]);
|
||
string engine = HttpContext.Current.Request["engine"];
|
||
|
||
MES_SPC.QualityData_LineMaterial.Select_repair(startdate, enddate, radio_isgoodbad, checkbox_engineid, engine, page, rows1, false, out PageCount, out ItemCount, out dt);
|
||
string text = JsonHelper.CreateJsonParameters(dt, true, dt.Rows.Count);//这句话是将json数据对象化,并且返回数据总条数
|
||
|
||
return text;
|
||
}
|
||
|
||
public bool IsReusable
|
||
{
|
||
get
|
||
{
|
||
return false;
|
||
}
|
||
}
|
||
} |