From 2fbfc7930364dffbb846d018226755ab66f5bcfb Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期一, 25 三月 2024 14:31:10 +0800
Subject: [PATCH] 版本大更新

---
 Yw.Service.Repair.Core/04-dal/02-postgresql/02-task/RepairTaskForm.cs |  119 +++++++++++++++++++++++++++++++----------------------------
 1 files changed, 63 insertions(+), 56 deletions(-)

diff --git a/Yw.Service.Repair.Core/4-dal/2-task/RepairTaskForm.cs b/Yw.Service.Repair.Core/04-dal/02-postgresql/02-task/RepairTaskForm.cs
similarity index 90%
copy from Yw.Service.Repair.Core/4-dal/2-task/RepairTaskForm.cs
copy to Yw.Service.Repair.Core/04-dal/02-postgresql/02-task/RepairTaskForm.cs
index 7b864fa..eabe112 100644
--- a/Yw.Service.Repair.Core/4-dal/2-task/RepairTaskForm.cs
+++ b/Yw.Service.Repair.Core/04-dal/02-postgresql/02-task/RepairTaskForm.cs
@@ -1,9 +1,9 @@
-锘縩amespace Yw.DAL
+锘縩amespace Yw.DAL.PostgreSql
 {
     /// <summary>
     /// RepairTaskForm
     /// </summary>
-    public partial class RepairTaskForm : BaseTraceDAL<Entity.RepairTaskForm>
+    public partial class RepairTaskForm : BaseTraceDAL<Entity.RepairTaskForm>, IRepairTaskForm
     {
         /// <summary>
         /// 
@@ -12,7 +12,7 @@
         {
             get
             {
-                return ConfigHelper.DefaultConnectionConfig;
+                return ConfigHelper.PostgreSqlConnectionConfig;
             }
         }
 
@@ -87,15 +87,15 @@
         /// <summary>
         /// 鏇存柊 FormStatus
         /// </summary>
-        public bool UpdateFormStatus(long ID, int FormStatus, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool UpdateFormStatus(long ID, int FormStatus)
         {
             using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
             {
                 return db.Updateable<Entity.RepairTaskForm>()
                     .SetColumns(x => x.FormStatus == FormStatus)
-                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                    .SetColumns(x => x.UpdateTime == DateTime.Now)
+                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                     .Where(x => x.ID == ID)
                     .ExecuteCommand() > 0;
             }
@@ -104,20 +104,21 @@
         /// <summary>
         /// 娲惧崟
         /// </summary>
-        public bool Assign(long ID, long RepairUserID, string RepairUserName, string Note, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool Assign(long ID, long RepairUserID, string RepairUserName, string Note)
         {
             using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
             {
                 try
                 {
+                    var dt = DateTime.Now;
                     db.BeginTran();
                     var bol = db.Updateable<Entity.RepairTaskForm>()
                                     .SetColumns(x => x.FormStatus == (int)eTaskStatus.Assigned)
                                     .SetColumns(x => x.RepairUserID == RepairUserID)
                                     .SetColumns(x => x.RepairUserName == RepairUserName)
-                                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                                    .SetColumns(x => x.UpdateTime == dt)
+                                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                                     .Where(x => x.ID == ID)
                                     .ExecuteCommand() > 0;
                     if (!bol)
@@ -129,9 +130,9 @@
                     entity4Log.FormID = ID;
                     entity4Log.OperateType = (int)eTaskOperation.Assign;
                     entity4Log.OperateContent = "娲惧崟";
-                    entity4Log.OperateTime = UpdateTime;
-                    entity4Log.OperateUserID = UpdateUserID;
-                    entity4Log.OperateUserName = UpdateUserName;
+                    entity4Log.OperateTime = dt;
+                    entity4Log.OperateUserID = UserRegister.UserID;
+                    entity4Log.OperateUserName = UserRegister.UserName;
                     entity4Log.OperateNote = Note;
                     var logId = db.Insertable(entity4Log).ExecuteReturnSnowflakeId();
                     if (logId < 1)
@@ -153,18 +154,19 @@
         /// <summary>
         /// 鎺ュ崟
         /// </summary>
-        public bool Receive(long ID, string Note, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool Receive(long ID, string Note)
         {
             using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
             {
                 try
                 {
+                    var dtNow = DateTime.Now;
                     db.BeginTran();
                     var bol = db.Updateable<Entity.RepairTaskForm>()
                                     .SetColumns(x => x.FormStatus == (int)eTaskStatus.Received)
-                                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                                    .SetColumns(x => x.UpdateTime == dtNow)
+                                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                                     .Where(x => x.ID == ID)
                                     .ExecuteCommandHasChange();
                     if (!bol)
@@ -176,9 +178,9 @@
                     entity4Log.FormID = ID;
                     entity4Log.OperateType = (int)eTaskOperation.Receive;
                     entity4Log.OperateContent = "鎺ュ崟";
-                    entity4Log.OperateTime = UpdateTime;
-                    entity4Log.OperateUserID = UpdateUserID;
-                    entity4Log.OperateUserName = UpdateUserName;
+                    entity4Log.OperateTime = dtNow;
+                    entity4Log.OperateUserID = UserRegister.UserID;
+                    entity4Log.OperateUserName = UserRegister.UserName;
                     entity4Log.OperateNote = Note;
                     var logId = db.Insertable(entity4Log).ExecuteReturnSnowflakeId();
                     if (logId < 1)
@@ -200,12 +202,13 @@
         /// <summary>
         /// 寮�宸�
         /// </summary>
-        public bool Start(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool Start(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList)
         {
             using (var db = new SqlSugarClient(ConnectionConfig))
             {
                 try
                 {
+                    var dtNow = DateTime.Now;
                     db.BeginTran();
                     var entity = db.Queryable<Entity.RepairTaskForm>().Where(x => x.ID == ID).First();
                     if (entity == null)
@@ -220,9 +223,9 @@
                     }
                     var bol = db.Updateable<Entity.RepairTaskForm>()
                                     .SetColumns(x => x.FormStatus == (int)eTaskStatus.Started)
-                                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                                    .SetColumns(x => x.UpdateTime == dtNow)
+                                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                                     .Where(x => x.ID == ID)
                                     .ExecuteCommand() > 0;
                     if (!bol)
@@ -234,9 +237,9 @@
                     entity4Log.FormID = ID;
                     entity4Log.OperateType = (int)eTaskOperation.Start;
                     entity4Log.OperateContent = "寮�宸�";
-                    entity4Log.OperateTime = UpdateTime;
-                    entity4Log.OperateUserID = UpdateUserID;
-                    entity4Log.OperateUserName = UpdateUserName;
+                    entity4Log.OperateTime = dtNow;
+                    entity4Log.OperateUserID = UserRegister.UserID;
+                    entity4Log.OperateUserName = UserRegister.UserName;
                     entity4Log.OperateNote = Note;
                     var logId = db.Insertable(entity4Log).ExecuteReturnSnowflakeId();
                     if (logId < 1)
@@ -273,12 +276,13 @@
         /// <summary>
         /// 鏆傚仠
         /// </summary>
-        public bool Pause(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool Pause(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList)
         {
             using (var db = new SqlSugarClient(ConnectionConfig))
             {
                 try
                 {
+                    var dtNow = DateTime.Now;
                     db.BeginTran();
                     var entity = db.Queryable<Entity.RepairTaskForm>().Where(x => x.ID == ID).First();
                     if (entity == null)
@@ -303,9 +307,9 @@
                     }
                     var bol = db.Updateable<Entity.RepairTaskForm>()
                                     .SetColumns(x => x.FormStatus == (int)eTaskStatus.Paused)
-                                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                                    .SetColumns(x => x.UpdateTime == dtNow)
+                                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                                     .Where(x => x.ID == ID)
                                     .ExecuteCommandHasChange();
                     if (!bol)
@@ -317,9 +321,9 @@
                     entity4Log.FormID = ID;
                     entity4Log.OperateType = (int)eTaskOperation.Pause;
                     entity4Log.OperateContent = "鏆傚仠";
-                    entity4Log.OperateTime = UpdateTime;
-                    entity4Log.OperateUserID = UpdateUserID;
-                    entity4Log.OperateUserName = UpdateUserName;
+                    entity4Log.OperateTime = dtNow;
+                    entity4Log.OperateUserID = UserRegister.UserID;
+                    entity4Log.OperateUserName = UserRegister.UserName;
                     entity4Log.OperateNote = Note;
                     var logId = db.Insertable(entity4Log).ExecuteReturnSnowflakeId();
                     if (logId < 1)
@@ -356,12 +360,13 @@
         /// <summary>
         /// 閲嶆柊寮�宸�
         /// </summary>
-        public bool Restart(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool Restart(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList)
         {
             using (var db = new SqlSugarClient(ConnectionConfig))
             {
                 try
                 {
+                    var dtNow = DateTime.Now;
                     db.BeginTran();
                     var entity = db.Queryable<Entity.RepairTaskForm>().Where(x => x.ID == ID).First();
                     if (entity == null)
@@ -376,9 +381,9 @@
                     }
                     var bol = db.Updateable<Entity.RepairTaskForm>()
                                     .SetColumns(x => x.FormStatus == (int)eTaskStatus.Restarted)
-                                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                                    .SetColumns(x => x.UpdateTime == dtNow)
+                                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                                     .Where(x => x.ID == ID)
                                     .ExecuteCommandHasChange();
                     if (!bol)
@@ -390,9 +395,9 @@
                     entity4Log.FormID = ID;
                     entity4Log.OperateType = (int)eTaskOperation.Restart;
                     entity4Log.OperateContent = "閲嶆柊寮�宸�";
-                    entity4Log.OperateTime = UpdateTime;
-                    entity4Log.OperateUserID = UpdateUserID;
-                    entity4Log.OperateUserName = UpdateUserName;
+                    entity4Log.OperateTime = dtNow;
+                    entity4Log.OperateUserID = UserRegister.UserID;
+                    entity4Log.OperateUserName = UserRegister.UserName;
                     entity4Log.OperateNote = Note;
                     var logId = db.Insertable(entity4Log).ExecuteReturnSnowflakeId();
                     if (logId < 1)
@@ -429,12 +434,13 @@
         /// <summary>
         /// 瀹屽伐
         /// </summary>
-        public bool Finish(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool Finish(long ID, string Note, List<Entity.RepairTaskLogFile> entity4FileList)
         {
             using (var db = new SqlSugarClient(ConnectionConfig))
             {
                 try
                 {
+                    var dtNow = DateTime.Now;
                     db.BeginTran();
                     var entity = db.Queryable<Entity.RepairTaskForm>().Where(x => x.ID == ID).First();
                     if (entity == null)
@@ -449,9 +455,9 @@
                     }
                     var bol = db.Updateable<Entity.RepairTaskForm>()
                                     .SetColumns(x => x.FormStatus == (int)eTaskStatus.Finished)
-                                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                                    .SetColumns(x => x.UpdateTime == dtNow)
+                                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                                     .Where(x => x.ID == ID)
                                     .ExecuteCommandHasChange();
                     if (!bol)
@@ -463,9 +469,9 @@
                     entity4Log.FormID = ID;
                     entity4Log.OperateType = (int)eTaskOperation.Finish;
                     entity4Log.OperateContent = "瀹屽伐";
-                    entity4Log.OperateTime = UpdateTime;
-                    entity4Log.OperateUserID = UpdateUserID;
-                    entity4Log.OperateUserName = UpdateUserName;
+                    entity4Log.OperateTime = dtNow;
+                    entity4Log.OperateUserID = UserRegister.UserID;
+                    entity4Log.OperateUserName = UserRegister.UserName;
                     entity4Log.OperateNote = Note;
                     var logId = db.Insertable(entity4Log).ExecuteReturnSnowflakeId();
                     if (logId < 1)
@@ -502,18 +508,19 @@
         /// <summary>
         /// 楠屾敹閫氳繃
         /// </summary>
-        public bool Success(long ID, string Note, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
+        public bool Success(long ID, string Note)
         {
             using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
             {
                 try
                 {
+                    var dtNow = DateTime.Now;
                     db.BeginTran();
                     var bol = db.Updateable<Entity.RepairTaskForm>()
                                     .SetColumns(x => x.FormStatus == (int)eTaskStatus.Succeed)
-                                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
-                                    .SetColumns(x => x.UpdateTime == UpdateTime)
-                                    .SetColumns(x => x.UpdateUserName == UpdateUserName)
+                                    .SetColumns(x => x.UpdateUserID == UserRegister.UserID)
+                                    .SetColumns(x => x.UpdateTime == dtNow)
+                                    .SetColumns(x => x.UpdateUserName == UserRegister.UserName)
                                     .Where(x => x.ID == ID)
                                     .ExecuteCommandHasChange();
                     if (!bol)
@@ -525,9 +532,9 @@
                     entity4Log.FormID = ID;
                     entity4Log.OperateType = (int)eTaskOperation.Success;
                     entity4Log.OperateContent = "楠屾敹閫氳繃";
-                    entity4Log.OperateTime = UpdateTime;
-                    entity4Log.OperateUserID = UpdateUserID;
-                    entity4Log.OperateUserName = UpdateUserName;
+                    entity4Log.OperateTime = dtNow;
+                    entity4Log.OperateUserID = UserRegister.UserID;
+                    entity4Log.OperateUserName = UserRegister.UserName;
                     entity4Log.OperateNote = Note;
                     var logId = db.Insertable(entity4Log).ExecuteReturnSnowflakeId();
                     if (logId < 1)

--
Gitblit v1.9.3