Beispiel #1
0
        public void ProcessRequest(HttpContext context)
        {
            string id = context.Request["id"];

            if (string.IsNullOrEmpty(id))
            {
                apiResp.msg  = "ids不能为空,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            BindBankCard model = bllDistributionOffLine.GetBindBankCard(int.Parse(id));

            if (bllDistributionOffLine.GetCurrUserID() != model.UserId)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.InadequatePermissions;
                apiResp.msg  = "无权操作";
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            if (bllDistributionOffLine.Delete(model) > 0)
            {
                apiResp.msg    = "删除成功";
                apiResp.status = true;
            }
            else
            {
                apiResp.msg  = "删除出错";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            bllDistributionOffLine.ContextResponse(context, apiResp);
        }
Beispiel #2
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex               = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1;
            int    pageSize                = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 1;
            string keyWord                 = context.Request["keyword"];
            int    totalCount              = 0;
            List <BindBankCard> bankList   = bllDistributionOffLine.GetBindBankCardList(pageSize, pageIndex, keyWord, bllDistributionOffLine.GetCurrUserID(), out totalCount);
            List <dynamic>      returnList = new List <dynamic>();

            foreach (var item in bankList)
            {
                returnList.Add(new
                {
                    id           = item.AutoID,
                    account_name = item.AccountName,
                    bank_account = item.BankAccount,
                    bank_name    = item.BankName
                });
            }
            apiResp.result = new
            {
                list       = returnList,
                totalcount = totalCount
            };
            apiResp.status = true;
            bllDistributionOffLine.ContextResponse(context, apiResp);
        }
Beispiel #3
0
        public void ProcessRequest(HttpContext context)
        {
            string autoId = context.Request["id"];

            if (string.IsNullOrEmpty(autoId))
            {
                apiResp.msg  = "银行卡id为必填项,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            BindBankCard model = bllDistributionOffLine.GetBindBankCard(int.Parse(autoId));

            if (model.UserId != bllDistributionOffLine.GetCurrUserID())
            {
                apiResp.msg  = "无权操作";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.InadequatePermissions;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            if (model == null)
            {
                apiResp.msg  = "没有找到银行卡信息";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            apiResp.status = true;
            apiResp.result = new
            {
                id                      = model.AutoID,
                account_name            = model.AccountName,
                bank_account            = model.BankAccount,
                bank_name               = model.BankName,
                account_branch_name     = model.AccountBranchName,
                account_branch_province = model.AccountBranchProvince,
                account_branch_city     = model.AccountBranchCity,
                bank_code               = model.BankCode
            };
            bllDistributionOffLine.ContextResponse(context, apiResp);
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1; //页码
            int    pageSize  = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 10;  //页数
            string projectId = context.Request["project_id"];

            if (string.IsNullOrEmpty(projectId))
            {
                apiResp.msg  = "project_id为必填项,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bll.ContextResponse(context, apiResp);
                return;
            }
            int            totalCount = 0;
            var            logList    = bll.GetProJectLogList(pageSize, pageIndex, bll.GetCurrUserID(), projectId, bll.WebsiteOwner, out totalCount);
            List <dynamic> returnList = new List <dynamic>();

            foreach (var item in logList)
            {
                returnList.Add(new
                {
                    status              = item.Status,                       //状态
                    remark              = item.Remark,                       //备注
                    projectlog_time     = bll.GetTimeStamp(item.InsertDate), //时间
                    projectlog_time_str = item.InsertDate.ToString("yyyy-MM-dd HH:mm")
                });
            }
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = returnList
            };
            apiResp.status = true;
            apiResp.msg    = "ok";
            bll.ContextResponse(context, apiResp);
        }
Beispiel #5
0
        public void ProcessRequest(HttpContext context)
        {
            BLLJIMP.BLLDistributionOffLine bll = new BLLJIMP.BLLDistributionOffLine();
            BllPay    bllPay     = new BllPay();
            BLLWeixin bllWeixin  = new BLLWeixin();
            string    ids        = context.Request["ids"];
            string    moduleName = "积分";

            if (!string.IsNullOrWhiteSpace(context.Request["module_name"]))
            {
                moduleName = context.Request["module_name"];
            }

            int total = 0;

            if (string.IsNullOrWhiteSpace(ids))
            {
                apiResp.msg  = "请选中申请";
                apiResp.code = (int)APIErrCode.IsNotFound;
                bll.ContextResponse(context, apiResp);
                return;
            }
            var sourceList = bll.QueryWithdrawCashList(1, int.MaxValue, null, out total, "0", context.Request["type"], ids);

            if (sourceList.Count == 0)
            {
                apiResp.msg  = "选中的申请无待审核申请";
                apiResp.code = (int)APIErrCode.IsNotFound;
                bll.ContextResponse(context, apiResp);
                return;
            }

            string websiteOwner = bll.WebsiteOwner;
            string ip           = System.Web.HttpContext.Current.Request.UserHostAddress;
            int    snum         = 0;

            foreach (var p in sourceList)
            {
                UserInfo pu = bllUser.GetUserInfo(p.UserId, websiteOwner);
                if (pu == null || string.IsNullOrWhiteSpace(pu.WXOpenId))
                {
                    apiResp.status = snum > 0;
                    apiResp.msg    = string.Format("编号:{0},审核出错,用户信息有误", p.AutoID);
                    apiResp.code   = (int)APIErrCode.OperateFail;
                    bll.ContextResponse(context, apiResp);
                    return;
                }
                //通知
                BLLJIMP.Model.SystemNotice notice = new BLLJIMP.Model.SystemNotice();
                notice.Ncontent     = string.Format("申请提现通过审核,编号:{0}", p.AutoID);
                notice.UserId       = currentUserInfo.UserID;
                notice.Receivers    = pu.UserID;
                notice.SendType     = 2;
                notice.Title        = "申请提现通过审核";
                notice.NoticeType   = 1;
                notice.WebsiteOwner = websiteOwner;
                notice.InsertTime   = DateTime.Now;

                BLLTransaction tran   = new BLLTransaction();
                bool           result = bll.Update(p, string.Format("Status=2,LastUpdateDate=getdate()"), string.Format("AutoID={0}", p.AutoID), tran) > 0;
                if (!result)
                {
                    tran.Rollback();
                    apiResp.status = snum > 0;
                    apiResp.msg    = string.Format("编号:{0},审核出错", p.AutoID);
                    apiResp.code   = snum > 0 ? (int)APIErrCode.IsSuccess : (int)APIErrCode.OperateFail;
                    bll.ContextResponse(context, apiResp);
                    return;
                }
                string msg = "";
                if (bllPay.WeixinTransfers(p.AutoID.ToString(), p.RealAmount, pu.WXOpenId, ip, out msg, "提现"))
                {
                    //发送微信模板消息
                    bllWeixin.SendTemplateMessageNotifyComm(pu, "您提现的佣金已经到账", string.Format("提现金额:{0}元。请查看微信钱包", p.RealAmount));
                    //发送微信模板消息

                    //发送通知
                    notice.SerialNum = bllUser.GetGUID(TransacType.SendSystemNotice);
                    bll.Add(notice);
                    //发送通知
                }
                else//打款失败
                {
                    tran.Rollback();
                    apiResp.status = snum > 0;
                    apiResp.msg    = string.Format("编号:{0},微信打款出错 : {1}", p.AutoID, msg);
                    apiResp.code   = snum > 0 ? (int)APIErrCode.IsSuccess : (int)APIErrCode.OperateFail;
                    bll.ContextResponse(context, apiResp);
                    return;
                }

                tran.Commit();
                snum++;
            }

            if (snum == 0)
            {
                apiResp.code = (int)APIErrCode.OperateFail;
                apiResp.msg  = "审核失败";
            }
            else
            {
                apiResp.status = true;
                apiResp.code   = (int)APIErrCode.IsSuccess;
                apiResp.msg    = string.Format("审核完成");
            }
            bll.ContextResponse(context, apiResp);
        }
Beispiel #6
0
        public void ProcessRequest(HttpContext context)
        {
            string ids        = context.Request["ids"];
            string moduleName = "积分";

            if (!string.IsNullOrWhiteSpace(context.Request["module_name"]))
            {
                moduleName = context.Request["module_name"];
            }
            int total = 0;

            if (string.IsNullOrWhiteSpace(ids))
            {
                apiResp.msg  = "请选中申请";
                apiResp.code = (int)APIErrCode.IsNotFound;
                bll.ContextResponse(context, apiResp);
                return;
            }
            var        sourceList   = bll.QueryWithdrawCashList(1, int.MaxValue, null, out total, "0", context.Request["type"], ids);
            string     websiteOwner = bll.WebsiteOwner;
            List <int> idList       = new List <int>();

            foreach (var p in sourceList)
            {
                UserInfo pu = bllUser.GetUserInfo(p.UserId, websiteOwner);

                //积分明细
                UserScoreDetailsInfo scoreModel = new UserScoreDetailsInfo();
                if (pu != null)
                {
                    scoreModel.AddNote      = string.Format("申请提现未通过审核,返还{0}{1},编号:{2}", p.Score, moduleName, p.AutoID);
                    scoreModel.AddTime      = DateTime.Now;
                    scoreModel.Score        = p.Score;
                    scoreModel.UserID       = p.UserId;
                    scoreModel.ScoreType    = "RefuseWithdrawCash";
                    scoreModel.TotalScore   = pu.TotalScore + p.Score;
                    scoreModel.WebSiteOwner = websiteOwner;
                }

                //通知
                BLLJIMP.Model.SystemNotice notice = new BLLJIMP.Model.SystemNotice();
                if (pu != null)
                {
                    notice.Ncontent     = scoreModel.AddNote;
                    notice.UserId       = currentUserInfo.UserID;
                    notice.Receivers    = pu.UserID;
                    notice.SendType     = 2;
                    notice.Title        = "申请提现未通过审核";
                    notice.NoticeType   = 1;
                    notice.WebsiteOwner = websiteOwner;
                    notice.InsertTime   = DateTime.Now;
                }

                BLLTransaction tran   = new BLLTransaction();
                bool           result = bll.Update(p, string.Format("Status=3,LastUpdateDate=getdate()"), string.Format("AutoID={0}", p.AutoID), tran) > 0;
                if (!result)
                {
                    idList.Add(p.AutoID);
                    tran.Rollback();
                    continue;
                }
                if (pu != null)
                {
                    result = bll.Update(pu, string.Format("TotalScore=TotalScore+{0}", p.Score), string.Format("UserID='{0}' And WebsiteOwner='{1}'", pu.UserID, websiteOwner), tran) > 0;
                    if (!result)
                    {
                        idList.Add(p.AutoID);
                        tran.Rollback();
                        continue;
                    }

                    result = bll.Add(scoreModel, tran);
                    if (!result)
                    {
                        idList.Add(p.AutoID);
                        tran.Rollback();
                        continue;
                    }
                    notice.SerialNum = bllUser.GetGUID(TransacType.SendSystemNotice);
                    result           = bll.Add(notice, tran);
                    if (!result)
                    {
                        idList.Add(p.AutoID);
                        tran.Rollback();
                        continue;
                    }
                }
                tran.Commit();
            }

            apiResp.status = true;
            apiResp.code   = (int)APIErrCode.IsSuccess;
            if (idList.Count == 0)
            {
                apiResp.msg = "处理完成";
            }
            else
            {
                apiResp.msg = string.Format("处理完成,编号[{0}]处理失败", ZentCloud.Common.MyStringHelper.ListToStr(idList, "", ","));
            }
            bll.ContextResponse(context, apiResp);
        }