public async Task <ObjectResultModule> DeleteQualityControlManage([FromBody] QualityControlManage input) { if (!Commons.CheckSecret(input.Secret)) { this.ObjectResultModule.StatusCode = 422; this.ObjectResultModule.Message = "Wrong Secret"; this.ObjectResultModule.Object = ""; return(this.ObjectResultModule); } var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0; var query = await _QualityControlManageService.QualityControlManageByID(input.Id); if (query != null) { query.DeleteBy = userid; query.DeleteTime = DateTime.Now; query.IsDelete = true; var res = await _QualityControlManageService.DeleteQualityControlManage(query); this.ObjectResultModule.Object = res; this.ObjectResultModule.Message = "sucess"; this.ObjectResultModule.StatusCode = 200; } else { this.ObjectResultModule.Message = "NotFound"; this.ObjectResultModule.StatusCode = 404; this.ObjectResultModule.Object = ""; } #region 操作日志 var CreateYaeherOperList = new YaeherOperList() { OperExplain = "DeleteQualityControlManage", OperContent = JsonHelper.ToJson(input), OperType = "DeleteQualityControlManage", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(this.ObjectResultModule); }
/// <summary> /// 输出模型 /// </summary> /// <param name="quality"></param> /// <param name="item"></param> /// <param name="hasCollect"></param> /// <param name="consultationfile"></param> /// <param name="reply"></param> /// <param name="doctor"></param> /// <param name="eva"></param> /// <param name="serverid"></param> /// <param name="IIIness"></param> /// <param name="paramlist"></param> public QualityControlManageOutDetail(QualityControlManage quality, YaeherConsultation item, bool hasCollect, IList <ReplyDetail> consultationfile, IList <ReplyDetail> reply, YaeherUser doctor, IList <ConsultationEvaluation> eva, int serverid, int IIIness, List <SystemParameter> paramlist) { Id = quality.Id; Sex = JsonHelper.FromJson <YaeherPatientLeaguerInfo>(item.PatientJSON).Sex; QualityLevel = quality.QualityLevel; RepayIllnessDescription = quality.RepayIllnessDescription; ReplyState = quality.ReplyState; IsReturnVisit = item.IsReturnVisit; HasCollect = hasCollect; CreatedBy = item.CreatedBy; CreatedOn = item.CreatedOn; UserImage = doctor.UserImage; ConsultNumber = item.ConsultNumber; ConsultantID = item.ConsultantID; ConsultantName = item.ConsultantName; ConsultantJSON = item.ConsultantJSON; DoctorName = item.DoctorName; DoctorID = item.DoctorID; DoctorJSON = item.DoctorJSON; PatientID = item.PatientID; PatientName = item.PatientName; PatientJSON = item.PatientJSON; ConsultType = item.ConsultType; IIInessType = item.IIInessType; IIInessId = IIIness; IIInessJSON = item.IIInessJSON; PhoneNumber = item.PhoneNumber; PatientCity = item.PatientCity; IIInessDescription = item.IIInessDescription; InquiryTimes = item.InquiryTimes; ConsultState = item.ConsultState; OvertimeRemindTimes = item.OvertimeRemindTimes; Overtime = item.Overtime; RefundBy = item.RefundBy; RefundTime = item.RefundTime; RefundType = item.RefundType; RefundNumber = item.RefundNumber; RefundState = item.RefundState; RefundReason = item.RefundReason; RefundRemarks = item.RefundRemarks; RecommendDoctorName = item.RecommendDoctorName; RecommendDoctorID = item.RecommendDoctorID; QualityDoctor = quality.DoctorName; Age = item.Age; Replys = reply.OrderBy(t => t.CreatedOn).ToList(); Consultationfile = consultationfile.ToList(); TimeSpan ts = DateTime.UtcNow.Subtract(item.CreatedOn); if (ts.TotalMinutes >= 3 || Replys.Count > 0) { Canhargeback = false; } else { Canhargeback = true; } var replycount = reply.Where(t => t.Message != "" && t.Message != null && t.ReplyType == "inquiries").ToList(); ReplysCount = 2 - replycount.Count > 0 ? 2 - replycount.Count : 0; ConsulationStatusCode = item.ConsultState; ConsultState = paramlist.Find(t => t.Code == item.ConsultState).Name; if (item.ConsultState == "consulting") { CanReplys = true; } else { CanReplys = false; } if (item.ConsultState == "success" && !HasEvaluation) { CanEvaluation = true; } else { CanEvaluation = false; } if (item.ConsultState == "success" || item.ConsultState == "return") { CanDelete = true; } else { CanDelete = false; } if (ReplysCount < 1) { CanReplys = false; } HasEvaluation = item.IsEvaluate; ReturnVisit = item.ReturnVisit; EvaluationId = eva.Count > 0 ? eva[0].Id : 0; ServiceMoneyListID = serverid; HasAllergic = JsonHelper.FromJson <YaeherPatientLeaguerInfo>(item.PatientJSON).HasAllergic; AllergicHistory = JsonHelper.FromJson <YaeherPatientLeaguerInfo>(item.PatientJSON).AllergicHistory; }
public async Task <QualityControlManage> DeleteQualityControlManage(QualityControlManage QualityControlManageInfo) { return(await _repository.UpdateAsync(QualityControlManageInfo)); }
public async Task <QualityControlManage> CreateQualityControlManage(QualityControlManage QualityControlManageInfo) { QualityControlManageInfo.Id = await _repository.InsertAndGetIdAsync(QualityControlManageInfo); return(QualityControlManageInfo); }
public async Task <ObjectResultModule> CreateQualityControlManage([FromBody] QualityControlManage input) { if (!Commons.CheckSecret(input.Secret)) { this.ObjectResultModule.StatusCode = 422; this.ObjectResultModule.Message = "Wrong Secret"; this.ObjectResultModule.Object = ""; return(this.ObjectResultModule); } var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0; var consult = await _consultationService.YaeherConsultationByID(input.ConsultID); var doctor = await _yaeherDoctorService.YaeherDoctorByID(input.DoctorID); var comtrol = await _QualityControlManageService.QualityControlManageByConsultStateID(consult.Id); if (comtrol != null) { return(new ObjectResultModule("", 400, "质控委员未处理完不允许质控重新分发质控委员!")); } if (doctor.Id == consult.DoctorID) { return(new ObjectResultModule("", 400, "咨询单不允许提交给咨询医生!")); } using (var unitOfWork = _unitOfWorkManager.Begin()) { var create = new QualityControlManage() { ConsultNumber = consult.ConsultNumber, ConsultID = consult.Id, ConsultantID = consult.ConsultantID, ConsultantName = consult.ConsultantName, DoctorID = input.DoctorID, DoctorName = doctor.DoctorName, ConsultType = consult.ConsultType, ReplyState = "untreated", CreatedBy = userid, CreatedOn = DateTime.Now }; var res = await _QualityControlManageService.CreateQualityControlManage(create); this.ObjectResultModule.Object = res; unitOfWork.Complete(); } #region 操作日志 var CreateYaeherOperList = new YaeherOperList() { OperExplain = "CreateQualityControlManage", OperContent = JsonHelper.ToJson(input), OperType = "CreateQualityControlManage", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion this.ObjectResultModule.StatusCode = 200; this.ObjectResultModule.Message = "sucess"; return(this.ObjectResultModule); }