private string SetOrderInfo() { string content = string.Empty; var respData = new Default.LowerRespData(); try { string reqContent = "{\"special\":{\"EventId\":\"1\" ,\"skuId\":\"18A5685F3B0D43909740EEC20AEFBC73\" ,\"userName\":\"邵志峰\" ,\"phone\":\"13764683490\" ,\"individuationInfo\":\"一统江湖\" ,\"salesPrice\":\"18000\",\"tableNumber\":\"4\" },\"common\":{\"weiXinId\":\"gh_bf70d7900c28\",\"openId\":\"o8Y7Ejm0kL4QB8-h_Z0Bncl619v4\"}} "; var reqObj = reqContent.DeserializeJSONTo <setOrderInfoReqData>(); string OpenID = reqObj.common.openId; string WeiXin = reqObj.common.weiXinId; Loggers.Debug(new DebugLogInfo() { Message = string.Format("setOrderInfo: {0}", reqContent) }); var loggingSessionInfo = Default.GetLjLoggingSession(); InoutService inoutService = new InoutService(loggingSessionInfo); string strError = string.Empty; string strMsg = string.Empty; bool bReturn = inoutService.SetWapPosInoutInfo(reqObj.special.skuId.Trim() , reqObj.special.eventId.Trim() , OpenID.Trim() , WeiXin.Trim() , reqObj.special.userName.Trim() , reqObj.special.phone.Trim() , reqObj.special.individuationInfo.Trim() , reqObj.special.salesPrice.Trim() , reqObj.special.tableNumber.Trim() , loggingSessionInfo , out strError, out strMsg); if (bReturn) { respData.code = "200"; } else { respData.code = "101"; } respData.description = strError; return(respData.ToJSON()); } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); } content = respData.ToJSON(); return(content); }
/// <summary> /// 获取优惠劵列表 /// </summary> /// <param name="pRequest"></param> /// <returns></returns> private string BestowCoupon(string pRequest) { Default.LowerRespData respData = new Default.LowerRespData(); try { var reqObj = pRequest.DeserializeJSONTo <reqConunbondata>(); if (string.IsNullOrEmpty(reqObj.common.userId)) { respData.code = "103"; respData.description = "登陆用户不能为空"; } var loggingSessionInfo = Default.GetBSLoggingSession(reqObj.common.customerId, "1"); CouponBLL bll = new CouponBLL(loggingSessionInfo); int res = bll.BestowCoupon(reqObj.special.cuponID, reqObj.special.doorID); if (res > 0) { respData.code = "100"; respData.description = "优惠劵使用成功"; } else { respData.code = "103"; respData.description = "优惠劵不存在"; } } catch (Exception) { respData.code = "103"; respData.description = "数据库操作失败"; } return(respData.ToJSON()); }
/// <summary> /// 关联领奖人和推荐人 /// </summary> /// <returns></returns> public string BindRecommender() { string content = string.Empty; var respData = new Default.LowerRespData(); string reqContent = Request["ReqContent"]; Loggers.Debug(new DebugLogInfo() { Message = string.Format("getItemList: {0}", reqContent) }); try { //解析请求字符串 var reqObj = reqContent.DeserializeJSONTo <BindRecommenderReqData>(); //判断客户ID是否传递 if (!string.IsNullOrEmpty(reqObj.common.customerId)) { customerId = reqObj.common.customerId; } var loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); var vipBLL = new VipBLL(loggingSessionInfo); var vip = vipBLL.GetVipDetailByVipID(reqObj.common.userId); //更新推荐人openId if (reqObj.special.Recommender != null && reqObj.special.Recommender != "") { string vipID = GetVipIDByOpenID(loggingSessionInfo, reqObj.special.Recommender); if ((vip.HigherVipID == null || vip.HigherVipID == "") && reqObj.common.userId != vipID) { vip.HigherVipID = vipID; vipBLL.Update(vip); //查看推荐人成功推荐人数,满足条件给奖励 CouponBLL couponService = new CouponBLL(loggingSessionInfo); //TODO:added by zhangwei20141009,保存上下线记录 couponService.UpdateVipRecommandTrace(reqObj.common.userId, vipID); couponService.RecommenderPrize(vipID, null); } } } catch (Exception ex) { respData.code = "103"; respData.description = ex.Message; } content = respData.ToJSON(); return(content); }
/// <summary> /// 用户否注册接口 /// </summary> public string Register() { string content = string.Empty; var respData = new Default.LowerRespData(); try { string reqContent = Request["ReqContent"]; var reqObj = reqContent.DeserializeJSONTo <RegisterReqData>(); Loggers.Debug(new DebugLogInfo() { Message = string.Format("Register: {0}", reqContent) }); var loggingSessionInfo = Default.GetLjLoggingSession(); Default.WriteLog(loggingSessionInfo, "Register", reqObj, respData, reqObj.ToJSON()); VipBLL vipBLL = new VipBLL(loggingSessionInfo); string result = vipBLL.Register(reqObj.common.userId, reqObj.special.mobile, reqObj.special.name, reqObj.special.code, reqObj.common.customerId); switch (result) { case "101": respData.code = result; respData.description = "验证码验证失败,请重试。"; break; case "102": respData.code = result; respData.description = "无法找到用户信息,请重试。"; break; default: break; } } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); } content = respData.ToJSON(); return(content); }
public string RecordBrowserLog() { string content = string.Empty; var respData = new Default.LowerRespData(); try { Loggers.Debug(new DebugLogInfo() { Message = string.Format("BrowserRecord: {0}", reqContent) }); #region //解析请求字符串 chech var reqObj = reqContent.DeserializeJSONTo <ReqData>(); #endregion #region //判断客户ID是否传递 if (!string.IsNullOrEmpty(reqObj.common.customerId)) { customerId = reqObj.common.customerId; } var loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); #endregion respData.code = "200"; respData.description = "记录完成"; } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); Loggers.Exception(new ExceptionLogInfo() { ErrorMessage = ex.ToJSON() }); } content = respData.ToJSON(); return(content); }
public string setiAlumniOrderInfo() { string content = string.Empty; var respData = new Default.LowerRespData(); try { string reqContent = Request["ReqContent"]; //reqContent = "{\"common\":{\\\"weiXinId\\\":\\\"gh_bf70d7900c28\\\",\\\"openId\\\":\\\"o8Y7Ejm0kL4QB8-h_Z0Bncl619v4\\\"},\"special\":{\\\"salesPrice\\\":\\\"235\\\",\\\"stdPrice\\\":\\\"250\\\",\\\"orderCode\\\":\\\"DO2013080800001\\\",\\\"totalAmount\\\":\\\"470\\\",\\\"deliveryName\\\":\\\"�ŵ����\\\",\\\"qty\\\":\\\"2\\\",\\\"deliveryRemark\\\":\\\"\\\",\\\"orderId\\\":\\\"E370FC0B39A77078E044005056BE1CB0\\\"}}"; //reqContent = Server.UrlDecode(reqContent); //reqContent = HttpUtility.UrlDecode(reqContent); //reqContent = reqContent.Replace("\\\"","\""); Loggers.Debug(new DebugLogInfo() { Message = string.Format("setiAlumniOrderInfo: {0}", reqContent) }); var reqObj = reqContent.DeserializeJSONTo <setOrderInfoReqData>(); string OpenID = reqObj.common.openId; string WeiXin = reqObj.common.weiXinId; #region if (OpenID == null || OpenID.Trim().Equals("")) { respData.code = "110"; respData.description = "OpenID不能为空"; return(respData.ToJSON()); } if (reqObj.special.skuId == null || reqObj.special.skuId.Trim().Equals("")) { respData.code = "110"; respData.description = "skuId不能为空"; return(respData.ToJSON()); } if (reqObj.special.orderId == null || reqObj.special.orderId.Trim().Equals("")) { respData.code = "110"; respData.description = "订单标识不能为空"; return(respData.ToJSON()); } if (reqObj.special.orderCode == null || reqObj.special.orderCode.Trim().Equals("")) { respData.code = "110"; respData.description = "订单号码不能为空"; return(respData.ToJSON()); } if (reqObj.special.qty == null || reqObj.special.qty.Trim().Equals("")) { respData.code = "110"; respData.description = "数量不能为空"; return(respData.ToJSON()); } if (reqObj.special.salesPrice == null || reqObj.special.salesPrice.Trim().Equals("")) { respData.code = "110"; respData.description = "销售价格不能为空"; return(respData.ToJSON()); } if (reqObj.special.stdPrice == null || reqObj.special.stdPrice.Trim().Equals("")) { respData.code = "110"; respData.description = "标准价格不能为空"; return(respData.ToJSON()); } if (reqObj.special.totalAmount == null || reqObj.special.totalAmount.Trim().Equals("")) { respData.code = "110"; respData.description = "总价不能为空"; return(respData.ToJSON()); } #endregion var loggingSessionInfo = Default.GetBSLoggingSession("29E11BDC6DAC439896958CC6866FF64E", "1"); //Default.WriteLog(loggingSessionInfo, "setiAlumniOrderInfo", null, respData, reqObj.special.ToJSON()); InoutService inoutService = new InoutService(loggingSessionInfo); string strError = string.Empty; string strMsg = string.Empty; bool bReturn = inoutService.SetiAlumniWapPosInoutInfo(reqObj.special.skuId.Trim() , reqObj.special.orderId.Trim() , OpenID.Trim() , WeiXin.Trim() , reqObj.special.orderCode.Trim() , reqObj.special.qty.Trim() , reqObj.special.stdPrice.Trim() , reqObj.special.salesPrice.Trim() , reqObj.special.totalAmount.Trim() , reqObj.special.deliveryName.Trim() , reqObj.special.deliveryRemark.Trim() , loggingSessionInfo , out strError, out strMsg); if (bReturn) { respData.code = "200"; // 推送消息 string msgUrl = ConfigurationManager.AppSettings["push_weixin_msg_url"].Trim(); string msgText = string.Format("{0}", strMsg); string msgData = "<xml><OpenID><![CDATA[" + OpenID + "]]></OpenID><Content><![CDATA[" + msgText + "]]></Content></xml>"; var msgResult = Common.Utils.GetRemoteData(msgUrl, "POST", msgData); Loggers.Debug(new DebugLogInfo() { Message = string.Format("PushMsgResult:{0}", msgResult) }); } else { respData.code = "101"; } respData.description = strError; return(respData.ToJSON()); } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); } content = respData.ToJSON(); return(content); }
public string setWeixinWallInfo() { string content = string.Empty; var respData = new Default.LowerRespData(); try { string reqContent = Request["ReqContent"]; //reqContent = "{\"common\":{\\\"weiXinId\\\":\\\"gh_bf70d7900c28\\\",\\\"openId\\\":\\\"o8Y7Ejm0kL4QB8-h_Z0Bncl619v4\\\"},\"special\":{\\\"salesPrice\\\":\\\"235\\\",\\\"stdPrice\\\":\\\"250\\\",\\\"orderCode\\\":\\\"DO2013080800001\\\",\\\"totalAmount\\\":\\\"470\\\",\\\"deliveryName\\\":\\\"�ŵ����\\\",\\\"qty\\\":\\\"2\\\",\\\"deliveryRemark\\\":\\\"\\\",\\\"orderId\\\":\\\"E370FC0B39A77078E044005056BE1CB0\\\"}}"; //reqContent = Server.UrlDecode(reqContent); //reqContent = HttpUtility.UrlDecode(reqContent); //reqContent = reqContent.Replace("\\\"","\""); Loggers.Debug(new DebugLogInfo() { Message = string.Format("setWeixinWallInfo: {0}", reqContent) }); var reqObj = reqContent.DeserializeJSONTo <setWeiXinWallInfoReqData>(); string OpenID = reqObj.common.openId; string WeiXin = reqObj.common.weiXinId; string customerId = reqObj.common.customerId; #region if (OpenID == null || OpenID.Trim().Equals("")) { respData.code = "110"; respData.description = "OpenID不能为空"; return(respData.ToJSON()); } if (WeiXin == null || WeiXin.Trim().Equals("")) { respData.code = "110"; respData.description = "WeiXin不能为空"; return(respData.ToJSON()); } if (customerId == null || customerId.Trim().Equals("")) { respData.code = "110"; respData.description = "customerId不能为空"; return(respData.ToJSON()); } if (reqObj.special.eventKeyword == null || reqObj.special.eventKeyword.Trim().Equals("")) { respData.code = "110"; respData.description = "eventKeyword不能为空"; return(respData.ToJSON()); } if (reqObj.special.content == null || reqObj.special.content.Trim().Equals("")) { respData.code = "110"; respData.description = "content不能为空"; return(respData.ToJSON()); } #endregion var loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); //Default.WriteLog(loggingSessionInfo, "setiAlumniOrderInfo", null, respData, reqObj.special.ToJSON()); WeixinWallBLL server = new WeixinWallBLL(loggingSessionInfo); string strError = string.Empty; string strMsg = string.Empty; WeixinWallEntity wallInfo = new WeixinWallEntity(); wallInfo.WallId = BaseService.NewGuidPub(); wallInfo.EventKeyword = reqObj.special.eventKeyword.Trim(); wallInfo.Content = reqObj.special.content.Trim(); wallInfo.OpenId = OpenID.Trim(); wallInfo.WeiXinId = WeiXin.Trim(); wallInfo.CreateBy = OpenID.Trim(); wallInfo.LastUpdateBy = OpenID.Trim(); wallInfo.HasReader = 0; server.Create(wallInfo); respData.code = "200"; respData.description = "成功"; return(respData.ToJSON()); } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); } content = respData.ToJSON(); return(content); }
/// <summary> /// 发送验证码 /// </summary> public string SendCode() { string content = string.Empty; var respData = new Default.LowerRespData(); try { string reqContent = Request["ReqContent"]; var reqObj = reqContent.DeserializeJSONTo <SendCodeReqData>(); if (reqObj.special.mobile != "") { var loggingSessionInfo = Default.GetLjLoggingSession(); Default.WriteLog(loggingSessionInfo, "sendCode", reqObj, respData, reqObj.ToJSON()); Random rd = new Random(); string code = rd.Next(100000, 999999).ToString(); RegisterValidationCodeBLL registerValidationCodeBLL = new RegisterValidationCodeBLL(loggingSessionInfo); string result = registerValidationCodeBLL.SendCode(reqObj.special.mobile); Loggers.Debug(new DebugLogInfo() { Message = string.Format("sendCode: {0}, result = {1}", reqContent, result) }); switch (result) { case "101": respData.code = result; respData.description = "验证码发送失败,请稍候再试。"; break; case "102": respData.code = result; respData.description = "该手机号码已被注册,请修改手机号码。"; break; default: break; } } else { respData.code = "102"; respData.description = "手机号码不能为空!"; } } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); Loggers.Exception(new ExceptionLogInfo() { ErrorMessage = string.Format("sendCode: {0}", ex.ToJSON()) }); } content = respData.ToJSON(); return(content); }
public string Feedback() { string content = string.Empty; var respData = new Default.LowerRespData(); #region //解析请求字符串 chech var reqObj = reqContent.DeserializeJSONTo <FeedbackReqData>(); if (reqObj.special == null) { respData.code = "101"; respData.description = "没有特殊参数"; return(respData.ToJSON().ToString()); } if (reqObj.special.name == null || reqObj.special.name.Equals("")) { respData.code = "102"; respData.description = "真实姓名不能为空"; return(respData.ToJSON().ToString()); } if (reqObj.special.phone == null || reqObj.special.phone.Equals("")) { respData.code = "103"; respData.description = "联系电话不能为空"; return(respData.ToJSON().ToString()); } if (reqObj.special.state == null || reqObj.special.state.Equals("")) { respData.code = "104"; respData.description = "反馈情况不能为空"; return(respData.ToJSON().ToString()); } #endregion #region //判断客户ID是否传递 if (!string.IsNullOrEmpty(reqObj.common.customerId)) { customerId = reqObj.common.customerId; } var loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); #endregion try { UserFeedbackEntity userFeedbackEntity = new UserFeedbackEntity(); userFeedbackEntity.UserID = reqObj.common.userId; userFeedbackEntity.CustomerId = reqObj.common.customerId; userFeedbackEntity.CreateBy = reqObj.common.userId; userFeedbackEntity.Name = reqObj.special.name; userFeedbackEntity.Phone = reqObj.special.phone; userFeedbackEntity.Field1 = reqObj.special.area; userFeedbackEntity.Field2 = reqObj.special.seller; userFeedbackEntity.Description = reqObj.special.state; UserFeedbackBLL userFeedbackBLL = new UserFeedbackBLL(loggingSessionInfo); userFeedbackBLL.Create(userFeedbackEntity); respData.code = "200"; respData.description = "提交成功!"; } catch (Exception ex) { respData.code = "100"; respData.description = ex.Message; } content = respData.ToJSON(); return(content); }