From 88d14b74edc9430c061c10fee97746566ddaf85d Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期二, 23 四月 2024 10:46:50 +0800 Subject: [PATCH] 自动生成条码_PLC:接收Socket通讯并自动生成条码、打印 --- WebAPI/Controllers/LMESController.cs | 184 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 184 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index 52fe709..86f8e5d 100644 --- a/WebAPI/Controllers/LMESController.cs +++ b/WebAPI/Controllers/LMESController.cs @@ -104,6 +104,8 @@ } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery"); @@ -131,6 +133,92 @@ return objJsonResult; } } + + #region 宸ュ簭娴佽浆鍗$淮鎶�-鏌ヨ + /// <summary> + /// 杩斿洖宸ュ簭娴佽浆鍗$淮鎶ゅ垪琛ㄤ富琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("LEMS/Sc_ProcessExchangeBillList_Query")] + [HttpGet] + public object Sc_ProcessExchangeBillList_Query(string sWhere, string user, string HBillSubType) + { + DataSet ds; + try + { + List<object> columnNameList = new List<object>(); + if (HBillSubType == "SUB") + { + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_SubQuery", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎸囧紩鍗℃棤鏌ヨ鏉冮檺!"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娴佽浆鍗℃棤鏌ヨ鏉冮檺!"; + objJsonResult.data = null; + return objJsonResult; + } + } + + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓� + string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "宸ュ簭娲惧伐鍗曞垪琛�"); + + sWhere += sql_splice; + } + } + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + + ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillList_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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "寮傚父锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion #region 宸ュ簭娴佽浆鍗� 涓嬫煡 /// <summary> @@ -1327,6 +1415,7 @@ List<object> columnNameList3 = new List<object>(); List<object> columnNameList4 = new List<object>(); List<object> columnNameList5 = new List<object>(); + List<object> columnNameList6 = new List<object>(); string sql = "exec h_p_Sc_ICMOBillList_LookDown " + HInterID; ds = oCN.RunProcReturn(sql, "h_p_Xs_SeOrderBill_lookdown"); @@ -1379,12 +1468,21 @@ columnNameList5.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 } + //娣诲姞 鐢熶骇璁㈠崟鍙樻洿鍗� 鍒楀悕 + foreach (DataColumn col in ds.Tables[6].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList6.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + columnNameListSum.Add(columnNameList0); columnNameListSum.Add(columnNameList1); columnNameListSum.Add(columnNameList2); columnNameListSum.Add(columnNameList3); columnNameListSum.Add(columnNameList4); columnNameListSum.Add(columnNameList5); + columnNameListSum.Add(columnNameList6); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -1472,6 +1570,54 @@ else { ds = oCN.RunProcReturn("exec [h_p_Xe_SeOutReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]"); + } + + //娣诲姞鍒楀悕 + 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 = "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("LEMS/SeOutStockReportList")] + [HttpGet] + public object SeOutStockReportList(string DateYear, string HType, string user) + { + try + { + DataSet ds; + List<object> columnNameList = new List<object>(); + + if (DateYear == null || DateYear.Equals("")) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璇烽�夋嫨鏈夋晥骞翠唤"; + return objJsonResult; + } + else + { + ds = oCN.RunProcReturn("exec [h_p_Xs_SeOutStockReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]"); } //娣诲姞鍒楀悕 @@ -2810,6 +2956,44 @@ #endregion + #region 鎶ヨ〃鏌ョ湅鏉冮檺鎺у埗 + /// <summary> + ///鍙傛暟锛歴tring HInterID銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("LMES/getReportByModRightNameCheck")] + [HttpGet] + public object getReportByModRightNameCheck(string ModRightNameCheck, string user) + { + try + { + string s = ""; + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = ""; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } \ No newline at end of file -- Gitblit v1.9.1