From eb29ee75c7f2f4154b7a3d0c475f94e0b964e996 Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期三, 02 四月 2025 18:17:48 +0800
Subject: [PATCH] 优化事务基础写法

---
 Tiger.Controllers.MES/Controllers/MESController.BIZ_MES_WO.cs |  141 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 141 insertions(+), 0 deletions(-)

diff --git a/Tiger.Controllers.MES/Controllers/MESController.BIZ_MES_WO.cs b/Tiger.Controllers.MES/Controllers/MESController.BIZ_MES_WO.cs
index bf78085..301f42f 100644
--- a/Tiger.Controllers.MES/Controllers/MESController.BIZ_MES_WO.cs
+++ b/Tiger.Controllers.MES/Controllers/MESController.BIZ_MES_WO.cs
@@ -7,6 +7,8 @@
 using Tiger.Model.Entitys.MES.BizMesWo;
 using Tiger.Model.Entitys.MES.BizMesWoBatch;
 using Tiger.Api.iBiz;
+using Newtonsoft.Json;
+using Tiger.Model.Entitys.MES.Position;
 
 namespace Tiger.Api.Controllers.MES
 {
@@ -119,6 +121,27 @@
         }
 
         /// <summary>
+        /// 浠庡伐鍗曚腑瑙g粦姝e湪鐢熶骇鐨勬潯鐮�
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> UnbindWipSnFromWO([FromBody] ApiAction<UnbindWipSnInput> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().UnbindWipSnFromWO(action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
         /// 鏇存柊宸ュ崟妯℃澘鍙橀噺
         /// </summary>
         /// <param name="action"></param>
@@ -160,6 +183,22 @@
             return Ok(response);
         }
 
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> SavePrintLabelInAct([FromBody] ApiAction action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().SavePrintLabelInAct(action.Data?.ToString()));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
         /// <summary>
         /// 鑾峰彇閲嶆墦鏍囩淇℃伅
         /// </summary>
@@ -173,6 +212,27 @@
             try
             {
                 response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().GetRePrintInfo(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> GetShipList([FromBody] ApiAction<ShippingInput> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().GetShipList(action.Data));
             }
             catch (System.Exception ex)
             {
@@ -203,5 +263,86 @@
             }
             return Ok(response);
         }
+
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> GetWoNodeBatchCount([FromBody] ApiAction<GetWoNodeBatchCountInput> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { BATCH = action.Data.BatchNo, NodeIdOrName=action.Data.NodeName });
+                var dt = Biz.Db.Ado.UseStoredProcedure().GetDataTable("SP_MES_GET_NODE_BATCH_COUNT", pars);
+                response.Data = dt;
+            }
+            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> GetErpProdInBth([FromBody] ApiAction action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().GetErpProdInBth(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> GetWoPickList([FromBody] ApiAction action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().GetWoPickList(action.Data?.ToString()));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
+        /// 鎻愪氦鍓嶆鏌ユ槸鍚﹀矖浣嶃�佸伐鍗曞拰涓嶈壇浠g爜
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> CheckCode([FromBody] ApiAction action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().CheckCode(action.Data?.ToString()));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
     }
 }

--
Gitblit v1.9.3