From bdeea0f54fcdb94531d404e9b720d0086d5cca96 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 13 八月 2021 10:29:31 +0800
Subject: [PATCH] 流程管理界面

---
 zhengcaioa/Services/WfHistoryService.cs |  116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 115 insertions(+), 1 deletions(-)

diff --git a/zhengcaioa/Services/WfHistoryService.cs b/zhengcaioa/Services/WfHistoryService.cs
index c3c607a..a19cbc3 100644
--- a/zhengcaioa/Services/WfHistoryService.cs
+++ b/zhengcaioa/Services/WfHistoryService.cs
@@ -301,6 +301,120 @@
 
             return listRole;
         }
-        
+
+
+        public ResultDataEntity<WfHistoryDTO> SearchByPagingGuanLi(WfHistoryDTOSearch searchEntity)
+        {
+
+
+
+            ResultDataEntity<WfHistoryDTO> data = new ResultDataEntity<WfHistoryDTO>();
+            List<WfHistoryDTO> list = new List<WfHistoryDTO>();
+
+
+
+
+            var listCode = (from a in _context.SysCodeDtls
+                            join b in _context.SysCodes
+                            on a.CodeId equals b.Id
+                            where a.RecStatus == "A"
+                                          && b.RecStatus == "A"
+                            select new CodeDataEntity()
+                            {
+                                CodeId = b.Id,
+                                CodeTable = b.CodeTable,
+                                CodeField = b.CodeField,
+                                CodeSn = a.CodeSn,
+                                Comments = a.Comments,
+                                Contents = a.Contents,
+                                RecStatus = a.RecStatus,
+                                Sort = a.Sort
+                            }
+                      );
+            DateTime Applytimestart = DateTime.Now;
+            DateTime Applytimeend = DateTime.Now;
+            if (!string.IsNullOrWhiteSpace(searchEntity.Applytime))
+            {
+                string[] Applytimes = searchEntity.Applytime.Split("|");
+                DateTime.TryParse(Applytimes[0], out Applytimestart);
+                DateTime.TryParse(Applytimes[1], out Applytimeend);
+                Applytimeend = Applytimeend.AddDays(1);
+            }
+
+            ///WfHistories
+            var query = (from k in _context.WfRunProcesses
+
+
+
+
+
+                         join a in _context.WfHistories
+                      on k.Id equals a.RunProcessId
+
+                         join e in listCode.Where(x => x.CodeTable == "wf_run_process" && x.CodeField == "shenpi_status")
+                        on k.ShenpiStatus equals e.CodeSn
+                        into esssss
+                         from eee in esssss.DefaultIfEmpty()
+
+                    //     join f in listCode.Where(x => x.CodeTable == "wf_needdeel" && x.CodeField == "needdeel_type")
+                    //on a.NeeddeelType equals f.CodeSn
+                    //into fsssss
+                    //     from fff in fsssss.DefaultIfEmpty()
+
+                         join d in _context.WfApplytypes
+                       on k.Applytiye equals d.Applyno
+
+                         join b in _context.PltUsers
+                        on k.Creater equals b.Id
+
+
+                         join c in _context.HrDepts
+                        on b.DeptId equals c.Id
+
+
+                         where k.RecStatus == "A"
+                          && (string.IsNullOrWhiteSpace(searchEntity.Applytime) || (k.Applytime >= Applytimestart && k.Applytime <= Applytimeend))
+                          && (string.IsNullOrWhiteSpace(searchEntity.DeptId) || b.DeptId == searchEntity.DeptId.Trim())
+                           && (string.IsNullOrWhiteSpace(searchEntity.ApplyUserName) || b.UserName.Contains(searchEntity.ApplyUserName.Trim()))
+                            && (string.IsNullOrWhiteSpace(searchEntity.Applytiye) || k.Applytiye == searchEntity.Applytiye.Trim())
+                             && (string.IsNullOrWhiteSpace(searchEntity.ShenpiStatus) || k.ShenpiStatus == searchEntity.ShenpiStatus.Trim())
+                               && (string.IsNullOrWhiteSpace(searchEntity.RunProcessId) || k.Id == searchEntity.RunProcessId.Trim())
+
+                                && (string.IsNullOrWhiteSpace(searchEntity.Applyno) || k.Applyno == searchEntity.Applyno.Trim())
+                                 && (string.IsNullOrWhiteSpace(searchEntity.Creater) || k.Creater == searchEntity.Creater.Trim())
+
+                         select new WfHistoryDTO
+                         {
+                             Id = k.Id,
+                              
+
+                             ApplytimeName = k.Applytime.Value.ToString("yyyy-MM-dd"),
+                             Applyno = k.Applyno,
+                             CreaterName = b.UserName,
+                             DeptName = c.DeptName,
+                             Applytiye = d.Applytiye,
+                             Content = k.Content,
+                             ShenpiStatusName = eee.Comments,
+                              
+                             Deelurl = a.Deelurl,
+                             Creater = k.Creater,
+                             Createtime = k.Createtime,
+                             Step = k.Step,
+                             RecStatus = k.RecStatus,
+                             Modifier = k.Modifier,
+                             Modifytime = k.Modifytime,
+
+                         }
+                ).Distinct().ToList().OrderByDescending(x => x.Applyno);
+
+
+
+            //if (searchEntity.totalrows == 0)
+            searchEntity.totalrows = query.Count();
+            var lianlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
+            data.LoadData(searchEntity, lianlist);
+            return data;
+        }
+
     }
 }

--
Gitblit v1.9.1