username@email.com
2021-07-01 57556b16aafbafebc7f9fc86745ac2ea83e7616d
流程  请假  销假  待办 已办  我得申请
30个文件已修改
5个文件已添加
2630 ■■■■■ 已修改文件
zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/AdmSignInDTO.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/IntentionCustomerDTO.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/IntentionVisitDTO.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/WfHistoryDTO.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/WfNeeddeelDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/WfRunProcessDTO.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IWfHistoryService.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IWfNeeddeelService.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IWfRunProcessService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/IntentionCustomer.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/WfRunProcess.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/zhengcaioaContext.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/IntentionCustomerService.cs 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/IntentionVisitService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/WfHistoryService.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/WfNeeddeelService.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/WfRunProcessService.cs 1096 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/AdmManagement/SigninController.cs 254 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/Customer/IntentionVisitController.cs 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/WorkFlow/WorkFlowTaskController.cs 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Startup.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/IntentionCustomer/IndexYiXiang.cshtml 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/IntentionVisit/Index.cshtml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/Shared/_Layout.cshtml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/Signin/AskLeave.cshtml 182 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/Signin/AskLeaveOff.cshtml 171 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/WfApplytype/Index.cshtml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/WorkFlowTask/Index.cshtml 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/WorkFlowTask/IndexMyApply.cshtml 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/WorkFlowTask/IndexYiBan.cshtml 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
表修改.sql 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs
@@ -164,6 +164,9 @@
            CreateMap<WfRunProcess, WfRunProcessDTO>();
            CreateMap<WfRunProcessDTO, WfRunProcess>();
            CreateMap<WfHistoryDTO, WfNeeddeelDTO>();
            CreateMap<WfNeeddeelDTO, WfHistoryDTO>();
            CreateMap<SysAttachment, SysAttachmentDTO>();
            CreateMap<SysAttachmentDTO, SysAttachment>();
zhengcaioa/DTO/AdmSignInDTO.cs
@@ -80,6 +80,11 @@
        public string CreaterName { get; set; }
        public string Tittle { get; set; }
        public string Content { get; set; }
        public string Tongguojujue { get; set; }
        public string Step { get; set; }
    }
@@ -111,6 +116,10 @@
        public string CreaterName { get; set; }
        public string Tittle { get; set; }
        public string Content { get; set; }
        public string Tongguojujue { get; set; }
        public string Step { get; set; }
    }
zhengcaioa/DTO/IntentionCustomerDTO.cs
@@ -50,6 +50,13 @@
        public string CityName { get; set; }
        public string AreaIdName { get; set; }
        public string YwjlName { get; set; }
        public DateTime? Yixiangtime { get; set; }
        public string YixiangtimeName { get; set; }
        public string Yixiang { get; set; }
        public string Dianxiaozhuanyuan { get; set; }
        public string DianxiaozhuanyuanName { get; set; }
        public DateTime? Zuijinzhuizongtime { get; set; }
        public string ZuijinzhuizongtimeName { get; set; }
    }
    public class IntentionCustomerDTOSearch : SearchEntity
@@ -67,5 +74,12 @@
        public string Creater { get; set; }
        public string Yixiangtime { get; set; }
        public string Dianxiaozhuanyuan { get; set; }
        public string Yixiang { get; set; }
        public string YwjlYx { get; set; }
    }
}
zhengcaioa/DTO/IntentionVisitDTO.cs
@@ -32,6 +32,9 @@
        public string ShengName { get; set; }
        public string Name { get; set; }
        public string IsYwjl { get; set; }
    }
    public class IntentionVisitDTOSearch : SearchEntity
@@ -47,5 +50,7 @@
        public string Vistime { get; set; }
        public string  Viscustomer { get; set; }
    }
}
zhengcaioa/DTO/WfHistoryDTO.cs
@@ -31,6 +31,9 @@
        public DateTime Modifytime { get; set; }
        public string Contentyijian { get; set; }
        public int? Sort { get; set; }
        public string ChuliStatusName { get; set; }
        public string DeelUserIdName { get; set; }
        public string ModifytimeName { get; set; }
    }
    public class WfHistoryDTOSearch : SearchEntity
@@ -45,5 +48,7 @@
        public string ShenpiStatus { get; set; }
        public string Creater { get; set; }
    }
}
zhengcaioa/DTO/WfNeeddeelDTO.cs
@@ -40,10 +40,10 @@
        public string Applytime { get; set; }
        public string DeptId { get; set; }
        public string ApplyUserName { get; set; }
        public string Applytiye { get; set; }
        public string ShenpiStatus { get; set; }
        public string Creater { get; set; }
    }
}
zhengcaioa/DTO/WfRunProcessDTO.cs
@@ -22,6 +22,7 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public string Deelurl { get; set; }
    }
    public class WfRunProcessDTOSearch : SearchEntity
@@ -34,5 +35,10 @@
        public string Applyno { get; set; }
        public string Creater { get; set; }
    }
}
zhengcaioa/IServices/IWfHistoryService.cs
@@ -15,6 +15,8 @@
        ResultEntity ModifyStatus(string id, string userid);
        List<WfHistoryDTO> GetList();
        List<WfHistoryDTO> GetList(string RunProcessId ="" );
        List<WfHistoryDTO> GetListshenpi(string RunProcessId);
    }
}
zhengcaioa/IServices/IWfNeeddeelService.cs
@@ -15,6 +15,8 @@
        ResultEntity ModifyStatus(string id, string userid);
        List<WfNeeddeelDTO> GetList();
        List<WfNeeddeelDTO> GetList(string RunProcessId = "", string step = "");
        List<WfNeeddeelDTO> GetListTracking(string RunProcessId = "", string step = "");
    }
}
zhengcaioa/IServices/IWfRunProcessService.cs
@@ -15,6 +15,10 @@
        ResultEntity ModifyStatus(string id, string userid);
        List<WfRunProcessDTO> GetList();
        List<WfRunProcessDTO> GetList(string DanjuId = "", string Applytiye = "");
        ResultEntity WfAskLeave(string DanjuId, string step, string tongguojujue , string Userid, string Content, string title, string version);
        ResultEntity WfAskLeaveOff(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version);
    }
}
zhengcaioa/Model/IntentionCustomer.cs
@@ -41,5 +41,9 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public DateTime? Yixiangtime { get; set; }
        public string Yixiang { get; set; }
        public string Dianxiaozhuanyuan { get; set; }
        public DateTime? Zuijinzhuizongtime { get; set; }
    }
}
zhengcaioa/Model/WfRunProcess.cs
@@ -21,5 +21,6 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public string Deelurl { get; set; }
    }
}
zhengcaioa/Model/zhengcaioaContext.cs
@@ -2904,6 +2904,10 @@
                    .HasColumnName("createtime")
                    .HasDefaultValueSql("(getdate())");
                entity.Property(e => e.Dianxiaozhuanyuan)
                    .HasMaxLength(50)
                    .HasColumnName("dianxiaozhuanyuan");
                entity.Property(e => e.Email)
                    .HasMaxLength(500)
                    .HasColumnName("email")
@@ -3021,6 +3025,10 @@
                    .HasColumnName("url")
                    .HasComment("网址");
                entity.Property(e => e.Yixiang).HasMaxLength(50);
                entity.Property(e => e.Yixiangtime).HasColumnType("datetime");
                entity.Property(e => e.YwName)
                    .HasMaxLength(500)
                    .HasColumnName("yw_name")
@@ -3040,6 +3048,10 @@
                    .HasMaxLength(50)
                    .HasColumnName("ywjl")
                    .HasComment("业务经理");
                entity.Property(e => e.Zuijinzhuizongtime)
                    .HasColumnType("datetime")
                    .HasColumnName("zuijinzhuizongtime");
            });
            modelBuilder.Entity<IntentionOrder>(entity =>
@@ -4863,6 +4875,10 @@
                    .HasColumnName("danjuId")
                    .HasComment("单据Id");
                entity.Property(e => e.Deelurl)
                    .HasMaxLength(500)
                    .HasColumnName("deelurl");
                entity.Property(e => e.Modifier)
                    .IsRequired()
                    .HasMaxLength(50)
zhengcaioa/Services/IntentionCustomerService.cs
@@ -90,7 +90,12 @@
                updateproject.Modifier = intentionCustomer.Modifier;
                updateproject.Modifytime = intentionCustomer.Modifytime;
            }
                    updateproject.Yixiangtime = intentionCustomer.Yixiangtime;
                    updateproject.Yixiang = intentionCustomer.Yixiang;
                    updateproject.Dianxiaozhuanyuan = intentionCustomer.Dianxiaozhuanyuan;
                    updateproject.Zuijinzhuizongtime = intentionCustomer.Zuijinzhuizongtime;
                }
            _context.SaveChanges();
            resultEntity.ReturnID = intentionCustomer.Id;
@@ -175,10 +180,18 @@
                DateTime.TryParse(Createtimes[1], out Createtimeend);
                Createtimeend = Createtimeend.AddDays(1);
            }
            DateTime Yixiangtimestart = DateTime.Now;
            DateTime Yixiangtimeend = DateTime.Now;
            if (!string.IsNullOrWhiteSpace(searchEntity.Yixiangtime))
            {
                string[] Yixiangtimes = searchEntity.Yixiangtime.Split("|");
                DateTime.TryParse(Yixiangtimes[0], out Yixiangtimestart);
                DateTime.TryParse(Yixiangtimes[1], out Yixiangtimeend);
               // Yixiangtimeend = Yixiangtimeend.AddDays(1);
            }
                var query = (from a in _context.IntentionCustomers
                     join b in listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "khly")
            var query = (from a in _context.IntentionCustomers
                     join b in listCode.Where(x => x.CodeTable == "IntentionCustomer" && x.CodeField == "khly")
                     on a.Khly equals b.CodeSn
                     join c in listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "hyfl")
                     on a.Hyfl equals c.CodeSn
@@ -188,7 +201,13 @@
                     on a.Ywjl equals e.Id
                     into esss
                     from abi in esss.DefaultIfEmpty()
                     join f in _context.Areas on a.Sheng equals f.CodeId
                             join f in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A" )
                            on a.Dianxiaozhuanyuan equals f.Id
                            into fsss
                             from fff in fsss.DefaultIfEmpty()
                             join f in _context.Areas on a.Sheng equals f.CodeId
                     join g in _context.Areas on a.City equals g.CodeId
                     join h in _context.Areas on a.AreaId equals h.CodeId
@@ -204,7 +223,11 @@
                            && (string.IsNullOrWhiteSpace(searchEntity.AreaId) || a.AreaId == searchEntity.AreaId.Trim())
                               && (string.IsNullOrWhiteSpace(searchEntity.Creater) || a.Creater == searchEntity.Creater.Trim())
                             select new IntentionCustomerDTO
                                 && (string.IsNullOrWhiteSpace(searchEntity.Dianxiaozhuanyuan) || a.Dianxiaozhuanyuan == searchEntity.Dianxiaozhuanyuan.Trim())
                                    && (string.IsNullOrWhiteSpace(searchEntity.Yixiangtime) || (a.Yixiangtime >= Yixiangtimestart && a.Yixiangtime <= Yixiangtimeend))
                                      && (string.IsNullOrWhiteSpace(searchEntity.Yixiang) || ( a.Yixiang == searchEntity.Yixiang.Trim() && (a.Ywjl == null || a.Ywjl == searchEntity.YwjlYx) ))
                         select new IntentionCustomerDTO
                     {
                         Id = a.Id,
                         Sheng = a.Sheng,
@@ -249,7 +272,14 @@
                         Modifier = a.Modifier,
                         Modifytime = a.Modifytime,
                         CreatetimeName = a.Createtime.ToString("yyyy-MM-dd"),
                     }
                                 Yixiangtime = a.Yixiangtime,
                                 YixiangtimeName = a.Yixiangtime.HasValue? a.Yixiangtime.Value.ToString("yyyy-MM-dd"):"",
                                 Yixiang = a.Yixiang,
                                 Dianxiaozhuanyuan = a.Dianxiaozhuanyuan,
                                 DianxiaozhuanyuanName = fff.UserName,
                                 Zuijinzhuizongtime = a.Zuijinzhuizongtime,
                                 ZuijinzhuizongtimeName = a.Zuijinzhuizongtime.HasValue ? a.Zuijinzhuizongtime.Value.ToString("yyyy-MM-dd") : "",
                             }
                    ).OrderByDescending(x => x.Modifytime).ToList();
zhengcaioa/Services/IntentionVisitService.cs
@@ -161,7 +161,7 @@
                              && (string.IsNullOrWhiteSpace(searchEntity.Sheng) || zz.Sheng == searchEntity.Sheng.Trim())
                               && (string.IsNullOrWhiteSpace(searchEntity.City) || zz.City == searchEntity.City.Trim())
                                && (string.IsNullOrWhiteSpace(searchEntity.AreaId) || zz.AreaId == searchEntity.AreaId.Trim())
                                && (string.IsNullOrWhiteSpace(searchEntity.Viscustomer) || a.Viscustomer == searchEntity.Viscustomer.Trim())
                         select new IntentionVisitDTO
                         {
                             Id = a.Id,
zhengcaioa/Services/WfHistoryService.cs
@@ -116,7 +116,7 @@
                string[] Applytimes = searchEntity.Applytime.Split("|");
                DateTime.TryParse(Applytimes[0], out Applytimestart);
                DateTime.TryParse(Applytimes[1], out Applytimeend);
                //Applytimeend = Applytimeend.AddDays(1);
                Applytimeend = Applytimeend.AddDays(1);
            }
            ///WfHistories
