Example #1
0
        public async Task <dynamic> ReservateDoctor([FromBody] ReservateDoctorModel model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    throw new ModelStateException(ModelState);
                }

                if (!model.OpId.HasValue)
                {
                    model.OpId  = TryGet <int?>(() => UserSelf.OpId);
                    model.OpMan = TryGet <string>(() => UserSelf.OpManFullMsg);
                }

                //姓名
                var cust = await _cusSvr.GetCustomerById(model.CustomerId);

                //科室
                var depart = _stationSvr.GetDepartmentById(model.DepartmentId);
                //医生
                var doctor   = _docrSvr.Find(model.DoctorId);
                var workInfo = _docrSvr.GetDoctorOnDutyInfo(model.DoctorId, model.DepartmentId, model.ReservationDate, model.ReservationSlot);
                var timestr  = $"{workInfo.FromTime?.ToString(@"hh\:mm")}—{workInfo.ToTime?.ToString(@"hh\:mm")}";

                var add = await _resSvr.AddOneRegister(cust.CustomerID, depart.DepartmentID, model.DoctorId, depart.StationID.Value, model.ReservationDate, model.ReservationSlot, RegistFrom.V20Web
                                                       , opId : model.OpId, opMan : model.OpMan, rxDoctorId : model.RxDoctorId
                                                       );

                //给用户发送短信
                StringBuilder b = new StringBuilder();
                b.Append($"尊敬的{cust.CustomerName},请于{model.ReservationDate.ToString("yyyy年MM月dd日")} {timestr} 至{depart.DepartmentName}({doctor.DoctorName})医生处就诊,感谢您的预约。【天使健康】");
                Codes.Utility.SMS sms = new Codes.Utility.SMS();
                //await new SendVCodeCBL(this).SendVCode(cust.Telephone, b.ToString());
                var rlt = await sms.PostSmsInfoAsync(cust.CustomerMobile, b.ToString());

                var d = MyDynamicResult(true, "");
                d.rltCode          = add.HaveRegisted ? "REPET_REGIST" : "";
                d.registStatus     = add.HaveRegisted ? "请注意,您已经预约了,不能重复预约。先前预约信息如下。" : "";
                d.registerId       = add.RegisterID;
                d.registerSeq      = add.RegisterSeq;
                d.customerId       = cust.CustomerID;
                d.customerName     = cust.CustomerName;
                d.customerGender   = cust.Gender;
                d.customerBirthday = cust.Birthday;
                d.customerPicUrl   = cust.PhotoUrlDef.ahDtUtil().GetCustomerImg(cust.Gender);
                d.stationName      = depart.StationName;
                d.departmentName   = depart.DepartmentName;
                d.doctorName       = doctor.DoctorName;
                d.doctorGender     = doctor.Gender;
                d.doctorTitle      = doctor.PostTitleName;
                d.doctorId         = doctor.DoctorId;
                d.doctorPicUrl     = doctor.DoctorPhotoUrl.ahDtUtil().GetDoctorImg(doctor.Gender, imgSizeTypes.HorizThumb);
                d.reservationDate  = model.ReservationDate.ToString("yyyy-MM-dd");
                d.timeInfo         = timestr;
                return(d);
            }
            catch (Exception ex) { return(MyDynamicResult(ex)); }
        }
Example #2
0
 public dynamic JetDoctorByIds(string doctorIds)
 {
     try
     {
         var finds = _docrSvr.Find(doctorIds.ToList <int>(',')).Select(m => new DoctorSEntityV00
         {
             DoctorId       = m.DoctorId,
             DoctorName     = m.DoctorName,
             DoctorGender   = (m.Gender ?? 2).ToGenderString(),
             PostTitleName  = m.PostTitleName,
             CustomerId     = m.CustomerId.Value,
             DoctorPhotoUrl = m.DoctorPhotoUrl.ahDtUtil().GetDoctorImg(m.Gender, imgSizeTypes.HorizThumb),
             DoctorSkillRmk = m.DoctorSkillRmk,
             DoctorAppId    = m.DoctorAppId
         });
         var d = MyDynamicResult(true, "");
         d.items = finds;
         return(d);
     }
     catch (Exception ex) { return(MyDynamicResult(ex)); }
 }
Example #3
0
        public IActionResult GetDoctorInfo(int doctorId)
        {
            try
            {
                var mdd = _docrSvr.Find(doctorId).ahDtUtil().NewModel <Models.vwCHIS_Code_Doctor>(m => new
                {
                    m.DoctorId,
                    m.DoctorName,
                    m.Gender,
                    m.Birthday,
                    m.EmployeeCode,
                    Mobile       = m.CustomerMobile,
                    EduLevelName = _dicSvr.FindName(m.EduLevel),
                    m.IsDoctorOfPerson,
                    DoctorPicUrl = m.PhotoUrlDef.ahDtUtil().GetDoctorImg(m.Gender),
                    m.PostTitleName,
                    m.DoctorSkillRmk,
                    m.DoctorIsAuthenticated,
                    m.DoctorAuthenticatedTime,
                    m.DoctorCreateTime,
                    m.TreatFee,
                    OtherInfo = new
                    {
                        m.IsForTest,
                        m.IsDoctor,
                        PrincipalShip = _dicSvr.FindName(m.Principalship),
                        m.FileType,
                        m.IsEnable,
                        m.StopDate,
                        m.DutyState,
                        PostTitleId = m.PostTitle,
                        m.OnDutyDate,
                        m.ApprovalDate,
                        m.OutDutyDate,
                        m.MasterTech,
                        ClassGroupId = m.ClassGroupID,
                        m.IsShiftClass,
                        m.Explain,
                        m.Remark,
                        m.sysAppId,

                        m.CustomerNo,
                        m.IDcard,
                        m.InsuranceNo,
                        m.CertificateTypeId,
                        m.CertificateNo,
                        m.CustomerId,
                        m.Email,
                        m.Presfession,
                        MarriageStatus = _dicSvr.FindName(m.Marriage),
                        m.CustomerIsAuthenticated,
                        m.CustomerAuthenticatedTime,
                        m.IsChecking,
                        m.UCusId,
                        m.LoginName,
                        m.DoctorAppId,
                    }
                });
                var rlt = MyDynamicResult(mdd);
                return(Ok(rlt));
            }
            catch (Exception ex) { return(Ok(MyDynamicResult(ex))); }
        }