From fd8f4776bf512f7e3068a5868c3b5af0bd974647 Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期二, 26 十一月 2024 14:01:08 +0800 Subject: [PATCH] 查询列表子表按subid排序 --- WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs | 398 +++++++++++++++++++++++++++++++++----------------------- 1 files changed, 233 insertions(+), 165 deletions(-) diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs index dd1b723..5a5df2f 100644 --- a/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs +++ b/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json.Linq; +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; using NPOI.SS.Formula.Functions; using Pub_Class; using System; @@ -44,6 +45,7 @@ { try { + List<object> columnNameList = new List<object>();//瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺 if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBackBillList order by hmainid desc", "h_v_Kf_POStockInBackBillList"); @@ -54,13 +56,19 @@ string sql = sql1 + sWhere + " order by hmainid desc"; ds = oCN.RunProcReturn(sql, "h_v_Kf_POStockInBackBillList"); } - + foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢� + { + Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆 + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } //if (ds.Tables[0].Rows.Count != 0 || ds != null) //{ objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucess锛�"; objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴�� return objJsonResult; //} //else @@ -174,9 +182,19 @@ 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_Kf_POStockInBackBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Kf_POStockInBackBillList"); - if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板 + if ((OperationType == 1 || OperationType == 2 || OperationType == 4) && ds.Tables[0].Rows.Count == 0)//鏂板 { //淇濆瓨鍓嶆帶鍒�========================================= ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBackBill_BeforeSaveCtrl " + HInterID, "h_p_Kf_POStockInBackBill_BeforeSaveCtrl"); @@ -202,19 +220,19 @@ String sql = $@"Insert Into Kf_ICStockBillMain (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark - ,HInnerBillNo,HSTOCKORGID,HOWNERID ,HChecker,HCheckDate,HMaker,HMakeDate) + ,HInnerBillNo,HSTOCKORGID,HOWNERID ,HMaker,HMakeDate) values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1239 + "','" + HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + "'," + HSupID + "," + HCurID + "," + HWHID + "," + HEmpID + "," + HManagerID + "," + HSecManagerID + "," + HKeeperID + "," + HDeptID + ",'" + HExplanation + "','" + HRemark - + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HChecker + "',getdate()" + ",'" + HMaker + "',getdate()" + ")"; + + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HMaker + "',getdate()" + ")"; oCN.RunProc(sql); } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) { //淇敼 String sql = $@"update Kf_ICStockBillMain set " + - "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + + "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + ",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID + ",HAddress='" + HAddress + "'where HInterID=" + HInterID; @@ -225,6 +243,9 @@ } //淇濆瓨瀛愯〃 objJsonResult = AddBillSub(msg3, HInterID, OperationType, user); + + //閲囪喘閫�鏂欏崟鏂板鍥炲~閫�鏂欓�氱煡鍗曞叧鑱旀暟閲� + oCN.RunProc("exec h_p_Kf_UpDateRelation_POStockInBackToPOInStockBack_Add " + HInterID); if (objJsonResult.code == "0") { @@ -384,81 +405,91 @@ /// <returns></returns> [Route("Kf_POStockInBackBill/DeltetKf_POStockInBackBill")] [HttpGet] - public object DeleteKf_POStockInBackBill(string Hmainid, string HsupId, string HQty, string HSourceInterID, string HSourceEntryID, string user) + public object DeltetKf_POStockInBackBill(string HInterID, string user) { - DataSet ds; - DataSet dss; - //string ModRightNameCheck = "Sc_ProcessReport_check"; try { - //鍒犻櫎鏉冮檺 - if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBackBill_Delete", 1, false, user)) + string HBillNo = ""; + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Kf_POStockInBackBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Kf_POStockInBackBill_BeforeDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; objJsonResult.data = null; return objJsonResult; } - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - if (string.IsNullOrWhiteSpace(Hmainid)) + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "Hmainid涓虹┖锛�"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } - oCN.BeginTran();//寮�濮嬩簨鍔� - ds = oCN.RunProcReturn("select * from Kf_ICStockBillMain a inner join Kf_ICStockBillSub b on a.HInterID=b.HInterID where a.HInterID= '" + Hmainid + "'", "Kf_ICStockBillMain"); - dss = oCN.RunProcReturn("exec h_p_Cg_POInStockBillMain " + HQty + ", '" + HSourceInterID + "', '" + HSourceEntryID + "','" + user + " '", "h_p_Cg_POInStockBillMain"); - var sReturn = ""; - if (DBUtility.ClsPub.isLong(dss.Tables[0].Rows[0]["HBack"]) != 0) + //================================================================================== + + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + 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) { - sReturn = DBUtility.ClsPub.isStrNull(dss.Tables[0].Rows[0]["HBackRemark"]).ToString(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = sReturn; - objJsonResult.data = null; + objJsonResult.Message = s; return objJsonResult; } - if (ds == null || ds.Tables[0].Rows.Count == 0) + string sReturn = ""; + oCN.BeginTran(); + oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); + oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); + oCN.Commit(); + + //鍒犻櫎鍚庢帶鍒�================================================================================== + string sql2 = "exec h_p_Kf_POStockInBackBill_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Kf_POStockInBackBill_AfterDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { + sReturn = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + sReturn; objJsonResult.data = null; - return objJsonResult; ; + oCN.RollBack(); + return objJsonResult; } - if (ds.Tables[0].Rows.Count == 1) + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { - oCN.RunProc("delete Kf_ICStockBillSub where HInterID=" + Hmainid); - oCN.RunProc("delete Kf_ICStockBillMain where HInterID=" + Hmainid); + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + sReturn; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; } - else - { - oCN.RunProc($"delete Kf_ICStockBillSub where HInterID={ Hmainid}and HEntryID={HsupId}"); - } - oCN.Commit();//鎻愪氦浜嬪姟 - objJsonResult.code = "0"; + //============================================================================================== + + objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�"; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; objJsonResult.data = null; - return objJsonResult; ; - + return objJsonResult; } catch (Exception e) { + oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); + objJsonResult.Message = "Exception锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } - /// <summary> /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 @@ -522,151 +553,83 @@ } #endregion - #region 閲囪喘閫�鏂欏崟 瀹℃牳 鍙嶅鏍� + #region 閲囪喘閫�鏂欏崟 瀹℃牳/鍙嶅鏍� + /// <summary> + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param> + /// <param name="CurUserName">瀹℃牳浜�</param> + /// <returns></returns> [Route("Kf_POStockInBackBill/AuditProcessReportList")] [HttpGet] public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName) { - string sql = ""; + string ModRightNameCheck = "Kf_POStockInBackBill_Check"; + DBUtility.ClsPub.CurUserName = CurUserName; try { - //flag=1 瀹℃牳锛� flag=2 鍙嶅鏍� - //缂栬緫鏉冮檺 - if (!DBUtility.ClsPub.Security_Log_second("Kf_POStockInBackBill_Check", 1, false, CurUserName)) + //瀹℃牳鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏃犲鏍告潈闄愶紒"; + 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); - string HBillNo = ""; - ds = oCN.RunProcReturn("select * from Kf_ICStockBillMain where HInterID = " + HInterID, "Kf_ICStockBillMain"); - if (lngBillKey == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�"; - objJsonResult.data = null; - return objJsonResult; - } - DLL.ClsKf_SellOutBackBill oBill = new DLL.ClsKf_SellOutBackBill(); - if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) - { - //瀹℃牳鍓嶆帶鍒� - sql = "h_p_Kf_POStockInBackBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; - ds = oCN.RunProcReturn(sql, "h_p_Kf_POStockInBackBill_BeforeCheckCtrl"); - if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; - objJsonResult.data = null; - return objJsonResult; + lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹� + DAL.ClsKf_POStockInBackBill oBill = new DAL.ClsKf_POStockInBackBill(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣� - } - if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; - objJsonResult.data = null; - return objJsonResult; - } - - if (!BillOld.CheckBill(HInterID, HBillNo, "h_p_Kf_POStockInBackBill_AfterCheckCtrl", CurUserName, ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - if (oBill.omodel.HCloseMan != "") + //閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔 + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁 + { + if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "褰撳墠鍗曟嵁宸插叧闂�,涓嶈兘瀹℃牳"; + objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�"; objJsonResult.data = null; return objJsonResult; } - - if (oBill.omodel.HDeleteMan != "") + if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "褰撳墠鍗曟嵁宸蹭綔搴�,涓嶈兘瀹℃牳"; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�"; objJsonResult.data = null; return objJsonResult; } - - if (IsAudit == 1) + if (IsAudit == 0) //瀹℃牳鍒ゆ柇 { - if (oBill.omodel.HBillStatus == 2) + if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "褰撳墠鍗曟嵁宸插鏍革紝鏃犻渶鍐嶆瀹℃牳"; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�"; objJsonResult.data = null; - return objJsonResult; - } - else - { - string HCheckDate = DateTime.Now.Date.ToString(); - oCN.RunProc(" Update Kf_ICStockBillMain set HChecker='" + CurUserName + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HBillType='1239' and HInterID=" + HInterID); - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "瀹℃牳鎴愬姛锛�"; - objJsonResult.data = 1; return objJsonResult; } } - else + if (IsAudit == 1) //鍙嶅鏍稿垽鏂� { - //鍙嶅鏍稿墠鎺у埗 - sql = "exec h_p_Kf_POStockInBackBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; - ds = oCN.RunProcReturn(sql, "h_p_Kf_POStockInBackBill_BeforeUnCheckCtrl"); - if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; - objJsonResult.data = null; - return objJsonResult; - - } - if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; - objJsonResult.data = null; - return objJsonResult; - } - - if (BillOld.AbandonCheck(HInterID, HBillNo, "h_p_Kf_POStockInBackBill_AfterUnCheckCtrl", CurUserName, ref ClsPub.sExeReturnInfo)) - { - SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - } - if (oBill.omodel.HBillStatus == 1) + if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "褰撳墠鍗曟嵁鏈鏍革紝鏃犻渶鍙嶅鏍�"; + objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!"; objJsonResult.data = null; - return objJsonResult; - } - else - { - string HCheckDate = DateTime.Now.Date.ToString(); - oCN.RunProc(" Update Kf_ICStockBillMain set HChecker=' ',HCheckDate=null,HBillStatus=1 Where HBillType='1239' and HInterID=" + HInterID); - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅鏍告垚鍔燂紒"; - objJsonResult.data = 1; return objJsonResult; } } @@ -675,17 +638,125 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁鏈壘鍒�"; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } - } + + //杩涜闇�瑕佽繘琛岀殑瀹℃牳/鍙嶅鏍告搷浣� + if (IsAudit == 0) //瀹℃牳鎻愪氦 + { + + //瀹℃牳鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Kf_POStockInBackBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Kf_POStockInBackBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + 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; + } + + //瀹℃牳鎻愪氦 + if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_POStockInBackBill_AfterCheckCtrl", 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) //鍙嶅鏍告彁浜� + { + //鍙嶅鏍稿墠鎺у埗========================================= + DataSet ds = oCN.RunProcReturn("Exec h_p_Kf_POStockInBackBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'", "h_p_Kf_POStockInBackBill_BeforeUnCheckCtrl"); + if (ds == null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + "鍙嶅鏍稿墠鍒ゆ柇澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + 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_Kf_POStockInBackBill_AfterUnCheckCtrl", 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.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -839,7 +910,6 @@ } #endregion - #region 閲囪喘閫�鏂欏崟 浣滃簾/鍙嶄綔搴熷姛鑳� [Route("Kf_POStockInBackBill/DropKf_POStockInBackBill")] [HttpGet] @@ -922,14 +992,14 @@ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { - //if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!"; - // objJsonResult.data = null; - // return objJsonResult; - //} + if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!"; + objJsonResult.data = null; + return objJsonResult; + } if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") { objJsonResult.code = "0"; @@ -969,8 +1039,6 @@ } } #endregion - - } } #endregion \ No newline at end of file -- Gitblit v1.9.1