@@ -140,7 +140,7 @@
                         from fff in fsssss.DefaultIfEmpty()
                         join d in _context.WfApplytypes
                       on k.Applytiye equals d.Id
                       on k.Applytiye equals d.Applyno
                         join b in _context.PltUsers
                        on k.Creater equals b.Id
@@ -159,7 +159,7 @@
                               && (string.IsNullOrWhiteSpace(searchEntity.RunProcessId) || a.RunProcessId == searchEntity.RunProcessId.Trim())
                                && (string.IsNullOrWhiteSpace(searchEntity.Applyno) || k.Applyno == searchEntity.Applyno.Trim())
                                 && (string.IsNullOrWhiteSpace(searchEntity.Creater) || a.DeelUserId == searchEntity.Creater.Trim())
                         select new WfHistoryDTO
                         {
@@ -191,10 +191,10 @@
                             NeeddeelTypeName = fff.Comments,
                             Contentyijian = a.Content,
                             Sort = a.Sort,
                             Deelurl = a.Deelurl,
                             Creater = a.Creater,
                             Createtime = a.Createtime,
                             Step = a.Step,
                             RecStatus = a.RecStatus,
                             Modifier = a.Modifier,
                             Modifytime = a.Modifytime,
@@ -235,14 +235,72 @@
        /// èŽ·å–æ‰€æœ‰æœ‰æ•ˆæµç¨‹ç±»åž‹
        /// </summary>
        /// <returns></returns>
        public List<WfHistoryDTO> GetList()
        public List<WfHistoryDTO> GetList(string RunProcessId = "")
        {
            var listRole = _context.WfHistories.Where(r => r.RecStatus == "A").ToList();
            var listRole = _context.WfHistories.Where(r => r.RecStatus == "A").OrderBy(x=>x.Sort).ToList();
            if (!string.IsNullOrEmpty(RunProcessId))
            {
                listRole = listRole.Where(x => x.RunProcessId == RunProcessId).ToList();
            }
            var list = _mapper.Map<List<WfHistoryDTO>>(listRole);
            return list;
        }
        /// <summary>
        /// æŸ¥è¯¢åŽ†å²å®¡æ‰¹æ„è§
        /// </summary>
        /// <returns></returns>
        public List<WfHistoryDTO> GetListshenpi(string RunProcessId)
        {
            var listRole = (from a in _context.WfHistories.Where(x => x.RecStatus == "A" && x.NeeddeelType =="1" && x.ChuliStatus != "0" && x.RunProcessId == RunProcessId)
                            join b in _context.PltUsers
                            on a.DeelUserId  equals b.Id
                            select new WfHistoryDTO
                            {
                                RunProcessId = a.RunProcessId,
                                SendUserId = a.SendUserId,
                                DeelUserId = a.DeelUserId,
                                Sendtime = a.Sendtime,
                                Resivetime = a.Resivetime,
                                Step = a.Step,
                                ChuliStatus = a.ChuliStatus,
                                Deelurl = a.Deelurl,
                                NeeddeelType = a.NeeddeelType,
                                Sort = a.Sort,
                                Content = a.Content,
                                RecStatus = a.RecStatus,
                                Creater = a.Creater,
                                Createtime = a.Createtime,
                                Modifier = a.Modifier,
                                Modifytime = a.Modifytime,
                                ChuliStatusName = a.Step == "提交"? "提交" : a.ChuliStatus == "2" ? "同意" : "拒绝",
                                DeelUserIdName = b.UserName,
                                ModifytimeName = a.Modifytime.ToString("yyyy-MM-dd HH:mm:ss"),
                            }
                             ).OrderBy(x => x.Modifytime).ToList();
            //    _context.WfHistories.Where(r => r.RecStatus == "A").OrderBy(x => x.Sort).ToList();
            //if (!string.IsNullOrEmpty(RunProcessId))
            //{
            //    listRole = listRole.Where(x => x.RunProcessId == RunProcessId).ToList();
            //}
            return listRole;
        }
    }
}
zhengcaioa/Services/WfNeeddeelService.cs
@@ -2,6 +2,7 @@
using DTO;
using DTO.Models;
using IServices;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -117,7 +118,7 @@
                string[] Applytimes = searchEntity.Applytime.Split("|");
                DateTime.TryParse(Applytimes[0], out Applytimestart);
                DateTime.TryParse(Applytimes[1], out Applytimeend);
                //Applytimeend = Applytimeend.AddDays(1);
                Applytimeend = Applytimeend.AddDays(1);
            }
            ///WfNeeddeels
@@ -141,7 +142,7 @@
                         from fff in fsssss.DefaultIfEmpty()
                         join d in _context.WfApplytypes
                       on k.Applytiye equals d.Id
                       on k.Applytiye equals d.Applyno
                         join b in _context.PltUsers 
                        on k.Creater equals b.Id
