From 35afcfe07fef52f74a2079fdb5977a87f88ddbb6 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 17 十二月 2024 20:40:47 +0800
Subject: [PATCH] 提交前检查是否岗位、工单和不良代码

---
 Tiger.Business.MES/Transaction/Position.cs |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/Tiger.Business.MES/Transaction/Position.cs b/Tiger.Business.MES/Transaction/Position.cs
index 5e71779..601f1a3 100644
--- a/Tiger.Business.MES/Transaction/Position.cs
+++ b/Tiger.Business.MES/Transaction/Position.cs
@@ -993,6 +993,27 @@
             return list;
         }
         #endregion
+        #region 鎻愪氦鍓嶉�氱敤鏂规硶
+        /// <summary>
+        /// 鎻愪氦鍓嶆鏌ユ槸鍚﹀矖浣嶃�佸伐鍗曞拰涓嶈壇浠g爜
+        /// </summary>
+        /// <param name="code"></param>
+        /// <returns></returns>
+        public async Task<ApiAction<CheckCodeOutput>> CheckCode(string code) {
+            var action = new ApiAction<CheckCodeOutput>($"妫�鏌ユ潯鐮亄code}鎴愬姛", new CheckCodeOutput());
+            try
+            {
+                action.Data.Position = DbCache.Cache.Position[code];
+                action.Data.WorkOrder = await MainDB.Queryable<BIZ_MES_WO>().Where(q=>q.ORDER_NO == code).FirstAsync();
+                action.Data.Defect = DbCache.Cache.Defect[code];
+            }
+            catch (Exception ex)
+            {
+                action.CatchExceptionWithLog(ex, $"妫�鏌ユ潯鐮亄code}寮傚父");
+            }
+            return action;
+        }
+        #endregion
         #endregion Functions
 
         public override bool Close(bool needSaveHistoryLog = false)

--
Gitblit v1.9.3