From cdaf126a48444b9c055f44c7266a7d43343aeb1e Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 24 九月 2024 11:39:21 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/品质管理/质量报表/QC_QualityReportsController.cs | 238 ++++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 184 insertions(+), 54 deletions(-)
diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_QualityReportsController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_QualityReportsController.cs"
index a20b31e..3ae4937 100644
--- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_QualityReportsController.cs"
+++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_QualityReportsController.cs"
@@ -640,17 +640,17 @@
{
try
{
- List<object> columnNameList = new List<object>();
- if (sWhere == null || sWhere.Equals(""))
- {
- ds = oCN.RunProcReturn("select * from h_v_Sc_StationOutBillQuery_HProc order by 鏃ユ湡 desc", "h_v_Sc_StationOutBillQuery_HProc");
- }
- else
- {
- string sql1 = "select * from h_v_Sc_StationOutBillQuery_HProc where 1 = 1 ";
- string sql = sql1 + sWhere + " order by 鏃ユ湡 ";
- ds = oCN.RunProcReturn(sql, "h_v_Sc_StationOutBillQuery_HProc");
- }
+ List<object> columnNameList = new List<object>();
+ Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(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)
@@ -678,7 +678,7 @@
}
#endregion
- #region 璐ㄩ噺妯″潡 璁惧宸ヨ壓鍙傛暟瓒嬪娍鍥� 鏍规嵁娴佽浆鍗¤幏鍙栬澶�
+ #region 璐ㄩ噺妯″潡 璁惧宸ヨ壓鍙傛暟瓒嬪娍鍥� 鏍规嵁娴佽浆鍗¤幏鍙栬澶�+妯″叿
[Route("QC_CustomerAppealReport/Get_EquipList")]
[HttpGet]
@@ -688,7 +688,10 @@
{
List<object> columnNameList = new List<object>();
- ds = oCN.RunProcReturn("select distinct b.HInterID HItemID,b.HName HName from SB_EquipICMOTechParamBillMain a left join Gy_EquipFileBillMain b on a.HEquipID=b.HInterID where HProcExchBillNo='" + HProcExchBillNo + "'", "SB_EquipICMOTechParamBillMain");
+ 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)
@@ -720,7 +723,7 @@
[Route("QC_CustomerAppealReport/SB_EquipICMOTechParamList")]
[HttpGet]
- public object SB_EquipICMOTechParamList(string sWhere, string user)
+ public object SB_EquipICMOTechParamList(string sWhere, string user,string Type)
{
try
{
@@ -742,7 +745,7 @@
return objJsonResult;
}
- ds = oCN.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillList '" + HProcExchBillNo + "','" + HProcName + "','" + HTechParamName + "','"+HEquipName+"'", "h_p_SB_EquipICMOTechParamBillList");
+ 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)
@@ -949,16 +952,18 @@
try
{
List<object> columnNameList = new List<object>();
- if (sWhere == null || sWhere.Equals(""))
- {
- ds = oCN.RunProcReturn("select * from h_v_QC_ProcessPerformanceFirstPassList order by 鏈堜唤 desc", "h_v_QC_ProcessPerformanceFirstPassList");
- }
- else
- {
- string sql1 = "select * from h_v_QC_ProcessPerformanceFirstPassList where 1 = 1 ";
- string sql = sql1 + sWhere + " order by 鏈堜唤 ";
- ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessPerformanceFirstPassList");
- }
+
+ Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
+
+ string HYear = dic["HYear"].ToString();//骞�
+ string HProject = dic["HProject"].ToString();//椤圭洰鍙�
+ string HMaterNumber = dic["HMaterNumber"].ToString();//鐗╂枡浠g爜
+ 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)
@@ -986,7 +991,6 @@
}
#endregion
-
#region 璐ㄩ噺妯″潡 鍒剁▼缁╂晥瓒嬪娍鍥�(鍚堟牸鐜�) 鏌ヨ
[Route("QC_CustomerAppealReport/getQC_ProcessPerformancePass")]
@@ -996,16 +1000,18 @@
try
{
List<object> columnNameList = new List<object>();
- if (sWhere == null || sWhere.Equals(""))
- {
- ds = oCN.RunProcReturn("select * from h_v_QC_ProcessPerformancePassList order by 鏈堜唤 desc", "h_v_QC_ProcessPerformancePassList");
- }
- else
- {
- string sql1 = "select * from h_v_QC_ProcessPerformancePassList where 1 = 1 ";
- string sql = sql1 + sWhere + " order by 鏈堜唤 ";
- ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessPerformancePassList");
- }
+
+ Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
+
+ string HYear = dic["HYear"].ToString();//骞�
+ string HProject = dic["HProject"].ToString();//椤圭洰鍙�
+ string HMaterNumber = dic["HMaterNumber"].ToString();//鐗╂枡浠g爜
+ 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)
@@ -1049,7 +1055,7 @@
else
{
string sql1 = "select * from h_v_OA_ErrMsgBackBillList_Query where 1 = 1 ";
- string sql = sql1 + sWhere + " order by 鏃ユ湡 ";
+ string sql = sql1 + sWhere + " order by 鏃ユ湡 desc ";
ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackBillList_Query");
}
@@ -1381,25 +1387,16 @@
{
List<object> columnNameList = new List<object>();
- Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
-
- string HEquipNumber = dic["HEquipNumber"].ToString();
- string HEquipName = dic["HEquipName"].ToString();
- string HProcName = dic["HProcName"].ToString();
-
- string HTechParamName = dic["HTechParamName"].ToString();
- string HDate = dic["HDate"].ToString();
-
- if ((HEquipNumber == null || HEquipNumber == "") && (HEquipName == null || HEquipName == "") && (HProcName == null || HProcName == "") && (HTechParamName == null || HTechParamName == "") && (HDate == null || HDate == ""))
+ if (sWhere == null || sWhere.Equals(""))
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳煡璇㈡潯浠讹紒";
- objJsonResult.data = null;
- return objJsonResult;
+ ds = oCN.RunProcReturn("select * from h_v_Sb_EquipMentCollectionTechParam order by 閲囬泦鏃ユ湡 desc", "h_v_Sb_EquipMentCollectionTechParam");
}
-
- ds = oCN.RunProcReturn("select HSourceCode 璁惧缂栫爜,CONVERT(VARCHAR, HDate, 120) 閲囬泦鏃ユ湡,HTechParamName 宸ヨ壓浜ф暟,HResult 鏁伴噰鍊� from Sb_EquipMentCollectionTechParam_Temp where HSourceCode='" + HEquipNumber + "' and HTechParamName='"+ HTechParamName + "' and CONVERT(date, HDate) <='"+HDate+"'", "Sb_EquipMentCollectionTechParam_Temp");
+ else
+ {
+ string sql1 = "select * from h_v_Sb_EquipMentCollectionTechParam where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 閲囬泦鏃ユ湡 ";
+ ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMentCollectionTechParam");
+ }
//娣诲姞鍒楀悕
foreach (DataColumn col in ds.Tables[0].Columns)
@@ -1427,6 +1424,98 @@
}
#endregion
+ #region 璐ㄩ噺妯″潡 鍏ㄧ▼璐ㄩ噺杩芥函
+ [Route("QC_CustomerAppealReport/Get_QC_FiveMenOneRingList")]
+ [HttpGet]
+ public object Get_QC_FiveMenOneRingList(string SN, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList '" + SN + "'", "h_p_QC_FiveMenOneRingList");
+
+ // 閬嶅巻鎵�鏈夎〃
+ foreach (DataTable table in ds.Tables)
+ {
+ List<object> tableColumnList = new List<object>();
+
+ // 娣诲姞鍒楀悕
+ 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<object> columnNameList = new List<object>();
+
+ ds = oCN.RunProcReturn("exec h_p_QC_FiveMenOneRingList_Query '" + linterid + "'", "h_p_QC_FiveMenOneRingList_Query");
+
+ // 閬嶅巻鎵�鏈夎〃
+ foreach (DataTable table in ds.Tables)
+ {
+ List<object> tableColumnList = new List<object>();
+
+ // 娣诲姞鍒楀悕
+ 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 璐ㄩ噺妯″潡 鍒剁▼闄烽槺娴嬭瘯瓒嬪娍鍥炬姤琛�
/// <summary>
@@ -1468,6 +1557,47 @@
#endregion
+ #region 璐ㄩ噺妯″潡 鍒剁▼璐ㄩ噺闂ㄩ�冮�歌秼鍔垮浘鎶ヨ〃
+
+ /// <summary>
+ /// 鍒剁▼璐ㄩ噺闂ㄩ�冮�歌秼鍔垮浘鎶ヨ〃
+ /// </summary>
+ /// <returns></returns>
+ [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<object> columnNameList = new List<object>();
+ //娣诲姞鍒楀悕
+ 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)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+ 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缁╂晥瓒嬪娍鍥炬姤琛�
/// <summary>
--
Gitblit v1.9.1