@@ -160,7 +161,7 @@
                               && (string.IsNullOrWhiteSpace(searchEntity.RunProcessId) || a.RunProcessId == searchEntity.RunProcessId.Trim())
                                && (string.IsNullOrWhiteSpace(searchEntity.Applyno) || k.Applyno == searchEntity.Applyno.Trim())
                                  && (string.IsNullOrWhiteSpace(searchEntity.Creater) || a.DeelUserId == searchEntity.Creater.Trim())
                         select new WfNeeddeelDTO
                         {
@@ -192,10 +193,10 @@
                             NeeddeelTypeName = fff.Comments,
                             Contentyijian = a.Content,
                             Sort = a.Sort,
                             Deelurl = a.Deelurl,
                             Creater = a.Creater,
                             Createtime = a.Createtime,
                             Step = a.Step,
                             RecStatus = a.RecStatus,
                             Modifier = a.Modifier,
                             Modifytime = a.Modifytime,
@@ -236,12 +237,37 @@
        /// èŽ·å–æ‰€æœ‰æœ‰æ•ˆæµç¨‹ç±»åž‹
        /// </summary>
        /// <returns></returns>
        public List<WfNeeddeelDTO> GetList()
        public List<WfNeeddeelDTO> GetList(string RunProcessId = "", string step = "")
        {
            var listRole = _context.WfNeeddeels.AsNoTracking().Where(r => r.RecStatus == "A").ToList();
            if (!string.IsNullOrEmpty(RunProcessId) && !string.IsNullOrEmpty(step))
            {
                listRole = listRole.Where(x => x.RunProcessId == RunProcessId && x.Step == step).ToList();
            }
            var list = _mapper.Map<List<WfNeeddeelDTO>>(listRole);
            return list;
        }
        /// <summary>
        /// èŽ·å–æ‰€æœ‰æœ‰æ•ˆæµç¨‹ç±»åž‹
        /// </summary>
        /// <returns></returns>
        public List<WfNeeddeelDTO> GetListTracking(string RunProcessId = "", string step = "")
        {
            var listRole = _context.WfNeeddeels.Where(r => r.RecStatus == "A").ToList();
            if (!string.IsNullOrEmpty(RunProcessId) && !string.IsNullOrEmpty(step))
            {
                listRole = listRole.Where(x => x.RunProcessId == RunProcessId && x.Step == step).ToList();
            }
            var list = _mapper.Map<List<WfNeeddeelDTO>>(listRole);
            return list;
        }
zhengcaioa/Services/WfRunProcessService.cs
@@ -2,6 +2,7 @@
using DTO;
using DTO.Models;
using IServices;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,10 +16,12 @@
    {
        private readonly zhengcaioaContext _context;
        private readonly IMapper _mapper;
        public WfRunProcessService(zhengcaioaContext context, IMapper mapper)
        private readonly IWfNeeddeelService _wfNeeddeelService;
        public WfRunProcessService(zhengcaioaContext context, IMapper mapper, IWfNeeddeelService wfNeeddeelService)
        {
            _context = context;
            _mapper = mapper;
            _wfNeeddeelService = wfNeeddeelService;
        }
        public ResultEntity save(WfRunProcessDTO dto)
        {
@@ -29,6 +32,17 @@
                if (String.IsNullOrEmpty(model.Id))
                {
                    model.Id = Guid.NewGuid().ToString();
                    dto.Id = model.Id;
                    var datestreing = DateTime.Now.ToString("yyyyMMdd");
                    var Applyno = _context.WfRunProcesses.Where(x => x.Applyno.Contains(datestreing)).Max(x => x.Applyno);
                    if (string.IsNullOrEmpty(Applyno))
                    {
                        model.Applyno = datestreing + 1.ToString().PadLeft(4, '0');
                    }
                    else
                    {
                        model.Applyno = datestreing + (int.Parse(Applyno.Substring(Applyno.Length - 4)) + 1).ToString().PadLeft(4, '0');
                    }
                    _context.WfRunProcesses.Add(model);
                }
                else
@@ -42,7 +56,7 @@
                    updateWfRunProcess.Step = model.Step;
                    updateWfRunProcess.ShenpiStatus = model.ShenpiStatus;
                    updateWfRunProcess.Version = model.Version;
                    updateWfRunProcess.Deelurl = model.Deelurl;
                    updateWfRunProcess.RecStatus = model.RecStatus;
                    // updateWfRunProcess.Creater = WfRunProcess.Creater;
@@ -112,25 +126,21 @@
                string[] Applytimes = searchEntity.Applytime.Split("|");
                DateTime.TryParse(Applytimes[0], out Applytimestart);
                DateTime.TryParse(Applytimes[1], out Applytimeend);
                //Applytimeend = Applytimeend.AddDays(1);
                Applytimeend = Applytimeend.AddDays(1);
            }
            ///WfRunProcesses
            var query = (from a in _context.WfRunProcesses
                         join e in listCode.Where(x => x.CodeTable == "wf_run_process" && x.CodeField == "shenpi_status")
                        on a.ShenpiStatus equals e.CodeSn
                        into esssss
                         from eee in esssss.DefaultIfEmpty()
                         join d in _context.WfApplytypes
                       on a.Applytiye equals d.Id
                       on a.Applytiye equals d.Applyno
                         join b in _context.PltUsers
                        on a.Creater equals b.Id
@@ -146,7 +156,7 @@
                             && (string.IsNullOrWhiteSpace(searchEntity.ShenpiStatus) || a.ShenpiStatus == searchEntity.ShenpiStatus.Trim())
                                && (string.IsNullOrWhiteSpace(searchEntity.Applyno) || a.Applyno == searchEntity.Applyno.Trim())
                                && (string.IsNullOrWhiteSpace(searchEntity.Creater) || a.Creater == searchEntity.Creater.Trim())
                         select new WfRunProcessDTO
                         {
@@ -159,10 +169,11 @@
                             Content = a.Content,
                             ShenpiStatusName = eee.Comments,
                             ShenpiStatus = a.ShenpiStatus,
                             Step = a.Step,
                             Version = a.Version,
                             Createtime = a.Createtime,
                             Deelurl = a.Deelurl,
                             RecStatus = a.RecStatus,
                             Modifier = a.Modifier,
                             Modifytime = a.Modifytime,
@@ -203,14 +214,1075 @@
        /// èŽ·å–æ‰€æœ‰æœ‰æ•ˆæµç¨‹ç±»åž‹
        /// </summary>
        /// <returns></returns>
        public List<WfRunProcessDTO> GetList()
        public List<WfRunProcessDTO> GetList(string DanjuId = "",string Applytiye = "")
        {
            var listRole = _context.WfRunProcesses.Where(r => r.RecStatus == "A").ToList();
            if(!string.IsNullOrEmpty(DanjuId) && !string.IsNullOrEmpty(Applytiye))
            {
                listRole = listRole.Where(x=>x.DanjuId == DanjuId && x.Applytiye == Applytiye).ToList();
            }
            var list = _mapper.Map<List<WfRunProcessDTO>>(listRole);
            return list;
        }
        public ResultEntity WfAskLeave(string DanjuId, string step, string tongguojujue, string Userid,string Content, string title, string version)
        {
            ResultEntity result = new ResultEntity();
            result.Result = true;
            WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "01").FirstOrDefault();
            if (wfRunProcessDTO != null)
            {
                version = wfRunProcessDTO.Version;
            }
            if (version == "v1")
            {
                if (step == "提交")
                {
                    //更新流程实例
                    // WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "01").FirstOrDefault();
                    if (wfRunProcessDTO == null)
                    {
                        //插入流程实例
                        wfRunProcessDTO = new WfRunProcessDTO();
                        //wfRunProcessDTO.Applyno =
                        wfRunProcessDTO.Applytime = DateTime.Now;
                        wfRunProcessDTO.Applytiye = "01";
                        wfRunProcessDTO.DanjuId = DanjuId;
                        wfRunProcessDTO.Content = title;
                        wfRunProcessDTO.Step = "人事审批";
                        wfRunProcessDTO.ShenpiStatus = "D";
                        wfRunProcessDTO.Version = version;
                        wfRunProcessDTO.RecStatus = "A";
                        wfRunProcessDTO.Creater = Userid;
                        wfRunProcessDTO.Createtime = DateTime.Now;
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        wfRunProcessDTO.Deelurl = "/Signin/AskLeave?id=" + DanjuId;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //查询处理人
                        var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "人事").FirstOrDefault();
                        if (hrPositions == null)
                        {
                            result.Result = false;
                            result.Message = "未找到职位";
                            return result;
                        }
                        var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A")
                                        join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId
                                        select a
                                        ).ToList();
                        if (pltUsers == null || pltUsers.Count == 0)
                        {
                            result.Result = false;
                            result.Message = "未找到处理人";
                            return result;
                        }
                        foreach (var pltUser in pltUsers)
                        {
                            //插入待办
                            WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                            wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                            wfNeeddeelDTO.SendUserId = Userid;
                            wfNeeddeelDTO.DeelUserId = pltUser.Id;
                            wfNeeddeelDTO.Sendtime = DateTime.Now;
                            wfNeeddeelDTO.Resivetime = DateTime.Now;
                            wfNeeddeelDTO.Step = "人事审批";
                            wfNeeddeelDTO.NeeddeelType = "1";
                            wfNeeddeelDTO.ChuliStatus = "0";
                            wfNeeddeelDTO.Deelurl = "/Signin/AskLeave?id=" + DanjuId;
                            wfNeeddeelDTO.Content = "";
                            wfNeeddeelDTO.Sort = 1;
                            wfNeeddeelDTO.RecStatus = "A";
                            wfNeeddeelDTO.Creater = Userid;
                            wfNeeddeelDTO.Createtime = DateTime.Now;
                            wfNeeddeelDTO.Modifier = Userid;
                            wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                            result = _wfNeeddeelService.save(wfNeeddeelDTO);
                            if (result.Result == false)
                            {
                                return result;
                            }
                        }
                        //插入新的已办
                        WfHistory wfHistoryDTO1 = new WfHistory();
                        wfHistoryDTO1.Id = Guid.NewGuid().ToString();
                        wfHistoryDTO1.RunProcessId = wfRunProcessDTO.Id;
                        wfHistoryDTO1.SendUserId = Userid;
                        wfHistoryDTO1.DeelUserId = wfRunProcessDTO.Creater;
                        wfHistoryDTO1.Sendtime = DateTime.Now;
                        wfHistoryDTO1.Resivetime = DateTime.Now;
                        wfHistoryDTO1.Step = "提交";
                        wfHistoryDTO1.NeeddeelType = "1";
                        wfHistoryDTO1.ChuliStatus = "2";
                        wfHistoryDTO1.Deelurl = "/Signin/AskLeave?id=" + DanjuId;
                        wfHistoryDTO1.Content = "";
                        wfHistoryDTO1.Sort = 1;
                        wfHistoryDTO1.RecStatus = "A";
                        wfHistoryDTO1.Creater = Userid;
                        wfHistoryDTO1.Createtime = DateTime.Now;
                        wfHistoryDTO1.Modifier = Userid;
                        wfHistoryDTO1.Modifytime = wfHistoryDTO1.Createtime;
                        _context.WfHistories.Add(wfHistoryDTO1);
                        _context.SaveChanges();
                    }
                    else
                    {
                        wfRunProcessDTO.Step = "人事审批";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "提交");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "2";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                        //查询处理人
                        var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "人事").FirstOrDefault();
                        if (hrPositions == null)
                        {
                            result.Result = false;
                            result.Message = "未找到职位";
                            return result;
                        }
                        var pltUsers = (from   a in  _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A")
                                        join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId
                                        select a
                                        ).ToList();
                        if (pltUsers == null || pltUsers.Count == 0)
                        {
                            result.Result = false;
                            result.Message = "未找到处理人";
                            return result;
                        }
                        foreach (var pltUser in pltUsers)
                        {
                            //插入新的待办
                            WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                            wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                            wfNeeddeelDTO.SendUserId = Userid;
                            wfNeeddeelDTO.DeelUserId = pltUser.Id;
                            wfNeeddeelDTO.Sendtime = DateTime.Now;
                            wfNeeddeelDTO.Resivetime = DateTime.Now;
                            wfNeeddeelDTO.Step = "人事审批";
                            wfNeeddeelDTO.NeeddeelType = "1";
                            wfNeeddeelDTO.ChuliStatus = "0";
                            wfNeeddeelDTO.Deelurl = "/Signin/AskLeave?id=" + DanjuId;
                            wfNeeddeelDTO.Content = "";
                            wfNeeddeelDTO.Sort = 2;
                            wfNeeddeelDTO.RecStatus = "A";
                            wfNeeddeelDTO.Creater = Userid;
                            wfNeeddeelDTO.Createtime = DateTime.Now;
                            wfNeeddeelDTO.Modifier = Userid;
                            wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                            result = _wfNeeddeelService.save(wfNeeddeelDTO);
                            if (result.Result == false)
                            {
                                return result;
                            }
                        }
                    }
                }
                if (step == "人事审批")
                {
                    //更新流程实例
                    //WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "01").FirstOrDefault();
                    if (wfRunProcessDTO == null)
                    {
                        result.Result = false;
                        result.Message = "未找到流程实例";
                        return result;
                    }
                    if (wfRunProcessDTO.Step != "人事审批")
                    {
                        result.Result = false;
                        result.Message = "当前步骤已经处理";
                        return result;
                    }
                    if (tongguojujue == "A")
                    {
                        wfRunProcessDTO.Step = "总经理审批";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "人事审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "2";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                        //查询处理人
                        var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "总经理").FirstOrDefault();
                        if (hrPositions == null)
                        {
                            result.Result = false;
                            result.Message = "未找到职位";
                            return result;
                        }
                        var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A")
                                        join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId
                                        select a
                                        ).ToList();
                        if (pltUsers == null || pltUsers.Count == 0)
                        {
                            result.Result = false;
                            result.Message = "未找到处理人";
                            return result;
                        }
                        foreach (var pltUser in pltUsers)
                        {
                            //插入新的待办
                            WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                            wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                            wfNeeddeelDTO.SendUserId = Userid;
                            wfNeeddeelDTO.DeelUserId = pltUser.Id;
                            wfNeeddeelDTO.Sendtime = DateTime.Now;
                            wfNeeddeelDTO.Resivetime = DateTime.Now;
                            wfNeeddeelDTO.Step = "总经理审批";
                            wfNeeddeelDTO.NeeddeelType = "1";
                            wfNeeddeelDTO.ChuliStatus = "0";
                            wfNeeddeelDTO.Deelurl = "/Signin/AskLeave?id=" + DanjuId;
                            wfNeeddeelDTO.Content = "";
                            wfNeeddeelDTO.Sort = 3;
                            wfNeeddeelDTO.RecStatus = "A";
                            wfNeeddeelDTO.Creater = Userid;
                            wfNeeddeelDTO.Createtime = DateTime.Now;
                            wfNeeddeelDTO.Modifier = Userid;
                            wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                            result = _wfNeeddeelService.save(wfNeeddeelDTO);
                            if (result.Result == false)
                            {
                                return result;
                            }
                        }
                    }
                    else
                    {
                        wfRunProcessDTO.Step = "提交";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "人事审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "1";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                            //插入新的待办
                            WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                            wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                            wfNeeddeelDTO.SendUserId = Userid;
                            wfNeeddeelDTO.DeelUserId = wfRunProcessDTO.Creater;
                            wfNeeddeelDTO.Sendtime = DateTime.Now;
                            wfNeeddeelDTO.Resivetime = DateTime.Now;
                            wfNeeddeelDTO.Step = "提交";
                            wfNeeddeelDTO.NeeddeelType = "1";
                            wfNeeddeelDTO.ChuliStatus = "0";
                            wfNeeddeelDTO.Deelurl = "/Signin/AskLeave?id=" + DanjuId;
                            wfNeeddeelDTO.Content = "";
                            wfNeeddeelDTO.Sort = 1;
                            wfNeeddeelDTO.RecStatus = "A";
                            wfNeeddeelDTO.Creater = Userid;
                            wfNeeddeelDTO.Createtime = DateTime.Now;
                            wfNeeddeelDTO.Modifier = Userid;
                            wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                            result = _wfNeeddeelService.save(wfNeeddeelDTO);
                            if (result.Result == false)
                            {
                                return result;
                            }
                    }
                }
                if (step == "总经理审批")
                {
                    //更新流程实例
                    //WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "01").FirstOrDefault();
                    if (wfRunProcessDTO == null)
                    {
                        result.Result = false;
                        result.Message = "未找到流程实例";
                        return result;
                    }
                    if (wfRunProcessDTO.Step != "总经理审批")
                    {
                        result.Result = false;
                        result.Message = "当前步骤已经处理";
                        return result;
                    }
                    if (tongguojujue == "A")
                    {
                        wfRunProcessDTO.Step = "完结";
                        wfRunProcessDTO.ShenpiStatus = "A";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新单据
                        var askLeave = _context.AdmAskLeaves.Find(DanjuId);
                        if (wfRunProcessDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到单据";
                            return result;
                        }
                        askLeave.ShenpiStatus = "A";
                        _context.SaveChanges();
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "总经理审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "2";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            // _wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                    }
                    else
                    {
                        wfRunProcessDTO.Step = "提交";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "总经理审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "1";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                        //插入新的待办
                        WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                        wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                        wfNeeddeelDTO.SendUserId = Userid;
                        wfNeeddeelDTO.DeelUserId = wfRunProcessDTO.Creater;
                        wfNeeddeelDTO.Sendtime = DateTime.Now;
                        wfNeeddeelDTO.Resivetime = DateTime.Now;
                        wfNeeddeelDTO.Step = "提交";
                        wfNeeddeelDTO.NeeddeelType = "1";
                        wfNeeddeelDTO.ChuliStatus = "0";
                        wfNeeddeelDTO.Deelurl = "/Signin/AskLeave?id=" + DanjuId;
                        wfNeeddeelDTO.Content = "";
                        wfNeeddeelDTO.Sort = 1;
                        wfNeeddeelDTO.RecStatus = "A";
                        wfNeeddeelDTO.Creater = Userid;
                        wfNeeddeelDTO.Createtime = DateTime.Now;
                        wfNeeddeelDTO.Modifier = Userid;
                        wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                        result = _wfNeeddeelService.save(wfNeeddeelDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                    }
                }
            }
            return result;
        }
        public ResultEntity WfAskLeaveOff(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version)
        {
            ResultEntity result = new ResultEntity();
            result.Result = true;
            WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "02").FirstOrDefault();
            if (wfRunProcessDTO != null)
            {
                version = wfRunProcessDTO.Version;
            }
            if (version == "v1")
            {
                if (step == "提交")
                {
                    //更新流程实例
                    // WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "02").FirstOrDefault();
                    if (wfRunProcessDTO == null)
                    {
                        //插入流程实例
                        wfRunProcessDTO = new WfRunProcessDTO();
                        //wfRunProcessDTO.Applyno =
                        wfRunProcessDTO.Applytime = DateTime.Now;
                        wfRunProcessDTO.Applytiye = "02";
                        wfRunProcessDTO.DanjuId = DanjuId;
                        wfRunProcessDTO.Content = title;
                        wfRunProcessDTO.Step = "人事审批";
                        wfRunProcessDTO.ShenpiStatus = "D";
                        wfRunProcessDTO.Version = version;
                        wfRunProcessDTO.RecStatus = "A";
                        wfRunProcessDTO.Creater = Userid;
                        wfRunProcessDTO.Createtime = DateTime.Now;
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        wfRunProcessDTO.Deelurl = "/Signin/AskLeaveOff?id=" + DanjuId;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //查询处理人
                        var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "人事").FirstOrDefault();
                        if (hrPositions == null)
                        {
                            result.Result = false;
                            result.Message = "未找到职位";
                            return result;
                        }
                        var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A")
                                        join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId
                                        select a
                                        ).ToList();
                        if (pltUsers == null || pltUsers.Count == 0)
                        {
                            result.Result = false;
                            result.Message = "未找到处理人";
                            return result;
                        }
                        foreach (var pltUser in pltUsers)
                        {
                            //插入待办
                            WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                            wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                            wfNeeddeelDTO.SendUserId = Userid;
                            wfNeeddeelDTO.DeelUserId = pltUser.Id;
                            wfNeeddeelDTO.Sendtime = DateTime.Now;
                            wfNeeddeelDTO.Resivetime = DateTime.Now;
                            wfNeeddeelDTO.Step = "人事审批";
                            wfNeeddeelDTO.NeeddeelType = "1";
                            wfNeeddeelDTO.ChuliStatus = "0";
                            wfNeeddeelDTO.Deelurl = "/Signin/AskLeaveOff?id=" + DanjuId;
                            wfNeeddeelDTO.Content = "";
                            wfNeeddeelDTO.Sort = 1;
                            wfNeeddeelDTO.RecStatus = "A";
                            wfNeeddeelDTO.Creater = Userid;
                            wfNeeddeelDTO.Createtime = DateTime.Now;
                            wfNeeddeelDTO.Modifier = Userid;
                            wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                            result = _wfNeeddeelService.save(wfNeeddeelDTO);
                            if (result.Result == false)
                            {
                                return result;
                            }
                        }
                        //插入新的已办
                        WfHistory wfHistoryDTO1 = new WfHistory();
                        wfHistoryDTO1.Id = Guid.NewGuid().ToString();
                        wfHistoryDTO1.RunProcessId = wfRunProcessDTO.Id;
                        wfHistoryDTO1.SendUserId = Userid;
                        wfHistoryDTO1.DeelUserId = wfRunProcessDTO.Creater;
                        wfHistoryDTO1.Sendtime = DateTime.Now;
                        wfHistoryDTO1.Resivetime = DateTime.Now;
                        wfHistoryDTO1.Step = "提交";
                        wfHistoryDTO1.NeeddeelType = "1";
                        wfHistoryDTO1.ChuliStatus = "2";
                        wfHistoryDTO1.Deelurl = "/Signin/AskLeaveOff?id=" + DanjuId;
                        wfHistoryDTO1.Content = "";
                        wfHistoryDTO1.Sort = 1;
                        wfHistoryDTO1.RecStatus = "A";
                        wfHistoryDTO1.Creater = Userid;
                        wfHistoryDTO1.Createtime = DateTime.Now;
                        wfHistoryDTO1.Modifier = Userid;
                        wfHistoryDTO1.Modifytime = wfHistoryDTO1.Createtime;
                        _context.WfHistories.Add(wfHistoryDTO1);
                        _context.SaveChanges();
                    }
                    else
                    {
                        wfRunProcessDTO.Step = "人事审批";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "提交");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "2";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                        //查询处理人
                        var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "人事").FirstOrDefault();
                        if (hrPositions == null)
                        {
                            result.Result = false;
                            result.Message = "未找到职位";
                            return result;
                        }
                        var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A")
                                        join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId
                                        select a
                                        ).ToList();
                        if (pltUsers == null || pltUsers.Count == 0)
                        {
                            result.Result = false;
                            result.Message = "未找到处理人";
                            return result;
                        }
                        foreach (var pltUser in pltUsers)
                        {
                            //插入新的待办
                            WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                            wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                            wfNeeddeelDTO.SendUserId = Userid;
                            wfNeeddeelDTO.DeelUserId = pltUser.Id;
                            wfNeeddeelDTO.Sendtime = DateTime.Now;
                            wfNeeddeelDTO.Resivetime = DateTime.Now;
                            wfNeeddeelDTO.Step = "人事审批";
                            wfNeeddeelDTO.NeeddeelType = "1";
                            wfNeeddeelDTO.ChuliStatus = "0";
                            wfNeeddeelDTO.Deelurl = "/Signin/AskLeaveOff?id=" + DanjuId;
                            wfNeeddeelDTO.Content = "";
                            wfNeeddeelDTO.Sort = 2;
                            wfNeeddeelDTO.RecStatus = "A";
                            wfNeeddeelDTO.Creater = Userid;
                            wfNeeddeelDTO.Createtime = DateTime.Now;
                            wfNeeddeelDTO.Modifier = Userid;
                            wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                            result = _wfNeeddeelService.save(wfNeeddeelDTO);
                            if (result.Result == false)
                            {
                                return result;
                            }
                        }
                    }
                }
                if (step == "人事审批")
                {
                    //更新流程实例
                    //WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "02").FirstOrDefault();
                    if (wfRunProcessDTO == null)
                    {
                        result.Result = false;
                        result.Message = "未找到流程实例";
                        return result;
                    }
                    if (wfRunProcessDTO.Step != "人事审批")
                    {
                        result.Result = false;
                        result.Message = "当前步骤已经处理";
                        return result;
                    }
                    if (tongguojujue == "A")
                    {
                        wfRunProcessDTO.Step = "总经理审批";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "人事审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "2";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                        //查询处理人
                        var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "总经理").FirstOrDefault();
                        if (hrPositions == null)
                        {
                            result.Result = false;
                            result.Message = "未找到职位";
                            return result;
                        }
                        var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A")
                                        join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId
                                        select a
                                        ).ToList();
                        if (pltUsers == null || pltUsers.Count == 0)
                        {
                            result.Result = false;
                            result.Message = "未找到处理人";
                            return result;
                        }
                        foreach (var pltUser in pltUsers)
                        {
                            //插入新的待办
                            WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                            wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                            wfNeeddeelDTO.SendUserId = Userid;
                            wfNeeddeelDTO.DeelUserId = pltUser.Id;
                            wfNeeddeelDTO.Sendtime = DateTime.Now;
                            wfNeeddeelDTO.Resivetime = DateTime.Now;
                            wfNeeddeelDTO.Step = "总经理审批";
                            wfNeeddeelDTO.NeeddeelType = "1";
                            wfNeeddeelDTO.ChuliStatus = "0";
                            wfNeeddeelDTO.Deelurl = "/Signin/AskLeaveOff?id=" + DanjuId;
                            wfNeeddeelDTO.Content = "";
                            wfNeeddeelDTO.Sort = 3;
                            wfNeeddeelDTO.RecStatus = "A";
                            wfNeeddeelDTO.Creater = Userid;
                            wfNeeddeelDTO.Createtime = DateTime.Now;
                            wfNeeddeelDTO.Modifier = Userid;
                            wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                            result = _wfNeeddeelService.save(wfNeeddeelDTO);
                            if (result.Result == false)
                            {
                                return result;
                            }
                        }
                    }
                    else
                    {
                        wfRunProcessDTO.Step = "提交";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "人事审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "1";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                        //插入新的待办
                        WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                        wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                        wfNeeddeelDTO.SendUserId = Userid;
                        wfNeeddeelDTO.DeelUserId = wfRunProcessDTO.Creater;
                        wfNeeddeelDTO.Sendtime = DateTime.Now;
                        wfNeeddeelDTO.Resivetime = DateTime.Now;
                        wfNeeddeelDTO.Step = "提交";
                        wfNeeddeelDTO.NeeddeelType = "1";
                        wfNeeddeelDTO.ChuliStatus = "0";
                        wfNeeddeelDTO.Deelurl = "/Signin/AskLeaveOff?id=" + DanjuId;
                        wfNeeddeelDTO.Content = "";
                        wfNeeddeelDTO.Sort = 1;
                        wfNeeddeelDTO.RecStatus = "A";
                        wfNeeddeelDTO.Creater = Userid;
                        wfNeeddeelDTO.Createtime = DateTime.Now;
                        wfNeeddeelDTO.Modifier = Userid;
                        wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                        result = _wfNeeddeelService.save(wfNeeddeelDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                    }
                }
                if (step == "总经理审批")
                {
                    //更新流程实例
                    //WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "02").FirstOrDefault();
                    if (wfRunProcessDTO == null)
                    {
                        result.Result = false;
                        result.Message = "未找到流程实例";
                        return result;
                    }
                    if (wfRunProcessDTO.Step != "总经理审批")
                    {
                        result.Result = false;
                        result.Message = "当前步骤已经处理";
                        return result;
                    }
                    if (tongguojujue == "A")
                    {
                        wfRunProcessDTO.Step = "完结";
                        wfRunProcessDTO.ShenpiStatus = "A";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新单据
                        var askLeaveOff = _context.AdmAskLeaveOffs.Find(DanjuId);
                        if (wfRunProcessDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到单据";
                            return result;
                        }
                        askLeaveOff.ShenpiStatus = "A";
                        _context.SaveChanges();
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "总经理审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "2";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            // _wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                    }
                    else
                    {
                        wfRunProcessDTO.Step = "提交";
                        wfRunProcessDTO.Modifier = Userid;
                        wfRunProcessDTO.Modifytime = DateTime.Now;
                        result = this.save(wfRunProcessDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                        //更新待办
                        List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "总经理审批");
                        var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs);
                        var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault();
                        if (wfHistoryDTO == null)
                        {
                            result.Result = false;
                            result.Message = "未找到代办";
                            return result;
                        }
                        wfHistoryDTO.Content = Content;
                        wfHistoryDTO.ChuliStatus = "1";
                        wfHistoryDTO.Modifier = Userid;
                        wfHistoryDTO.Modifytime = DateTime.Now;
                        var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs);
                        foreach (var wfHistory in wfHistories)
                        {
                            _context.WfHistories.Add(wfHistory);
                        }
                        var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs);
                        foreach (var wfNeeddeel in wfNeeddeels)
                        {
                            //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid);
                            _context.WfNeeddeels.Remove(wfNeeddeel);
                        }
                        _context.SaveChanges();
                        //插入新的待办
                        WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO();
                        wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id;
                        wfNeeddeelDTO.SendUserId = Userid;
                        wfNeeddeelDTO.DeelUserId = wfRunProcessDTO.Creater;
                        wfNeeddeelDTO.Sendtime = DateTime.Now;
                        wfNeeddeelDTO.Resivetime = DateTime.Now;
                        wfNeeddeelDTO.Step = "提交";
                        wfNeeddeelDTO.NeeddeelType = "1";
                        wfNeeddeelDTO.ChuliStatus = "0";
                        wfNeeddeelDTO.Deelurl = "/Signin/askLeaveOff?id=" + DanjuId;
                        wfNeeddeelDTO.Content = "";
                        wfNeeddeelDTO.Sort = 1;
                        wfNeeddeelDTO.RecStatus = "A";
                        wfNeeddeelDTO.Creater = Userid;
                        wfNeeddeelDTO.Createtime = DateTime.Now;
                        wfNeeddeelDTO.Modifier = Userid;
                        wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime;
                        result = _wfNeeddeelService.save(wfNeeddeelDTO);
                        if (result.Result == false)
                        {
                            return result;
                        }
                    }
                }
            }
            return result;
        }
    }
}
zhengcaioa/zhengcaioa/Controllers/AdmManagement/SigninController.cs
@@ -22,15 +22,22 @@
        private readonly ISysAttachmentService _sysAttachmentService;
        private readonly IAdmAttendanceRuleService _attendanceRuleService;
        private readonly ILiaotianService _liaotianService;
        private readonly IWfRunProcessService _wfRunProcessService;
        private readonly IWfHistoryService _wfHistoryService;
        private readonly IWfNeeddeelService _wfNeeddeelService;
        [CheckLogin]
        public SigninController(ILogger<SigninController> logger, IAdmSigninService signinService, ISysAttachmentService sysAttachmentService
            , IAdmAttendanceRuleService attendanceRuleService, ILiaotianService liaotianService)
            , IAdmAttendanceRuleService attendanceRuleService, ILiaotianService liaotianService, IWfRunProcessService wfRunProcessService
            , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService)
        {
            _logger = logger;
            _signinService = signinService;
            _sysAttachmentService = sysAttachmentService;
            _attendanceRuleService = attendanceRuleService;
            _liaotianService = liaotianService;
            _wfRunProcessService = wfRunProcessService;
            _wfHistoryService = wfHistoryService;
            _wfNeeddeelService = wfNeeddeelService;
        }
        #region è€ƒå‹¤ç­¾åˆ°æ‰“卡
