| | |
| | | else |
| | | { |
| | | dangqianbuzhou = wfRunProcessDTO.Step; |
| | | //查询历史意见 |
| | | lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id); |
| | | //查询审批进度 |
| | | lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id); |
| | | if(wfRunProcessDTO.Step != "提交") |
| | | { |
| | | shifoubiaoji = "D"; |
| | |
| | | admAsk.RecStatus = "A"; |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | |
| | | if (String.IsNullOrEmpty(admAsk.Id)) |
| | | |
| | | if(admAsk.Step == "提交") |
| | | { |
| | | //请假时间不能重叠 |
| | | var qingjia = _signinService.GetAskLeaveChongdie(curentuser.Id, admAsk.StratTime.Value, admAsk.EndTime.Value); |
| | | if (qingjia.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该时间段已经有请假!"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | |
| | | //请假超过三天,必须提前三天以上请假! |
| | | if (admAsk.LaveDay.Value >= 3 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(3)) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "请假超过三天,必须提前三天以上请假!"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | |
| | | //请假超过七天,必须提前七天以上请假! |
| | | if (admAsk.LaveDay.Value >= 7 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(7)) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "请假超过七天,必须提前七天以上请假!"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (String.IsNullOrEmpty(admAsk.Id)) |
| | | { |
| | | admAsk.Creater = curentuser.Id; |
| | | admAsk.Createtime = DateTime.Now; |
| | |
| | | var jiejiari = admAttendanceRulesDtlDTOs.Where(x=>x.Name== "jiejiari").ToList(); |
| | | |
| | | var tiaoxiuri = admAttendanceRulesDtlDTOs.Where(x => x.Name == "tiaoxiuri").ToList(); |
| | | |
| | | var jiabanri = admAttendanceRulesDtlDTOs.Where(x => x.Name == "jiabanri").ToList(); |
| | | |
| | | //每天的考勤时间点 |
| | | string[] WorkingStart = admAttendanceRuleDTO.WorkingStart.Split('.'); |
| | |
| | | { |
| | | |
| | | //是否调休日 调休日需要上班 |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= StratTime.Date && x.ValueEnd >= StratTime.Date)) |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= StratTime.Date && x.ValueEnd >= StratTime.Date) |
| | | || jiabanri.Exists(x => x.ValueStart <= StratTime.Date && x.ValueEnd >= StratTime.Date)) |
| | | { |
| | | if (StratTime <= StratTimeWorkingStart) |
| | | { |
| | |
| | | { |
| | | |
| | | //是否调休日 调休日需要上班 |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= EndTime.Date && x.ValueEnd >= EndTime.Date)) |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= EndTime.Date && x.ValueEnd >= EndTime.Date) |
| | | || jiabanri.Exists(x => x.ValueStart <= EndTime.Date && x.ValueEnd >= EndTime.Date)) |
| | | { |
| | | if (EndTime >= EndTimeOffworkEnd) |
| | | { |
| | |
| | | { |
| | | |
| | | //是否调休日 调休日需要上班 |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= StratTime.Date && x.ValueEnd >= StratTime.Date)) |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= dateTimenow.Date && x.ValueEnd >= dateTimenow.Date) |
| | | || jiabanri.Exists(x => x.ValueStart <= dateTimenow.Date && x.ValueEnd >= dateTimenow.Date)) |
| | | { |
| | | LavehTime += shangbanshijian; |
| | | } |
| | |
| | | else |
| | | { |
| | | //是否调休日 调休日需要上班 |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= StratTime.Date && x.ValueEnd >= StratTime.Date)) |
| | | if (tiaoxiuri.Exists(x => x.ValueStart <= StratTime.Date && x.ValueEnd >= StratTime.Date) |
| | | || jiabanri.Exists(x => x.ValueStart <= StratTime.Date && x.ValueEnd >= StratTime.Date)) |
| | | { |
| | | LavehTime -= shangbanshijian; |
| | | } |
| | |
| | | else |
| | | { |
| | | dangqianbuzhou = wfRunProcessDTO.Step; |
| | | //查询历史意见 |
| | | //查询审批进度 |
| | | lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id); |
| | | if (wfRunProcessDTO.Step != "提交") |
| | | { |
| | |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | leaveOff.RecStatus = "A"; |
| | | //未挂审批流,提交直接通过 |
| | | leaveOff.ShenpiStatus = "A"; |
| | | ////未挂审批流,提交直接通过 |
| | | //leaveOff.ShenpiStatus = "A"; |
| | | if (String.IsNullOrEmpty(leaveOff.Id)) |
| | | { |
| | | leaveOff.Creater = curentuser.Id; |
| | |
| | | leaveOff.Modifytime = DateTime.Now; |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | |
| | | if (leaveOff.Step == "提交") |
| | | { |
| | | //请假时间不能重叠 |
| | | var qingjia = _signinService.GetAskLeaveOffChongdie(curentuser.Id, leaveOff.StratTime.Value, leaveOff.EndTime.Value); |
| | | if (qingjia.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该时间段已经有销假!"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | |
| | | //销假必须三天以内 |
| | | if (leaveOff.StratTime.Value.Date < DateTime.Now.Date.AddDays(-3)) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "请在72小时内进行销假处理,超过72小时无法提交"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | } |
| | | |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | { |
| | | if (leaveOff.Step == "提交") |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | for (int i = 0; i < dto.jiaban_s.Length; i++) |
| | | { |
| | | if (!String.IsNullOrEmpty(dto.jiaban_s[i]) && !String.IsNullOrEmpty(dto.jiaban_e[i])) |
| | | { |
| | | AdmAttendanceRulesDtlDTO admAttendanceRulesDtlDTO = new AdmAttendanceRulesDtlDTO(); |
| | | admAttendanceRulesDtlDTO.Pid = dto.Id; |
| | | admAttendanceRulesDtlDTO.ValueStart = DateTime.Parse(dto.jiaban_s[i]); |
| | | admAttendanceRulesDtlDTO.ValueEnd = DateTime.Parse(dto.jiaban_e[i]); |
| | | admAttendanceRulesDtlDTO.Name = "jiabanri"; |
| | | admAttendanceRulesDtlDTO.RecStatus = "A"; |
| | | admAttendanceRulesDtlDTO.Creater = curentuser.Id; |
| | | admAttendanceRulesDtlDTO.Createtime = DateTime.Now; |
| | | admAttendanceRulesDtlDTO.Modifier = admAttendanceRulesDtlDTO.Creater; |
| | | admAttendanceRulesDtlDTO.Modifytime = admAttendanceRulesDtlDTO.Createtime; |
| | | resultEntity = _attendanceRuleService.saveDtl(admAttendanceRulesDtlDTO); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | scope.Complete(); |
| | | } |
| | | |