using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Web.Http;
using WebAPI.DLL;
using WebAPI.Models;
using WebAPI.Service;
using Kingdee.BOS.WebApi.Client;
namespace WebAPI.Controllers
{
public class QC_QualityReportsController : ApiController
{
private json objJsonResult = new json();
public DataSet ds = new DataSet();
public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
#region 质量模块 直通率报表查询
///
/// 返回直通率报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/FirstPassRate")]
[HttpGet]
public object FirstPassRate(string Year,string DeptName, string user)
{
try
{
List columnNameList = new List();
if (Year == null || Year.Equals(""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "请选择有效年份";
return objJsonResult;
}
else
{
ds = oCN.RunProcReturn("exec h_p_QC_FirstPassRateReport '" + Year + "','" + DeptName + "'", "h_p_QC_FirstPassRateReport");
}
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 生产不良原因统计分析报表查询
///
/// 返回生产不良原因统计分析报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/ProdBadReason")]
[HttpGet]
public object ProdBadReason(string BeginDate, string EndDate, string DeptName,string ICMOBillNo, string SourceName, string DeptType, string user)
{
try
{
List columnNameList = new List();
if (BeginDate == null || BeginDate.Equals(""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "请选择有效年份";
return objJsonResult;
}
else
{
ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonByProcReport '" + BeginDate + "','" + EndDate + "','" + DeptName + "','" + ICMOBillNo + "','"
+ SourceName + "','" + DeptType + "'", "h_p_Sc_BadReasonByProcReport");
}
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 直通率周报表查询
///
/// 返回直通率周报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/FirstPassRateWeek")]
[HttpGet]
public object FirstPassRateWeek(string Year, string DeptName, string user)
{
try
{
List columnNameList = new List();
if (Year == null || Year.Equals(""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "请选择有效年份";
return objJsonResult;
}
else
{
ds = oCN.RunProcReturn("exec h_p_QC_FirstPassRateWeekReport '" + Year + "','" + DeptName + "'", "h_p_QC_FirstPassRateWeekReport");
}
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 不良原因总体统计分析报表查询
///
/// 返回不良原因总体统计分析报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/ProdBadReason_Sum")]
[HttpGet]
public object ProdBadReason_Sum(string BeginDate, string EndDate, string DeptName, string ICMOBillNo, string SourceName, string DeptType, string user)
{
try
{
List columnNameList = new List();
if (BeginDate == null || BeginDate.Equals(""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "请选择有效年份";
return objJsonResult;
}
else
{
ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonByProcReport_Sum '" + BeginDate + "','" + EndDate + "','" + DeptName + "','" + ICMOBillNo + "','"
+ SourceName + "','" + DeptType + "'", "h_p_Sc_BadReasonByProcReport_Sum");
}
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 质量预警报表查询
///
/// 返回质量预警报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/ProductQtyWarning")]
[HttpGet]
public object ProductQtyWarning(DateTime HBeginDate, DateTime HEndDate, string DeptName)
{
try
{
List columnNameList = new List();
if (HBeginDate == null || HBeginDate.Equals(""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "请选择有时间";
return objJsonResult;
}
else
{
ds = oCN.RunProcReturn("exec h_p_QC_FirstPassRateICMOReport '" + HBeginDate + "','" + HEndDate + "','" + DeptName + "'", "h_p_QC_FirstPassRateICMOReport");
}
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 质量追溯报表报表查询(首件检验)
///
/// 返回质量追溯报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/QualityTraceability1")]
[HttpGet]
public object QualityTraceability1(string HICMOBillNo, string HType)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
//添加列名
foreach (DataColumn col in ds.Tables[2].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[2];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 质量追溯报表报表查询(工序检验)
///
/// 返回质量追溯报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/QualityTraceability2")]
[HttpGet]
public object QualityTraceability2(string HICMOBillNo, string HType)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
//添加列名
foreach (DataColumn col in ds.Tables[3].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[3];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 质量追溯报表报表查询(生产汇报)
///
/// 返回质量追溯报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/QualityTraceability3")]
[HttpGet]
public object QualityTraceability3(string HICMOBillNo, string HType)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 质量追溯报表报表查询(质量汇报)
///
/// 返回质量追溯报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_Report/QualityTraceability4")]
[HttpGet]
public object QualityTraceability4(string HICMOBillNo, string HType)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
//添加列名
foreach (DataColumn col in ds.Tables[1].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[1];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 SPC检验单分析
///
/// 返回直通率报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_InspectionFormReport")]
[HttpGet]
public object QC_InspectionFormReport(string sWhere,string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "") {
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HDeptID = dic["HDeptID"].ToString();
int limit = int.Parse(dic["limit"].ToString());
int HQCCheckItemID = int.Parse(dic["HQCCheckItemID"].ToString());
int HMaterID = int.Parse(dic["HMaterID"].ToString());
string HMouldNum = dic["HMouldNum"].ToString();
string HSourceID = dic["HSourceID"].ToString();
ds = oCN.RunProcReturn("exec h_p_QC_InspectionFormReport '" + HBeginDate + "','" + HEndDate + "'," + limit + "," + HQCCheckItemID + "," + HMaterID + ",'" + HMouldNum + "','"+ HSourceID + "','"+ HDeptID + "'", "h_p_QC_InspectionFormReport");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 生产质量统计日报
///
/// 返回直通率报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_QualityStatisticsDailyReport")]
[HttpGet]
public object QC_QualityStatisticsDailyReport(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
int HDeptName = int.Parse(dic["HDeptName"].ToString());
int HOrgID = int.Parse(dic["HOrgID"].ToString());
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HResult = dic["HResult"].ToString();//判断结果
string HProcName = dic["HProcName"].ToString();//工序名称
ds = oCN.RunProcReturn("exec h_p_QC_QualityStatisticsDailyReport '" + HYear + "','" + HMonth + "'," + HDeptName + "," + HOrgID+ ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HResult + "','" + HProcName + "'", "h_p_QC_QualityStatisticsDailyReport");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 含水率数据台账
///
/// 返回直通率报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_MoistureContentDataLedger")]
[HttpGet]
public object QC_MoistureContentDataLedger(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HResult = dic["HResult"].ToString();
int HSourceID = int.Parse(dic["HSourceID"].ToString());
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_MoistureContentDataLedger '" + HBeginDate + "','" + HEndDate + "','" + HResult + "'," + HSourceID+ ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_MoistureContentDataLedger");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 各工序质量趋势图 查询
[Route("QC_CustomerAppealReport/getSc_StationOutBill_HProc")]
[HttpGet]
public object getSc_HMaterYieldStatistics(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HProcName = dic["HProcName"].ToString();
string HMaterName = dic["HMaterName"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDeptID = dic["HDeptID"].ToString();//部门
ds = oCN.RunProcReturn("exec h_p_Sc_StationOutBillQuery_HProc '" + HYear + "','" + HMonth + "','" + HDivisionName + "','" + HProcName + "','" + HMaterName + "','" + HProject + "','" + HBatchWork + "','"+ HDeptID + "'", "h_p_SB_EquipICMOTechParamBillList");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 设备工艺参数趋势图 根据流转卡+工序 获取设备
[Route("QC_CustomerAppealReport/Get_EquipList")]
[HttpGet]
public object Get_EquipList(string HProcExchBillNo,string HProcID, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("select isnull(c.HInterID,0)设备id,isnull(c.HEquipFileNumber,'') 设备代码,isnull(c.HName,'') 设备名称,b.HRelBeginDate 开始时间,b.HRelEndDate 结束时间 from Sc_ProcessExchangeBillMain a " +
" inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID" +
" left join Gy_EquipFileBillMain c on b.HSourceID=c.HSourceID" +
" where a.HBillNo='" + HProcExchBillNo + "'and b.HProcID='"+ HProcID + "' and b.HSourceID !=0 ", "Sc_ProcessExchangeBillMain");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 设备工艺参数趋势图
[Route("QC_CustomerAppealReport/SB_EquipICMOTechParamList")]
[HttpGet]
public object SB_EquipICMOTechParamList(string sWhere, string user,string Type)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HProcExchBillNo = dic["HProcExchBillNo"].ToString();
string HProcID = dic["HProcID"].ToString();
string HTechParamName = dic["HTechParamName"].ToString();
string HEquipID = dic["HEquipID"].ToString();
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
if ((HProcExchBillNo == null || HProcExchBillNo == "")&&(HProcID == null || HProcID == "") && (HTechParamName == null || HTechParamName == "") && (HEquipID == null || HEquipID == ""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
ds = oCN.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillList '" + HProcExchBillNo + "','" + HProcID + "','" + HTechParamName + "','"+ HEquipID + "','" + HBeginDate + "','" + HEndDate + "','" + Type+"'", "h_p_SB_EquipICMOTechParamBillList");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 工艺参数大类分析报表
[Route("QC_CustomerAppealReport/GtetQc_TechnologyParameterClassList")]
[HttpGet]
public object GtetQc_TechnologyParameterClassList(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HProcExchBillNo = dic["HProcExchBillNo"].ToString();
string HProcName = dic["HProcName"].ToString();
string HTechParamClass = dic["HTechParamName"].ToString();
string HEquipName = dic["HEquipName"].ToString();
if ((HProcExchBillNo == null || HProcExchBillNo == "") && (HProcName == null || HProcName == "") && (HTechParamClass == null || HTechParamClass == "") && (HEquipName == null || HEquipName == ""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
ds = oCN.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillList_Class '" + HProcExchBillNo + "','" + HProcName + "','" + HTechParamClass + "'," + HEquipName, "h_p_SB_EquipICMOTechParamBillList_Class");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 性能报废台账
///
/// 返回直通率报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_PerformanceScrapLedger")]
[HttpGet]
public object QC_PerformanceScrapLedger(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HBatchNo = dic["HBatchNo"].ToString();
int HMaterID = int.Parse(dic["HMaterID"].ToString());
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_PerformanceScrapLedger '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo+ "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_PerformanceScrapLedger");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 送测登记数据台账
///
/// 返回直通率报表列表
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_RegistrationForTestingReport")]
[HttpGet]
public object QC_RegistrationForTestingReport(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HBatchNo = dic["HBatchNo"].ToString();
int HMaterID = int.Parse(dic["HMaterID"].ToString());
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_RegistrationForTestingReport '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_RegistrationForTestingReport");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 制程绩效趋势图(一次合格率) 查询
[Route("QC_CustomerAppealReport/getQC_ProcessPerformanceFirstPass")]
[HttpGet]
public object getQC_ProcessPerformanceFirstPass(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();//年
string HProject = dic["HProject"].ToString();//项目号
string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
string HMaterName = dic["HMaterName"].ToString();//物料名称
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_ProcessPerformanceFirstPassList '" + HYear + "','" + HProject + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ProcessPerformanceFirstPassList");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 制程绩效趋势图(合格率) 查询
[Route("QC_CustomerAppealReport/getQC_ProcessPerformancePass")]
[HttpGet]
public object getQC_ProcessPerformancePass(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();//年
string HProject = dic["HProject"].ToString();//项目号
string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
string HMaterName = dic["HMaterName"].ToString();//物料名称
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_ProcessPerformancePassList '" + HYear + "','" + HProject + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ProcessPerformancePassList");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 异常反馈分析报表 查询
[Route("QC_CustomerAppealReport/getOA_ErrMsgBackBillList_Query")]
[HttpGet]
public object getOA_ErrMsgBackBillList_Query(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere.Equals(""))
{
ds = oCN.RunProcReturn("select * from h_v_OA_ErrMsgBackBillList_Query order by 日期 desc", "h_v_OA_ErrMsgBackBillList_Query");
}
else
{
string sql1 = "select * from h_v_OA_ErrMsgBackBillList_Query where 1 = 1 ";
string sql = sql1 + sWhere + " order by 日期 desc ";
ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackBillList_Query");
}
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 异常管理台账
///
/// 返回异常管理台账
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport")]
[HttpGet]
public object QC_ErrManagerLedgerReport(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
int HDeptID = int.Parse(dic["HDeptID"].ToString());
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport '" + HBeginDate + "','" + HEndDate + "'," + HDeptID + ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 不良品台账
///
/// 返回异常管理台账
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_BadProductsReport")]
[HttpGet]
public object QC_BadProductsReport(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HMaterNumber = dic["HMaterNumber"].ToString();//物料代码
string HMaterName = dic["HMaterName"].ToString();//物料名称
string HBatchNo = dic["HBatchNo"].ToString();//批次号
string HProjectNum = dic["HProjectNum"].ToString();//项目号
string HProcName = dic["HProcName"].ToString();//工序名称
ds = oCN.RunProcReturn("exec h_p_QC_BadProductsReport '" + HBeginDate + "','" + HEndDate + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HMaterNumber + "','" + HMaterName + "','" + HBatchNo + "','" + HProjectNum + "','"+ HProcName + "'", "h_p_QC_BadProductsReport");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 线别异常管理台账
///
/// 返回线别异常管理台账
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_Source")]
[HttpGet]
public object QC_ErrManagerLedgerReport_Source(string sWhere, string user)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_Source '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_Source");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 异常管理台账数
///
/// 返回异常管理台账数
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_Issue")]
[HttpGet]
public object QC_ErrManagerLedgerReport_Issue(string sWhere, string user)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_Issue '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_Issue");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 异常问题来源
///
/// 返回异常问题来源
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_SourceOfTheProblem")]
[HttpGet]
public object QC_ErrManagerLedgerReport_SourceOfTheProblem(string sWhere, string user)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_SourceOfTheProblem '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_SourceOfTheProblem");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 设备TOP3问题
///
/// 返回设备TOP3问题
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/QC_ErrManagerLedgerReport_EquipTop3Issue")]
[HttpGet]
public object QC_ErrManagerLedgerReport_EquipTop3Issue(string sWhere, string user)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_EquipTop3Issue '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_ErrManagerLedgerReport_EquipTop3Issue");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 设备工艺参数趋势分析图
[Route("QC_CustomerAppealReport/Get_QC_EquipMentCollectionTechParamList")]
[HttpGet]
public object Get_QC_EquipMentCollectionTechParamList(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HEquipNumber = dic["HEquipNumber"].ToString();//设备编码
string HTechParamName = dic["HTechParamName"].ToString();//工艺产数
string HDate = dic["HDate"].ToString();//采集日期
string HDate1 = dic["HDate1"].ToString();//采集日期
string HEquipType = dic["HEquipType"].ToString();//查询类型
ds = oCN.RunProcReturn("exec h_p_Sb_EquipMentCollectionTechParam '"+ HEquipNumber + "','"+ HTechParamName + "','"+ HDate + "','"+ HDate1 + "','"+ HEquipType + "'", "h_p_Sb_EquipMentCollectionTechParam");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 全程质量追溯
//SN码追溯
[Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList")]
[HttpGet]
public object Get_QC_FiveMenOneRingList(string SN, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList '" + SN + "'", "h_p_QC_FiveMenOneRingList");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "此条码查无数据!";
objJsonResult.data = null;
return objJsonResult;
}
// 遍历所有表
foreach (DataTable table in ds.Tables)
{
List tableColumnList = new List();
// 添加列名
foreach (DataColumn col in table.Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
}
// 将每个表的列名列表添加到总列名列表
columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds;
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
//黑白标查询
[Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList_HB")]
[HttpGet]
public object Get_QC_FiveMenOneRingList_HB(string sWhere, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("select * from h_v_QC_FiveMenOneRingList_HB where 1=1 "+sWhere+" order by 日期 desc", "h_v_QC_FiveMenOneRingList_HB");
// 遍历所有表
foreach (DataTable table in ds.Tables)
{
List tableColumnList = new List();
// 添加列名
foreach (DataColumn col in table.Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
}
// 将每个表的列名列表添加到总列名列表
columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds;
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
//镭雕码页签-流转卡号查询返回流转卡id
[Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList_HProcHBillNoID")]
[HttpGet]
public object Get_QC_FiveMenOneRingList_HProcHBillNoID(string HProcHBillNo, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("select top 1 hmainid from h_v_Sc_ProcessExchangeBillList_Query where 单据号= '"+ HProcHBillNo +"'", "h_v_Sc_ProcessExchangeBillList_Query");
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = null;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
//点击主表格的流转卡,查询子表格数据
[Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList_Right")]
[HttpGet]
public object Get_QC_FiveMenOneRingList_Right(string linterid,string HProcID,string SNs, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList_Query '" + linterid + "','"+ HProcID + "','" + SNs + "'", "h_p_QC_FiveMenOneRingList_Query");
// 遍历所有表
foreach (DataTable table in ds.Tables)
{
List tableColumnList = new List();
// 添加列名
foreach (DataColumn col in table.Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
}
// 将每个表的列名列表添加到总列名列表
columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds;
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 制程陷阱测试趋势图报表
///
/// 制程陷阱测试趋势图报表
///
///
[Route("QC_QualityReportsController/GetQC_SkillExamMonthSumReport_Json")]
[HttpGet]
public object GetQC_SkillExamMonthSumReport_Json(string sWhere)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();//年
string HDeptID = dic["HDeptID"].ToString();//部门
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_SkillExamMonthSumReport '" + HYear.ToString() + "'," + HDeptID.ToString()+",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_SkillExamMonthSumReport");
List columnNameList = new List();
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //获取到DataColumn列对象的列名
}
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "成功!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
//}
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "返回报表信息失败!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 制程质量门逃逸趋势图报表
///
/// 制程质量门逃逸趋势图报表
///
///
[Route("QC_QualityReportsController/GetQC_QualityMonthSumReport_Json")]
[HttpGet]
public object GetQC_QualityMonthSumReport_Json(string sWhere)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();//年
string HDeptID = dic["HDeptID"].ToString();//部门
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
ds = oCN.RunProcReturn("exec h_p_QC_QualityMonthSumReport '" + HYear.ToString() + "'," + HDeptID.ToString() + ",'" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_QualityMonthSumReport");
List columnNameList = new List();
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //获取到DataColumn列对象的列名
}
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "成功!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
//}
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "返回报表信息失败!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 PPM绩效趋势图报表
///
/// PPM绩效趋势图报表
///
///
[Route("QC_CustomerAppealReport/GetQC_PPMReport_Json")]
[HttpGet]
public object GetQC_PPMReport_Json(string sWhere)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();//年
string HMonth = dic["HMonth"].ToString();//月
string HSupID = dic["HSupID"].ToString();//供应商
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDeptID = dic["HDeptID"].ToString();//部门
ds = oCN.RunProcReturn("exec h_p_QC_PPMReport '" + HYear + "','" + HMonth + "','" + HDivisionName + "','" + HProject + "','" + HBatchWork + "','" + HDeptID + "','" + HSupID + "'", "h_p_QC_PPMReport");
List columnNameList = new List();
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //获取到DataColumn列对象的列名
}
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "成功!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
//}
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "返回报表信息失败!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 全程质量追溯 根据全程追溯报表 法 获取物料+流转卡+设备+工序
[Route("QC_CustomerAppealReport/Get_EquipICMOTechParamList")]
[HttpGet]
public object Get_EquipICMOTechParamList(string linterid, string HProcID, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("select a.HBillNo 工序流转卡号,e.HInterID 设备id,e.HEquipFileNumber 设备代码,e.HName 设备名称,d.HName 生产资源,a.HMaterID 物料id,c.HName 物料名称,b.HProcID 工序id,f.HName 工序名称,b.HRelBeginDate 开始时间,b.HRelEndDate 结束时间 " +
"from Sc_ProcessExchangeBillMain a inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " +
"left join Gy_Material c on a.HMaterID = c.HItemID left join Gy_Source d on b.HSourceID = d.HItemID " +
"left join Gy_EquipFileBillMain e on b.HSourceID = e.HSourceID and b.HSourceID<>0 left join Gy_Process f on b.HProcID = f.HItemID where a.HInterID='" + linterid+ "' and b.HProcID='"+HProcID+"'", "SB_EquipICMOTechParamBillMain");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 设备工艺参数趋势图 根据物料+设备+工序 获取 产品工艺参数清单 工艺参数
[Route("QC_CustomerAppealReport/Get_TechParamList")]
[HttpGet]
public object Get_TechParamList(string HMaterID, string HProID, string HEquId, string HTeachName, string user)
{
try
{
List columnNameList = new List();
if (HTeachName=="")
{
ds = oCN.RunProcReturn("select c.HName 工艺参数,b.HDataForm 采集来源 from Gy_MaterialTechParamBillMain a " +
"inner join Gy_MaterialTechParamBillSub b on a.HInterID = b.HInterID " +
"left join Gy_TechnologyParameter c on b.HTechParamID = c.HItemID where a.HMaterID='" + HMaterID + "' and a.HProcID='" + HProID + "' and a.HEquipID='" + HEquId + "'", "SB_EquipICMOTechParamBillMain");
}
else
{
ds = oCN.RunProcReturn("select c.HName 工艺参数,b.HDataForm 采集来源 from Gy_MaterialTechParamBillMain a " +
"inner join Gy_MaterialTechParamBillSub b on a.HInterID = b.HInterID " +
"left join Gy_TechnologyParameter c on b.HTechParamID = c.HItemID where a.HMaterID='" + HMaterID + "' and a.HProcID='" + HProID + "' and a.HEquipID='" + HEquId + "' and c.HName ='" + HTeachName + "'", "SB_EquipICMOTechParamBillMain");
}
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 生产质量日报
[Route("QC_CustomerAppealReport/GetQC_QualityDailyReprot")]
[HttpGet]
public object GetQC_QualityDailyReprot(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HBatchNo = dic["HBatchNo"].ToString();//批次号
string HBatchNo1 = dic["HBatchNo1"].ToString();//ID号
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HProcName = dic["HProcName"].ToString();//工序名称
string HReceiveMan = dic["HReceiveMan"].ToString();//操作员
string HEquipNumber = dic["HEquipNumber"].ToString();//设备编码
string HMaterName = dic["HMaterName"].ToString();//物料名称
string HBachNO_BCP = dic["HBachNO_BCP"].ToString();//半成品批次
string HBachNO_CP = dic["HBachNO_CP"].ToString();//成品批次
ds = oCN.RunProcReturn("exec h_p_QC_QualityDailyReprot '" + HBeginDate + "','" + HEndDate + "','" + HBatchNo + "','" + HBatchNo1 + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HProcName + "','" + HReceiveMan + "','" + HEquipNumber + "','" + HMaterName + "','" + HBachNO_BCP + "','" + HBachNO_CP + "'", "h_p_QC_QualityDailyReprot");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 每日日报
[Route("QC_CustomerAppealReport/GetQC_QualityDailyReprot_Sum")]
[HttpGet]
public object GetQC_QualityDailyReprot_Sum(string sWhere, string user)
{
try
{
List columnNameList = new List();
if (sWhere == null || sWhere == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HProcName = dic["HProcName"].ToString();//工序名称
ds = oCN.RunProcReturn("exec h_p_QC_QualityDailyReprot_Sum '" + HBeginDate + "','" + HEndDate + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "','" + HProcName + "'", "h_p_QC_QualityDailyReprot_Sum");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 月度报告 查询
[Route("QC_CustomerAppealReport/GetQC_QualityMonthReportList")]
[HttpGet]
public object GetQC_QualityMonthReportList(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
ds = oCN.RunProcReturn("exec h_p_QC_QualityMonthReport '" + HYear + "','" + HMonth + "','" + HDivisionName + "','" + HProject + "','" + HBatchWork + "'", "h_p_QC_QualityMonthReport");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 设备TOP3问题
///
/// 返回设备TOP3问题
///参数:string sql。
///返回值:object。
///
[Route("QC_CustomerAppealReport/GetQC_BadReasonTop3ReportList")]
[HttpGet]
public object GetQC_BadReasonTop3ReportList(string sWhere, string user)
{
try
{
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HYear = dic["HYear"].ToString();
string HMonth = dic["HMonth"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_BadReasonTop3Report '" + HYear + "','" + HMonth + "','" + HProject + "','" + HBatchWork + "','" + HDivisionName + "'", "h_p_QC_BadReasonTop3Report");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 性能检测报表 查询
[Route("QC_CustomerAppealReport/getQC_TechParamReport")]
[HttpGet]
public object getQC_TechParamReport(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HProcId = dic["HProcId"].ToString(); //工序
string Frequency = dic["Frequency"].ToString();//频次
string HSourceID= dic["HSourceID"].ToString();//生产资源
ds = oCN.RunProcReturn("exec h_p_TechParamReportList '" + Frequency + "','" + HProject + "','" + HProcId + "','" + HBeginDate + "','" + HEndDate + "','"+ HSourceID + "'", "h_p_TechParamReportList");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 质量模块 返工登记表格 查询
[Route("QC_CustomerAppealReport/getQC_BackWorkReport")]
[HttpGet]
public object getQC_BackWorkReport(string sWhere, string user)
{
try
{
List columnNameList = new List();
Dictionary dic = Newtonsoft.Json.JsonConvert.DeserializeObject>(sWhere);
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
string HProject = dic["HProject"].ToString();//项目号
string HBatchWork = dic["HBatchWork"].ToString();//是否量产
string HDivisionName = dic["HDivisionName"].ToString();//事业部
string HMaterName = dic["HMaterName"].ToString();//物料名称
string HProcName = dic["HProcName"].ToString();//工序名称
string HBadReasonID = dic["HBadReasonID"].ToString();//不良原因
ds = oCN.RunProcReturn("exec h_p_QC_BackWorkReport '" + HBeginDate + "','" + HEndDate + "','" + HProject + "','" + HDivisionName + "','" + HBatchWork + "','" + HMaterName + "','" + HProcName + "','" + HBadReasonID + "'", "h_p_QC_BackWorkReport");
//添加列名
foreach (DataColumn col in ds.Tables[0].Columns)
{
Type dataType = col.DataType;
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
}
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
}
}