@@ -272,6 +279,51 @@
            ViewData["Lavetype"] = _liaotianService.GetSYScode("ADM_AskLeave", "Lavetype");
            string shifoubiaoji = "A";
            string sifoudangqian = "A";
            string dangqianbuzhou = "提交";
            var lishiyijian = new  List<WfHistoryDTO>();
            //流程相关
            if (!string.IsNullOrEmpty(id))
            {
              var wfRunProcessDTO  =  _wfRunProcessService.GetList(id,"01").FirstOrDefault();
                if (wfRunProcessDTO == null)
                {
                    shifoubiaoji = "D";
                    sifoudangqian = "D";
                }
                else
                {
                    dangqianbuzhou = wfRunProcessDTO.Step;
                    //查询历史意见
                     lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
                    if(wfRunProcessDTO.Step != "提交")
                    {
                        shifoubiaoji = "D";
                    }
                    //查询待办
                    var chaxundaiban = _wfNeeddeelService.GetListTracking(wfRunProcessDTO.Id, wfRunProcessDTO.Step).Where(x=>x.DeelUserId == curentuser.Id).ToList();
                    if(chaxundaiban!=null && chaxundaiban.Count > 0)
                    {
                        sifoudangqian = "A";
                    }
                    else
                    {
                        sifoudangqian = "D";
                    }
                }
            }
            ViewBag.shifoubiaoji = shifoubiaoji;
            ViewBag.sifoudangqian = sifoudangqian;
            ViewBag.lishiyijian = lishiyijian;
            ViewBag.dangqianbuzhou = dangqianbuzhou;
            return View();
        }
