public async Task <ObjectResultModule> DoctorIncomePage([FromBody] DoctorIncomeIn DoctorIncomeInPage) { if (!Commons.CheckSecret(DoctorIncomeInPage.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 usermanager = JsonHelper.FromJson <UserMemory>(_IabpSession.GetUserData()); // 判断当角色为医生角色时 if ((!usermanager.IsAdmin && usermanager.IsDoctor) || usermanager.MobileRoleName == "doctor") { if (DoctorIncomeInPage.Platform == "PC") { DoctorIncomeInPage.AndAlso(t => t.DoctorID == usermanager.DoctorID); } else if (DoctorIncomeInPage.Platform == "Mobile") { var doctor = await _yaeherDoctorService.YaeherDoctorByUserID(userid); DoctorIncomeInPage.AndAlso(t => t.DoctorID == doctor.Id); } } else { if (!string.IsNullOrEmpty(DoctorIncomeInPage.DoctorName)) { DoctorIncomeInPage.AndAlso(t => t.DoctorName.Contains(DoctorIncomeInPage.DoctorName)); } } DoctorIncomeInPage.AndAlso(t => !t.IsDelete); var values = await _DoctorIncomeService.DoctorIncomePage(DoctorIncomeInPage); this.ObjectResultModule.Object = new DoctorIncomeOut(values, DoctorIncomeInPage); this.ObjectResultModule.Message = "sucess"; this.ObjectResultModule.StatusCode = 200; #region 操作日志 var CreateYaeherOperList = new YaeherOperList() { OperExplain = "DoctorIncomePage", OperContent = JsonHelper.ToJson(DoctorIncomeInPage), OperType = "DoctorIncomePage", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(this.ObjectResultModule); }
public async Task <ObjectResultModule> DoctorIncomeList([FromBody] DoctorIncomeIn DoctorIncomeInList) { if (!Commons.CheckSecret(DoctorIncomeInList.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; DoctorIncomeInList.AndAlso(t => !t.IsDelete); if (!string.IsNullOrEmpty(DoctorIncomeInList.DoctorName)) { DoctorIncomeInList.AndAlso(t => t.DoctorName.Contains(DoctorIncomeInList.DoctorName)); } var value = await _DoctorIncomeService.DoctorIncomeList(DoctorIncomeInList); this.ObjectResultModule.Object = value; this.ObjectResultModule.Message = "sucess"; this.ObjectResultModule.StatusCode = 200; #region 操作日志 var CreateYaeherOperList = new YaeherOperList() { OperExplain = "DoctorIncomeList", OperContent = JsonHelper.ToJson(DoctorIncomeInList), OperType = "DoctorIncomeList", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(this.ObjectResultModule); }