username@email.com
2021-07-01 57556b16aafbafebc7f9fc86745ac2ea83e7616d
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,8 +335,9 @@
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            admAsk.RecStatus = "A";
            //未挂审批流,提交直接通过
            admAsk.ShenpiStatus = "A";
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
            if (String.IsNullOrEmpty(admAsk.Id))
            {
                admAsk.Creater = curentuser.Id;
@@ -295,9 +348,11 @@
                admAsk.Modifier = curentuser.Id;
                admAsk.Modifytime = DateTime.Now;
            }
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
            using (TransactionScope scope = new TransactionScope())
            {
                if (admAsk.Step == "提交")
            {
                resultEntity = _signinService.SaveAskLeave(admAsk);
                if (resultEntity.Result == false)
@@ -335,7 +390,15 @@
                }
                }
                //发起流程相关
                resultEntity = _wfRunProcessService.WfAskLeave(admAsk.Id, admAsk.Step, admAsk.Tongguojujue, curentuser.Id, admAsk.Content, admAsk.Tittle, "v1");
                scope.Complete();
            }
               
@@ -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();
        }
@@ -805,6 +915,8 @@
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
            using (TransactionScope scope = new TransactionScope())
            {
                if (leaveOff.Step == "提交")
            {
                resultEntity = _signinService.SaveAskLeaveOff(leaveOff);
                if(resultEntity.Result == false)
@@ -841,6 +953,8 @@
                }
                }
                resultEntity = _wfRunProcessService.WfAskLeaveOff(leaveOff.Id, leaveOff.Step, leaveOff.Tongguojujue, curentuser.Id, leaveOff.Content, leaveOff.Tittle, "v1");
                scope.Complete();
            }