@@ -283,61 +335,72 @@
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            admAsk.RecStatus = "A";
            //未挂审批流,提交直接通过
            admAsk.ShenpiStatus = "A";
            if (String.IsNullOrEmpty(admAsk.Id))
            {
                admAsk.Creater = curentuser.Id;
                admAsk.Createtime = DateTime.Now;
            }
            else
            {
                admAsk.Modifier = curentuser.Id;
                admAsk.Modifytime = DateTime.Now;
            }
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
                if (String.IsNullOrEmpty(admAsk.Id))
                {
                    admAsk.Creater = curentuser.Id;
                    admAsk.Createtime = DateTime.Now;
                }
                else
                {
                    admAsk.Modifier = curentuser.Id;
                    admAsk.Modifytime = DateTime.Now;
                }
            using (TransactionScope scope = new TransactionScope())
            {
                resultEntity = _signinService.SaveAskLeave(admAsk);
                if (resultEntity.Result == false)
                if (admAsk.Step == "提交")
                {
                    return JsonConvert.SerializeObject(resultEntity);
                }
                string[] Filepaths = admAsk.Filepath;
                if (Filepaths != null && Filepaths.Length > 0)
                {
                    for (int i = 0; i < Filepaths.Length; i++)
                    resultEntity = _signinService.SaveAskLeave(admAsk);
                    if (resultEntity.Result == false)
                    {
                        if (string.IsNullOrEmpty(admAsk.attachmentid[i]))
                        {
                            SysAttachmentDTO sysAttachmentDTO = new SysAttachmentDTO();
                            //sysAttachmentDTO.Id =
                            sysAttachmentDTO.AttObj = "AskLeave";
                            sysAttachmentDTO.AttObjid = admAsk.Id;
                            sysAttachmentDTO.Filefullname = admAsk.Filefullname[i];
                            sysAttachmentDTO.Filepath = admAsk.Filepath[i];
                            sysAttachmentDTO.Creater = curentuser.Id;
                            sysAttachmentDTO.Modifier = curentuser.Id;
                            sysAttachmentDTO.Createtime = DateTime.Now;
                            sysAttachmentDTO.Modifytime = sysAttachmentDTO.Createtime;
                            resultEntity = _sysAttachmentService.save(sysAttachmentDTO);
                            if (resultEntity.Result == false)
                            {
                                return JsonConvert.SerializeObject(resultEntity);
                            }
                        }
                        return JsonConvert.SerializeObject(resultEntity);
                    }
                    string[] Filepaths = admAsk.Filepath;
                    if (Filepaths != null && Filepaths.Length > 0)
                    {
                        for (int i = 0; i < Filepaths.Length; i++)
                        {
                            if (string.IsNullOrEmpty(admAsk.attachmentid[i]))
                            {
                                SysAttachmentDTO sysAttachmentDTO = new SysAttachmentDTO();
                                //sysAttachmentDTO.Id =
                                sysAttachmentDTO.AttObj = "AskLeave";
                                sysAttachmentDTO.AttObjid = admAsk.Id;
                                sysAttachmentDTO.Filefullname = admAsk.Filefullname[i];
                                sysAttachmentDTO.Filepath = admAsk.Filepath[i];
                                sysAttachmentDTO.Creater = curentuser.Id;
                                sysAttachmentDTO.Modifier = curentuser.Id;
                                sysAttachmentDTO.Createtime = DateTime.Now;
                                sysAttachmentDTO.Modifytime = sysAttachmentDTO.Createtime;
                                resultEntity = _sysAttachmentService.save(sysAttachmentDTO);
                                if (resultEntity.Result == false)
                                {
                                    return JsonConvert.SerializeObject(resultEntity);
                                }
                            }
                        }
                    }
                }
                //发起流程相关
                resultEntity = _wfRunProcessService.WfAskLeave(admAsk.Id, admAsk.Step, admAsk.Tongguojujue, curentuser.Id, admAsk.Content, admAsk.Tittle, "v1");
                scope.Complete();
            }
            return JsonConvert.SerializeObject(resultEntity);
             
@@ -785,6 +848,53 @@
            ViewData["Lavetype"] = _liaotianService.GetSYScode("ADM_AskLeaveOff", "Lavetype");
            ViewData.Model = askLeaveOffDTO;
            string shifoubiaoji = "A";
            string sifoudangqian = "A";
            string dangqianbuzhou = "提交";
            var lishiyijian = new List<WfHistoryDTO>();
            //流程相关
            if (!string.IsNullOrEmpty(id))
            {
                var wfRunProcessDTO = _wfRunProcessService.GetList(id, "02").FirstOrDefault();
                if (wfRunProcessDTO == null)
                {
                    shifoubiaoji = "D";
                    sifoudangqian = "D";
                }
                else
                {
                    dangqianbuzhou = wfRunProcessDTO.Step;
                    //查询历史意见
                    lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id);
                    if (wfRunProcessDTO.Step != "提交")
                    {
                        shifoubiaoji = "D";
                    }
                    //查询待办
                    var chaxundaiban = _wfNeeddeelService.GetListTracking(wfRunProcessDTO.Id, wfRunProcessDTO.Step).Where(x => x.DeelUserId == curentuser.Id).ToList();
                    if (chaxundaiban != null && chaxundaiban.Count > 0)
                    {
                        sifoudangqian = "A";
                    }
                    else
                    {
                        sifoudangqian = "D";
                    }
                }
            }
            ViewBag.shifoubiaoji = shifoubiaoji;
            ViewBag.sifoudangqian = sifoudangqian;
            ViewBag.lishiyijian = lishiyijian;
            ViewBag.dangqianbuzhou = dangqianbuzhou;
            return View();
        }
@@ -806,41 +916,45 @@
            resultEntity.Result = false;
            using (TransactionScope scope = new TransactionScope())
            {
                resultEntity = _signinService.SaveAskLeaveOff(leaveOff);
                if(resultEntity.Result == false)
                if (leaveOff.Step == "提交")
                {
                    return JsonConvert.SerializeObject(resultEntity);
                }
                string[] Filepaths = leaveOff.Filepath;
                if (Filepaths != null && Filepaths.Length > 0)
                {
                    for (int i = 0; i < Filepaths.Length; i++)
                    resultEntity = _signinService.SaveAskLeaveOff(leaveOff);
                    if (resultEntity.Result == false)
                    {
                        if (string.IsNullOrEmpty(leaveOff.attachmentid[i]))
                        {
                            SysAttachmentDTO sysAttachmentDTO = new SysAttachmentDTO();
                            //sysAttachmentDTO.Id =
                            sysAttachmentDTO.AttObj = "AskLeaveOff";
                            sysAttachmentDTO.AttObjid = leaveOff.Id;
                            sysAttachmentDTO.Filefullname = leaveOff.Filefullname[i];
                            sysAttachmentDTO.Filepath = leaveOff.Filepath[i];
                            sysAttachmentDTO.Creater = curentuser.Id;
                            sysAttachmentDTO.Modifier = curentuser.Id;
                            sysAttachmentDTO.Createtime = DateTime.Now;
                            sysAttachmentDTO.Modifytime = sysAttachmentDTO.Createtime;
                        return JsonConvert.SerializeObject(resultEntity);
                    }
                    string[] Filepaths = leaveOff.Filepath;
                            resultEntity = _sysAttachmentService.save(sysAttachmentDTO);
                            if (resultEntity.Result == false)
                    if (Filepaths != null && Filepaths.Length > 0)
                    {
                        for (int i = 0; i < Filepaths.Length; i++)
                        {
                            if (string.IsNullOrEmpty(leaveOff.attachmentid[i]))
                            {
                                return JsonConvert.SerializeObject(resultEntity);
                                SysAttachmentDTO sysAttachmentDTO = new SysAttachmentDTO();
                                //sysAttachmentDTO.Id =
                                sysAttachmentDTO.AttObj = "AskLeaveOff";
                                sysAttachmentDTO.AttObjid = leaveOff.Id;
                                sysAttachmentDTO.Filefullname = leaveOff.Filefullname[i];
                                sysAttachmentDTO.Filepath = leaveOff.Filepath[i];
                                sysAttachmentDTO.Creater = curentuser.Id;
                                sysAttachmentDTO.Modifier = curentuser.Id;
                                sysAttachmentDTO.Createtime = DateTime.Now;
                                sysAttachmentDTO.Modifytime = sysAttachmentDTO.Createtime;
                                resultEntity = _sysAttachmentService.save(sysAttachmentDTO);
                                if (resultEntity.Result == false)
                                {
                                    return JsonConvert.SerializeObject(resultEntity);
                                }
                            }
                        }
                    }
                }
                resultEntity = _wfRunProcessService.WfAskLeaveOff(leaveOff.Id, leaveOff.Step, leaveOff.Tongguojujue, curentuser.Id, leaveOff.Content, leaveOff.Tittle, "v1");
                scope.Complete();
            }
zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs
@@ -114,7 +114,7 @@
            ViewBag.khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.khly = _liaotianService.GetSYScode("CooperatecustomCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.khly = _liaotianService.GetSYScode("IntentionCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.hyfl = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
@@ -133,6 +133,41 @@
        {
            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
            return new JsonResult(_intentionCustomerService.SearchByPaging(search));
        }
        public IActionResult IndexYiXiang()
        {
            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;
            actionEntity.ActionUrl = "";
            actionEntity.ActionFun = "Search";
            actionEntity.PageIco = "fa fa-search";
            actionEntity.ActionName = "查询";
            actionlist.Add(actionEntity);
            ViewData["ActionInfo"] = actionlist;
            ViewBag.khly = _liaotianService.GetSYScode("IntentionCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.ywjl = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
            ViewBag.Dianxiaozhuanyuan = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList();
            ViewBag.ywjlId = curentuser.Id;
            //ViewBag.khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            //ViewBag.hyfl = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            //ViewBag.ShengDropDown = _projectService.Getsheng().Select(x => new { code = x.CodeId, label = x.Name }).ToList();
            return View();
        }
        public IActionResult Edit(string id = null,string namecus = null)
@@ -163,7 +198,7 @@
            var users = _userService.GetList().Where(x => x.IsYwjl == "A").ToList(); ;
            ViewData["khlx"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx");
            ViewData["khly"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "khly");
            ViewData["khly"] = _liaotianService.GetSYScode("IntentionCustomer", "khly");
            ViewData["hyfl"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl");
            ViewData["users"] = users;
@@ -196,7 +231,7 @@
            var users = _userService.GetList().Where(x => x.IsYwjl == "A").ToList(); ;
            ViewData["khlx"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx");
            ViewData["khly"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "khly");
            ViewData["khly"] = _liaotianService.GetSYScode("IntentionCustomer", "khly");
            ViewData["hyfl"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl");
            ViewData["users"] = users;
@@ -282,11 +317,11 @@
                    for (int i = 0; i < result.Count; i++)
                    {
                        resultEntity = _intentionCustomerService.ModifyStatus(result[i].Id, curentuser.Id);
                        if (!resultEntity.Result)
                        {
                            return new JsonResult(resultEntity);
                        }
                        //resultEntity = _intentionCustomerService.ModifyStatus(result[i].Id, curentuser.Id);
                        //if (!resultEntity.Result)
                        //{
                        //    return new JsonResult(resultEntity);
                        //}
                        var dto = _mapper.Map<CooperatecustomCustomerDTO>(result[i]);
                        dto.Id = "";
zhengcaioa/zhengcaioa/Controllers/Customer/IntentionVisitController.cs
@@ -18,6 +18,7 @@
using CommonToolsCore;
using static CommonToolsCore.SendMailHelper;
using System.Net.Mail;
using System.Transactions;
namespace zhengcaioa.Controllers.Customer
{
@@ -46,7 +47,7 @@
        }
        public IActionResult Index()
        public IActionResult Index(string Viscustomer = "", string IsYwjl = "")
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
@@ -74,13 +75,13 @@
            ViewBag.khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.khly = _liaotianService.GetSYScode("CooperatecustomCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.khly = _liaotianService.GetSYScode("IntentionCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.hyfl = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList();
            ViewBag.Viscustomer = Viscustomer;
            ViewBag.IsYwjl = IsYwjl;
            ViewBag.ShengDropDown = _projectService.Getsheng().Select(x => new { code = x.CodeId, label = x.Name }).ToList();
            return View();
@@ -93,7 +94,7 @@
            return new JsonResult(_intentionVisitService.SearchByPaging(search));
        }
        public IActionResult Edit(string id = null)
        public IActionResult Edit(string id = null,string Viscustomer = null,string IsYwjl = "")
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
@@ -107,6 +108,10 @@
            else
            {
                dto.Vistime = DateTime.Now;
                if (!string.IsNullOrWhiteSpace(Viscustomer))
                {
                    dto.Viscustomer = Viscustomer;
                }
            }
@@ -121,7 +126,7 @@
            ViewData["jy"] = _liaotianService.GetSYScode("CooperVisit", "jy");
            ViewBag.IsYwjl = IsYwjl;
            ViewData.Model = dto;
            return View();
@@ -147,8 +152,37 @@
            }
            data.Modifier = curentuser.Id;
            data.Modifytime = DateTime.Now;
            ResultEntity resultEntity = new ResultEntity();
            using (TransactionScope scope = new TransactionScope())
            {
                resultEntity = _intentionVisitService.save(data);
            ResultEntity resultEntity = _intentionVisitService.save(data);
                if (!string.IsNullOrEmpty(data.IsYwjl))
                {
                    IntentionCustomerDTO intentionCustomerDTO = _intentionCustomerService.Get(data.Viscustomer);
                    intentionCustomerDTO.Zuijinzhuizongtime = data.Vistime;
                    if (string.IsNullOrEmpty(intentionCustomerDTO.Ywjl))
                    {
                        intentionCustomerDTO.Ywjl = curentuser.Id;
                    }
                    resultEntity = _intentionCustomerService.save(intentionCustomerDTO);
                }
                else if (data.Jy == "05")
                {
                    IntentionCustomerDTO intentionCustomerDTO = _intentionCustomerService.Get(data.Viscustomer);
                    intentionCustomerDTO.Yixiang = data.Jy;
                    intentionCustomerDTO.Yixiangtime = data.Vistime;
                    intentionCustomerDTO.Dianxiaozhuanyuan = curentuser.Id;
                    resultEntity = _intentionCustomerService.save(intentionCustomerDTO);
                }
                scope.Complete();
            }
            return new JsonResult(resultEntity);
        }
zhengcaioa/zhengcaioa/Controllers/WorkFlow/WorkFlowTaskController.cs
New file
@@ -0,0 +1,163 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoMapper;
using AngleSharp.Html.Parser;
using DTO;
using IServices;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using zhengcaioa.Models;
using zhengcaioa.IService;
using System.Net.Mail;
using static CommonToolsCore.SendMailHelper;
using CommonToolsCore;
namespace zhengcaioa.Controllers.WorkFlow
{
    [CheckLogin]
    public class WorkFlowTaskController : Controller
    {
        private readonly ILogger<WorkFlowTaskController> _logger;
        private readonly IWfRunProcessService _wfRunProcessService;
        private readonly IWfHistoryService _wfHistoryService;
        private readonly IWfNeeddeelService _wfNeeddeelService;
        private readonly IWfApplytypeService _wfApplytypeService;
        private readonly ILiaotianService _liaotianService;
        [CheckLogin]
        public WorkFlowTaskController(ILogger<WorkFlowTaskController> logger, IWfRunProcessService wfRunProcessService
            , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService, IWfApplytypeService wfApplytypeService
            , ILiaotianService liaotianService)
        {
            _logger = logger;
            _wfRunProcessService = wfRunProcessService;
            _wfHistoryService = wfHistoryService;
            _wfNeeddeelService = wfNeeddeelService;
            _wfApplytypeService = wfApplytypeService;
            _liaotianService = liaotianService;
        }
        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;
            actionEntity.ActionUrl = "";
            actionEntity.ActionFun = "Search";
            actionEntity.PageIco = "fa fa-search";
            actionEntity.ActionName = "查询";
            actionlist.Add(actionEntity);
            ViewData["ActionInfo"] = actionlist;
            ViewBag.Applytiye = _wfApplytypeService.GetList().Select(x => new { code = x.Applyno, label = x.Applytiye }).ToList();
            return View();
        }
        public IActionResult GetList(WfNeeddeelDTOSearch search)
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            search.Creater = curentuser.Id;
            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
            return new JsonResult(_wfNeeddeelService.SearchByPaging(search));
        }
        public int CountRemindRecord()
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            WfNeeddeelDTOSearch search = new WfNeeddeelDTOSearch();
            search.page = 1;
            search.rows = 10;
            search.Creater = curentuser.Id;
            ResultDataEntity<WfNeeddeelDTO> resultDataEntity =  _wfNeeddeelService.SearchByPaging(search);
            return search.totalrows;
        }
        public IActionResult IndexYiBan()
        {
            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;
            actionEntity.ActionUrl = "";
            actionEntity.ActionFun = "Search";
            actionEntity.PageIco = "fa fa-search";
            actionEntity.ActionName = "查询";
            actionlist.Add(actionEntity);
            ViewData["ActionInfo"] = actionlist;
            ViewBag.Applytiye = _wfApplytypeService.GetList().Select(x => new { code = x.Applyno, label = x.Applytiye }).ToList();
            return View();
        }
        public IActionResult GetListYiBan(WfHistoryDTOSearch search)
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            search.Creater = curentuser.Id;
            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
            return new JsonResult(_wfHistoryService.SearchByPaging(search));
        }
        public IActionResult IndexMyApply()
        {
            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;
            actionEntity.ActionUrl = "";
            actionEntity.ActionFun = "Search";
            actionEntity.PageIco = "fa fa-search";
            actionEntity.ActionName = "查询";
            actionlist.Add(actionEntity);
            ViewData["ActionInfo"] = actionlist;
            ViewBag.Applytiye = _wfApplytypeService.GetList().Select(x => new { code = x.Applyno, label = x.Applytiye }).ToList();
            ViewBag.ShenpiStatus = _liaotianService.GetSYScode("wf_run_process", "shenpi_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            return View();
        }
        public IActionResult GetListMyApply(WfRunProcessDTOSearch search)
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            search.Creater = curentuser.Id;
            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
            return new JsonResult(_wfRunProcessService.SearchByPaging(search));
        }
    }
}
zhengcaioa/zhengcaioa/Startup.cs
@@ -132,7 +132,10 @@
            services.AddScoped(typeof(ILZhuanjiahuidumService), typeof(LZhuanjiahuidumService));
            services.AddScoped(typeof(IWfApplytypeService), typeof(WfApplytypeService));
            services.AddScoped(typeof(IWfApplytypeService), typeof(WfApplytypeService));
            services.AddScoped(typeof(IWfRunProcessService), typeof(WfRunProcessService));
            services.AddScoped(typeof(IWfNeeddeelService), typeof(WfNeeddeelService));
            services.AddScoped(typeof(IWfHistoryService), typeof(WfHistorieservice));
            //定时执行
            services.AddHostedService<TimedBackgroundService>();
zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml
@@ -21,12 +21,19 @@
                    return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/IntentionCustomer/Edit?id=" + rowObject.Id + "')\"  >" + cellvalue + "</a>";
                }
            },
            { label: '联系电话', name: 'Tel', labtype: 'txt', hidden: false, width: 100 },
            { label: '所属区域', name: 'ShengName', labtype: 'txt', hidden: false, width: 100  },
            { label: '客户来源', name: 'KhlyName', labtype: 'txt', hidden: false, width: 100  },
            { label: '行业分类', name: 'HyflName', labtype: 'txt', hidden: false, width: 100 },
            { label: '客户类型', name: 'KhlxName', labtype: 'txt', hidden: false, width: 100},
            { label: '业务经理', name: 'YwjlName', labtype: 'txt', hidden: false, width: 100},
            { label: '业务经理', name: 'YwjlName', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '客户访问', name: 'Name111', labtype: 'txt', hidden: false, width: 100,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('新增意向客户拜访','98%','100%', '/IntentionVisit/Edit?id=&Viscustomer=" + rowObject.Id + "')\"  >客户访问</a>";
                }
            },
        ];
        dataUrl = "/IntentionCustomer/GetList";
