From ce376f4060560f729dcd3820b31b202253828264 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期三, 15 五月 2024 17:29:02 +0800 Subject: [PATCH] 采购管理 全部模块, 销售管理一半模块 增加 单据保存时、审核时、反审核时、删除时 ,进行 会计期间 结账 的判断和控制 --- WebAPI/Controllers/BaseSet/Gy_CustomerController.cs | 90 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 73 insertions(+), 17 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs index c5d51b0..b2ef0d7 100644 --- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs @@ -93,6 +93,49 @@ } } + #region 瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛] 鏌ヨ + /// <summary> + /// 杩斿洖瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛]鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/RelationUserlist")] + [HttpGet] + public object RelationUserlist(Int64 HCusID) + { + try + { + List<object> columnNameList = new List<object>(); + + string sql = "select * from h_v_Gy_Customer_RelationUsers_Query where HCusID = " + HCusID + " order by 鐢ㄦ埛缂栫爜 asc"; + ds = oCN.RunProcReturn(sql, "h_v_Gy_Customer_RelationUsers_Query"); + + //娣诲姞鍒楀悕 + 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 = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + /// <summary> /// 瀹㈡埛鍒楄〃淇敼鎸夐挳鏂规硶 ///鍙傛暟锛歴tring sql銆� @@ -105,7 +148,7 @@ try { string sql = string.Format(@"select c.HItemID,c.HNumber 瀹㈡埛浠g爜,c.HName 瀹㈡埛鍚嶇О,c.HHelpCode 鍔╄鐮�,c.HShortName 绠�绉�,c.HAddress 鍦板潃,c.HLinkMan 鑱旂郴浜�,c.HLinkPhone 鑱旂郴鐢佃瘽 - ,c.HMobilePhone 鎵嬫満,c.HFax 浼犵湡,c.HPostalCode 閭紪,c.HEmail 鐢靛瓙閭欢,c.HCorMan 娉曚汉浠h〃,c.HBank 寮�鎴烽摱琛�,c.HBankAccount 閾惰璐﹀彿, + ,c.HMobilePhone 鎵嬫満,c.HFax 浼犵湡,c.HPostalCode 閭紪,c.HEmail 鐢靛瓙閭欢,c.HCorMan 娉曚汉浠h〃,c.HBank 寮�鎴烽摱琛�,c.HBankAccount 閾惰璐﹀彿,c.HMateOutEmp 棰嗙敤浜�, c.HTaxNum 绋庡姟鐧昏鍙�,c.HTaxRate 澧炲�肩◣鐜�,c.HEnglishName 鑻辨枃鍚嶇О,c.HEngLishAddress 鑻辨枃鍦板潃,c.HCountry 鍥藉,c.HCusStatus 瀹㈡埛鐘舵�� ,c.HStopflag 绂佺敤鏍囧織,c.HRemark 澶囨敞,c.HAreaID 鍦板尯ID,a.HName 鍦板尯鍚嶇О,c.HCurID 榛樿璐у竵ID,r.HName 榛樿璐у竵, c.HSSID 缁撶畻鏂瑰紡ID,s.HName 缁撶畻鏂瑰紡,c.HCusTypeID 瀹㈡埛鍒嗙被ID,t.HName 瀹㈡埛鍒嗙被 from Gy_Customer c @@ -311,7 +354,7 @@ DateTime HMakeTime = list[0].HMakeTime; long HCreateOrgID = list[0].HCREATEORGID; long HUseOrgID = list[0].HUSEORGID; - + string HMateOutEmp = list[0].HMateOutEmp; //DateTime HDeleteDate = list[0].HDeleteDate; @@ -339,7 +382,7 @@ ",HEmpID,HCreditDate,HCreditRatingDate,HMaxCreditRatingDate" + ",HMonthUseQty,HForecastCreditRating,HCreditLevelID,HCountAccrualRating" + ",HSubsidyAccrualRating,HCreditRating,HMaxCreditRating" + - ",HCusTypeID,HCREATEORGID,HUSEORGID) " + + ",HCusTypeID,HCREATEORGID,HUSEORGID,HMateOutEmp) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID + ", " + HLevel + ",1,'" + HStopflag + "','" + HRemark + "'" + ",'" + HShortName + "','" + HAddress + "','" + HLinkMan + "','" + HLinkPhone + "','" + HMobilePhone + "'" + @@ -349,7 +392,7 @@ "," + HEmpID + "," + HCreditDate + "," + HCreditRatingDate + "," + HMaxCredRatingDate + "," + HMonthUseQty + "," + HForecastCreditRating + "," + HCreditLevelID + "," + HCountAccrualRating + "," + HSubsidyAccrualRating + "," + HCreditRating + "," + HMaxCreditRating + - ", " + HCusTypeID + ","+ HCreateOrgID + ","+ HUseOrgID + ")"); + ", " + HCusTypeID + ","+ HCreateOrgID + ","+ HUseOrgID + ",'"+ HMateOutEmp + "')"); //淇敼涓婄骇涓洪潪鏈骇浠g爜 oCN.RunProc("Update Gy_Customer set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); @@ -565,7 +608,7 @@ DateTime HMakeTime = list[0].HMakeTime; long HCreateOrgID = list[0].HCREATEORGID; long HUseOrgID = list[0].HUSEORGID; - + string HMateOutEmp = list[0].HMateOutEmp; //鍒ゆ柇鏉冮檺 if (!ClsPub.Security_Log(msg5, 1, false, msg4)) @@ -622,7 +665,8 @@ ",HAreaID ='" + HAreaID + "'" + ",HCusStatus ='" + HCusStatus + "'" + ",HCusTypeID ='" + HCusTypeID + "'" + - ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + ",HMateOutEmp='"+ HMateOutEmp+ + "',HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); //淇敼瀛愰」鐩唬鐮� //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); //灏嗕笂绾� 涓洪潪鏈骇 @@ -704,25 +748,37 @@ return objJsonResult; } // - if (oDept.DeleteByID(HItemID)) + try { - //鍐欏叆鏃ュ織 - ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); - //鏇存柊涓婄骇涓� 鏈骇 - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "鍒犻櫎鎴愬姛"; - objJsonResult.data = null; - return objJsonResult; + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } } - else + catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.Message = "鍒犻櫎澶辫触锛岃瀹㈡埛瀛樺湪鍏宠仈鐨勯攢鍞鍗曘�侀攢鍞嚭搴撳崟銆佺敓浜ц鍗曪紝鎴栫▼搴忛敊璇��"; objJsonResult.data = null; return objJsonResult; } + } //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); -- Gitblit v1.9.1