From de01df014d96593a797e446fcf27b7d35bd295c9 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期四, 28 十二月 2023 17:49:14 +0800 Subject: [PATCH] 检验依据后端审查,反审查,禁用,反禁用 --- WebAPI/Controllers/XSGL/Xs_SeOutStockBackBillController.cs | 406 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 405 insertions(+), 1 deletions(-) diff --git a/WebAPI/Controllers/XSGL/Xs_SeOutStockBackBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOutStockBackBillController.cs index 0cfc2c0..fc77be8 100644 --- a/WebAPI/Controllers/XSGL/Xs_SeOutStockBackBillController.cs +++ b/WebAPI/Controllers/XSGL/Xs_SeOutStockBackBillController.cs @@ -17,6 +17,7 @@ //鑾峰彇绯荤粺鍙傛暟 Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; + public DAL.ClsXs_SeOutStockBackBill BillOld = new DAL.ClsXs_SeOutStockBackBill(); private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); @@ -212,7 +213,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "閲戣澏鏀舵枡閫氱煡鍗曞悓姝ュけ璐sonRoot锛�" + _result; + objJsonResult.Message = "閲戣澏閫�璐ч�氱煡鍗曞悓姝ュけ璐sonRoot锛�" + _result; objJsonResult.data = null; return objJsonResult; } @@ -447,5 +448,408 @@ } #endregion + #region 閫�璐ч�氱煡鍗曞鏍�/鍙嶅鏍稿姛鑳� + [Route("Xs_SeOutStockBackBill/CheckXs_SeOutStockBackBill")] + [HttpGet] + public object CheckXs_SeOutStockBackBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBackBill_Check", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愬鏍�!"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 瀹℃牳 2 鍙嶅鏍� + if (Type == 1) + { + if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); + //if (DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["Hback"]) != 0) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 1; + // objJsonResult.Message = "璇ヤ换鍔″崟宸蹭笅鎺ㄦ祦杞崱锛屼笉鍏佽鍙嶅鏍�" + DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HBackRemark"]); + // objJsonResult.data = null; + // return objJsonResult; + //} + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + 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 閫�璐ч�氱煡鍗曞叧闂�/鍙嶅叧闂姛鑳� + [Route("Xs_SeOutStockBackBill/CloseXs_SeOutStockBackBill")] + [HttpGet] + public object CloseXs_SeOutStockBackBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBackBill_Close", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愬叧闂�!"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 鍏抽棴 2 鍙嶅叧闂� + if (Type == 1) + { + if (!BillOld.CloseBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + if (!BillOld.CancelClose(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + 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 閫�璐ч�氱煡鍗曚綔搴�/鍙嶄綔搴熷姛鑳� + [Route("Xs_SeOutStockBackBill/CancellXs_SeOutStockBackBill")] + [HttpGet] + public object CancellXs_SeOutStockBackBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBackBill_Delete", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愪綔搴�!"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 浣滃簾 2 鍙嶄綔搴� + if (Type == 1) + { + if (!BillOld.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + if (!BillOld.AbandonCancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + 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 閫�璐ч�氱煡 + /// <summary> + /// 淇濆瓨閫�璐ч�氱煡鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Xs_SeOutStockBackBill/SaveXs_SeOutStockBackBillList")] + [HttpPost] + public object SaveXs_SeOutStockBackBillList([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string user = sArray[2].ToString(); + string OperationType = sArray[3].ToString(); + + string UserName = ""; + ListModels oListModels = new ListModels(); + try + { + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBackBill_Edit", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄�"; + objJsonResult.data = null; + return objJsonResult; + } + DAL.ClsXs_SeOutStockBackBillForLayUI oBill = new DAL.ClsXs_SeOutStockBackBillForLayUI(); + List<Model.ClsXs_SeOutStockBackBillMain> lsmain = new List<Model.ClsXs_SeOutStockBackBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getSeOutStockBackBillMainByJson(msg2); + foreach (Model.ClsXs_SeOutStockBackBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HBillType = "1403"; + oItem.HBillSubType = "1403"; + oItem.HBillStatus = 0; + oItem.HPeriod = 0; + oItem.HMaker = user; + oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Model.ClsXs_SeOutStockBackBillSub> ls = new List<Model.ClsXs_SeOutStockBackBillSub>(); + ls = oListModels.getSeOutStockBackBillSubByJson(msg3); + int i = 0; + foreach (Model.ClsXs_SeOutStockBackBillSub oItemSub in ls) + { + i++; + oItemSub.HSourceEntryID = 0; + oItemSub.HSourceInterID = 0; + oItemSub.HEntryID = i; + // DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HCloseType = false; + oItemSub.HSourceBillNo = ""; + oItemSub.HSourceBillType = ""; + oItemSub.HRelationQty = 0; + oItemSub.HRelationMoney = 0; + oItemSub.HCloseMan = ""; + //oItemSub.HRemark = ""; + oBill.DetailColl.Add(oItemSub); + + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (Convert.ToInt32(OperationType) == 1) + { + // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + #endregion + + /// <summary> + /// 鏍规嵁ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xs_SeOutStockBackBill/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBackBillList where hmainid=" + HInterID, "h_v_IF_SellOutBillList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + } } \ No newline at end of file -- Gitblit v1.9.1