zhengcaioa/zhengcaioa/Views/IntentionCustomer/IndexYiXiang.cshtml
New file
@@ -0,0 +1,93 @@
@{
    ViewBag.Title = "IntentionCustomer";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
    string ywjlId = ViewBag.ywjlId as string;
}
@section headerStyle{
    <script type="text/javascript">
        var ywjls = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ywjl))';
         var khlys = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.khly))';
         var Dianxiaozhuanyuans = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Dianxiaozhuanyuan))';
        loseherght = 60;
        //gridConfig = { multiselect: true, selectcol: "Id" };
        dataCol = [
            { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
            { label: '意向时间', name: 'YixiangtimeName', labtype: 'txt', hidden: false, width: 100 },
            { label: '意向来源', name: 'KhlyName', labtype: 'txt', hidden: false, width: 100 },
            { label: '电销专员', name: 'DianxiaozhuanyuanName', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '客户单位', name: 'Name', labtype: 'txt', hidden: false, width: 400,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/IntentionCustomer/Edit?id=" + rowObject.Id + "')\"  >" + cellvalue + "</a>";
                }
            },
            { label: '承办人', name: 'YwjlName', labtype: 'txt', hidden: false, width: 100 },
            { label: '最近跟踪时间', name: 'ZuijinzhuizongtimeName', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '跟踪记录', name: 'Name111', labtype: 'txt', hidden: false, width: 100,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('跟踪记录','98%','100%', '/IntentionVisit/Index?IsYwjl=true&Viscustomer=" + rowObject.Id + "')\"  >跟踪记录</a>";
                }
            },
        ];
        dataUrl = "/IntentionCustomer/GetList?Yixiang=05&YwjlYx=@ywjlId";
        searchCol = [
            { label: '意向时间', name: 'Yixiangtime', labtype: 'datearea', hidden: false },
            { label: '意向来源', name: 'Khly', labtype: 'combox', hidden: false, data: JSON.parse(khlys)/*, cwidth: '5%', cccwidth: '8%'*/ },
            { label: '电销专员', name: 'Dianxiaozhuanyuan', labtype: 'combox', hidden: false, data: JSON.parse(Dianxiaozhuanyuans)/*, cwidth: '5%', cccwidth: '8%' */},
            { label: '客户单位', name: 'Name', labtype: 'txt', hidden: false },
            { label: '承办人', name: 'Ywjl', labtype: 'combox', hidden: false, data: JSON.parse(ywjls) },
        ];
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
        }
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除失败");
        /**/
    }
}
    </script>
}
@section footerScripts{
    <script type="text/javascript">
    </script>
}
zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml
@@ -10,6 +10,7 @@
    List<SysCodeDtl> zw = ViewData["zw"] as List<SysCodeDtl>; //职务
    List<SysCodeDtl> yx = ViewData["yx"] as List<SysCodeDtl>; //成交意向
    List<SysCodeDtl> jy = ViewData["jy"] as List<SysCodeDtl>; //跟踪建议
    string IsYwjl = ViewBag.IsYwjl as string;
}
@@ -133,6 +134,7 @@
                                        </select>
                                        <input type="hidden" id="Id" name="Id" value="@Model.Id" />
                                        <input type="hidden" id="IsYwjl" name="IsYwjl" value="@IsYwjl" />
                                    </div>
                                </div>
zhengcaioa/zhengcaioa/Views/IntentionVisit/Index.cshtml
@@ -1,6 +1,9 @@
@{
    ViewBag.Title = "IntentionVisit";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
    string Viscustomer = ViewBag.Viscustomer as string;
    string IsYwjl = ViewBag.IsYwjl as string;
}
@section headerStyle{
    <script type="text/javascript">
@@ -13,11 +16,11 @@
        gridConfig = { multiselect: true, selectcol: "Id" };
        dataCol = [
            { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
            {
                label: '拜访时间', name: 'VistimeName', labtype: 'txt', hidden: false, width: 100,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/IntentionVisit/Edit?id=" + rowObject.Id + "')\"  >" + cellvalue + "</a>";
                    return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/IntentionVisit/Edit?id=" + rowObject.Id + "&Viscustomer=@Viscustomer&IsYwjl=@IsYwjl')\"  >" + cellvalue + "</a>";
                }
            },
@@ -32,7 +35,7 @@
            { label: '跟踪建议', name: 'JyName', labtype: 'txt', hidden: false, width: 100 },
        ];
        dataUrl = "/IntentionVisit/GetList";
        dataUrl = "/IntentionVisit/GetList?Viscustomer=@Viscustomer";
        searchCol = [
            { label: '客户来源', name: 'Khly', labtype: 'combox', hidden: false, data: JSON.parse(khlys), cwidth: '5%', cccwidth: '8%' },
            { label: '行业分类', name: 'Hyfl', labtype: 'combox', hidden: false, data: JSON.parse(hyfls), cwidth: '5%', cccwidth: '15%' },
@@ -49,11 +52,11 @@
        ];
        var _pageAdd = function () {
            OpenWindow("新增意向客户拜访", "98%", "90%", "/IntentionVisit/Edit/");
            OpenWindow("新增意向客户拜访", "98%", "90%", "/IntentionVisit/Edit?Viscustomer=@Viscustomer&IsYwjl=@IsYwjl");
        }
        var _afterSave = function (result) {
            if (result) {
zhengcaioa/zhengcaioa/Views/Shared/_Layout.cshtml
@@ -161,6 +161,29 @@
                }
            });
            $.ajax({
                type: "POST",
                url: "/WorkFlowTask/CountRemindRecord",
                dataType: "json",
                global: false,
                async: false,
                //data: $('form').serializeArray(),
                success: function (data) {
                    // console.log(data);
                    $("#wfmsgcount").text(data);
                    if (parseInt(data) > 0) {
                        $("#showmsgcounts").attr("style", 'font-size:18px; color:#0d9c63;');
                    }
                    else {
                        $("#showmsgcounts").attr("style", 'font-size: larger;');
                    }
                },
                error: function () {
                    parent.layer.msg('失败', { icon: 5 });
                }
            });
        };
        timerId();
zhengcaioa/zhengcaioa/Views/Signin/AskLeave.cshtml
@@ -3,6 +3,7 @@
@using zhengcaioa.Models;
@{
    Layout = null;
    ResultDataEntity<SysAttachmentDTO> attachment = ViewBag.attachment as ResultDataEntity<SysAttachmentDTO>; //问题类型
    List<SysAttachmentDTO> attachmentsssss = attachment.DataList;
@@ -10,8 +11,14 @@
    {
        attachmentsssss = new List<SysAttachmentDTO>();
    }
    List<SysCodeDtl> Lavetype = ViewData["Lavetype"] as List<SysCodeDtl>; //拜访方式
    //流程相关
    string shifoubiaoji = ViewBag.shifoubiaoji as string;
    string sifoudangqian = ViewBag.sifoudangqian as string;
    string dangqianbuzhou = ViewBag.dangqianbuzhou as string;
    List<WfHistoryDTO> lishiyijian = ViewData["lishiyijian"] as List<WfHistoryDTO>; //历史意见
}
<!DOCTYPE html>
<html>
@@ -78,21 +85,21 @@
            <tbody>
                <tr>
                    <td class="title">单据名称</td>
                    <td>
                        <input type="text" class="form-control" value="@Model.Tittle" name="Tittle" id="Tittle" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    <td colspan="4">
                        <input type="text" class="form-control" value="@Model.Tittle" name="Tittle" id="Tittle" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">申请人</td>
                    <td>
                    <td colspan="4">
                        <input type="text" class="form-control" value="@Model.CreaterName" name="CreaterName" id="CreaterName" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">请假时间</td>
                    <td>
                    <td colspan="4">
                        <input type="text" class="layui-input  layer-date  ldate form-control" value="@Model.StratTimeName" name="StratTime" id="StratTime" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">-  <input type="text" class="layui-input  layer-date ldate form-control" value="@Model.EndTimeName" name="EndTime" id="EndTime" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
