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); } }
public IHttpActionResult Post([FromBody] Request <TreatmentRequest> request) { try { IList <FileUpload> files = request.Data.files; UserEvent u = request.Data.userEvent; string eventID = u.EventID; string newEventID = Guid.NewGuid().ToString(); UserEvent userEvent = bll.Get(p => p.EVENTID.Equals(eventID)); UserEvent serviceEvent = bll.Get(p => p.REMARKS == eventID && p.USERAPPLYID == userEvent.UserApplyId && p.ACTIONSTATUS == "1"); if (userEvent == null) { return(BadRequest("该记录不存在!")); } //更新文件列表 FileUploadBLL fileBLL = new FileUploadBLL(); string fromUser = userEvent.ToUser; foreach (FileUpload item in files) { item.FormId = newEventID; fileBLL.Edit(item); } userEvent.Remarks = u.Remarks; userEvent.ActionType = "1"; userEvent.ActionStatus = ((int)ActionStatus.Complete).ToString(); userEvent.EndTime = DateTime.Now; bool result = bll.Edit(userEvent); #region 结束客服待办 if (serviceEvent != null) { serviceEvent.ActionStatus = ((int)ActionStatus.Complete).ToString(); serviceEvent.EndTime = DateTime.Now; bll.Edit(serviceEvent); } #endregion if (result) { UserInfo currentUser = new UserInfoService().GetCurrentUser(); string _name = currentUser == null ? "" : currentUser.LoginName; UserEvent newUEvent = new UserEvent(); newUEvent.EventID = newEventID; newUEvent.UserApplyId = userEvent.UserApplyId; 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) { LogService.WriteErrorLog("DoTreatmentController[Post]", ex.ToString()); return(BadRequest(ex.ToString())); } }