public SimpleResultModel ChangeWorkStatus(ChangeWorkStatusPM paraModel) { if (paraModel.WorkStatus == null) //检查非空 { return(SimpleResultModel.Conclude(ChangeWorkStatusEnum.WorkStatusError)); } if (paraModel.Id == null) //检查非空 { return(SimpleResultModel.Conclude(ChangeWorkStatusEnum.ClienterError)); } return(SimpleResultModel.Conclude(iClienterProvider.ChangeWorkStatus(paraModel))); }
public SimpleResultModel VoiceCheckCode(SmsParaModel model) { if (!CommonValidator.IsValidPhoneNumber(model.PhoneNumber)) { return(SimpleResultModel.Conclude(SendCheckCodeStatus.InvlidPhoneNumber)); } var redis = new RedisCache(); string msg = string.Empty; string key = model.Stype == "0" ? RedissCacheKey.PostRegisterInfo_C + model.PhoneNumber : RedissCacheKey.PostForgetPwd_C + model.PhoneNumber; object obj = redis.Get <object>(key); if (obj == null) { return(SimpleResultModel.Conclude(SendCheckCodeStatus.CodeNotExists)); } string tempcode = obj.ToString().Aggregate("", (current, c) => current + (c.ToString() + ',')); bool userStatus = iClienterProvider.CheckClienterExistPhone(model.PhoneNumber); if (model.Stype == "0") //注册 { if (userStatus) //判断该手机号是否已经注册过 { return(SimpleResultModel.Conclude(SendCheckCodeStatus.AlreadyExists)); } msg = string.Format(SupermanApiConfig.Instance.SmsContentCheckCodeVoice, tempcode, SystemConst.MessageClinenter); } else //修改密码 { if (!userStatus) { return(SimpleResultModel.Conclude(SendCheckCodeStatus.NotExists)); } msg = string.Format(SupermanApiConfig.Instance.SmsContentCheckCodeFindPwdVoice, tempcode, SystemConst.MessageClinenter); } try { // 更新短信通道 Task.Factory.StartNew(() => { SendSmsHelper.SendSmsSaveLogNew(model.PhoneNumber, msg, SystemConst.SMSSOURCE); }); return(SimpleResultModel.Conclude(SendCheckCodeStatus.Sending)); } catch (Exception) { return(SimpleResultModel.Conclude(SendCheckCodeStatus.SendFailure)); } }
public SimpleResultModel CheckCode(string PhoneNumber, string type) { if (!CommonValidator.IsValidPhoneNumber(PhoneNumber)) { return(SimpleResultModel.Conclude(SendCheckCodeStatus.InvlidPhoneNumber)); } var randomCode = new Random().Next(1000).ToString("D4"); string msg = string.Empty; string key = ""; bool checkUser = iClienterProvider.CheckClienterExistPhone(PhoneNumber); if (type == "0") //注册 { if (checkUser) //判断该手机号是否已经注册过 { return(SimpleResultModel.Conclude(SendCheckCodeStatus.AlreadyExists)); } key = RedissCacheKey.PostRegisterInfo_C + PhoneNumber; msg = string.Format(SupermanApiConfig.Instance.SmsContentCheckCode, randomCode, SystemConst.MessageClinenter); } else //修改密码 { if (!checkUser) { //如果骑士不存在 return(SimpleResultModel.Conclude(SendCheckCodeStatus.NotExists)); } key = RedissCacheKey.PostForgetPwd_C + PhoneNumber; msg = string.Format(SupermanApiConfig.Instance.SmsContentFindPassword, randomCode, SystemConst.MessageClinenter); } try { var redis = new RedisCache(); redis.Add(key, randomCode, DateTime.Now.AddHours(1)); // 更新短信通道 Task.Factory.StartNew(() => { SendSmsHelper.SendSendSmsSaveLog(PhoneNumber, msg, SystemConst.SMSSOURCE); }); return(SimpleResultModel.Conclude(SendCheckCodeStatus.Sending)); } catch (Exception) { return(SimpleResultModel.Conclude(SendCheckCodeStatus.SendFailure)); } }
public SimpleResultModel PostDistribSubsidy_B(BusiDistribInfoPM mod) { if (mod.userId <= 0 || mod.price < 0) //判断传入参数是否正常 { return(SimpleResultModel.Conclude(DistribSubsidyStatus.Failed)); } var selResult = iBusinessProvider.GetBusiness(mod.userId); if (selResult == null) //商户是否存在 { return(SimpleResultModel.Conclude(DistribSubsidyStatus.Failed)); } int modResult = iBusinessProvider.ModifyWaiMaiPrice(mod.userId, mod.price); if (modResult > 0) { return(SimpleResultModel.Conclude(DistribSubsidyStatus.Success)); } else { return(SimpleResultModel.Conclude(DistribSubsidyStatus.Failed)); } }