From 6dbb4801f817b738fddcde730919db972636544b Mon Sep 17 00:00:00 2001 From: 沈泽 <211959439@qq.com> Date: 星期一, 30 八月 2021 08:46:33 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 41 +++++++++++++++++++++-------------------- 1 files changed, 21 insertions(+), 20 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index 38726d4..54e7dbc 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -22,13 +22,13 @@ DataSet ds; DataSet ds1; string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"]; - - /// <summary> - /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 - ///鍙傛暟锛歴tring sql銆� - ///杩斿洖鍊硷細object銆� - /// </summary> - [Route("Cj_StationOutBill/AddBill")] + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Cj_StationOutBill/AddBill")] [HttpPost] public object AddBill([FromBody] JObject oMain) { @@ -390,15 +390,15 @@ ///鍙傛暟锛歴tring sql銆� ///杩斿洖鍊硷細object銆� /// </summary> - [Route("Cj_StationOutBill/list")] + [Route("Cj_StationOutBill/get_Display")] [HttpGet] - public object list(string sWhere) + public object get_Display(string sWhere) { try { if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList " + sWhere, "h_v_MES_StationOutBillList"); + ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList " + sWhere + " order by 鍑虹珯鏃堕棿 desc", "h_v_MES_StationOutBillList"); } else { @@ -484,7 +484,8 @@ string HRemark = HttpContext.Current.Request.Params["HRemark"]; //澶囨敞 string HUserName = HttpContext.Current.Request.Params["HUserName"]; //鍒涘缓浜� HttpPostedFile files = HttpContext.Current.Request.Files["file"]; - string path = HttpContext.Current.Server.MapPath("~/Files/" + HBillNo); + string path = HttpContext.Current.Server.MapPath("~/../Files/" + HBillNo); + //string path = @"D:\\Files\\"+ HBillNo; dynamic dyResult = UpLoadFile(files, path, HBillNo, HRemark, HUserName); if (dyResult != null && dyResult.result == 1) { @@ -498,7 +499,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "涓婁紶澶辫触锛�"; + objJsonResult.Message = dyResult.returnval; objJsonResult.data = null; return objJsonResult; } @@ -539,7 +540,7 @@ { File.Delete(fileurl); //鍒犻櫎鎸囧畾鏂囦欢 files.SaveAs(fileurl); - string StrPath = "/Files/"+ HBillNo+"/"+ filename; + string StrPath = "/files/"+ HBillNo+"/"+ filename; if (File.Exists(fileurl)) { //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱 @@ -562,7 +563,7 @@ { Directory.CreateDirectory(fileSavePath); //娣诲姞鏂囦欢澶� files.SaveAs(fileurl); - string StrPath = "/Files/" + HBillNo + "/" + filename; + string StrPath = "/files/" + HBillNo + "/" + filename; if (File.Exists(fileurl)) { //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱 @@ -612,10 +613,11 @@ [HttpGet] public object Filelist(string HBillNo) { - var url = fileip + "/Files/" + HBillNo+"/"; + var url = fileip + "/files/" + HBillNo+"/"; + //@"C:\\files\\" try { - ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url from MES_AccessoriesList where HSourceBillNo=" + HBillNo, "MES_AccessoriesList"); + ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url from MES_AccessoriesList where HSourceBillNo='" + HBillNo+"'", "MES_AccessoriesList"); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucess锛�"; @@ -644,16 +646,15 @@ { try { - - ds = oCN.RunProcReturn("delete from MES_AccessoriesList where HItemID ='" + HItemID + "'", "MES_AccessoriesList"); - string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/Files/" + HSourceBillNo), HFileName); + + oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID); + string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/" + HSourceBillNo), HFileName); File.Delete(fileurl); //鍒犻櫎鎸囧畾鏂囦欢 objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; objJsonResult.data = null; return objJsonResult; - } catch (Exception e) { -- Gitblit v1.9.1