From e1dd681c82cdde2b21c35eb091fc992202d6d339 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期三, 31 七月 2024 14:04:03 +0800 Subject: [PATCH] 设备工艺参数趋势图,制程绩效趋势图(一次合格率) --- WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs | 71 +++++++++++++++++++++++++++++++++-- 1 files changed, 67 insertions(+), 4 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs index 4a5c1dc..520f9c4 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs @@ -16,6 +16,15 @@ public class Sc_ProcessExchangeBillController : ApiController { public DBUtility.ClsPub.Enum_BillStatus BillStatus; + public const string ModName = "3772"; //鍗曟嵁绫诲瀷 + public const string ModCaption = "宸ュ簭娴佽浆鍗�"; //鍗曟嵁鍚嶇О + public const string ModRightName = "Sc_ProcessExchangeBill"; + public const string ModRightNameList = ModRightName + "List"; //鍒楄〃 + public const string ModRightNameEdit = ModRightName + "_Edit"; //缂栬緫 + public const string ModRightNameCheck = ModRightName + "_Check"; //瀹℃牳 + public const string ModRightNameClose = ModRightName + "_Close"; //鍏抽棴 + public const string ModRightNameDelete = ModRightName + "_Delete"; //浣滃簾 + public const string ModRightNameDrop = ModRightName + "_Drop"; //鍒犻櫎 private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; @@ -1161,7 +1170,7 @@ string sql = string.Format(@"select * from h_v_Sc_ProcessExchangeBillQuerySub"); - ds = oCN.RunProcReturn(sql + " where hmainid=" + HInterID + " and 鍑虹珯鍏宠仈鏁伴噺=0 and cast(娴佹按鍙� as int)>" + ds1 .Tables[0].Rows[0][0].ToString(), "h_v_Sc_ProcessExchangeBillQuerySub"); + ds = oCN.RunProcReturn(sql + " where hmainid=" + HInterID + " and 鍑虹珯鍏宠仈鏁伴噺=0 and cast(娴佹按鍙� as int)>" + ds1 .Tables[0].Rows[0][0].ToString()+ " order by cast(娴佹按鍙� as int) ", "h_v_Sc_ProcessExchangeBillQuerySub"); if (float.Parse(ds.Tables[0].Rows[0]["杩涚珯鍏宠仈鏁伴噺"].ToString()) > 0) { @@ -1237,9 +1246,9 @@ objJsonResult.data = 1; return objJsonResult; } - + int num = oItem.HBillNo.Split('-').Length; oBill.omodel.HMaker = msg5; //鍒跺崟浜� - oBill.omodel.HNo = DBUtility.ClsPub.isLong(oItem.HBillNo.Split('-')[1]); + oBill.omodel.HNo = DBUtility.ClsPub.isLong(oItem.HBillNo.Split('-')[num - 1]); oBill.omodel.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oBill.omodel.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oBill.omodel.HDate = oItem.HDate;// 鏃ユ湡 @@ -1247,6 +1256,7 @@ oBill.omodel.HPlanEndDate = oItem.HPlanEndDate;// 璁″垝瀹屽伐鏃ユ湡 oBill.omodel.HQty = oItem.HQty;// 鏁伴噺 oBill.omodel.HBillNo = oItem.HBillNo;// 鍗曟嵁鍙� + oBill.omodel.HProjectNum = oItem.HProjectNum;// 椤圭洰鍙� } //琛ㄤ綋鏁版嵁 @@ -1302,7 +1312,6 @@ j++; } } - //淇濆瓨 //淇濆瓨瀹屾瘯鍚庡鐞� @@ -1902,5 +1911,59 @@ } #endregion + + #region 宸ュ簭娴佽浆鍗″垪琛� + /// <summary> + /// 鑾峰彇宸ュ簭娴佽浆鍗″垪琛ㄤ俊鎭� + /// </summary> + /// <returns></returns> + [Route("Sc_ProcessExchangeBillController/GetSc_ProcessExchangeBillList_Json")] + [HttpGet] + public object GetSc_ProcessExchangeBillList_Json(string sWhere, string HMaker, string OperationType, string ViewName) + { + try + { + //鍒ゆ柇鏉冮檺 + if (OperationType == "1") + { + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, HMaker)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } + } + + //杩斿洖鍒楄〃淇℃伅 + ds = oCN.RunProcReturn("select * from " + ViewName + " where 1=1 " + sWhere + " order by hmainid desc", ViewName); + 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 + } } \ No newline at end of file -- Gitblit v1.9.1