Example #1
0
        //提现
        public ResultInfo <string> OutMoney(PutForwardRecordEntity entity)
        {
            ResultInfo <string> resultInfo = new ResultInfo <string>();

            if (entity.userid == 0 || entity.money > 10000)
            {
                resultInfo.ResultCode = EmResultDescribe.参数错误;
                resultInfo.ResultData = "请输入有效金额";
            }
            //判断余额是否充足
            AccountEntity acc = noAwardBLL.GetAccountInfo(entity.userid);

            if (entity.money > acc.cash)
            {
                resultInfo.ResultCode = EmResultDescribe.参数错误;
                resultInfo.ResultData = "账户余额不足";
            }
            else
            {
                decimal TXmoney = entity.money * (decimal)0.2;
                SortedDictionary <string, object> resDic = DoOutMoney(TXmoney, acc.openId);
                if (resDic["result_code"].ToString() == "SUCCESS")
                {
                    var         date = DateTime.Now.ToString();
                    Account_Log log  = new Account_Log();
                    log.update_time        = resDic["payment_time"].ToString();
                    log.pay_no             = resDic["payment_no"].ToString();
                    log.pay_way            = "公司商户";
                    log.user_id            = entity.userid;
                    log.account_id         = Convert.ToInt32(acc.accountId);
                    log.collection_account = "微信零钱";
                    log.cash = entity.money;
                    noAwardBLL.UpdateAccountInfo(log);
                    resultInfo.ResultCode = EmResultDescribe.正确返回结果;
                    resultInfo.ResultData = "提现成功";
                }
                else
                {
                    resultInfo.ResultCode = EmResultDescribe.缺少必要信息;
                    resultInfo.ResultData = resDic["return_msg"].ToString();
                }
            }
            return(resultInfo);
        }
Example #2
0
        public ResultInfo <PutForwardRecordList> GetPutForwardRecordList(PutForwardRecordEntity putForward)
        {
            ResultInfo <PutForwardRecordList> result = new ResultInfo <PutForwardRecordList>();

            try
            {
                PutForwardRecordList list = new PutForwardRecordList();
                list.datas        = AccountProfitBLL.Instance.GetPutForwardRecordList(putForward.userid);
                list.totalamount  = list.datas.Sum(c => c.amount) == 0?"0.00": list.datas.Sum(c => c.amount).ToString("F2");
                result.ResultData = list;
                result.ResultCode = EmResultDescribe.OK;
            }
            catch (Exception ex)
            {
                result.ResultData = null;
                result.ResultCode = EmResultDescribe.系统错误;
                LogMessage("获取我的提现记录/AccountProfit/GetPutForwardRecordList", "putForward:" + JsonConvert.SerializeObject(result), JsonConvert.SerializeObject(result.ResultData), ex.Message);
            }
            return(result);
        }