@@ -100,7 +107,7 @@
                <tr>
                    <td class="title">请假类型</td>
                    <td>
                    <td colspan="4">
                        <select class="leaveType form-control data" name="Lavetype" id="Lavetype" style="margin-right: 4px;">
                            <option value="" hassubinfo="true">请选择</option>
                            @foreach (var item in Lavetype)
@@ -136,38 +143,78 @@
                </tr>
                <tr>
                    <td class="title">请假时长</td>
                    <td>
                    <td colspan="4">
                        <input class="layui-input data" style="width:100px !important;float: left;" type="number" value="@Model.LaveDay" name="LaveDay" id="LaveDay" min="0" step="1" readonly="readonly">天
                        <input class="layui-input data" style="width:100px !important;" type="number" value="@Model.LavehHour" name="LavehHour" id="LavehHour" min="0" step="1" readonly="readonly">小时
                    </td>
                </tr>
                <tr>
                    <td class="title">备&nbsp;&nbsp;注</td>
                    <td>
                    <td colspan="4">
                        <textarea class="form-control data" name="Remark" style="width:374px; vertical-align: top;height:100px" maxlength="500">@Model.Remark</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="title">上传附件</td>
                    <td>
                    <td colspan="4">
                        <input type="file" name="file" id="fileUp" multiple>
                    </td>
                </tr>
                <tr>
                    <td colspan="10" style="text-align: center">
                        <a class="btn btn-success" href="javascript:void(0)" onclick="Save();" style="margin-left:4px; border-radius:4px;">
                            <span class="bold">提交</span>
                        </a>
                <tr id="shenpiyijian">
                    <td class="title">审批意见</td>
                    <td colspan="4">
                        <textarea class="form-control data" id="Content" name="Content" style="width:374px; vertical-align: top;height:100px" maxlength="500"></textarea>
                    </td>
                </tr>
                <tr>
                    <td class="title">历史意见</td>
                    <td colspan="4">
                    </td>
                </tr>
                <tr>
                    <td colspan="10">  <table>
    @foreach (var wfHistory in lishiyijian)
    {
                                           <tr>
                                               <td style="border:1px solid #ccc;width:150px;">@wfHistory.Step</td>
                                               <td style="border:1px solid #ccc;width:50px;">@wfHistory.ChuliStatusName</td>
                                               <td style="border:1px solid #ccc;width:150px;">@wfHistory.ModifytimeName</td>
                                               <td style="border:1px solid #ccc;width:300px;">@wfHistory.Content</td>
                                               <td style="border:1px solid #ccc;width:100px;">@wfHistory.DeelUserIdName</td>
                                           </tr>
    }
