/// <summary> /// 关闭流程 /// </summary> /// <returns></returns> public JsonResult CloseEvent(string eventId, string applyId) { UserEventBLL ueBll = new UserEventBLL(); ueBll.CloseEvent(eventId); ueBll.CloseApply(applyId); return(Json("ok", JsonRequestBehavior.AllowGet)); }
public IHttpActionResult Post([FromBody] Request <IList <FileUpload> > request) { try { //获取参数 string eventID = request.ID; IList <FileUpload> list = request.Data; string newEventID = Guid.NewGuid().ToString(); //更新文件列表 FileUploadBLL fileBLL = new FileUploadBLL(); string fromUser = string.Empty; foreach (FileUpload item in list) { item.FormId = newEventID; fromUser = item.CreatBy; fileBLL.Edit(item); } bool result = bll.CloseEvent(eventID); if (result) { UserInfo currentUser = new UserInfoService().GetCurrentUser(); string _name = currentUser == null ? "" : currentUser.LoginName; UserEvent userEvent = bll.Get(p => p.EVENTID.Equals(eventID)); string _applyId = userEvent == null ? "" : userEvent.UserApplyId; UserEvent newUEvent = new UserEvent(); newUEvent.EventID = newEventID; newUEvent.UserApplyId = _applyId; newUEvent.FromUser = fromUser; newUEvent.ActionType = ((int)ActionType.待办事项).ToString(); newUEvent.ActionInfo = string.Format("您收到了用户{0}上传的病历资料,请整理", _name); newUEvent.ReceiptTime = DateTime.Now; newUEvent.ActionStatus = ((int)ActionStatus.Progress).ToString(); newUEvent.CreateTime = DateTime.Now; newUEvent.LinkUrl = "UserArrange"; bll.AddUserEvent(newUEvent, UserType.医学编辑); } return(Ok("ok")); } catch (Exception ex) { LogHelper.WriteInfo(ex.ToString()); return(BadRequest("异常")); } }
public bool SendEvent(UserEvent userEvent, string FormID) { try { UserEventBLL userBLL = new UserEventBLL(); userBLL.CloseEvent(userEvent.EventID); UserInfoService _service = new UserInfoService(); UserInfo currentUser = _service.GetCurrentUser(); string _fromUser = currentUser == null ? "" : currentUser.UserId; string _applyId = userEvent == null ? "" : userEvent.UserApplyId; string _userID = userEvent.FromUser; UserInfo createUser = _service.GetUserInfoByID(_userID); string _name = createUser == null ? "" : createUser.LoginName; UserEvent newUEvent = new UserEvent(); newUEvent.EventID = Guid.NewGuid().ToString("N"); newUEvent.UserApplyId = _applyId; newUEvent.FromUser = _fromUser; newUEvent.ActionType = ((int)ActionType.待办事项).ToString(); newUEvent.ActionInfo = string.Format("您收到了{0}的病历报告,请查看", _name); newUEvent.ReceiptTime = DateTime.Now; newUEvent.ActionStatus = ((int)ActionStatus.Progress).ToString(); newUEvent.CreateTime = DateTime.Now; newUEvent.ModelType = "DoctorHistory"; newUEvent.ModelId = FormID; newUEvent.LinkUrl = "EventDetailForDoc"; userBLL.AddUserEvent(newUEvent, UserType.医生); return(true); } catch (Exception ex) { LogHelper.WriteError(ex.ToString()); return(false); } }