コード例 #1
0
        public JsonResult ApplyWithDrawList(ApplyWithDrawInfo.ApplyWithDrawStatus capitalType, string withdrawno, string user, int page, int rows)
        {
            IMemberCapitalService memberCapitalService = ServiceHelper.Create <IMemberCapitalService>();
            IMemberService        memberService        = ServiceHelper.Create <IMemberService>();
            long?nullable = null;

            if (!string.IsNullOrWhiteSpace(user))
            {
                nullable = new long?((memberService.GetMemberByName(user) ?? new UserMemberInfo()
                {
                    Id = 0
                }).Id);
            }
            ApplyWithDrawQuery applyWithDrawQuery = new ApplyWithDrawQuery()
            {
                memberId       = nullable,
                PageSize       = rows,
                PageNo         = page,
                withDrawStatus = new ApplyWithDrawInfo.ApplyWithDrawStatus?(capitalType)
            };
            ApplyWithDrawQuery nullable1 = applyWithDrawQuery;

            if (!string.IsNullOrWhiteSpace(withdrawno))
            {
                nullable1.withDrawNo = new long?(long.Parse(withdrawno));
            }
            PageModel <ApplyWithDrawInfo>    applyWithDraw       = memberCapitalService.GetApplyWithDraw(nullable1);
            IEnumerable <ApplyWithDrawModel> applyWithDrawModels = applyWithDraw.Models.ToList().Select <ApplyWithDrawInfo, ApplyWithDrawModel>((ApplyWithDrawInfo e) =>
            {
                string description    = e.ApplyStatus.ToDescription();
                UserMemberInfo member = memberService.GetMember(e.MemId);
                return(new ApplyWithDrawModel()
                {
                    Id = e.Id,
                    ApplyAmount = e.ApplyAmount,
                    ApplyStatus = e.ApplyStatus,
                    ApplyStatusDesc = description,
                    ApplyTime = e.ApplyTime.ToString(),
                    NickName = e.NickName,
                    MemberName = member.UserName,
                    ConfirmTime = e.ConfirmTime.ToString(),
                    MemId = e.MemId,
                    OpUser = e.OpUser,
                    PayNo = e.PayNo,
                    PayTime = e.PayTime.ToString(),
                    Remark = e.Remark,
                    WithdrawType = e.WithdrawType,
                    Myaccount = e.Myaccount,
                    UserInfo = e.Myaccount + '(' + e.NickName + ')'
                });
            });
            DataGridModel <ApplyWithDrawModel> dataGridModel = new DataGridModel <ApplyWithDrawModel>()
            {
                rows  = applyWithDrawModels,
                total = applyWithDraw.Total
            };

            return(Json(dataGridModel));
        }
コード例 #2
0
        public JsonResult ApplyWithDrawList(int page, int rows)
        {
            IMemberCapitalService memberCapitalService = ServiceHelper.Create <IMemberCapitalService>();
            ApplyWithDrawQuery    applyWithDrawQuery   = new ApplyWithDrawQuery()
            {
                memberId = new long?(base.CurrentUser.Id),
                PageSize = rows,
                PageNo   = page,
                Sort     = "ApplyTime"
            };
            PageModel <ApplyWithDrawInfo>    applyWithDraw       = memberCapitalService.GetApplyWithDraw(applyWithDrawQuery);
            IEnumerable <ApplyWithDrawModel> applyWithDrawModels = applyWithDraw.Models.ToList().Select <ApplyWithDrawInfo, ApplyWithDrawModel>((ApplyWithDrawInfo e) =>
            {
                string empty = string.Empty;
                if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.PayFail || e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.WaitConfirm)
                {
                    empty = "提现中";
                }
                else if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.Refuse)
                {
                    empty = "提现失败";
                }
                else if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess)
                {
                    empty = "提现成功";
                }
                return(new ApplyWithDrawModel()
                {
                    Id = e.Id,
                    ApplyAmount = e.ApplyAmount,
                    ApplyStatus = e.ApplyStatus,
                    ApplyStatusDesc = empty,
                    ApplyTime = e.ApplyTime.ToString()
                });
            });
            DataGridModel <ApplyWithDrawModel> dataGridModel = new DataGridModel <ApplyWithDrawModel>()
            {
                rows  = applyWithDrawModels,
                total = applyWithDraw.Total
            };

            return(Json(dataGridModel));
        }
