Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        returnValue.ErrMessage = "";
        returnValue.Success    = true;

        #region 验证用户登录信息

        UserSession = WebFramework.GeneralMethodBase.GetUserSession();

        if (UserSession == null || new Db.UserInfoDal().Exists(WebFramework.GeneralMethodBase.GetUserSession().UserName) == false)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "登录信息失效!";

            Response.Write(Common.JsonHelper.GetJsonString(returnValue));
            Response.End();
            return;
        }
        #endregion

        lock (SysLock)
        {
            string GetType = Request["GetType"];

            if (string.IsNullOrEmpty(GetType) == false)
            {
                returnValue = ResultData(GetType);
            }
        }

        Response.Write(Common.JsonHelper.GetJsonString(returnValue));
        Response.End();
        return;
    }
Example #2
0
    public Model.ReturnValue CheckSession()
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 获取session
        orderSession = WebFramework.SessionManage.SessionMethod.SessionInstance.GetSession();
        if (orderSession == null)
        {
            result.ErrMessage = "系统繁忙,请稍后再试!";
            result.Success    = false;

            return(result);
        }
        else
        {
            result.ErrMessage = "";
            result.Success    = true;

            return(result);
        }

        #endregion
    }
Example #3
0
    public Model.ReturnValue ResultData(string GetType)
    {
        #region 操作日志订单

        mdlog.CreateTime    = DateTime.Now;
        mdlog.Description   = "";
        mdlog.LStatus       = model.States;
        mdlog.Mobile        = model.Mob;
        mdlog.OperationType = "";
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Status        = 0;
        mdlog.UpdateTime    = DateTime.Now;
        mdlog.UserName      = UserSession.UserName;
        mdlog.Remark        = "";
        mdlog.HideContent   = "";
        #endregion

        if (GetType == "SaveRemark")
        {
            //设置备注
            returnValue = SaveRemark();
        }
        if (GetType == "Success")
        {
            //审核通过
            returnValue = Success();
        }
        if (GetType == "Fail")
        {
            //审核作废
            returnValue = Fail();
        }
        if (GetType == "Unable")
        {
            //无法审核
            returnValue = Unable();
        }
        if (GetType == "Recovery")
        {
            //恢复订单
            returnValue = Recovery();
        }
        if (GetType == "BatchDelete")
        {
            //批量删除
            returnValue = BatchDelete();
        }
        if (GetType == "BatchFail")
        {
            //批量作废
            returnValue = BatchFail();
        }

        if (GetType == "BatchRecorded")
        {
            //批量OCR预审勾选小票
            returnValue = BatchRecorded();
        }
        if (GetType == "BatchRecordedAll")
        {
            //批量OCR预审未录入小票
            returnValue = BatchRecordedAll();
        }
        if (GetType == "DelayedReissue")
        {
            //延时订单发送失败补发
            returnValue = DelayedReissue();
        }
        if (GetType == "ReissueHb")
        {
            //红包退款补发
            returnValue = ReissueHb();
        }

        if (returnValue.Success)
        {
            returnValue = InitData(returnValue);
        }

        return(returnValue);
    }
