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();
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();
ds = oCN.RunProcReturn("exec h_p_QC_InspectionFormReport '" + HBeginDate + "','" + HEndDate + "'," + limit + "," + HQCCheckItemID + "," + HMaterID + ",'" + HMouldNum + "'", "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());
ds = oCN.RunProcReturn("exec h_p_QC_QualityStatisticsDailyReport '" + HYear + "','" + HMonth + "'," + HDeptName + "," + HOrgID, "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());
ds = oCN.RunProcReturn("exec h_p_QC_MoistureContentDataLedger '" + HBeginDate + "','" + HEndDate + "','" + HResult + "'," + HSourceID, "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();
ds = oCN.RunProcReturn("exec h_p_Sc_StationOutBillQuery_HProc '" + HYear + "','" + HMonth + "','" + HDivisionName + "','" + HProcName + "','" + HMaterName + "'", "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 user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("select distinct b.HInterID HItemID,b.HEquipFileNumber HEquipFileNumber,b.HName HName,d.HMouldNo HMouldNumber,d.HName HMouldName " +
" from SB_EquipICMOTechParamBillMain a left join Gy_EquipFileBillMain b on a.HEquipID=b.HInterID" +
" left join Sc_ICMOBillStatus_Tmp c on a.HProcExchInterID = c.HSourceInterID and a.HProcExchEntryID = c.HSourceEntryID and a.HProcID = c.HProcID" +
" left join Gy_MouldFileMain d on c.HMouldID = d.HInterID where HProcExchBillNo='" + HProcExchBillNo + "'", "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/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 HProcName = dic["HProcName"].ToString();
string HTechParamName = dic["HTechParamName"].ToString();
string HEquipName = dic["HEquipName"].ToString();
if ((HProcExchBillNo == null || HProcExchBillNo == "")&&(HProcName == null || HProcName == "") && (HTechParamName == null || HTechParamName == "") && (HEquipName == null || HEquipName == ""))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "无查询条件!";
objJsonResult.data = null;
return objJsonResult;
}
ds = oCN.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillList '" + HProcExchBillNo + "','" + HProcName + "','" + HTechParamName + "','"+HEquipName+"','"+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());
ds = oCN.RunProcReturn("exec h_p_QC_PerformanceScrapLedger '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo+"'", "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());
ds = oCN.RunProcReturn("exec h_p_QC_RegistrationForTestingReport '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo + "'", "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 HMaterModel = dic["HMaterModel"].ToString();
string HSourceName = dic["HSourceName"].ToString();
string HProSource = dic["HProSource"].ToString();
string HShiftsName = dic["HShiftsName"].ToString();
string HCustomize = dic["HCustomize"].ToString();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport '" + HBeginDate + "','" + HEndDate + "'," + HDeptID + ",'" + HMaterModel + "','" + HSourceName + "','" + HProSource + "','" + HShiftsName + "','" + HCustomize + "'", "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 HMaterNumber = dic["HMaterNumber"].ToString();
string HMaterModel = dic["HMaterModel"].ToString();
string HProcessName = dic["HProcessName"].ToString();
string HDealingType = dic["HDealingType"].ToString();
string HSendManName = dic["HSendManName"].ToString();
string HCustomize = dic["HCustomize"].ToString();
ds = oCN.RunProcReturn("exec h_p_QC_BadProductsReport '" + HBeginDate + "','" + HEndDate + "','" + HMaterNumber + "','" + HMaterModel + "','" + HProcessName + "','" + HDealingType + "','" + HSendManName + "','" + HCustomize + "'", "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 HYear, string HMonth, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_Source '" + HYear + "','" + HMonth + "'", "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 HYear, string HMonth, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_Issue '" + HYear + "','" + HMonth + "'", "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 HYear, string HMonth, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_SourceOfTheProblem '" + HYear + "','" + HMonth + "'", "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 HYear, string HMonth, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_ErrManagerLedgerReport_EquipTop3Issue '" + HYear + "','" + HMonth + "'", "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 质量模块 全程质量追溯
[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");
// 遍历所有表
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_Right")]
[HttpGet]
public object Get_QC_FiveMenOneRingList_Right(string linterid, string user)
{
try
{
List columnNameList = new List();
ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList_Query '" + linterid + "'", "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(Int64 HYear, Int64 HDeptID)
{
try
{
ds = oCN.RunProcReturn("exec h_p_QC_SkillExamMonthSumReport '" + HYear.ToString() + "'," + HDeptID.ToString(), "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(Int64 HYear, Int64 HDeptID)
{
try
{
ds = oCN.RunProcReturn("exec h_p_QC_QualityMonthSumReport '" + HYear.ToString() + "'," + HDeptID.ToString(), "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_QualityReportsController/GetQC_PPMReport_Json")]
[HttpGet]
public object GetQC_PPMReport_Json(Int64 HYear, Int64 HDeptID)
{
try
{
ds = oCN.RunProcReturn("exec h_p_QC_PPMReport '" + HYear.ToString() + "'," + HDeptID.ToString(), "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
}
}