From acb137729948d4e3d5e99864338c203d68993b9d Mon Sep 17 00:00:00 2001
From: 仲国强 <519541279@qq.com>
Date: 星期五, 27 八月 2021 16:48:08 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 38726d4..727a50f 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,9 +390,9 @@
         ///鍙傛暟锛歴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
             {
@@ -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