From 8c8be9fbcc6888f0770dd95fcf96cd75bff1a952 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期五, 29 十一月 2024 12:11:09 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 111 insertions(+), 6 deletions(-) diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" index f0d78c2..85039e8 100644 --- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" +++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" @@ -1,6 +1,7 @@ 锘縰sing Newtonsoft.Json; using Newtonsoft.Json.Linq; using Pub_Class; +using SyntacticSugar.constant; using System; using System.Collections; using System.Collections.Generic; @@ -34,7 +35,7 @@ List<object> columnNameList = new List<object>(); string sql1 = "select * from h_v_QC_FirstPieceCheckBill where 1 = 1 "; - string sql = sql1 + sWhere + " order by hmainid desc"; + string sql = sql1 + sWhere + " order by 鍒跺崟鏃ユ湡 desc"; ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBill"); //娣诲姞鍒楀悕 @@ -84,8 +85,18 @@ { List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Query", 3, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } + string sql1 = "select * from h_v_QC_FirstPieceCheckBillMainList where 1 = 1 "; - string sql = sql1 + sWhere + " order by hmainid desc"; + string sql = sql1 + sWhere + " "; ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBillMainList"); //娣诲姞鍒楀悕 @@ -122,6 +133,61 @@ objJsonResult.Message = "Exception锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; + } + } + #endregion + + #region 宸ヨ祫缁撶畻鍗�(涓汉)鍒嗛〉鍒楄〃 + [Route("QC_FirstPieceCheckBillMain/QC_FirstPieceCheckBillMainListPage")] + [HttpGet] + public json QC_FirstPieceCheckBillMainListPage(string sWhere, string user, int page, int size) + { + DataSet ds; + json res = new json(); + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Query", 3, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + objJsonResult.data = null; + return objJsonResult; + } + sWhere = sWhere.Replace("'", "''"); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_QC_FirstPieceCheckBillMainList " + page + "," + size + ",''", "h_p_QC_FirstPieceCheckBillMainList"); + } + else + { + ds = oCN.RunProcReturn("exec h_p_QC_FirstPieceCheckBillMainList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_FirstPieceCheckBillMainList"); + } + + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + res.code = CodeConstant.SUCCEED; + res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + res.Message = "Sucess锛�"; + res.list = columnNameList; + res.data = ds.Tables[0]; + return res; + } + catch (Exception e) + { + res.code = CodeConstant.FAIL; + res.count = CountConstant.FAIL; + res.Message = "Exception锛�" + e.ToString(); + res.data = null; + return res; } } #endregion @@ -242,6 +308,7 @@ BillNew.omodel.HProcExchEntryID = ClsPub.isLong(mainList[0].HProcExchEntryID); BillNew.omodel.HProcExchBillNo = ClsPub.isStrNull(mainList[0].HProcExchBillNo); BillNew.omodel.HProcExchQty = ClsPub.isLong(mainList[0].HProcExchQty); + BillNew.omodel.HProcID = ClsPub.isLong(mainList[0].HProcID); BillNew.omodel.HMaterID = ClsPub.isLong(mainList[0].HMaterID); BillNew.omodel.HFirstCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); BillNew.omodel.HLastResult = ClsPub.isBool(mainList[0].HLastResult); @@ -254,6 +321,8 @@ BillNew.omodel.HShiftsID = ClsPub.isLong(mainList[0].HShiftsID); BillNew.omodel.HErrTreatment = ClsPub.isStrNull(mainList[0].HErrTreatment); BillNew.omodel.HBatchNo = ClsPub.isStrNull(mainList[0].HBatchNo); + BillNew.omodel.HTakeSampleCheckBillID = ClsPub.isLong(mainList[0].HTakeSampleCheckBillID); + BillNew.omodel.HTakeSampleCheckBillNo = ClsPub.isStrNull(mainList[0].HTakeSampleCheckBillNo); List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg3); BillNew.DetailColl = new List<Model.ClsQC_FirstPieceCheckBillSub>(); for (int i = 0; i < subList.ToArray().Length; i++) @@ -1111,7 +1180,7 @@ #region 棣栦欢/宸ュ簭 妫�楠屽崟鏍规嵁婧愬崟绫诲瀷鑾峰彇淇℃伅-婧愬崟涓哄伐搴忔祦杞崱 [Route("CheckBill/get_ProcessExchangeBill")] [HttpGet] - public object get_ProcessExchangeBill(string HInterID, string user) + public object get_ProcessExchangeBill(string HInterID, string HEntryID, string user) { try { @@ -1124,13 +1193,13 @@ switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource) { case "宸ュ簭": - sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ュ簭','" + HInterID + "'"; + sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ュ簭','" + HInterID + "','" + HEntryID + "'"; break; case "鐗╂枡": - sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'鐗╂枡','" + HInterID + "'"; + sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'鐗╂枡','" + HInterID + "','" + HEntryID + "'"; break; case "宸ヨ壓璺嚎": - sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ヨ壓璺嚎','" + HInterID + "'"; + sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ヨ壓璺嚎','" + HInterID + "','" + HEntryID + "'"; break; } @@ -1164,6 +1233,42 @@ } #endregion + #region 棣栦欢 鏍规嵁宸ュ簭鎴栬�呯敓浜ц祫婧愬幓鏌ヨ鏁版嵁 + [Route("CheckBill/GetICMOBillStatusList")] + [HttpGet] + public object GetICMOBillStatusList(string sWhere, string user) + { + try + { + ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOBillStatus_TmpList where 1=1 " + sWhere.ToString(), " h_v_Sc_ICMOBillStatus_TmpList "); + + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + else { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ユ棤鏁版嵁锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 棣栦欢妫�楠屽崟鏍规嵁婧愬崟绫诲瀷鑾峰彇淇℃伅-婧愬崟涓虹敓浜х姸鎬佷复鏃惰〃锛�3722锛� /// <summary> ///鍙傛暟锛歴tring sql銆� -- Gitblit v1.9.1