コード例 #3
0
        public JsonResult ApplyWithDrawListByUser(long userid, UserWithdrawType?applyType, int page, int rows)
        {
            IMemberCapitalService service = this._iMemberCapitalService;
            ApplyWithDrawQuery    query   = new ApplyWithDrawQuery
            {
                memberId  = new long?(userid),
                ApplyType = applyType,
                PageSize  = rows,
                PageNo    = page
            };
            ObsoletePageModel <ApplyWithDrawInfo> applyWithDraw = service.GetApplyWithDraw(query);
            IEnumerable <ApplyWithDrawModel>      enumerable    = applyWithDraw.Models.ToList <ApplyWithDrawInfo>().Select <ApplyWithDrawInfo, ApplyWithDrawModel>(delegate(ApplyWithDrawInfo e)
            {
                string str = string.Empty;
                if ((e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.PayFail) || (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.WaitConfirm))
                {
                    str = "提现中";
                }
                else if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.Refuse)
                {
                    str = "提现失败";
                }
                else if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess)
                {
                    str = "提现成功";
                }
                return(new ApplyWithDrawModel {
                    Id = e.Id, ApplyAmount = e.ApplyAmount, ApplyStatus = e.ApplyStatus, ApplyStatusDesc = str, ApplyTime = e.ApplyTime.ToString(), ApplyType = e.ApplyType
                });
            });
            DataGridModel <ApplyWithDrawModel> data = new DataGridModel <ApplyWithDrawModel>
            {
                rows  = enumerable,
                total = applyWithDraw.Total
            };

            return(base.Json(data));
        }
コード例 #4
0
        public JsonResult ApplyWithDrawList(ApplyWithDrawInfo.ApplyWithDrawStatus capitalType, UserWithdrawType?applyType, string withdrawno, string user, int page, int rows)
        {
            IMemberCapitalService memberCapitalService = this._iMemberCapitalService;
            IMemberService        memberService        = this._iMemberService;
            long?nullable = new long?();

            if (!string.IsNullOrWhiteSpace(user))
            {
                UserMemberInfo userMemberInfo = memberService.GetMemberByName(user);
                if (userMemberInfo == null)
                {
                    userMemberInfo = new UserMemberInfo()
                    {
                        Id = 0L
                    }
                }
                ;
                nullable = new long?(userMemberInfo.Id);
            }
            ApplyWithDrawQuery applyWithDrawQuery = new ApplyWithDrawQuery();

            applyWithDrawQuery.memberId       = nullable;
            applyWithDrawQuery.ApplyType      = applyType;
            applyWithDrawQuery.PageSize       = rows;
            applyWithDrawQuery.PageNo         = page;
            applyWithDrawQuery.withDrawStatus = new ApplyWithDrawInfo.ApplyWithDrawStatus?(capitalType);
            ApplyWithDrawQuery query = applyWithDrawQuery;

            if (!string.IsNullOrWhiteSpace(withdrawno))
            {
                query.withDrawNo = new long?(long.Parse(withdrawno));
            }
            ObsoletePageModel <ApplyWithDrawInfo> applyWithDraw = memberCapitalService.GetApplyWithDraw(query);
            IEnumerable <ApplyWithDrawModel>      enumerable    = Enumerable.Select <ApplyWithDrawInfo, ApplyWithDrawModel>((IEnumerable <ApplyWithDrawInfo>)Enumerable.ToList <ApplyWithDrawInfo>((IEnumerable <ApplyWithDrawInfo>)applyWithDraw.Models), (Func <ApplyWithDrawInfo, ApplyWithDrawModel>)(e =>
            {
                string str            = EnumHelper.ToDescription((Enum)e.ApplyStatus);
                UserMemberInfo member = memberService.GetMember(e.MemId);
                return(new ApplyWithDrawModel()
                {
                    Id = e.Id,
                    ApplyAmount = e.ApplyAmount,
                    ApplyStatus = e.ApplyStatus,
                    ApplyStatusDesc = str,
                    ApplyTime = e.ApplyTime.ToString(),
                    NickName = e.NickName,
                    MemberName = member.UserName,
                    ConfirmTime = e.ConfirmTime.ToString(),
                    MemId = e.MemId,
                    OpUser = e.OpUser,
                    PayNo = e.PayNo,
                    PayTime = e.PayTime.ToString(),
                    Remark = e.Remark
                });
            }));

            return(this.Json((object)new DataGridModel <ApplyWithDrawModel>()
            {
                rows = enumerable,
                total = applyWithDraw.Total
            }));
        }
