| | |
| | | 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 考勤签到打卡 |
| | |
| | | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | 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); |
| | | |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | 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(); |
| | | } |