From caff80579a118f9347dd3510fa42ac72125d0b98 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期三, 12 六月 2024 23:55:02 +0800
Subject: [PATCH] 工序岗位资源更新

---
 Tiger.Business/MES/Biz.Route.cs                     |   30 ++++++++++
 Tiger.IBusiness/MES/IRoute.cs                       |    1 
 Tiger.Api/Controllers/MES/MESController.Route.cs    |   22 +++++++
 Tiger.Model.Net/Tiger.Model.Net.csproj              |    1 
 Tiger.Model.Net/Entitys/MES/V_MES_ROUTE_NOE_POST.cs |   68 ++++++++++++++++++++++
 Tiger.Model.Net/Entitys/MES/MES_ROUTE_NODE_POST.cs  |   36 ++++++-----
 6 files changed, 141 insertions(+), 17 deletions(-)

diff --git a/Tiger.Api/Controllers/MES/MESController.Route.cs b/Tiger.Api/Controllers/MES/MESController.Route.cs
index 02e4d7a..383aa66 100644
--- a/Tiger.Api/Controllers/MES/MESController.Route.cs
+++ b/Tiger.Api/Controllers/MES/MESController.Route.cs
@@ -1,5 +1,6 @@
 锘縰sing Microsoft.AspNetCore.Mvc;
 using Rhea.Common;
+using System.Collections.Generic;
 using System.Threading.Tasks;
 using Tiger.IBusiness;
 using Tiger.Model;
@@ -112,5 +113,26 @@
             }
             return Ok(response);
         }
+
+        /// <summary>
+        /// 淇濆瓨鑺傜偣宀椾綅璧勬簮
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/[controller]/[action]")]
+        public async Task<IActionResult> SaveRouteNodePost([FromBody] ApiAction<List<MES_ROUTE_NODE_POST>> action)
+        {
+            ApiAction response = new();
+            try
+            {
+                response = response.GetResponse(await DI.Resolve<IRoute>().SaveRouteNodePost(action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = response.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
     }
 }
diff --git a/Tiger.Business/MES/Biz.Route.cs b/Tiger.Business/MES/Biz.Route.cs
index 3cf9ded..c36570e 100644
--- a/Tiger.Business/MES/Biz.Route.cs
+++ b/Tiger.Business/MES/Biz.Route.cs
@@ -379,6 +379,36 @@
                 }
                 return await Task.FromResult(result);
             }
+
+            /// <summary>
+            /// 淇濆瓨鑺傜偣宀椾綅璧勬簮
+            /// </summary>
+            /// <param name="nodePost"></param>
+            /// <returns></returns>
+            public async Task<ApiAction> SaveRouteNodePost(List<MES_ROUTE_NODE_POST> nodePost) {
+                var result = new ApiAction();
+                try
+                {
+                    var db = Db;
+                    var dbTran = db.UseTran(() =>
+                    {
+                        var y = db.Storageable(nodePost)
+                           .ToStorage();
+                        y.AsInsertable.ExecuteCommand();
+                        y.AsUpdateable.ExecuteCommand();
+                    });
+                    if (!dbTran.IsSuccess)
+                    {
+                        result.IsSuccessed = false;
+                        result.LocaleMsg = new($"淇濆瓨鑺傜偣宀椾綅璧勬簮鏁版嵁寮傚父");
+                    }
+                }
+                catch (Exception ex)
+                {
+                    result.CatchExceptionWithLog(ex, "淇濆瓨鑺傜偣宀椾綅璧勬簮鏁版嵁寮傚父");
+                }
+                return await Task.FromResult(result);
+            }
         }
     }
 }
diff --git a/Tiger.IBusiness/MES/IRoute.cs b/Tiger.IBusiness/MES/IRoute.cs
index dfeb1b3..ebeb884 100644
--- a/Tiger.IBusiness/MES/IRoute.cs
+++ b/Tiger.IBusiness/MES/IRoute.cs
@@ -19,5 +19,6 @@
         public Task<ApiAction<List<MES_ROUTE>>> GetRoute(string routeCode);
         public Task<ApiAction<RouteData>> GetRouteData(string routeCode);
         public Task<ApiAction> DeleteRoute(string routeId);
+        public Task<ApiAction> SaveRouteNodePost(List<MES_ROUTE_NODE_POST> nodePost);
     }
 }
diff --git a/Tiger.Model.Net/Entitys/MES/MES_ROUTE_NODE_POST.cs b/Tiger.Model.Net/Entitys/MES/MES_ROUTE_NODE_POST.cs
index fa0351c..9e056aa 100644
--- a/Tiger.Model.Net/Entitys/MES/MES_ROUTE_NODE_POST.cs
+++ b/Tiger.Model.Net/Entitys/MES/MES_ROUTE_NODE_POST.cs
@@ -27,21 +27,23 @@
 		/// </summary>
 		[SugarColumn(IsPrimaryKey = true)]
 		public string NODE_ID { get; set; }
-		/// <summary>
-		/// 涓婚敭 宀椾綅缂栫爜
-		/// </summary>
-		public string POST_CODE { get; set; }
-		#endregion
+        /// <summary>
+        /// 涓婚敭 宀椾綅缂栫爜
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true)]
+        public string POST_CODE { get; set; }
+        public string REMARK { get; set; }
+        #endregion
 
