From 8073c856046a276b7a7ccdec4f91b202ffd06878 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期五, 25 十月 2024 12:04:30 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/WebAPIController.cs | 221 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 197 insertions(+), 24 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index 6af28ed..ce68293 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -171,6 +171,68 @@ } } + [Route("Web/GetMAXNum_ProcExchange")] + [HttpGet] + public object GetMAXNum_ProcExchange(string HBillType) + { + try + { + string HBillNo = ""; + string sErrMsg = ""; + Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈� + HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref sErrMsg); + //HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref sErrMsg, true); + + DataSet ds; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ds = oCN.RunProcReturn("exec h_p_IF_CheckBillIDExists_WMS " + HInterID + ",'" + HBillNo + "'", "h_p_IF_CheckBillIDExists_WMS"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + sErrMsg = "瀛樺湪閲嶅鍗曟嵁鍐呯爜鎴栧崟鎹彿鐨勫崟鎹紝涓嶅厑璁告柊澧烇紝璇烽��鍑哄悗閲嶆柊鐧诲綍锛�"; + objjson.code = "0"; + objjson.count = 0; + objjson.Message = sErrMsg; + objjson.data = null; + return objjson; + } + else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0][0]) == "1") + { + sErrMsg = "瀛樺湪閲嶅鍗曟嵁鍐呯爜鎴栧崟鎹彿鐨勫崟鎹紝涓嶅厑璁告柊澧烇紝璇烽��鍑哄悗閲嶆柊鐧诲綍锛�"; + objjson.code = "0"; + objjson.count = 0; + objjson.Message = sErrMsg; + objjson.data = null; + return objjson; + } + else + { + //----------鍒涘缓铏氳〃------------------------ + DataTable dt_Main = new DataTable("Json"); + dt_Main.Columns.Add("HBillNo", typeof(string)); + dt_Main.Columns.Add("HInterID", typeof(Int64)); + //---------鍒涘缓鏂拌------------------------ + DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 + dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑 + dr_main["HBillNo"] = DBUtility.ClsPub.isStrNull(HBillNo); + dr_main["HInterID"] = DBUtility.ClsPub.isLong(HInterID); + //杩斿洖鏁版嵁 + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛"; + objjson.data = dt_Main; + return objjson; + } + } + catch (Exception e) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + e.ToString(); + objjson.data = null; + return objjson; + } + } + /// <summary> /// 鑷姩鑾峰彇鍩虹璧勬枡 娴佹按鍙� 灏辨槸浠g爜 /// </summary> @@ -373,47 +435,57 @@ /// <returns></returns> [Route("Web/GetXGPassword")] [HttpGet] - public object GetXGPassword(string UserName, string oldPassword, string PassWord, string Repassword) + public object GetXGPassword(string UserName, string oldPassword, string PassWord, string Repassword,string HCloudUserName,string HCloudUserPsd) { try { ClsCN oCn = new ClsCN(); DataSet oDs = new DataSet(); //========== - oDs = oCn.RunProcReturn("select Czmm from Gy_Czygl where Czybm='" + UserName + "'", "Gy_Czygl"); - if (PassWord.Trim() != Repassword.Trim()) + + if(PassWord!=null) { - objjson.code = "0"; - objjson.count = 0; - objjson.Message = "2娆″瘑鐮佷笉涓�鑷达紒"; - objjson.data = oDs.Tables[0]; - return objjson; ; - } - //=========== - if (oDs == null || oDs.Tables[0].Rows.Count == 0) - { - objjson.code = "0"; - objjson.count = 0; - objjson.Message = "娌℃湁杩欎釜鐢ㄦ埛锛屼笉鑳戒慨鏀瑰瘑鐮侊紒"; - objjson.data = null; - return objjson; ; - } - else - { - oCn.RunProc("update Gy_Czygl set Czmm='" + ClsPub.StrToPsd(PassWord.Trim()) + "' where Czybm='" + UserName.Trim() + "'"); + oDs = oCn.RunProcReturn("select Czmm from Gy_Czygl where Czybm='" + UserName + "'", "Gy_Czygl"); + if (PassWord.Trim() != Repassword.Trim()) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "2娆″瘑鐮佷笉涓�鑷达紒"; + objjson.data = oDs.Tables[0]; + return objjson; ; + } + //=========== + if (oDs == null || oDs.Tables[0].Rows.Count == 0) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "娌℃湁杩欎釜鐢ㄦ埛锛屼笉鑳戒慨鏀瑰瘑鐮侊紒"; + objjson.data = null; + return objjson; ; + } + oCn.RunProc("update Gy_Czygl set Czmm='" + ClsPub.StrToPsd(PassWord.Trim()) + "',HCloudUserName = '" + HCloudUserName+ "',HCloudUserPsd = '" + HCloudUserPsd+ "' where Czybm='" + UserName.Trim() + "'"); objjson.code = "0"; objjson.count = 1; objjson.Message = "* 瀵嗙爜淇敼鎴愬姛锛�"; objjson.data = null; + return objjson; + } + else + { + oCn.RunProc("update Gy_Czygl set HCloudUserName = '" + HCloudUserName + "',HCloudUserPsd = '" + HCloudUserPsd + "' where Czybm='" + UserName.Trim() + "'"); + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "* 閲戣澏浜戣处鍙蜂慨鏀规垚鍔燂紒"; + objjson.data = null; return objjson; ; } } - catch (Exception) + catch (Exception e) { objjson.code = "0"; objjson.count = 0; - objjson.Message = "淇敼瀵嗙爜寮傚父锛�"; + objjson.Message = "淇敼瀵嗙爜寮傚父锛�" + e.ToString(); objjson.data = null; return objjson; ; } @@ -1436,6 +1508,52 @@ { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); ds = oCN.RunProcReturn("Select HItemID,鐝粍浠g爜 鐝粍浠g爜,鐝粍鍚嶇О 鐝粍 from h_v_GroupList where 1=1 " + sWhere + " Order by HItemID ", "h_v_GroupList"); + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触"; + objjson.data = null; + return objjson; + } + else + { + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛!"; + objjson.data = ds.Tables[0]; + return objjson; + } + } + catch (Exception e) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + e.ToString(); + objjson.data = null; + return objjson; + } + } + + /// <summary> + /// 鑾峰彇鐝粍鍒楄〃 鏍规嵁鐢ㄦ埛瀵瑰簲鐝粍鍏崇郴锛岃幏鍙栫敤鎴峰搴旂殑鐝粍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Web/GetGroupListByUser_Json")] + [HttpGet] + public object GetGroupListByUser_Json(string sWhere, string user) + { + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + //鏍规嵁鐢ㄦ埛瀵瑰簲鐝粍鐨勫叧绯伙紝杩囨护鏉′欢涓鍔犲彧鏄剧ず瀵瑰簲鐨勭彮缁� + DataSet dsHitemID = oCN.RunProcReturn("exec h_p_Gy_GetSQLGroupByUser '" + user + "'", "h_p_Gy_GetSQLGroupByUser"); + sWhere = sWhere + DBUtility.ClsPub.isStrNull(dsHitemID.Tables[0].Rows[0]["HBack"]); + + DataSet ds = oCN.RunProcReturn("Select HItemID,鐝粍浠g爜 鐝粍浠g爜,鐝粍鍚嶇О 鐝粍 from h_v_GroupList where 1=1 " + sWhere + " Order by HItemID ", "h_v_GroupList"); if (ds == null || ds.Tables[0].Rows.Count <= 0) { objjson.code = "0"; @@ -14099,7 +14217,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn(" select * from h_v_Sc_ProcessExchangeBillList where 1=1 and 鏃ユ湡>=DATEADD(MONTH,-2,GETDATE()) order by 鍗曟嵁鍙� desc,hsubid", "h_v_Sc_ProcessExchangeBillList"); + ds = oCN.RunProcReturn("select top 500 * from h_v_Sc_ProcessExchangeBillList where 1=1 order by 鍗曟嵁鍙� desc,hsubid", "h_v_Sc_ProcessExchangeBillList"); } else { @@ -14650,6 +14768,61 @@ return objjson; } } + + #region 鏉$爜涓绘。鍒嗛〉鍒楄〃 + [Route("Gy_BarCodeBillList/page")] + [HttpGet] + public json Gy_BarCodeBillListPage(string sWhere, string user, int page, int size) + { + DataSet ds; + json res = new json(); + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; + objJsonResult.data = null; + return objJsonResult; + } + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",''", "h_p_IF_BarCodeBillList"); + } + else + { + ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_BarCodeBillList"); + } + + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + res.code = CodeConstant.SUCCEED; + res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + res.Message = "Sucess锛�"; + res.list = columnNameList; + res.data = ds.Tables[0]; + return res; + } + catch (Exception e) + { + res.code = CodeConstant.FAIL; + res.count = CountConstant.FAIL; + res.Message = "Exception锛�" + e.ToString(); + res.data = null; + return res; + } + } + #endregion + /// <summary> /// 鏍规嵁璁惧淇濆吇瑙勭▼鏄剧ず璁惧淇濆吇瑙勭▼椤圭洰 /// </summary> -- Gitblit v1.9.1