From 58e8384dc1d75fa13441011e073e6fede4ec71b7 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期日, 18 八月 2024 22:17:18 +0800
Subject: [PATCH] 一些更改

---
 Tiger.Api/Controllers/MES/MESController.Route.cs |  134 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 133 insertions(+), 1 deletions(-)

diff --git a/Tiger.Api/Controllers/MES/MESController.Route.cs b/Tiger.Api/Controllers/MES/MESController.Route.cs
index 63c004f..f1030aa 100644
--- a/Tiger.Api/Controllers/MES/MESController.Route.cs
+++ b/Tiger.Api/Controllers/MES/MESController.Route.cs
@@ -139,6 +139,111 @@
         }
 
         /// <summary>
+        /// 鍒犻櫎浜у搧缁戝畾鐨勫伐鑹鸿矾绾�
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> DeleteProdRoute([FromBody] ApiAction<DelProdRotInput> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IRoute>().DeleteProdRoute(action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
+        /// 淇濆瓨宸ュ崟宸ヨ壓鑺傜偣宀椾綅璧勬簮
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> SaveWoRouteNodePost([FromBody] ApiAction<List<MES_WO_NODE_POST>> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IRoute>().SaveWoRouteNodePost(action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
+        /// 淇濆瓨宸ュ崟宸ヨ壓璺嚎鍥惧舰鏁版嵁
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> SaveWoRouteData([FromBody] ApiAction<WoRouteData> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IRoute>().SaveWoRouteData(action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
+        /// 鑾峰彇宸ュ崟宸ヨ壓璺嚎鍥惧舰鏁版嵁
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> GetWoRouteData([FromBody] ApiAction action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IRoute>().GetWoRouteData(action.Data?.ToString()));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
+        /// 鍒犻櫎宸ュ崟缁戝畾鐨勫伐鑹鸿矾绾�
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> DeleteWoRoute([FromBody] ApiAction<DelWoRotInput> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IRoute>().DeleteWoRoute(action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
         /// 鑾峰彇宸ヨ壓璺嚎鏍戝舰缁撴瀯
         /// </summary>
         /// <param name="prodCode"></param>
@@ -157,7 +262,7 @@
         public async Task<IActionResult> GetWoPTreeAsync(string wo)
         {
             SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { WO = wo });
-            var data = Biz.Db.Ado.UseStoredProcedure().SqlQuery<V_MES_ROUTE_PTREE>("SP_MES_GET_WO_PTREE", pars);//杩斿洖List
+            var data = Biz.Db.Ado.UseStoredProcedure().SqlQuery<V_MES_WO_PTREE>("SP_MES_GET_WO_PTREE", pars);//杩斿洖List
             return Ok(data);
         }
 
@@ -245,5 +350,32 @@
             }
             return Ok(response);
         }
+
+        /// <summary>
+        /// 娣诲姞宸ュ崟鐨勫鎴风殑宸ヨ壓璺嚎
+        /// </summary>
+        /// <param name="wo"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> SP_MES_WO2CUST(string wo)
+        {
+            ApiAction response = new();
+            try
+            {
+                SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { WO = wo, ERR_CODE = 0, ERR_MSG = "" });
+                pars[1].Direction = System.Data.ParameterDirection.Output;
+                pars[2].Direction = System.Data.ParameterDirection.Output;
+                Biz.Db.Ado.UseStoredProcedure().ExecuteCommand("SP_MES_WO2CUST", pars);
+                response.Data = pars[1].Value;
+                response.IsSuccessed = pars[1].Value.ToInt32() == 0 ? true : false;
+                response.LocaleMsg = new(pars[2].Value.ToString());
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
     }
 }

--
Gitblit v1.9.3