From d3473e15fd14ea84a1378f3d3841bcad16c2d9f3 Mon Sep 17 00:00:00 2001 From: yxj <yxj@hz-kingdee.com> Date: 星期二, 18 六月 2024 15:32:04 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs | 205 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 192 insertions(+), 13 deletions(-) diff --git a/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs b/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs index c9c1657..e2daa97 100644 --- a/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs +++ b/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs @@ -38,14 +38,14 @@ { List<object> columnNameList = new List<object>(); //鏌ョ湅鏉冮檺 - //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user)) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; - // objJsonResult.data = null; - // return objJsonResult; - //} + if (!DBUtility.ClsPub.Security_Log("YS_ReceiveBillQuery", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } if (sWhere == null || sWhere.Equals("")) { @@ -218,7 +218,15 @@ } - + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + 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; + } //淇濆瓨 //淇濆瓨瀹屾瘯鍚庡鐞� @@ -351,21 +359,79 @@ return objJsonResult; } + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_YS_ReceiveBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_YS_ReceiveBill_BeforeDelCtrl"); + 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; + } + //================================================================================== + + //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗 + 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; + } + oCN.BeginTran(); oCN.RunProc("delete from YS_ReceiveBillMain where HInterID = " + HInterID); oCN.RunProc("delete from YS_ReceiveBillSub where HInterID= " + HInterID); + //鍒犻櫎鍚庢帶鍒�================================================================================== + string sql2 = "exec h_p_YS_ReceiveBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_YS_ReceiveBill_AfterDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + s = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + s = ds.Tables[0].Rows[0]["HRemark"].ToString(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //============================================================================================== + oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; + objJsonResult.Message = "鎮ㄥ凡鍒犻櫎鍗曟嵁鍙蜂负" + BillOld.omodel.HBillNo + "鐨勬敹娆惧崟锛�"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { + oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exception锛�" + e.ToString(); @@ -469,6 +535,17 @@ //杩涜闇�瑕佽繘琛岀殑瀹℃牳/鍙嶅鏍告搷浣� if (IsAudit == 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) + { + objJsonResult.Message = s; + return objJsonResult; + } + oCN.BeginTran(); //璁板綍杩斿洖淇℃伅 @@ -507,9 +584,33 @@ oCN.RunProc(sql); } } - + + //瀹℃牳鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_YS_ReceiveBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_YS_ReceiveBill_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; + oCN.RollBack(); + 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; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + //瀹℃牳鎻愪氦 - if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) + if (oBill.CheckBill(oBill.omodel.HInterID,oBill.omodel.HBillNo, "h_p_YS_ReceiveBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { oCN.Commit(); @@ -543,8 +644,41 @@ 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 sql1 = "exec h_p_YS_ReceiveBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_YS_ReceiveBill_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; + } + //=========================================================== + //鍙嶅鏍告彁浜bandonCheck - if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) + if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_YS_ReceiveBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -915,5 +1049,50 @@ } } #endregion + + #region 鏀舵鍗� 鏍规嵁瀹㈡埛鑾峰彇鍏宠仈鑱屽憳 + [Route("YS_ReceiveBill/getRelationEmpByCusID")] + [HttpGet] + public object getRelationEmpByCusID(long HCusID) + { + try + { + string sql = @"select b.HEmpID HEmpID,e.HName HEmpName,b.HDeptID HDeptID,d.HName HDeptName,d.HEmpID HManagerID,e1.HName HManagerName + from Gy_UserCustomerRelation as a + left join Gy_Czygl as b on a.HUserID = b.Czybm + left join Gy_Employee as e on b.HEmpID = e.HItemID + left join Gy_Department as d on b.HDeptID = d.HItemID + left join Gy_Employee as e1 on d.HEmpID = e1.HItemID + where a.HCusID = " + HCusID; + ds = oCN.RunProcReturn(sql, "Gy_UserCustomerRelation"); + + + 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 } } \ No newline at end of file -- Gitblit v1.9.1