From 5b6d9876d89219f34a2fda2820b1de752d28d77e Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期二, 08 四月 2025 11:05:24 +0800 Subject: [PATCH] 物料:增加 制单人 --- WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 222 insertions(+), 9 deletions(-) diff --git a/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs b/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs index e966cf1..affcc46 100644 --- a/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs +++ b/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs @@ -9,6 +9,7 @@ using System.Web.Http; using WebAPI.Models; using System.Windows.Forms; +using SyntacticSugar.constant; namespace WebAPI.Controllers { @@ -385,6 +386,30 @@ } bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + + //鑷姩瀹℃牳璁剧疆 + if (Convert.ToInt32(OperationType) == 1 || Convert.ToInt32(OperationType) == 4) + { + objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D + //绯荤粺鍙傛暟 鑷姩瀹℃牳 + string sReturn = ""; + if (oSystemParameter.ShowBill(ref sReturn) == true) + { + if (oSystemParameter.omodel.Kf_SellOutBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳 + { + objJsonResult.Verify = "Y"; + } + else + { + objJsonResult.Verify = "N"; + } + } + } + else + { + objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D + objJsonResult.Verify = "N"; } if (bResult) @@ -1232,7 +1257,7 @@ { List<object> columnNameListSum = new List<object>(); List<object> columnNameList0 = new List<object>(); - //List<object> columnNameList1 = new List<object>(); + List<object> columnNameList1 = new List<object>(); //List<object> columnNameList2 = new List<object>(); //List<object> columnNameList3 = new List<object>(); //List<object> columnNameList4 = new List<object>(); @@ -1248,13 +1273,13 @@ columnNameList0.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 } - ////娣诲姞 鐢熶骇璁㈠崟 鍒楀悕 - //foreach (DataColumn col in ds.Tables[1].Columns) - //{ - // Type dataType = col.DataType; - // string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; - // columnNameList1.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 - //} + //娣诲姞 鐢熶骇璁㈠崟 鍒楀悕 + foreach (DataColumn col in ds.Tables[1].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList1.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } ////娣诲姞 鐗规壒鐢宠鍗� 鍒楀悕 //foreach (DataColumn col in ds.Tables[2].Columns) @@ -1281,7 +1306,7 @@ //} columnNameListSum.Add(columnNameList0); - //columnNameListSum.Add(columnNameList1); + columnNameListSum.Add(columnNameList1); //columnNameListSum.Add(columnNameList2); //columnNameListSum.Add(columnNameList3); //columnNameListSum.Add(columnNameList4); @@ -1819,5 +1844,193 @@ } } #endregion + + + #region 閿�鍞嚭搴撳崟涓嬫帹鏌ヨ鍒楄〃 + [Route("Kf_SellOutBill/PushList")] + [HttpGet] + public object PushList(string HBillNo, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + string sql = "select * from h_v_IF_SellOutBillList_EditInit where 鍗曟嵁鍙� = '" + HBillNo + "' and 鐘舵�� = '宸插鏍�' and 鏁伴噺 - 鍏宠仈鏁伴噺 > 0"; + + + ds = oCN.RunProcReturn(sql, "h_v_IF_SellOutBillList_EditInit"); + + if (ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "鎵句笉鍒扮鍚堟潯浠跺崟鎹�!"; + objJsonResult.data = null; + return objJsonResult; + } + + + 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 = CodeConstant.SUCCEED; + objJsonResult.count = CountConstant.SUCCEED; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 閿�鍞嚭搴撳崟鏌ヨ鍒楄〃 + [Route("Kf_SellOutBill/QueryList")] + [HttpGet] + public object QueryList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + + if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBillQuery", 1, false, user)) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "鏃犳潈闄愭煡鐪�!"; + objJsonResult.data = null; + return objJsonResult; + } + string sql = "select * from h_v_Kf_SellOutBillQuery where 1 = 1 "; + + if (sWhere == "" || sWhere == null) + { + ds = oCN.RunProcReturn("select * from h_v_Kf_SellOutBillQuery order by hmainid desc", "h_v_Kf_SellOutBillQuery"); + } + else + { + ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_Kf_SellOutBillQuery"); + } + + + + 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 = CodeConstant.SUCCEED; + objJsonResult.count = CountConstant.SUCCEED; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 閿�鍞嚭搴撳崟鏌ヨ瀛愬垪琛� + [Route("Kf_SellOutBill/QuerySubList")] + [HttpGet] + public object QuerySubList(string hmainid, string user) + { + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + + if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBillQuery", 1, false, user)) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "鏃犳潈闄愭煡鐪�!"; + objJsonResult.data = null; + return objJsonResult; + } + string sql = "select * from h_v_Kf_SellOutBillQuerySub where hmainid = " + hmainid; + + ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Kf_SellOutBillQuerySub"); + + + 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 = CodeConstant.SUCCEED; + objJsonResult.count = CountConstant.SUCCEED; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 閿�鍞嚭搴撳崟 鍒ゆ柇鏄惁鍏峰鏌ョ湅閲戦鏉冮檺 + [Route("Kf_SellOutBill/CheckRight_Money")] + [HttpGet] + public object CheckRight_Money(string user) + { + try + { + //鍒ゆ柇鏌ヨ鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBill_Money", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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