-		#region 铏氭嫙灞炴��
-		/*渚嬪瓙
+        #region 铏氭嫙灞炴��
+        /*渚嬪瓙
 		[SugarColumn(IsIgnore = true)]
 		public string FieldName { get; set; }
 		*/
-		#endregion
+        #endregion
 
-		#region 澶栭敭灞炴��
-		/*渚嬪瓙
+        #region 澶栭敭灞炴��
+        /*渚嬪瓙
 		//涓�瀵逛竴澶栭敭瀵艰埅
 		[Navigate(NavigateType.OneToOne, nameof(ClassAId))]//涓�瀵逛竴 ClassAId鏄疢ES_ROUTE_NODE_POST绫婚噷闈㈢殑澶栭敭ID瀛楁
 		public ClassA ClassA { get; set; } //娉ㄦ剰绂佹鎵嬪姩璧嬪�硷紝鍙兘鏄痭ull
@@ -52,10 +54,10 @@
 		[Navigate(typeof(MappingClass), nameof(MappingClass.MES_ROUTE_NODE_POSTId), nameof(MappingClass.ClassAId))]//娉ㄦ剰椤哄簭
 		public List<ClassA> ClassAList { get; set; } //娉ㄦ剰绂佹鎵嬪姩璧嬪�硷紝鍙兘鏄痭ull
 		*/
-		#endregion
+        #endregion
 
-		#region 鏋氫妇鍙橀噺
-		/*渚嬪瓙
+        #region 鏋氫妇鍙橀噺
+        /*渚嬪瓙
 		public enum FieldNames
 		{
 			[Description("鏋氫妇鎻忚堪0")]
@@ -64,11 +66,11 @@
 			Enum1,
 		}
 		*/
-		#endregion
+        #endregion
 
-		#region 鍏叡鏂规硶
+        #region 鍏叡鏂规硶
 
-		#endregion
+        #endregion
 
-	}//endClass
+    }//endClass
 }
\ No newline at end of file
diff --git a/Tiger.Model.Net/Entitys/MES/V_MES_ROUTE_NOE_POST.cs b/Tiger.Model.Net/Entitys/MES/V_MES_ROUTE_NOE_POST.cs
new file mode 100644
index 0000000..ed834d5
--- /dev/null
+++ b/Tiger.Model.Net/Entitys/MES/V_MES_ROUTE_NOE_POST.cs
@@ -0,0 +1,68 @@
+using System;
+using SqlSugar;
+using System.Linq;
+using System.ComponentModel;
+using System.Collections.Generic;
+using Tiger.Model;
+
+namespace Tiger.Model
+{
+	/// <summary>
+	/// 实体:V_MES_ROUTE_NODE_POST
+	/// </summary>
+	[Serializable]
+	[SugarTable("V_MES_ROUTE_NODE_POST")]
+	public class V_MES_ROUTE_NODE_POST : iViewEntity
+	{
+		#region 构造函数
+		/// <summary>
+		/// 实体:V_MES_ROUTE_NODE_POST
+		/// </summary>
+		public V_MES_ROUTE_NODE_POST() {}
+        #endregion
+
+        #region 公共属性
+        /// <summary>
+        /// 
+        /// </summary>
+        public string NODE_ID { get; set; }
+        public string POST_CODE { get; set; }
+		/// <summary>
+		/// 
+		/// </summary>
+		public string POST_NAME { get; set; }
+		/// <summary>
+		/// 
+		/// </summary>
+		public string LINE_CODE { get; set; }
+		/// <summary>
+		/// 
+		/// </summary>
+		public string OPER_CODE { get; set; }
+		#endregion
+
+		#region 虚拟属性
+		/*例子
+		[SugarColumn(IsIgnore = true)]
+		public string FieldName { get; set; }
+		*/
+		#endregion
+
+		#region 枚举变量
+		/*例子
+		public enum FieldNames
+		{
+			[Description("枚举描述0")]
+			Enum0,
+			[Description("枚举描述1")]
+			Enum1,
+		}
+		*/
+		#endregion
+
+		#region 公共方法
+
+		#endregion
+
+	}//endClass
+}
\ No newline at end of file
diff --git a/Tiger.Model.Net/Tiger.Model.Net.csproj b/Tiger.Model.Net/Tiger.Model.Net.csproj
index 6997ea6..3fe8100 100644
--- a/Tiger.Model.Net/Tiger.Model.Net.csproj
+++ b/Tiger.Model.Net/Tiger.Model.Net.csproj
@@ -131,6 +131,7 @@
     <Compile Include="Entitys\MES\SMT_PROD_TABLE.cs" />
     <Compile Include="Entitys\MES\SMT_SOLDER.cs" />
     <Compile Include="Entitys\MES\SMT_SOLDER_HIS.cs" />
+    <Compile Include="Entitys\MES\V_MES_ROUTE_NOE_POST.cs" />
     <Compile Include="Entitys\MES\V_SMT_TOOL.cs" />
     <Compile Include="Entitys\MES\SMT_TOOL.cs" />
     <Compile Include="Entitys\MES\SMT_TOOL_HIS.cs" />

--
Gitblit v1.9.3