From faa75fa1adc685525773ead403278350cdfb8595 Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期三, 19 六月 2024 14:06:20 +0800 Subject: [PATCH] 添加新查询接口 --- WebAPI/Controllers/CGGL/Cg_POInStockBackBillController.cs | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 260 insertions(+), 4 deletions(-) diff --git a/WebAPI/Controllers/CGGL/Cg_POInStockBackBillController.cs b/WebAPI/Controllers/CGGL/Cg_POInStockBackBillController.cs index 4b59d38..cb4573a 100644 --- a/WebAPI/Controllers/CGGL/Cg_POInStockBackBillController.cs +++ b/WebAPI/Controllers/CGGL/Cg_POInStockBackBillController.cs @@ -91,7 +91,7 @@ return objJsonResult; } } - #region 閲囪喘閫�鏂欏崟 淇濆瓨/缂栬緫鍔熻兘 + #region 閫�鏂欓�氱煡鍗� 淇濆瓨/缂栬緫鍔熻兘 [Route("Cg_POInStockBackBill/POInStockBackBillEdit")] [HttpPost] public object POInStockBackBillEdit([FromBody] JObject sMainSub) @@ -144,7 +144,7 @@ { msg2 = "[" + msg2.ToString() + "]"; List<ClsCg_POInStockBackBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBackBillMain>>(msg2); - + long HPURCHASEORGID = mainList[0].HOrgID; long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 long HPRDORGID = mainList[0].HPRDORGID;//鐢熶骇缁勭粐 @@ -158,7 +158,6 @@ Single HExRate = mainList[0].HExRate;//姹囩巼 long HManagerID = mainList[0].HManagerID;//涓荤 long HAPPORGID = mainList[0].HAPPORGID;//鐢宠缁勭粐 - long HPURCHASEORGID = mainList[0].HPURCHASEORGIDD;//閲囪喘缁勭粐 long HREQUIREORGID = mainList[0].HREQUIREORGID;//闇�姹傜粍缁� long HSETTLEORGID = mainList[0].HSETTLEORGID;//缁撶畻缁勭粐 long HOWNERTYPEID = mainList[0].HOWNERTYPEID;//璐т富绫诲瀷 @@ -187,6 +186,16 @@ string HDeleteDate = mainList[0].HDeleteDate; string HCloseMan = mainList[0].HCloseMan; string HCloseDate = mainList[0].HCloseDate; + + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.Message = s; + return objJsonResult; + } ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_POInStockBackBillList"); @@ -234,7 +243,7 @@ "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + ",HSupID=" + HSupID + ",HCurID=" + HCurID + ", HWHID = " + HWHID + ",HExRate=" + HExRate + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID - + ",HAddress='" + HAddress + "'where HInterID=" + HInterID; + + ",HAddress='" + HAddress + "' ,HInnerBillNo='" + HInnerBillNo + "' where HInterID=" + HInterID; oCN.RunProc(sql); //鍒犻櫎瀛愯〃 @@ -242,6 +251,9 @@ } //淇濆瓨瀛愯〃 objJsonResult = AddBillSub(msg3, HInterID, OperationType, user); + + //閫�鏂欓�氱煡鍗曟柊澧炲洖濉噰璐鍗曞叧鑱旀暟閲� + oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockBackToPOOrder_Add " + HInterID); if (objJsonResult.code == "0") { @@ -414,6 +426,17 @@ return objJsonResult; } //================================================================================== + + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + string s = ""; + int sYear = 0; + int sPeriod = 0; + DateTime HDate = DateTime.Now; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.Message = s; + return objJsonResult; + } string sReturn = ""; oCN.BeginTran(); @@ -983,6 +1006,17 @@ } //================================================================================== + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + string s = ""; + int sYear = 0; + int sPeriod = 0; + DateTime HDate = DateTime.Now; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.Message = s; + return objJsonResult; + } + //瀹℃牳鎻愪氦 if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Cg_POInStockBackBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { @@ -1022,6 +1056,17 @@ return objJsonResult; } //========================================================= + + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + string s = ""; + int sYear = 0; + int sPeriod = 0; + DateTime HDate = DateTime.Now; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.Message = s; + return objJsonResult; + } //鍙嶅鏍告彁浜bandonCheck if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Cg_POInStockBackBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) @@ -1202,6 +1247,182 @@ } #endregion + #region 閫�鏂欓�氱煡鍗� 琛屽叧闂�/琛屽弽鍏抽棴 + /// <summary> + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="IsAudit">鍏抽棴(0),鍙嶅叧闂�(1)</param> + /// <param name="CurUserName">鍏抽棴浜�</param> + /// <returns></returns> + [Route("Cg_POInStockBackBill/CloseRowCg_POInStockBackBill")] + [HttpGet] + public object CloseRowCg_POInStockBackBill(int HInterID, int HEntryID, int IsAudit, string CurUserName) + { + string ModRightNameCheck = "Cg_POInStockBackBill_Close"; + string SubBillName = "Cg_POInStockBackBillSub"; //瀛愯〃琛ㄥ悕 + DBUtility.ClsPub.CurUserName = CurUserName; + DataSet ds = null; + try + { + //妫�鏌ユ潈闄� + if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "琛屽叧闂け璐ワ紒鏃犳潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + //HInterID鏁版嵁鍒ゆ柇 + if (HInterID <= 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID灏忎簬0锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + Int64 lngBillKey = 0; + lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹� + DAL.ClsCg_POInStockBackBill oBill = new DAL.ClsCg_POInStockBackBill(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣� + + //閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔 + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁 + { + if (oBill.omodel.HDeleteMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘杩涜琛屽叧闂紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HCloseMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘杩涜琛屽叧闂紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶈兘杩涜琛屽叧闂紒"; + objJsonResult.data = null; + return objJsonResult; + } + + string sql = "select * from " + SubBillName + " where HInterID = " + HInterID + " and HEntryID = " + HEntryID; + ds = oCN.RunProcReturn(sql, "Cg_POInStockBackBillSub"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璇ヨ鏁版嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + if (IsAudit == 0) //琛屽叧闂垽鏂� + { + if (ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "琛屽凡鍏抽棴!涓嶈兘鍐嶆琛屽叧闂紒"; + objJsonResult.data = null; + return objJsonResult; + } + } + if (IsAudit == 1) //琛屽弽鍏抽棴鍒ゆ柇 + { + if (ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "琛屾湭鍏抽棴!涓嶉渶瑕佸啀琛屽弽鍏抽棴锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒ゆ柇琛屾槸鍚︿负鑷姩鍏抽棴 + string temp = ds.Tables[0].Rows[0]["HCloseType"].ToString(); + if (ds.Tables[0].Rows[0]["HCloseType"].ToString() == "False") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "琛屽弽鍏抽棴澶辫触!琛屼负鑷姩鍏抽棴锛屼笉鑳借繘琛屾墜鍔ㄥ弽鍏抽棴锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + + + //杩涜闇�瑕佽繘琛岀殑琛屽叧闂�/琛屽弽鍏抽棴鎿嶄綔 + if (IsAudit == 0) //琛屽叧闂彁浜� + { + //琛屽叧闂彁浜� + if (oBill.CloseRow(lngBillKey, HEntryID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "琛屽叧闂垚鍔�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "琛屽叧闂け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + if (IsAudit == 1) //琛屽弽鍏抽棴鎻愪氦 + { + //琛屽弽鍏抽棴鎻愪氦 + if (oBill.CancelRow(lngBillKey, HEntryID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅叧闂垚鍔�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍏抽棴澶辫触鎴栬�呭弽鍏抽棴澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 閫�鏂欓�氱煡鍗� 浣滃簾/鍙嶄綔搴熷姛鑳� [Route("Cg_POInStockBackBill/DropCg_POInStockBackBill")] [HttpGet] @@ -1332,7 +1553,42 @@ } #endregion + #region 閫�鏂欓�氱煡鍗� 鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栭��鏂欓�氱煡鍗曟暟鎹� + [Route("Cg_POInStockBackBill/loadCg_POInStockBackBill_Push")] + [HttpGet] + public object loadCg_POInStockBackBill_Push(long HInterID, long HSubID) + { + try + { + ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_POInStockBackBillList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈煡璇㈠埌婧愬崟淇℃伅锛�"; + 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; + } + } + #endregion } } #endregion \ No newline at end of file -- Gitblit v1.9.1