Exemplo n.º 1
0
        /// <summary>
        /// 商户提现申请单打款失败
        /// danny-20150511
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool BusinessWithdrawPayFailed(BusinessWithdrawLogModel model)
        {
            string        sql  = string.Format(@" 
UPDATE BusinessWithdrawForm
 SET    [Status] = @Status,
		Payer=@Operator,
		PayTime=getdate(),
        PayFailedReason=@PayFailedReason
OUTPUT
  Inserted.Id,
  Inserted.[Status],
  @Remark,
  @Operator,
  getdate()
INTO BusinessWithdrawLog
  ([WithwardId],
  [Status],
  [Remark],
  [Operator],
  [OperatTime])
 WHERE  Id = @Id");
            IDbParameters parm = DbHelper.CreateDbParameters();

            parm.AddWithValue("@Status", model.Status);
            parm.AddWithValue("@Operator", model.Operator);
            parm.AddWithValue("@Remark", model.Remark);
            parm.AddWithValue("@PayFailedReason", model.PayFailedReason);
            parm.AddWithValue("@Id", model.WithwardId);
            return(DbHelper.ExecuteNonQuery(SuperMan_Write, sql, parm) > 0);
        }
Exemplo n.º 2
0
        public JsonResult WithdrawAuditRefuse(string withwardId, string auditFailedReason)
        {
            var businessWithdrawLog = new BusinessWithdrawLogModel()
            {
                Operator          = UserContext.Current.Name,
                Remark            = "商户提款申请单审核拒绝-" + auditFailedReason,
                Status            = BusinessWithdrawFormStatus.TurnDown.GetHashCode(),
                WithwardId        = Convert.ToInt64(withwardId),
                AuditFailedReason = auditFailedReason
            };
            bool reg = iBusinessFinanceProvider.BusinessWithdrawAuditRefuse(businessWithdrawLog);

            return(Json(new ResultModel(reg, reg ? "审核拒绝成功!" : "审核拒绝失败!"), JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 3
0
        public JsonResult WithdrawPayFailed(string withwardId, string payFailedReason)
        {
            var businessWithdrawLog = new BusinessWithdrawLogModel()
            {
                Operator        = UserContext.Current.Name,
                Remark          = "商户提款申请单打款失败-" + payFailedReason,
                Status          = BusinessWithdrawFormStatus.Error.GetHashCode(),
                WithwardId      = Convert.ToInt64(withwardId),
                PayFailedReason = payFailedReason
            };
            bool reg = iBusinessFinanceProvider.BusinessWithdrawPayFailed(businessWithdrawLog);

            return(Json(new ResultModel(reg, reg ? "打款失败操作提交成功!" : "打款失败操作提交失败!"), JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 商户提现失败后返现
        /// danny-20150511
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool BusinessWithdrawReturn(BusinessWithdrawLogModel model)
        {
            string        sql  = string.Format(@" 
insert into BusinessBalanceRecord
            ([BusinessId]
           ,[Amount]
           ,[Status]
           ,[Balance]
           ,[RecordType]
           ,[Operator]
           ,[OperateTime]
           ,[WithwardId]
           ,[RelationNo]
           ,[Remark])
select      bbr.[BusinessId]
           ,-ISNULL(bbr.[Amount],0) Amount
           ,@NewStatus [Status]
           ,-ISNULL(bbr.[Amount],0)+ISNULL(b.BalancePrice,0) Balance
           ,@NewRecordType [RecordType]
           ,@Operator
           ,getdate() OperateTime
           ,bbr.[WithwardId]
           ,bbr.[RelationNo]
           ,@Remark
 from BusinessBalanceRecord bbr (nolock)
    join business b (nolock) on b.Id=bbr.BusinessId
 where bbr.WithwardId=@WithwardId and bbr.Status=@Status and bbr.RecordType=@RecordType;");
            IDbParameters parm = DbHelper.CreateDbParameters();

            parm.AddWithValue("@Operator", model.Operator);
            parm.AddWithValue("@Remark", model.Remark);
            parm.AddWithValue("@WithwardId", model.WithwardId);
            parm.AddWithValue("@Status", BusinessBalanceRecordStatus.Tradeing);
            parm.AddWithValue("@RecordType", BusinessBalanceRecordRecordType.WithdrawApply);
            parm.AddWithValue("@NewStatus", BusinessBalanceRecordStatus.Success);
            parm.AddWithValue("@NewRecordType", model.Status == BusinessWithdrawFormStatus.TurnDown.GetHashCode() ?BusinessBalanceRecordRecordType.WithdrawRefuse :BusinessBalanceRecordRecordType.PayFailure);
            return(DbHelper.ExecuteNonQuery(SuperMan_Write, sql, parm) > 0);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 商户提现申请单打款失败
        /// danny-20150511
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool BusinessWithdrawPayFailed(BusinessWithdrawLogModel model)
        {
            bool reg = false;

            using (IUnitOfWork tran = EdsUtilOfWorkFactory.GetUnitOfWorkOfEDS())
            {
                if (businessFinanceDao.BusinessWithdrawReturn(model))
                {
                    if (businessFinanceDao.BusinessWithdrawPayFailed(model))
                    {
                        if (businessFinanceDao.ModifyBusinessBalanceRecordStatus(model.WithwardId.ToString()))
                        {
                            if (businessFinanceDao.ModifyBusinessAmountInfo(model.WithwardId.ToString()))
                            {
                                reg = true;
                                tran.Complete();
                            }
                        }
                    }
                }
            }
            return(reg);
        }