</table></td>
                    </tr>
            </tbody>
                    <tr>
                        <td colspan="10" style="text-align: center">
                            <a class="btn btn-success" id="tijiao" href="javascript:void(0)" onclick="Save('');" style="margin-left:4px; border-radius:4px;">
                                <span class="bold">提交</span>
                            </a>
                            <a class="btn btn-success" id="tongyi" href="javascript:void(0)" onclick="Save('A');" style="margin-left:4px; border-radius:4px;">
                                <span class="bold">同意</span>
                            </a>
                            <a class="btn btn-success" id="jujue" href="javascript:void(0)" onclick="Save('D');" style="margin-left:4px; border-radius:4px;">
                                <span class="bold">拒绝</span>
                            </a>
                            <input type="hidden" id="Id" name="Id" value="@Model.Id" />
                            <input type="hidden" id="Tongguojujue" name="Tongguojujue" value="" />
                            <input type="hidden" id="Step" name="Step" value="@dangqianbuzhou" />
                        </td>
                    </tr>
                </tbody>
        </table>
        <div id='file-list-display' style="width: 100%;text-align: left; background-color:white">
            @{ for (int i = 0; i < attachmentsssss.Count; i++)
                {
                    <div>
                        <a download href='@attachmentsssss[i].Filepath'>@attachmentsssss[i].Filefullname  </a> &nbsp;  <a href='javascript: void (0);' onclick='js_method(this,"@attachmentsssss[i].Id")'><i class='glyphicon glyphicon-remove'></i> </a>
                        <a download href='@attachmentsssss[i].Filepath'>@attachmentsssss[i].Filefullname  </a> &nbsp;  <a href='javascript: void (0);' class = 'fujianshanchu'  onclick='js_method(this,"@attachmentsssss[i].Id")'><i class='glyphicon glyphicon-remove'></i> </a>
                        <input type="hidden" name="attachmentid" value="@attachmentsssss[i].Id" />
                        <input type="hidden" name="Filepath" value="@attachmentsssss[i].Filepath" />
                        <input type="hidden" name="Filefullname" value="@attachmentsssss[i].Filefullname" />
@@ -184,7 +231,7 @@
    </form>
    <script type="text/javascript">
        var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2 - 95;
        $("#div_content").height(hh);
@@ -209,33 +256,74 @@
        $(function () {
            $(".ldate").each(function (el) {
                laydate({
                    elem: "#" + $(this).attr('id'), //对应id
                    format: 'YYYY-MM-DD hh:mm', //日期格式 // åˆ†éš”符可以任意定义,该例子表示只显示年月
                    min: '2021-01-01', //设定最小日期为当前日期
                    max: '2099-06-16', //最大日期
                    type: 'datetime',
                    festival: false, //显示节日
                    istime: true, Â  //是否显示时分秒
                    istoday: true, //是否是今天
                    choose: function (datas) { //选择日期完毕的回调
                         // console.log("234234234234324");
                        // end.min = datas; //开始日选好后,重置结束日的最小日期
                        // end.start = datas //将结束日的初始值设定为开始日
                        checktime();
                    }
                });
            });
            $("#Lavetype").val("@Model.Lavetype");
             if ("@shifoubiaoji" != "A") {
                $("input").attr('readonly', true);
                $("textarea").attr('readonly', true);
                $(':radio').attr('disabled', true);
                $(':checkbox').attr('disabled', true);
                $(':button').attr('disabled', true);
                //$('a').removeAttr('onclick');
                 $('select').attr('disabled', true);
                 $("#fileUp").attr('disabled', true);
                 $('.fujianshanchu').removeAttr('onclick');
                 if ("@sifoudangqian" == "A") {
                     $("#Content").attr('readonly', false);
                      $('#tijiao').hide();
                 } else {
                     $('#tongyi').hide();
                      $('#jujue').hide();
                     $('#tijiao').hide();
                     $('#shenpiyijian').hide();
                 }
            } else {
                  //审批相关
                 $('#shenpiyijian').hide();
                 if ("@sifoudangqian" == "A") {
                     $('#tongyi').hide();
                     $('#jujue').hide();
                 } else {
                     $('#tongyi').hide();
                      $('#jujue').hide();
                      $('#tijiao').hide();
                 }
                 $(".ldate").each(function (el) {
                     laydate({
                         elem: "#" + $(this).attr('id'), //对应id
                         format: 'YYYY-MM-DD hh:mm', //日期格式 // åˆ†éš”符可以任意定义,该例子表示只显示年月
                         min: '2021-01-01', //设定最小日期为当前日期
                         max: '2099-06-16', //最大日期
                         type: 'datetime',
                         festival: false, //显示节日
                         istime: true, Â  //是否显示时分秒
                         istoday: true, //是否是今天
                         choose: function (datas) { //选择日期完毕的回调
                             // console.log("234234234234324");
                             // end.min = datas; //开始日选好后,重置结束日的最小日期
                             // end.start = datas //将结束日的初始值设定为开始日
                             checktime();
                         }
                     });
                 });
            }
        })
        function Save() {
        function Save(tongyi) {
            if ($("#StratTime").val() == '') {
                toastr.warning("开始日期不能为空");
                return;
@@ -264,9 +352,9 @@
                return;
            }
            
            $("#Tongguojujue").val(tongyi);
            //var data = { id: $("#Id").val(), StartTime:$("#StartTime").val(), Sheng: $("#Sheng").val(), job_level: $("#Job_level").val().toString(), ExistsAttachment: fileId != "" }
            $.ajax({
                type: "POST",
@@ -355,7 +443,7 @@
                        var fileListDisplay = $("#file-list-display");
                        if (data.DataList && data.DataList.length > 0) {
                            for (var i = 0; i < data.DataList.length; i++) {
                                var aaa = "<div><a download href ='" + data.DataList[i].Filepath + "'>" + data.DataList[i].Filefullname + " </a> &nbsp;  <a   href='javascript: void (0);' onclick='js_method(this,\"\")' ><i class='glyphicon glyphicon-remove'></i> </a> "
                                var aaa = "<div><a download href ='" + data.DataList[i].Filepath + "'>" + data.DataList[i].Filefullname + " </a> &nbsp;  <a   href='javascript: void (0);' class = 'fujianshanchu' onclick='js_method(this,\"\")' ><i class='glyphicon glyphicon-remove'></i> </a> "
                                aaa += ' <input type="hidden"  name="attachmentid" value="" />   ';
                                aaa += ' <input type="hidden"  name="Filepath" value="' + data.DataList[i].Filepath + '" />  ';
                                aaa += '  <input type="hidden"  name="Filefullname" value="' + data.DataList[i].Filefullname + '" />  ';
@@ -411,7 +499,7 @@
        }
        function checktime() {
            if ($("#StratTime").val() == '') {
@@ -426,8 +514,8 @@
                return;
            }
@@ -442,14 +530,14 @@
                success: function (data) {
                    if (data.Result) {
                        $("#LaveDay").val(data.DataInfo.LaveDay);
                        $("#LavehHour").val(data.DataInfo.LavehHour);
                        $("#LavehHour").val(data.DataInfo.LavehHour);
                    }
                    else {
                        toastr.error(data.Message);
                    }
                },
                error: function () {
zhengcaioa/zhengcaioa/Views/Signin/AskLeaveOff.cshtml
@@ -14,6 +14,13 @@
    }
    List<SysCodeDtl> Lavetype = ViewData["Lavetype"] as List<SysCodeDtl>; //拜访方式
    //流程相关
    string shifoubiaoji = ViewBag.shifoubiaoji as string;
    string sifoudangqian = ViewBag.sifoudangqian as string;
    string dangqianbuzhou = ViewBag.dangqianbuzhou as string;
    List<WfHistoryDTO> lishiyijian = ViewData["lishiyijian"] as List<WfHistoryDTO>; //历史意见
}
<!DOCTYPE html>
@@ -107,28 +114,28 @@
            <tbody>
                <tr>
                    <td class="title">单据名称</td>
                    <td>
                    <td  colspan="4">
                        <input type="text" class="form-control" value="@Model.Tittle" name="Tittle" id="Tittle" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">申请人</td>
                    <td>
                    <td  colspan="4">
                        <input type="text" class="form-control" value="@Model.CreaterName" name="CreaterName" id="CreaterName" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">销假时间</td>
                    <td>
                    <td  colspan="4">
                        <input type="text" class="layui-input  layer-date  ldate form-control" value="@Model.StratTimeName" name="StratTime" id="StratTime" style="width:150px;margin-right: 4px;" autocomplete="off" readonly="readonly">-
                        <input type="text" class="layui-input  layer-date ldate form-control" value="@Model.EndTimeName" name="EndTime" id="EndTime" style="width:150px;margin-right: 4px;" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">销假类型</td>
                    <td>
                    <td  colspan="4">
                        <select class="leaveType form-control" name="Lavetype" id="Lavetype" style="width:150px;margin-right: 4px;">
                            <option value="" hassubinfo="true">请选择</option>
                            @foreach (var item in Lavetype)
@@ -156,7 +163,7 @@
                </tr>
                <tr>
                    <td class="title">申请理由</td>
                    <td>
                    <td  colspan="4">
                        <textarea name="Remark" style="width:374px; vertical-align: top;height:100px" maxlength="500">@Model.Remark</textarea>
                    </td>
                </tr>
@@ -164,7 +171,7 @@
                <tr style="height:120px;">
                    <td class="title">上传病历</td>
                    <td>
                    <td  colspan="4">
                        <div class="img-box">
                            <div id="ImgMedicalRecord" class="ImgMedicalRecord"></div>
                            <input type="hidden" id="MedicalRecord" name="MedicalRecord" value="@Model.MedicalRecord" />
@@ -178,17 +185,57 @@
                    </td>
                </tr>
                <tr>
                    <td class="title">上传附件</td>
                    <td>
                    <td class="title" >上传附件</td>
                    <td  colspan="4" >
                        <input type="file" name="file" id="fileUp" multiple>
                    </td>
                </tr>
                <tr id="shenpiyijian">
                    <td class="title">审批意见</td>
                    <td colspan="4">
                        <textarea class="form-control data" id="Content" name="Content" style="width:374px; vertical-align: top;height:100px" maxlength="500"></textarea>
                    </td>
                </tr>
                <tr>
                    <td class="title">历史意见</td>
                    <td colspan="4">
                    </td>
                </tr>
                <tr>
                    <td colspan="10">
                        <table>
                            @foreach (var wfHistory in lishiyijian)
                            {
                                <tr>
                                    <td style="border:1px solid #ccc;width:150px;">@wfHistory.Step</td>
                                    <td style="border:1px solid #ccc;width:50px;">@wfHistory.ChuliStatusName</td>
                                    <td style="border:1px solid #ccc;width:150px;">@wfHistory.ModifytimeName</td>
                                    <td style="border:1px solid #ccc;width:300px;">@wfHistory.Content</td>
                                    <td style="border:1px solid #ccc;width:100px;">@wfHistory.DeelUserIdName</td>
                                </tr>
                            }
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="10" style="text-align: center">
                        <a class="btn btn-success" href="javascript:void(0)" onclick="Save();" style="margin-left:4px; border-radius:4px;">
                        <a class="btn btn-success" id="tijiao" href="javascript:void(0)" onclick="Save();" style="margin-left:4px; border-radius:4px;">
                            <span class="bold">提交</span>
                        </a>
                        <a class="btn btn-success" id="tongyi" href="javascript:void(0)" onclick="Save('A');" style="margin-left:4px; border-radius:4px;">
                            <span class="bold">同意</span>
                        </a>
                        <a class="btn btn-success" id="jujue" href="javascript:void(0)" onclick="Save('D');" style="margin-left:4px; border-radius:4px;">
                            <span class="bold">拒绝</span>
                        </a>
                        <input type="hidden" id="Tongguojujue" name="Tongguojujue" value="" />
                        <input type="hidden" id="Step" name="Step" value="@dangqianbuzhou" />
                    </td>
                </tr>
            </tbody>
@@ -233,27 +280,7 @@
        };
        var imgPath = "@Url.Content("~/UploadFile/")";
        $(function () {
            $(".ldate").each(function (el) {
                laydate({
                    elem: "#" + $(this).attr('id'), //对应id
                    format: 'YYYY-MM-DD hh:mm', //日期格式 // åˆ†éš”符可以任意定义,该例子表示只显示年月
                    min: '2021-01-01', //设定最小日期为当前日期
                    max: '2099-06-16', //最大日期
                    type: 'datetime',
                    festival: false, //显示节日
                    istime: true, Â  //是否显示时分秒
                    istoday: true, //是否是今天
                    choose: function (datas) { //选择日期完毕的回调
                        // end.min = datas; //开始日选好后,重置结束日的最小日期
                        // end.start = datas //将结束日的初始值设定为开始日
                    }
                });
            });
          var imgPath = "@Url.Content("~/UploadFile/")";
            new DragImgUpload("#ImgMedicalRecord", {
                callback: function (files) {
                    let img = imgUploadCallback(files);
@@ -265,7 +292,71 @@
            });
            let img = "@Model.MedicalRecord";
            if ($.trim(img) !== "")
        $(function () {
             if ("@shifoubiaoji" != "A") {
                $("input").attr('readonly', true);
                $("textarea").attr('readonly', true);
                $(':radio').attr('disabled', true);
                $(':checkbox').attr('disabled', true);
                $(':button').attr('disabled', true);
                //$('a').removeAttr('onclick');
                 $('select').attr('disabled', true);
                 $("#fileUp").attr('disabled', true);
                 $("#ImgMedicalRecord").unbind("click");
                 $('.fujianshanchu').removeAttr('onclick');
                 if ("@sifoudangqian" == "A") {
                     $("#Content").attr('readonly', false);
                      $('#tijiao').hide();
                 } else {
                     $('#tongyi').hide();
                      $('#jujue').hide();
                     $('#tijiao').hide();
                     $('#shenpiyijian').hide();
                 }
            } else {
                  //审批相关
                 $('#shenpiyijian').hide();
                 if ("@sifoudangqian" == "A") {
                     $('#tongyi').hide();
                     $('#jujue').hide();
                 } else {
                     $('#tongyi').hide();
                      $('#jujue').hide();
                      $('#tijiao').hide();
                 }
                 $(".ldate").each(function (el) {
                     laydate({
                         elem: "#" + $(this).attr('id'), //对应id
                         format: 'YYYY-MM-DD hh:mm', //日期格式 // åˆ†éš”符可以任意定义,该例子表示只显示年月
                         min: '2021-01-01', //设定最小日期为当前日期
                         max: '2099-06-16', //最大日期
                         type: 'datetime',
                         festival: false, //显示节日
                         istime: true, Â  //是否显示时分秒
                         istoday: true, //是否是今天
                         choose: function (datas) { //选择日期完毕的回调
                             // console.log("234234234234324");
                             // end.min = datas; //开始日选好后,重置结束日的最小日期
                             // end.start = datas //将结束日的初始值设定为开始日
                             checktime();
                         }
                     });
                 });
            }
       if ($.trim(img) !== "")
            {
                $("#ImgMedicalRecord img").each(function (i) {
                    $(this).attr("src", img);
@@ -274,7 +365,13 @@
           $("#Lavetype").val("@Model.Lavetype");
           $("#SigninId").val("@ViewBag.SigninId");
        })
         function imgUploadCallback(files) {
                var fileName = "";
@@ -300,7 +397,7 @@
            return fileName;
        };
        function Save() {
        function Save(tongyi) {
            if ($("#StratTime").val() == '') {
                toastr.warning("开始日期不能为空");
                return;
@@ -316,17 +413,17 @@
                return;
            }
            if ($("#Lavetype").val() == '') {
                toastr.warning("销假类型不能为空");
                return;
            }
            $("#Tongguojujue").val(tongyi);
            //var data = { id: $("#Id").val(), StartTime:$("#StartTime").val(), Sheng: $("#Sheng").val(), job_level: $("#Job_level").val().toString(), ExistsAttachment: fileId != "" }
            $.ajax({
                type: "POST",
@@ -336,7 +433,7 @@
                async: false,
                data: $('form').serializeArray(),
                success: function (data) {
                    if (data.Result) {
                        //  parent._afterSave(true);
@@ -418,7 +515,7 @@
                                aaa += ' <input type="hidden"  name="attachmentid" value="" />   ';
                                aaa += ' <input type="hidden"  name="Filepath" value="' + data.DataList[i].Filepath + '" />  ';
                                aaa += '  <input type="hidden"  name="Filefullname" value="' + data.DataList[i].Filefullname + '" />  ';
                                aaa += "</div>";
                                fileListDisplay.append(aaa);
                            }
zhengcaioa/zhengcaioa/Views/WfApplytype/Index.cshtml
@@ -84,7 +84,7 @@
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>                            <i class="fa fa-list"></i>&nbsp; å‘起流程</h5>@*<div class="ibox-tools">
                            <h5>                            <i class="fa fa-list"></i>&nbsp; å‘起申请</h5>@*<div class="ibox-tools">
                                                                                            <a class="collapse-link" onclick="collapseBox(this);"><i class="fa fa-chevron-up" title="折叠/展开明细"></i></a>&nbsp;&nbsp;
                                </div>*@
                        </div>
zhengcaioa/zhengcaioa/Views/WorkFlowTask/Index.cshtml
New file
@@ -0,0 +1,80 @@
@{
    ViewBag.Title = "WorkFlowTask";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
}
@section headerStyle{
    <script type="text/javascript">
        var Applytiye = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Applytiye))';
        loseherght = 60;
        dataCol = [
            { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
            { label: '申请时间', name: 'ApplytimeName', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '申请单号', name: 'Applyno', labtype: 'txt', hidden: false, width: 100
            },
            { label: '部门', name: 'DeptName', labtype: 'txt', hidden: false, width: 100 },
            { label: '申请人', name: 'CreaterName', labtype: 'txt', hidden: false, width: 100 },
            { label: '请示名称', name: 'Content', labtype: 'txt', hidden: false, width: 100 },
            { label: '步骤', name: 'Step', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '审批', name: 'Remark', labtype: 'txt', hidden: false, width: 100,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('审批','100%','100%', '" + rowObject.Deelurl + "')\"  >审批</a> ";
                }
            },
        ];
        dataUrl = "/WorkFlowTask/GetList";
        searchCol = [
            { label: '申请时间', name: 'Applytime', labtype: 'datearea', hidden: false },
            { label: '申请单号', name: 'Applyno', labtype: 'txt', hidden: false },
            { label: '申请人', name: 'ApplyUserName', labtype: 'txt', hidden: false },
            { label: '申请流程', name: 'Applytiye', labtype: 'combox', hidden: false, data: JSON.parse(Applytiye)/*, cwidth: '5%', cccwidth: '8%' */},
        ];
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
        }
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除成功");
        /**/
    }
}
    </script>
}
@section footerScripts{
    <script type="text/javascript">
    </script>
}
zhengcaioa/zhengcaioa/Views/WorkFlowTask/IndexMyApply.cshtml
New file
@@ -0,0 +1,81 @@
@{
    ViewBag.Title = "WorkFlowTask";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
}
@section headerStyle{
    <script type="text/javascript">
        var Applytiye = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Applytiye))';
        var ShenpiStatus = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ShenpiStatus))';
        loseherght = 60;
        dataCol = [
            { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
            { label: '申请时间', name: 'ApplytimeName', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '申请单号', name: 'Applyno', labtype: 'txt', hidden: false, width: 100
            },
            //{ label: '部门', name: 'DeptName', labtype: 'txt', hidden: false, width: 100 },
            //{ label: '申请人', name: 'CreaterName', labtype: 'txt', hidden: false, width: 100 },
            { label: '请示名称', name: 'Content', labtype: 'txt', hidden: false, width: 100 },
            { label: '步骤', name: 'Step', labtype: 'txt', hidden: false, width: 100 },
            { label: '批复状态', name: 'ShenpiStatusName', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '查看', name: 'Remark', labtype: 'txt', hidden: false, width: 100,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('查看','100%','100%', '" + rowObject.Deelurl + "')\"  >查看</a> ";
                }
            },
        ];
        dataUrl = "/WorkFlowTask/GetListMyApply";
        searchCol = [
            { label: '申请时间', name: 'Applytime', labtype: 'datearea', hidden: false },
            { label: '申请单号', name: 'Applyno', labtype: 'txt', hidden: false },
            { label: '申请流程', name: 'Applytiye', labtype: 'combox', hidden: false, data: JSON.parse(Applytiye)/*, cwidth: '5%', cccwidth: '8%' */ },
            { label: '批复状态', name: 'ShenpiStatus', labtype: 'combox', hidden: false, data: JSON.parse(ShenpiStatus)/*, cwidth: '5%', cccwidth: '8%' */ },
        ];
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
        }
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除成功");
        /**/
    }
}
    </script>
}
@section footerScripts{
    <script type="text/javascript">
    </script>
}
zhengcaioa/zhengcaioa/Views/WorkFlowTask/IndexYiBan.cshtml
New file
@@ -0,0 +1,79 @@
@{
    ViewBag.Title = "WorkFlowTask";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
}
@section headerStyle{
    <script type="text/javascript">
        var Applytiye = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Applytiye))';
        loseherght = 60;
        dataCol = [
            { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
            { label: '申请时间', name: 'ApplytimeName', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '申请单号', name: 'Applyno', labtype: 'txt', hidden: false, width: 100
            },
            { label: '部门', name: 'DeptName', labtype: 'txt', hidden: false, width: 100 },
            { label: '申请人', name: 'CreaterName', labtype: 'txt', hidden: false, width: 100 },
            { label: '请示名称', name: 'Content', labtype: 'txt', hidden: false, width: 100 },
            { label: '步骤', name: 'Step', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '查看', name: 'Remark', labtype: 'txt', hidden: false, width: 100,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('查看','100%','100%', '" + rowObject.Deelurl + "')\"  >查看</a> ";
                }
            },
        ];
        dataUrl = "/WorkFlowTask/GetListYiBan";
        searchCol = [
            { label: '申请时间', name: 'Applytime', labtype: 'datearea', hidden: false },
            { label: '申请单号', name: 'Applyno', labtype: 'txt', hidden: false },
            { label: '申请人', name: 'ApplyUserName', labtype: 'txt', hidden: false },
            { label: '申请流程', name: 'Applytiye', labtype: 'combox', hidden: false, data: JSON.parse(Applytiye)/*, cwidth: '5%', cccwidth: '8%' */},
        ];
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
        }
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除成功");
        /**/
    }
}
    </script>
}
@section footerScripts{
    <script type="text/javascript">
    </script>
}
±íÐÞ¸Ä.sql
@@ -1,3 +1,42 @@
USE [zhengcaioa]
GO
ALTER TABLE [dbo].[wf_run_process] ADD  [deelurl] [nvarchar](500) NULL;
GO
ALTER TABLE [dbo].[IntentionCustomer] ADD  [Yixiangtime] [datetime]   NULL;
GO
ALTER TABLE [dbo].[IntentionCustomer] ADD  [Yixiang]  [nvarchar](50)   NULL;
GO
ALTER TABLE [dbo].[IntentionCustomer] ADD  [dianxiaozhuanyuan] [nvarchar](50)   NULL;
GO
ALTER TABLE [dbo].[IntentionCustomer] ADD  [zuijinzhuizongtime] [datetime]   NULL;
GO
USE [zhengcaioa]
GO