From 15eb82df2d6ec539e9d4245bfe08d531e8eb6379 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期日, 27 四月 2025 14:33:26 +0800
Subject: [PATCH] 修改培训订单占多个座位

---
 zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs |   46 ++++++++++++++++++++++++++++++++++++----------
 1 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs b/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs
index 2e21181..858095c 100644
--- a/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs
@@ -21,9 +21,11 @@
         private readonly IWfRunProcessService _wfRunProcessService;
         private readonly IWfHistoryService _wfHistoryService;
         private readonly IWfNeeddeelService _wfNeeddeelService;
+        private readonly IPltPageService _pltPageService;
 
         public SalaryCheckController(ILogger<SalaryCheckController> logger, IHrSalaryService hrSalaryService, IHrDeptService hrDeptService, IWfRunProcessService wfRunProcessService
-            , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService)
+            , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService
+              , IPltPageService pltPageService)
         {
             _logger = logger;            
             _hrDeptService = hrDeptService;
@@ -31,10 +33,13 @@
             _wfRunProcessService = wfRunProcessService;
             _wfHistoryService = wfHistoryService;
             _wfNeeddeelService = wfNeeddeelService;
+            _pltPageService = pltPageService;
         }
 
         public IActionResult Index()
         {
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ViewData["curentuser"] = curentuser;
             List<ActionEntity> actionlist = new List<ActionEntity>();
             ActionEntity actionEntity = new ActionEntity();
             actionEntity.OpenType = 0;
@@ -44,14 +49,25 @@
             actionEntity.ActionName = "鏌ヨ";
             actionlist.Add(actionEntity);
 
-            ActionEntity actionEntity1 = new ActionEntity();
-            actionEntity1.OpenType = 0;
-            actionEntity1.ActionUrl = "";
-            actionEntity1.ActionFun = "Edit";
-            actionEntity1.PageIco = "fa fa-plus";
-            actionEntity1.ActionName = "鏍稿噯";
-            actionlist.Add(actionEntity1);
-
+            //ActionEntity actionEntity1 = new ActionEntity();
+            //actionEntity1.OpenType = 0;
+            //actionEntity1.ActionUrl = "";
+            //actionEntity1.ActionFun = "Edit";
+            //actionEntity1.PageIco = "fa fa-plus";
+            //actionEntity1.ActionName = "鏍稿噯";
+            //actionlist.Add(actionEntity1);
+            var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/SalaryCheck/Index");
+            var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList();
+            foreach (var pageEntity in pageEntities1)
+            {
+                ActionEntity actionEntity1 = new ActionEntity();
+                actionEntity1.OpenType = pageEntity.OpenType;
+                actionEntity1.ActionUrl = "";
+                actionEntity1.ActionFun = pageEntity.PageShortcut;
+                actionEntity1.PageIco = pageEntity.PageIco;
+                actionEntity1.ActionName = pageEntity.PageName;
+                actionlist.Add(actionEntity1);
+            }
             ViewBag.editBtn = false;
                         
             ViewData["ActionInfo"] = actionlist;
@@ -84,7 +100,13 @@
         /// <param name="id"></param>
         /// <returns></returns>
         public IActionResult Edit(string id)
-        {           
+        {
+
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ViewData["curentuser"] = curentuser;
+            var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/SalaryCheck/Index");
+            var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList();
+            ViewData["ActionInfo2"] = pageEntities2;
             HrSalaryDTO dto = new HrSalaryDTO();
             if (!string.IsNullOrEmpty(id))
             {
@@ -106,6 +128,10 @@
             {
                 dto.Jiucuo = 0;
             }
+            //if (!dto.Yufagongziheji.HasValue)
+            //{
+            //    dto.Yufagongziheji = 0;
+            //}
             ViewData.Model = dto;
             return View();
         }

--
Gitblit v1.9.1