コード例 #5
0
 /// <summary>
 /// 取申请提现记录
 /// </summary>
 /// <param name="MemId"></param>
 /// <returns></returns>
 public static ObsoletePageModel <ApplyWithDrawInfo> GetApplyWithDraw(ApplyWithDrawQuery query)
 {
     return(_iMemberCapitalService.GetApplyWithDraw(query));
 }
コード例 #6
0
        public JsonResult ConfirmPay(long id, ApplyWithDrawInfo.ApplyWithDrawStatus status, string remark)
        {
            JsonResult            jsonResult;
            IMemberCapitalService memberCapitalService = ServiceHelper.Create <IMemberCapitalService>();

            if (status == ApplyWithDrawInfo.ApplyWithDrawStatus.Refuse)
            {
                memberCapitalService.RefuseApplyWithDraw(id, status, base.CurrentManager.UserName, remark);
                return(Json(new { success = true, msg = "审核成功!" }));
            }
            ApplyWithDrawQuery applyWithDrawQuery = new ApplyWithDrawQuery()
            {
                withDrawNo = new long?(id),
                PageNo     = 1,
                PageSize   = 1
            };
            ApplyWithDrawQuery      applyWithDrawQuery1 = applyWithDrawQuery;
            ApplyWithDrawInfo       applyWithDrawInfo   = memberCapitalService.GetApplyWithDraw(applyWithDrawQuery1).Models.FirstOrDefault();
            Plugin <IPaymentPlugin> plugin = (
                from e in PluginsManagement.GetPlugins <IPaymentPlugin>(true)
                where e.PluginInfo.PluginId.ToLower().Contains("weixin")
                select e).FirstOrDefault <Plugin <IPaymentPlugin> >();

            if (plugin == null)
            {
                return(Json(new { success = false, msg = "未找到支付插件" }));
            }
            try
            {
                EnterprisePayPara enterprisePayPara = new EnterprisePayPara()
                {
                    amount       = applyWithDrawInfo.ApplyAmount,
                    check_name   = false,
                    openid       = applyWithDrawInfo.OpenId,
                    out_trade_no = applyWithDrawInfo.Id.ToString(),
                    desc         = "提现"
                };
                PaymentInfo       paymentInfo        = plugin.Biz.EnterprisePay(enterprisePayPara);
                ApplyWithDrawInfo applyWithDrawInfo1 = new ApplyWithDrawInfo()
                {
                    PayNo       = paymentInfo.TradNo,
                    ApplyStatus = ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess,
                    Remark      = plugin.PluginInfo.Description,
                    PayTime     = new DateTime?((paymentInfo.TradeTime.HasValue ? paymentInfo.TradeTime.Value : DateTime.Now)),
                    ConfirmTime = new DateTime?(DateTime.Now),
                    OpUser      = base.CurrentManager.UserName,
                    ApplyAmount = applyWithDrawInfo.ApplyAmount,
                    Id          = applyWithDrawInfo.Id
                };
                memberCapitalService.ConfirmApplyWithDraw(applyWithDrawInfo1);
                return(Json(new { success = true, msg = "付款成功" }));
            }
            catch (Exception exception)
            {
                Log.Error(string.Concat("调用企业付款接口异常:", exception.Message));
                ApplyWithDrawInfo applyWithDrawInfo2 = new ApplyWithDrawInfo()
                {
                    ApplyStatus = ApplyWithDrawInfo.ApplyWithDrawStatus.PayFail,
                    Remark      = plugin.PluginInfo.Description,
                    ConfirmTime = new DateTime?(DateTime.Now),
                    OpUser      = base.CurrentManager.UserName,
                    ApplyAmount = applyWithDrawInfo.ApplyAmount,
                    Id          = applyWithDrawInfo.Id
                };
                memberCapitalService.ConfirmApplyWithDraw(applyWithDrawInfo2);
                jsonResult = Json(new { success = false, msg = "付款接口异常" });
            }
            return(jsonResult);
        }