Example #4
0
    public Model.ReturnValue InitData(Model.ReturnValue returnValue)
    {
        int PageIndex = Common.TypeHelper.ObjectToInt(Request["PageIndex"], 0);
        int PageSize  = Common.TypeHelper.ObjectToInt(Request["PageSize"], 10);

        string CheckInputText   = Request["CheckInputText"];
        string SearchOptionText = Request["SearchOptionText"];
        //string StatusOptionText = Request["StatusOptionText"];
        string PrizeOptionText = Request["PrizeOptionText"];
        string OcrOptionText   = Request["OcrOptionText"];
        string StarTimeText    = Request["StarTimeText"];
        string EndTimeText     = Request["EndTimeText"];
        string OrderStatusType = Request["OrderStatusType"];

        string sqlwhere = "";

        if (string.IsNullOrEmpty(CheckInputText) == false && string.IsNullOrEmpty(SearchOptionText) == false)
        {
            sqlwhere += " and " + SearchOptionText + " like '%" + Common.ReplaceErorrSql.StripSQLInjection(CheckInputText) + "%'";
        }
        if (string.IsNullOrEmpty(OrderStatusType) == false && OrderStatusType != "1")
        {
            sqlwhere += " and a.States =" + (OrderStatusType == "2" ? "0" : OrderStatusType == "3" ? "1" : "-1") + "";
        }
        if (string.IsNullOrEmpty(PrizeOptionText) == false)
        {
            sqlwhere += " and a.Jx='" + PrizeOptionText + "'";
        }
        if (string.IsNullOrEmpty(OcrOptionText) == false && Request["GetType"] != "Export")
        {
            if (OcrOptionText == "是")
            {
                sqlwhere += " and ap.note is not null ";
            }
            else
            {
                sqlwhere += " and ap.note is null ";
            }
        }
        if (string.IsNullOrEmpty(StarTimeText) == false)
        {
            sqlwhere += " and a.CreateTime >= '" + StarTimeText + " 00:00:00'";
        }
        if (string.IsNullOrEmpty(EndTimeText) == false)
        {
            sqlwhere += " and a.CreateTime <= '" + EndTimeText + " 23:59:59'";
        }

        if (Request["GetType"] == "Export")
        {
            string ExportData = string.IsNullOrEmpty(Request["ExportData"]) ? "" : Request["ExportData"].TrimEnd(',');

            Common.NPOIHelper.ExportByWeb(OrderDal.GetVueExcelList(sqlwhere, ExportData, "", "OrderInfo", true), "", DateTime.Now.ToString("yyyyMMdd") + ".xlsx");
            return(null);
        }
        else
        {
            DataTable OrderDt = OrderDal.GetList(sqlwhere, PageIndex, PageSize, true);

            #region 查询订单红包是否过期
            if (string.IsNullOrEmpty(Request["IsRefund"]) == false && Request["IsRefund"] == "是")
            {
                OrderDt.Columns.Add("isRefund", typeof(int));//消费者是否退款
                for (int row = 0; row < OrderDt.Rows.Count; row++)
                {
                    string Jx           = OrderDt.Rows[row]["Jx"].ToString();
                    string HbOrderCode  = OrderDt.Rows[row]["HbOrderCode"].ToString();
                    string SearchStatus = Common.SearchRedPack.SearchOrder(HbOrderCode);
                    OrderDt.Rows[row]["isRefund"] = (HbOrderCode.Length > 0 && (SearchStatus == "已退款" || SearchStatus == "发放失败")) ? 1 : 0;
                }
            }
            #endregion

            returnValue.EffectRows  = OrderDal.GetCount(sqlwhere, "", true);//true 左连接小票表   非小票项目可不传
            returnValue.ObjectValue = Common.JsonHelper.DataTableToJson(OrderDt);
        }

        return(returnValue);
    }
