From 9f0add00d40fc00e039b92b2fb3469394b1a24f5 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期五, 28 三月 2025 14:28:59 +0800
Subject: [PATCH] 111

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs |   84 +++++++++++++-----------------------------
 1 files changed, 26 insertions(+), 58 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
index c4de149..aad8de4 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
@@ -4,17 +4,15 @@
 using System.Text;
 using System.Threading.Tasks;
 using AutoMapper;
+using SqlSugar;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseRepository;
 using WIDESEAWCS_Core.BaseServices;
 using WIDESEAWCS_ITelescopicService;
 using WIDESEAWCS_Model.Models;
-<<<<<<< Updated upstream
-=======
 using WIDESEAWCS_DTO;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
 using WIDESEAWCS_DTO.Telescopic;
->>>>>>> Stashed changes
 
 namespace WIDESEAWCS_TelescopicService
 {
@@ -27,33 +25,14 @@
         {
             _user = user;
         }
-<<<<<<< Updated upstream
-
-        public WebResponseContent ShowMaintence()
-=======
         public WebResponseContent ShowMaintence(PaginationDTO pagination)
->>>>>>> Stashed changes
         {
             try
             {
-                var sys = _user.QueryData();
-                var main = BaseDal.QueryData();
+                int totalCount = 0;
+                var sys = _user.Db.Queryable<Sys_User>();
+                var main = Db.Queryable<Dt_Maintenance>();
 
-<<<<<<< Updated upstream
-                var result = sys.Join(main,
-                    u => u.UserName,
-                    m => m.UserAccount,
-                    (u, m) => new
-                    {
-                        u.UserTrueName,
-                        u.UserName,
-                        u.CardNumber,
-                        u.RoleName,
-                        u.HeadImageUrl,
-                        m.IsPossible,
-                    });
-                return new WebResponseContent { Status = true, Data = result };
-=======
                 var query = sys.InnerJoin<Dt_Maintenance>((a, b) => a.UserName == b.UserAccount);
                 if (!string.IsNullOrEmpty(pagination.searchKeyword))
                 {
@@ -85,18 +64,13 @@
                         Items = result
                     }
                 };
->>>>>>> Stashed changes
             }
             catch (Exception ex)
             {
-
-                return new WebResponseContent { Status = false, Data = ex };
+                return new WebResponseContent { Status = false, Data = ex.Message };
             }
         }
 
-<<<<<<< Updated upstream
-        public WebResponseContent PersonnelMonitoring(bool ispossible)
-=======
 
 
 
@@ -108,28 +82,13 @@
         /// <param name="searchKeyword"></param>
         /// <returns></returns>
         public WebResponseContent PersonnelMonitoring(PaginationDTO pagination)
->>>>>>> Stashed changes
         {
             try
             {
-                var sys = _user.QueryData();
-                var main = BaseDal.QueryData();
+                int totalCount = 0;
+                var sys = _user.Db.Queryable<Sys_User>();
+                var main = Db.Queryable<Dt_Maintenance>();
 
-<<<<<<< Updated upstream
-                var result = sys.Join(main,
-                    u => u.UserName,
-                    m => m.UserAccount,
-                    (u, m) => new
-                    {
-                        u.UserTrueName,
-                        u.RoleName,
-                        u.HeadImageUrl,
-                        m.MaintenanceStatus,
-                        m.MaintenanceDate,
-                        m.IsPossible,
-                    }).Where(x=>x.IsPossible== ispossible);
-                return new WebResponseContent { Status = true, Data = result };
-=======
                 var query = sys.InnerJoin<Dt_Maintenance>((a, b) => a.UserName == b.UserAccount)
                                .Where((a, b) => b.IsPossible == "true"); // 鍏堢瓫閫� IsPossible 涓� true 鐨勬暟鎹�
 
@@ -170,22 +129,34 @@
                         Items = result
                     }
                 };
->>>>>>> Stashed changes
             }
             catch (Exception ex)
             {
-
-                return new WebResponseContent { Status = false, Data = ex };
+                return new WebResponseContent { Status = false, Data = ex.Message };
             }
         }
 
-        public WebResponseContent RunOperation(int id)
+
+
+
+
+
+        public WebResponseContent RunOperation(int id, string  ispossible)
         {
             try
             {
                 var mon = BaseDal.QueryFirst(x => x.ID == id);
-                mon.IsPossible = true;
-                BaseDal.UpdateData(mon);
+                if (ispossible == "true")
+                {
+                    mon.IsPossible = "true";
+                    mon.MaintenanceDate = DateTime.Now;
+                    BaseDal.UpdateData(mon);
+                }
+                else
+                {
+                    mon.IsPossible = "false";
+                    BaseDal.UpdateData(mon);
+                }
                 return new WebResponseContent { Status = true, Data = mon };
             }
             catch (Exception ex)
@@ -235,8 +206,6 @@
         }
 
         /// <summary>
-<<<<<<< Updated upstream
-=======
         /// 妫�淇搷浣滆褰�
         /// </summary>
         /// <param name="pageIndex">椤垫暟</param>
@@ -297,7 +266,6 @@
       
 
         /// <summary>
->>>>>>> Stashed changes
         /// 鐘舵�佹灇涓�
         /// </summary>
         private enum Maint

--
Gitblit v1.9.3