From f1b334ba320250708dcb47a8e2c97015fc07cc27 Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期一, 18 八月 2025 16:05:08 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/条码管理/WEBSController.cs | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 213 insertions(+), 17 deletions(-) diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" index 1d36d6b..4b9ec14 100644 --- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" +++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" @@ -658,6 +658,44 @@ } } + /// <summary> + /// 鑾峰彇閮ㄩ棬鍒楄〃淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetDepartmentList_Json")] + [HttpGet] + public object GetDepartmentList_Json(string Department, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Department with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Department + "%' or HName like '%" + Department + "%')", "Gy_Department"); + 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 = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "杩斿洖閮ㄩ棬淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion #region 渚涘簲鍟嗚祫鏂� @@ -1708,6 +1746,101 @@ #endregion + #region 鏍峰搧閿�鍞嚭搴撶紦瀛樺垪琛ㄧ晫闈紝杩斿洖缂撳瓨鍒楄〃淇℃伅 + + /// <summary> + /// 缂撳瓨鍒楄〃鐣岄潰锛岃繑鍥炵紦瀛樺垪琛ㄤ俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_PonderationBillMain_TempList_New_Json_YPSellOut")] + [HttpGet] + public object GetKf_PonderationBillMain_TempList_New_Json_YPSellOut(string HBillType, string HMaker, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_GetPonderationBillMain_TempList_New_YPSellOut '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_KF_GetPonderationBillMain_TempList_New_YPSellOut"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + 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 = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇鍗曟嵁缂撳瓨鍒楄〃淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇鍗曟嵁缂撳瓨鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍峰搧閿�鍞嚭搴撶紦瀛樺垪琛ㄧ晫闈紝杩斿洖宸蹭笂浼犲垪琛ㄤ俊鎭� + [Route("WEBSController/GetKf_ICStockBillList_Json_YPSellOut")] + [HttpGet] + public object GetKf_ICStockBillList_Json_YPSellOut(string HBillType, string HBillNo, string HSourceBillNo, string HMaker, Int64 HStockOrgID, string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryList_New_YPSellOut '" + HBillType + "','" + HBillNo + "','" + HSourceBillNo + "','" + HMaker + "'," + HStockOrgID.ToString() + ",'" + sWhere + "'", "h_p_Kf_ICStockBillQueryList_New_YPSellOut"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ涓嶅埌璇ュ崟鎹褰曪紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + 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 = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇鍗曟嵁淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇宸蹭笂浼犲崟鎹俊鎭け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion #region 缂撳瓨鍒楄〃 缂栬緫鍔熻兘璋冪敤 @@ -3070,25 +3203,23 @@ if (oWebs.set_SaveSellOutBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo)) { - if(lsmain[0].HIsTaxRate == 1) + oCn.BeginTran(); + try { - try - { - oCn.BeginTran(); - string sql_reWriteTaxData = "exec h_p_Kf_SellOutBill_withOutSourceBill_ReWriteTax " + lsmain[0].HInterID; - oCn.RunProc(sql_reWriteTaxData); - oCn.Commit(); - } - catch (Exception e3) - { - oCn.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "閿�鍞嚭搴撳崟涓婁紶鎴愬姛锛侊紒绋庣巼璁$畻澶辫触锛侊紒" + e3.ToString(); - objJsonResult.data = null; - return objJsonResult; - } + string sql_reWriteTaxData = "exec h_p_Kf_SellOutBill_withOutSourceBill_ReWriteTax " + lsmain[0].HInterID + "," + lsmain[0].HIsTaxRate + "," + lsmain[0].HIsTaxRate_upper; + oCn.RunProc(sql_reWriteTaxData); + oCn.Commit(); } + catch (Exception e3) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "閿�鍞嚭搴撳崟涓婁紶鎴愬姛锛侊紒绋庣巼璁$畻澶辫触锛侊紒" + e3.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� @@ -3223,6 +3354,8 @@ websLsmain.HBillerID = lsmain[0].HBillerID; websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; websLsmain.HOWNERID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SaveEntrustOutBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo)) { @@ -9654,6 +9787,69 @@ } #endregion + #region [鏍规嵁鍗曟嵁鍙� 鐗╂枡缂栫爜 鐗╂枡鍚嶇О 鐢熶骇璁㈠崟 宸ュ簭 閮ㄩ棬鑾峰彇 宸ュ簭娴佽浆鍗 + /// <summary> + /// 鑾峰彇鏉$爜淇℃伅 娣诲姞宸ュ簭 閮ㄩ棬鏌ヨ鏉′欢 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetMES_ProcessExchangeBillList_APP_HaiCheng")] + [HttpGet] + public object GetMES_ProcessExchangeBillList_APP_HaiCheng(string HBillNo, string HNumber, string HName, string HICMOBillNo, string user, string HProcID, string HDeptID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeBillList_APP_HaiCheng " + + "@HBillNo = N'" + HBillNo + "', " + + "@HNumber = N'" + HNumber + "', " + + "@HName = N'" + HName + "', " + + "@HICMOBillNo = N'" + HICMOBillNo + "'," + + "@HProcID = N'" + HProcID + "', " + + "@HDeptID = N'" + HDeptID + "'" + , "h_p_MES_ProcessExchangeBillList_PDA_QiaoYi"); + if((bool)ds.Tables[1].Rows[0]["returntype"] == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = ds.Tables[1].Rows[0]["mesg"].ToString(); + objJsonResult.data = null; + return objJsonResult; + } + else if (ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "褰撳墠鎵�杈撳叆杩囨护鏉′欢锛屾病鏈夎繑鍥炰换浣曠粨鏋滐紒"; + objJsonResult.data = null; + return objJsonResult; + }else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + 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 = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 瀛愯〃鏄庣粏璋冪敤鏂规硶 /// <summary> /// 鏌ョ湅鏄庣粏 -- Gitblit v1.9.1