Example #5
0
    /// <summary>
    /// 二等奖:完善地址信息
    /// </summary>
    /// <param name="context"></param>
    /// <returns></returns>
    public Model.ReturnValue AddAddressInfo(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();
        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog("session", "session不通过", context);
            return(result);
        }
        #endregion

        string OpenId        = orderSession.OpenId;
        string name          = context.Request["name"];          //姓名
        string province      = context.Request["province"];      //省
        string city          = context.Request["city"];          //市
        string area          = context.Request["area"];          //区
        string detailAddress = context.Request["detailAddress"]; //详细地址
        #region 验证地址
        if (Common.ValidateHelper.IsAddrs(province) == false)
        {
            ESLogMethod.ESLogInstance.Debug("省份错误", detailAddress);

            result.ErrMessage = "请填写正确省份";
            result.Success    = false;
            return(result);
        }
        if (Common.ValidateHelper.IsAddrs(city) == false)
        {
            ESLogMethod.ESLogInstance.Debug("城市错误", detailAddress);

            result.ErrMessage = "请填写正确城市";
            result.Success    = false;
            return(result);
        }
        if (Common.ValidateHelper.IsAddrs(detailAddress) == false)
        {
            ESLogMethod.ESLogInstance.Debug("地址错误", detailAddress);

            result.ErrMessage = "请填写正确地址";
            result.Success    = false;
            return(result);
        }
        if (detailAddress.Length > 100)
        {
            ESLogMethod.ESLogInstance.Debug("地址长度超限", detailAddress);

            result.ErrMessage = "地址长度超限";
            result.Success    = false;
            return(result);
        }

        #endregion
        #region 验证名字

        if (Common.ValidateHelper.IsName(name) == false)
        {
            ESLogMethod.ESLogInstance.Debug("名字错误", detailAddress);

            result.ErrMessage = "请填写姓名";
            result.Success    = false;
            return(result);
        }
        #endregion


        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "Openid格式异常:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        //获取未完善信息的二等奖订单
        Model.OrderInfoModel order = OrderDal.GetModel(" and ordercode='" + orderSession.OrderKey + "' and states = 3");
        if (order.Id <= 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "抽奖:订单ID不存在:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }

        order.States   = 0;
        order.Area     = area;
        order.Province = province;
        order.City     = city;
        order.Adds     = detailAddress;
        order.Name     = name;

        Model.OrderLogModel OrderLog = new Model.OrderLogModel();
        OrderLog.OId       = order.Id;
        OrderLog.Mob       = order.Mob;
        OrderLog.OrderCode = order.OrderCode;
        OrderLog.LStatus   = 8;//上传小票
        OrderLog.Notes     = order.FilesId + ";" + order.States + ";" + order.Area + ";" + order.Province + ";" + order.City + ";" + order.Adds + ";" + order.Name;
        OrderLog.Status    = 1;
        OrderLog.UpTime    = DateTime.Now;

        if (OrderDal.UpdateInfo(order, OrderLog) > 0)
        {
            result.ErrMessage = "提交成功";
            result.Notes      = order.Jx;
            result.Success    = true;
            return(result);
        }

        WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "修改地址失败");

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
Example #6
0
    /// <summary>
    /// 抽奖
    /// </summary>
    /// <param name="context"></param>
    /// <returns></returns>
    public Model.ReturnValue GetJx(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();
        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog("session", "session不通过", context);
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;

        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "Openid格式异常:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        //获取未抽奖的唯一订单
        Model.OrderInfoModel order = OrderDal.GetModel(" and ordercode='" + orderSession.OrderKey + "' and states = 2");
        if (order.Id <= 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "抽奖:订单ID不存在:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        //如果中足球,完善地址信息
        if (order.Jx == "二等奖")
        {
            order.States = 3;//已抽奖,待完善地址信息
        }
        else
        {
            order.States = 0;
        }
        Model.OrderLogModel OrderLog = new Model.OrderLogModel();
        OrderLog.OId       = order.Id;
        OrderLog.Mob       = order.Mob;
        OrderLog.OrderCode = order.OrderCode;
        OrderLog.LStatus   = 9;//上传小票
        OrderLog.Notes     = order.FilesId + ";" + order.States;
        OrderLog.Status    = 1;
        OrderLog.UpTime    = DateTime.Now;

        if (OrderDal.UpdateInfo(order, OrderLog) > 0)
        {
            result.ErrMessage = "提交成功";
            result.Notes      = order.Jx;
            result.Success    = true;
            return(result);
        }

        WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "修改抽奖状态失败");

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
Example #7
0
    public Model.ReturnValue ProcessUpdateTypes(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog("session", "session不通过", context);
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Code   = orderSession.Code;

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "OpenId格式不正确:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证Code

        Model.OrderInfoModel orderdel = OrderDal.GetModelByCode(Code);
        if (orderdel.Id <= 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "Code不存在:" + Code);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        if (orderdel.Types != 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "订单Types异常:" + orderdel.Types);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }

        if (OpenId != orderdel.OpenId)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "订单OpenId不匹配-订单OpenId:" + orderdel.OpenId + "-OpenId:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        orderdel.Types = 1;

        if (OrderDal.UpdateTypes(orderdel) > 0)
        {
            result.ErrMessage = "提交成功";
            result.Success    = true;
            return(result);
        }

        ESLogMethod.ESLogInstance.Error("修改订单失败", Code);

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
Example #8
0
    public Model.ReturnValue ProcessUpdateInfo(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Code   = orderSession.Code;
        string Name   = context.Request["name"];
        string Mobile = context.Request["mob"];
        string Adds   = context.Request["adds"];

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("Openid格式异常", OpenId, Code);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile, Code);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证姓名
        if (Common.ValidateHelper.IsName(Name) == false || Name.Length > 12)
        {
            ESLogMethod.ESLogInstance.Debug("姓名错误", Name, Code);

            result.ErrMessage = "请填写正确姓名";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证地址

        if (Common.ValidateHelper.IsAddrs(Adds) == false || Adds.Length > 100)
        {
            ESLogMethod.ESLogInstance.Debug("地址错误", Adds, Code);

            result.ErrMessage = "请填写正确地址";
            result.Success    = false;
            return(result);
        }
        #endregion

        lock (_PrizeLock)
        {
            Model.OrderInfoModel orderdel = OrderDal.GetModelByCode(Code);

            #region 验证Code订单状态
            if (orderdel.Id <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("Code不存在", Code, Mobile);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }

            if (orderdel.Types != 0)
            {
                ESLogMethod.ESLogInstance.Debug("订单Types异常", orderdel.Types.ToString(), Code);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }

            if (OpenId != orderdel.OpenId)
            {
                ESLogMethod.ESLogInstance.Debug("订单OpenId不匹配", OpenId, Code);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }

            if (orderdel.States > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }
            #endregion

            orderdel.Name      = Name;
            orderdel.Adds      = Adds;
            orderdel.Types     = 1;
            orderdel.States    = 0;
            orderdel.PrizeCode = "";
            orderdel.Mob       = Mobile;

            #region 延时发放奖品

            if (WebFramework.PrivacyDemand.PrivacyMethod.PrivacyInstance.DelayedMethod(orderdel.Id))
            {
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }
            #endregion

            #region 调取资源库串码
            string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetEswAPI(0, 0, orderdel.Mob, orderdel.OrderCode);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;

            //}
            #endregion

            #region 调取优酷串码
            //string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetAPIClient(0, 0, orderdel.Mob, orderdel.OrderCode, WebFramework.GeneralMethodBase.GetKeyConfig(22).Val);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;
            //}
            #endregion

            Model.OrderLogModel OrderLog = new Model.OrderLogModel();
            OrderLog.OId       = orderdel.Id;
            OrderLog.Mob       = Mobile;
            OrderLog.OrderCode = orderdel.PrizeCode;
            OrderLog.LStatus   = 8;//上传信息
            OrderLog.Notes     = orderdel.Name + ";" + orderdel.Adds;
            OrderLog.Status    = 1;
            OrderLog.UpTime    = DateTime.Now;

            if (OrderDal.UpdateInfo(orderdel, OrderLog) > 0)
            {
                #region 大数据录入-请在订单完成时调用该方法
                if (orderdel.States == 1)
                {
                    WebFramework.OrderService.OrderMethod.OrderInstance.AddOrderApi(orderdel);
                }
                #endregion

                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }

            ESLogMethod.ESLogInstance.Error("修改订单失败", Code);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
    }
Example #9
0
    //生成订单
    public Model.ReturnValue ProcessCode(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");

            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Mobile = context.Request["mob"];
        //string Code = context.Request["code"];

        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("Openid格式异常", OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        string Ip     = Common.ClientIP.GetIp();
        int    FileId = orderSession.FileId;
        #region 检查IP
        if (Db.Security.IpAccessControlDal.CheckIpIsOK(false, CacheBase.IPSettingModel, Ip, "", "") == false)
        {
            ESLogMethod.ESLogInstance.Debug("IP模型超过限制", Ip);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region //验证激活码
        //if (Common.ValidateHelper.IsCode(Code, 13) == false)
        //{

        //    #region 登记IP
        //    Db.Security.IpAccessControlDal.CheckIpIsOK(true, CacheBase.IPSettingModel, Ip, Code, "激活码格式错误");
        //    #endregion

        //    ESLogMethod.ESLogInstance.Debug("激活码格式错误", Code, Mobile);

        //    result.ErrMessage = "请填写正确的激活码";
        //    result.Success = false;
        //    return result;
        //}
        #endregion

        lock (_SyncLock)
        {
            //Model.PassCodeInfoModel PassCodeModel = PassCodeDal.GetModelByCode(Code);

            #region //验证激活码状态
            //if (PassCodeModel.Id <= 0)
            //{
            //    #region 登记IP
            //    Db.Security.IpAccessControlDal.CheckIpIsOK(true, CacheBase.IPSettingModel, Ip, Code, "库无此激活码");
            //    #endregion

            //    ESLogMethod.ESLogInstance.Debug("激活码不存在", Code, Mobile);

            //    result.ErrMessage = "请填写正确的激活码";
            //    result.Success = false;
            //    return result;
            //}

            //if (PassCodeModel.StatusId == 1)
            //{
            //    Model.OrderInfoModel orderdel = OrderDal.GetModelByCode(Code);

            //    if (orderdel.Id <= 0)
            //    {
            //        #region 登记IP
            //        Db.Security.IpAccessControlDal.CheckIpIsOK(true, CacheBase.IPSettingModel, Ip, Code, "订单无此串码");
            //        #endregion

            //        ESLogMethod.ESLogInstance.Debug("激活码已激活无订单", Code, Mobile);

            //        result.ErrMessage = "请填写正确的激活码";
            //        result.Success = false;
            //        return result;
            //    }

            //    if (orderdel.OpenId != OpenId)
            //    {
            //        ESLogMethod.ESLogInstance.Debug("激活码已绑定其他微信号", OpenId, Code);

            //        result.ErrMessage = "激活码已绑定其他微信号";
            //        result.Success = false;
            //        return result;
            //    }

            //    result.ErrMessage = "提交成功";
            //    result.Success = true;
            //    return result;
            //}
            #endregion

            #region 检查手机号-openid-IP 参与次数是否超限
            string maxcont = WebFramework.OrderService.OrderMethod.OrderInstance.CheckMobOpidIp(Mobile, OpenId, Ip);

            if (string.IsNullOrEmpty(maxcont) == false)
            {
                ESLogMethod.ESLogInstance.Debug("参与次数超限", maxcont);

                result.ErrMessage = maxcont;
                result.Success    = false;
                return(result);
            }
            #endregion


            Model.FileInfoModel filedel = new Db.FileInfoDal().GetModel(FileId);
            if (filedel.Id <= 0)
            {
                WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "小票不存在:" + FileId);

                result.ErrMessage = "请上传小票";
                result.Success    = false;
                return(result);
            }

            #region 验证小票是否重复
            if (Common.TypeHelper.ObjectToBool(WebFramework.GeneralMethodBase.GetKeyConfig(11).Val, true))
            {
                int RepetCount = new Db.OrderInfoDal().CheckFilesRepeatCount(filedel.Hashdata);

                if (RepetCount > 0)
                {
                    filedel.States = -1;
                }
            }
            #endregion

            #region 抽奖-保存订单
            int goid = WebFramework.GeneralMethodBase.GenerationOrderId(0);

            #region 抽奖
            Model.AwardsStatisticsModel PrizeModel = WebFramework.GeneralMethodBase.GetPrize(3, 1);
            #endregion

            Model.OrderInfoModel model = new Model.OrderInfoModel();
            model.OrderCode  = WebFramework.GeneralMethodBase.CreateOrderCode(goid);
            model.Jx         = PrizeModel.AwardsName;
            model.Jp         = PrizeModel.PrizeName;
            model.DateStamp  = DateTime.Now.ToString("yyyyMMdd");
            model.Ip         = Ip;
            model.IpAddress  = string.Join("-", Common.ClientIP.GetArrayAdds(model.Ip));
            model.CreateTime = DateTime.Now;
            model.OpenId     = OpenId;
            model.Mob        = Mobile;

            model.FilesId = FileId;
            if (filedel.States == -1)
            {
                model.States = filedel.States;//-1表示已作废
            }
            else
            {
                model.States = 2;//2------>表示上传未抽奖
            }

            #region 抽取红包奖项
            Model.AwardsStatisticsModel RedPackPrizeModel = new Model.AwardsStatisticsModel();

            if (model.Jp == "微信红包")
            {
                //RedPackPrizeModel = WebFramework.GeneralMethodBase.GetPrize(7, 2);
                //model.HbOrderCode = WebFramework.GeneralMethodBase.CreateHbCode(goid);//创建红包单号
                //model.RedPackMoney = Common.TypeHelper.ObjectToInt(RedPackPrizeModel.PrizeName, 0);//获取红包金额
            }
            #endregion

            #region 节流
            //if (WebFramework.PrivacyDemand.PrivacyMethod.PrivacyInstance.Throttling())
            //{
            //    model.States = 1;
            //}
            #endregion

            //PassCodeModel.Mob = Mobile;
            //PassCodeModel.StatusId = 1;
            //PassCodeModel.ActiveTime = DateTime.Now;
            //PassCodeModel.OpenId = model.OpenId;

            Model.OrderLogModel mdlog = new Model.OrderLogModel();
            mdlog.OId       = 0;
            mdlog.OrderCode = model.OrderCode;
            mdlog.Mob       = Mobile;
            mdlog.UpTime    = DateTime.Now;
            mdlog.LStatus   = 0;
            mdlog.Status    = 1;
            mdlog.Notes     = "";

            int OrderId = 0;//插入订单ID

            //此方法不可替换更改,因与抽奖查询关联
            if (OrderDal.AddOrderInfo_UpdatePassCodeInfo_AddOrderLog(model, null, mdlog, PrizeModel.Id, RedPackPrizeModel.Id, ref OrderId) > 0)
            {
                #region 虚拟订单
                WebFramework.PrivacyDemand.PrivacyMethod.PrivacyInstance.AddFictitiousOrder(model);
                #endregion
                #region 发送自动作废短信
                if (model.States == -1)
                {
                    WebFramework.GeneralMethodBase.GetMsg(2, model.Mob, model.OrderCode);
                }
                #endregion
                orderSession.OrderKey = model.OrderCode;
                SessionMethod.SessionInstance.SetSession(orderSession);
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);;
            }
            #endregion
        }

        ESLogMethod.ESLogInstance.Error("添加订单失败", Mobile);

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
Example #10
0
    public Model.ReturnValue ProcessUpdateInfo(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");

            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Name   = context.Request["name"];
        string Mobile = context.Request["mob"];
        string Adds   = context.Request["adds"];

        int orderId = Common.TypeHelper.ObjectToInt(orderSession.Id, 0);

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("OpenId格式不正确", OpenId, Mobile);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile, OpenId);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证姓名
        if (Common.ValidateHelper.IsName(Name) == false || Name.Length > 12)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Name, Mobile);

            result.ErrMessage = "请填写正确姓名";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证地址

        if (Common.ValidateHelper.IsAddrs(Adds) == false || Adds.Length > 100)
        {
            ESLogMethod.ESLogInstance.Debug("地址错误", Adds, Mobile);

            result.ErrMessage = "请填写正确地址";
            result.Success    = false;
            return(result);
        }
        #endregion

        lock (_PrizeLock)
        {
            #region 验证订单Id
            Model.OrderInfoModel orderdel = oddal.GetModel(orderId);
            if (orderId <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("订单ID不存在", orderId.ToString(), Mobile);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            if (orderdel.Types > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = false;
                return(result);
            }
            if (OpenId != orderdel.OpenId)
            {
                ESLogMethod.ESLogInstance.Debug("订单OpenId不匹配", OpenId, orderId.ToString());

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            #endregion

            orderdel.Name      = Name;
            orderdel.Adds      = Adds;
            orderdel.Types     = 1;
            orderdel.States    = 0;
            orderdel.PrizeCode = "";
            orderdel.Mob       = Mobile;

            #region 调取资源库串码
            //string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetYHPsiAPI(0, 0, orderdel.Mob, orderdel.OrderCode);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;

            //}
            #endregion

            #region 调取优酷串码
            //string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetAPIClient(0, 0, orderdel.Mob, orderdel.OrderCode, WebFramework.GeneralMethodBase.GetKeyConfig(22).Val);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;
            //}
            #endregion

            Model.OrderLogModel OrderLog = new Model.OrderLogModel();
            OrderLog.OId       = orderdel.Id;
            OrderLog.Mob       = Mobile;
            OrderLog.OrderCode = orderdel.PrizeCode;
            OrderLog.LStatus   = 8;//上传信息
            OrderLog.Notes     = orderdel.Name + ";" + orderdel.Adds;
            OrderLog.Status    = 1;
            OrderLog.UpTime    = DateTime.Now;

            if (oddal.UpdateInfo(orderdel, OrderLog) > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }

            ESLogMethod.ESLogInstance.Error("修改订单失败", orderId.ToString(), Mobile);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
    }
Example #11
0
    public Model.ReturnValue ProcessUpload(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Mobile = context.Request["mob"];
        int    FileId = orderSession.FileId;
        string Ip     = Common.ClientIP.GetIp();

        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("Openid格式异常", OpenId, Mobile);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        lock (_SyncLock)
        {
            #region 验证小票
            Model.FileInfoModel filedel = new Db.FileInfoDal().GetModel(FileId);
            if (filedel.Id <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("小票不存在", FileId.ToString(), Mobile);

                result.ErrMessage = "请上传小票";
                result.Success    = false;
                return(result);
            }

            #region 验证小票是否重复
            if (Common.TypeHelper.ObjectToBool(WebFramework.GeneralMethodBase.GetKeyConfig(11).Val, true))
            {
                int RepetCount = new Db.OrderInfoDal().CheckFilesRepeatCount(filedel.Hashdata);

                if (RepetCount > 0)
                {
                    filedel.States = -1;
                }
            }
            #endregion
            #endregion

            #region 检查是否有中奖未完善信息订单

            //Model.OrderInfoModel Nomobdel = oddal.GetModel(string.Format(" Mob='{0}' and Types=0 and Jx<>'参与奖' and States=0", mob));
            //if (Nomobdel.Id > 0)
            //{
            //    orderSession.Id = Nomobdel.Id;

            //    returnErro(context, "true", "提交成功", "");
            //    context.Response.End();
            //    return;
            //}
            #endregion

            #region 检查手机号-openid-IP 参与次数是否超限
            string maxcont = WebFramework.OrderService.OrderMethod.OrderInstance.CheckMobOpidIp(Mobile, OpenId, Ip);

            if (string.IsNullOrEmpty(maxcont) == false)
            {
                ESLogMethod.ESLogInstance.Debug("参与总数超限", maxcont);

                result.ErrMessage = maxcont;
                result.Success    = false;
                return(result);
            }
            #endregion

            #region 抽奖-保存订单
            int goid = WebFramework.GeneralMethodBase.GenerationOrderId(0);

            #region 抽奖
            Model.AwardsStatisticsModel PrizeModel = WebFramework.GeneralMethodBase.GetPrize(7, 1);
            #endregion

            Model.OrderInfoModel model = new Model.OrderInfoModel();

            model.Jx         = PrizeModel.AwardsName;
            model.OrderCode  = WebFramework.GeneralMethodBase.CreateOrderCode(goid);
            model.Jp         = PrizeModel.PrizeName;
            model.States     = filedel.States;
            model.DateStamp  = DateTime.Now.ToString("yyyyMMdd");
            model.Ip         = Ip;
            model.IpAddress  = string.Join("-", Common.ClientIP.GetArrayAdds(model.Ip));
            model.CreateTime = DateTime.Now;
            model.OpenId     = OpenId;
            model.Mob        = Mobile;
            model.FilesId    = FileId;

            #region 抽取红包奖项
            Model.AwardsStatisticsModel RedPackPrizeModel = new Model.AwardsStatisticsModel();
            if (model.Jp == "微信红包")
            {
                //RedPackPrizeModel = WebFramework.GeneralMethodBase.GetPrize(7, 2);
                //model.HbOrderCode = WebFramework.GeneralMethodBase.CreateHbCode(goid);//创建红包单号
                //model.RedPackMoney = Common.TypeHelper.ObjectToInt(RedPackPrizeModel.PrizeName, 0);//获取红包金额
            }
            #endregion

            int OrderId = 0;

            //此方法不可替换更改,因与抽奖查询关联
            if (oddal.AddOrderInfo_UpdatePassCodeInfo_AddOrderLog(model, null, null, PrizeModel.Id, RedPackPrizeModel.Id, ref OrderId) > 0)
            {
                #region 发送自动作废短信
                if (model.States == -1)
                {
                    WebFramework.GeneralMethodBase.GetMsg(2, model.Mob, model.OrderCode);
                }
                #endregion

                #region OCR预录
                if (filedel != null)
                {
                    WebFramework.OrderService.OrderMethod.OrderInstance.OcrRecorded(model.OrderCode, filedel.Hashdata, filedel.FileName);
                }
                #endregion

                orderSession.Id = OrderId;
                WebFramework.SessionManage.SessionMethod.SessionInstance.SetSession(orderSession);

                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }
            #endregion
        }

        ESLogMethod.ESLogInstance.Error("添加订单失败", Mobile);

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
Example #12
0
    public Model.ReturnValue ProcessUploadFiles(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        int    FileId = orderSession.FileId;

        int orderId = Common.TypeHelper.ObjectToInt(orderSession.Id, 0);

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("OpenId格式不正确", OpenId, orderId.ToString());

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证小票
        Model.FileInfoModel filedel = new Db.FileInfoDal().GetModel(FileId);
        if (filedel.Id <= 0)
        {
            ESLogMethod.ESLogInstance.Debug("小票不存在", FileId.ToString(), orderId.ToString());

            result.ErrMessage = "请上传小票";
            result.Success    = false;
            return(result);
        }

        #region 验证小票是否重复
        if (Common.TypeHelper.ObjectToBool(WebFramework.GeneralMethodBase.GetKeyConfig(11).Val, true))
        {
            int RepetCount = new Db.OrderInfoDal().CheckFilesRepeatCount(filedel.Hashdata);

            if (RepetCount > 0)
            {
                filedel.States = -1;
            }
        }
        #endregion
        #endregion

        lock (_PrizeLock)
        {
            #region 验证订单Id
            Model.OrderInfoModel orderdel = oddal.GetModel(orderId);
            if (orderId <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("订单ID不存在", orderId.ToString());

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            if (orderdel.FilesId > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = false;
                return(result);
            }
            if (OpenId != orderdel.OpenId)
            {
                ESLogMethod.ESLogInstance.Debug("OpenId与订单不匹配", OpenId, orderId.ToString());

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            #endregion

            orderdel.FilesId = FileId;
            orderdel.States  = filedel.States;

            Model.OrderLogModel OrderLog = new Model.OrderLogModel();
            OrderLog.OId       = orderdel.Id;
            OrderLog.Mob       = orderdel.Mob;
            OrderLog.OrderCode = orderdel.OrderCode;
            OrderLog.LStatus   = 9;//上传小票
            OrderLog.Notes     = orderdel.FilesId + ";" + orderdel.States;
            OrderLog.Status    = 1;
            OrderLog.UpTime    = DateTime.Now;

            if (oddal.UpdateFiles(orderdel, OrderLog) > 0)
            {
                #region 发送自动作废短信
                if (orderdel.States == -1)
                {
                    WebFramework.GeneralMethodBase.GetMsg(2, orderdel.Mob, orderdel.OrderCode);
                }
                #endregion

                #region OCR预录
                if (filedel != null)
                {
                    WebFramework.OrderService.OrderMethod.OrderInstance.OcrRecorded(orderdel.OrderCode, filedel.Hashdata, filedel.FileName);
                }
                #endregion

                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }

            ESLogMethod.ESLogInstance.Error("修改订单失败", orderId.ToString());

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
    }