public JsonResult Post(ITSM_EventLog _t) { if (WMFactory.ITSMEventLog.Insert(_t)) return Json(ResultMsg.Success("新增成功!")); else return Json(ResultMsg.Failure("新增失败,请您重试!")); }
public JsonResult Delete(ITSM_EventLog _t) { if (WMFactory.ITSMEventLog.Delete(s => s.Id == _t.Id )) return Json(ResultMsg.Success("删除成功!")); else return Json(ResultMsg.Failure("删除失败,请您重试!")); }
public JsonResult Put(ITSM_EventLog _t) { IITSMEventLogService service = WMFactory.ITSMEventLog; ITSM_EventLog entity = service.GetById(_t.Id.ToString()); entity = AutoMapper<ITSM_EventLog, ITSM_EventLog>.Convert(_t, entity); if (service.Update(entity)) return Json(ResultMsg.Success("更新成功!")); else return Json(ResultMsg.Failure("更新失败,请您重试!")); }
public JsonResult Assignment(Guid[] ids, string egrName) { int success = 0; foreach (Guid _t in ids) { IITSMEventService service = WMFactory.ITSMEvent; ITSM_Event entity = service.GetById(_t.ToString()); if (entity.ProcessStatus == 9 || entity.ProcessStatus == 5) { return Json(ResultMsg.Failure("“" + entity.Code + "”已取消或已完结的不可再派工!")); } //校验工程师,20140922修改,f.EgrName换成EgrAmName IEnumerable<ITSM_Engineer> egrList = WMFactory.ITSMEngineer.FindByConditions(null, f => f.EgrAmName == egrName); if (egrList == null || egrList.Count() <= 0) return Json(ResultMsg.Failure("工程师错误,不存在!")); //电话号码 entity.EngineerPhone = egrList.FirstOrDefault().Phone; //20141007,修改为工程师的小翅膀账号名称,否则itdc微信端gang不显示 entity.Engineer = egrList.First().EgrAmName; ITSM_EventLog entLog = new ITSM_EventLog(); entLog.Reason = "派工给" + egrName; entLog.Eid = _t; entLog.TntId = Guid.Parse(AuthToken.CurrentUser.GroupId); WMFactory.ITSMEventLog.Insert(entLog); //派工状态 entity.ProcessStatus = 1; if (service.Update(entity)) { WMFactory.ITSMEvent.Notice(1, entity); SendWxSvrNotice(entity);//发送微信服务通知 success++; } } return Json(ResultMsg.Success("派工成功!共计:" + success.ToString() + "条")); }
public JsonResult HandleEvent(Guid id, int type) { CertificateDto cer = CurrentUser(); string curUser = cer.UserName; Guid tntId = Guid.Parse(cer.GroupId); ITSM_Event ent = WMFactory.ITSMEvent.GetById(id.ToString()); if (ent.Engineer != curUser) { return Json(ResultMsg.Failure("无法处理非己事件")); } ITSM_EventLog entlog = new ITSM_EventLog(); entlog.Eid = ent.Id; entlog.CreateUser = curUser; if (type == 2 && ent.ProcessStatus != 1) { return Json(ResultMsg.Failure("非派工状态,操作无效")); } if (type == 3 && ent.ProcessStatus != 2) { return Json(ResultMsg.Failure("非接收状态,操作无效")); } if (type == 4 && ent.ProcessStatus != 3) { return Json(ResultMsg.Failure("非处理状态,操作无效")); } else if (type != 2 && type != 3 && type != 4) { return Json(ResultMsg.Failure("非法操作!")); } if (type == 2) { entlog.Reason = "接收事件"; } else if (type == 3) { entlog.Reason = "处理中"; } else if (type == 4) { entlog.Reason = "处理完成"; } entlog.TntId = tntId; WMFactory.ITSMEventLog.Insert(entlog); ent.ProcessStatus = type; if (WMFactory.ITSMEvent.Update(ent)) { return Json(ResultMsg.Success("操作成功!")); } else return Json(ResultMsg.Failure("操作失败!")); }
public JsonResult CompleteEvent(ITSM_Event evt) { CertificateDto cer = CurrentUser(); string curUser = cer.UserName; Guid tntId = Guid.Parse(cer.GroupId); ITSM_Event ent = WMFactory.ITSMEvent.GetById(evt.Id.ToString()); if (ent.Engineer != curUser) { return Json(ResultMsg.Failure("无法处理非己事件")); } if (ent.ProcessStatus != 3) { return Json(ResultMsg.Failure("非处理状态,不能完成!")); } ent.EventApp = evt.EventApp; ent.EventEquipment = evt.EventEquipment; ent.EventSolution = evt.EventSolution; ITSM_EventLog entlog = new ITSM_EventLog(); entlog.Eid = ent.Id; entlog.CreateUser = curUser; entlog.Reason = "处理完成"; entlog.TntId = tntId; WMFactory.ITSMEventLog.Insert(entlog); ent.ProcessStatus = 4; if (WMFactory.ITSMEvent.Update(ent)) { if(!SendWxSvrNoticeWhenOver(ent))//如果执行失败了还是要发送小翅膀 WMFactory.ITSMEvent.Notice(4, ent); return Json(ResultMsg.Success("操作成功!")); } else return Json(ResultMsg.Failure("操作失败!")); }
public JsonResult ShiftEvent(Guid id, string egr, string remark) { CertificateDto cer = CurrentUser(); string curUser = cer.UserName; Guid tntId = Guid.Parse(cer.GroupId); ITSM_Event ent = WMFactory.ITSMEvent.GetById(id.ToString()); if (ent.Engineer != curUser) { return Json(ResultMsg.Failure("无法处理非己事件")); } if (ent.ProcessStatus != 2 && ent.ProcessStatus != 3) { return Json(ResultMsg.Failure("非接收和处理状态,不能转派!")); } ITSM_EventLog entlog = new ITSM_EventLog(); entlog.Eid = ent.Id; entlog.CreateUser = curUser; entlog.Reason = "转派给" + egr; entlog.TntId = tntId; entlog.Remark = remark; WMFactory.ITSMEventLog.Insert(entlog); ent.ProcessStatus = 1; ent.Engineer = egr; if (WMFactory.ITSMEvent.Update(ent)) { WMFactory.ITSMEvent.Notice(6, ent); SendWxSvrNotice(ent); return Json(ResultMsg.Success("操作成功!")); } else return Json(ResultMsg.Failure("操作失败!")); }
public JsonResult SubmitEval(ITSM_Event ent) { CertificateDto cer = CurrentUser(); string curUser = cer.UserName; IITSMEventService srv = WMFactory.ITSMEvent; ITSM_Event orgEvent = srv.GetById(ent.Id.ToString()); if (orgEvent.ReqMan != curUser) { return Json(ResultMsg.Failure("只能评价自己的事件")); } if (orgEvent.ProcessStatus != 4) { return Json(ResultMsg.Failure("失败,事件非待评价状态!")); } orgEvent.ElvTime = ent.ElvTime; orgEvent.ElvAtude = ent.ElvAtude; orgEvent.ElvRst = ent.ElvRst; orgEvent.ElvDesc = ent.ElvDesc; orgEvent.ProcessStatus = 5; orgEvent.ModifyUser = curUser; //插入日志 ITSM_EventLog entlog = new ITSM_EventLog(); entlog.Reason = "完成评价"; entlog.CreateUser = curUser; entlog.Eid = ent.Id; WMFactory.ITSMEventLog.Insert(entlog); if (srv.Update(orgEvent)) { WMFactory.ITSMEvent.Notice(5, orgEvent); return Json(ResultMsg.Success("评价成功,感谢支持")); } else return Json(ResultMsg.Failure("评价失败,请重试")); }
public JsonResult CancelEvent(Guid id) { //取消自己的事件 CertificateDto cer = CurrentUser(); string curUser = cer.UserName; ITSM_Event ent = WMFactory.ITSMEvent.GetById(id.ToString()); if (ent.ReqMan != curUser) { return Json(ResultMsg.Failure("只能取消自己的事件")); } if (ent.ProcessStatus != 0) { return Json(ResultMsg.Failure("只能取消提报中的事件")); } ent.ModifyUser = curUser; ent.ProcessStatus = 9; if (WMFactory.ITSMEvent.Update(ent)) { //插入日志 ITSM_EventLog entlog = new ITSM_EventLog(); entlog.Reason = "取消事件"; entlog.CreateUser = curUser; entlog.Eid = ent.Id; WMFactory.ITSMEventLog.Insert(entlog); return Json(ResultMsg.Success("事件取消成功")); } else return Json(ResultMsg.Failure("操作失败")); }