/// <summary> /// 商家批量审核通过(只审核待审核状态的数据) /// </summary> /// <UpdateBy>zhaohailong</UpdateBy> /// <UpdateTime>20150625</UpdateTime> /// <param name="withwardIds"></param> /// <returns></returns> public JsonResult BatchWithdrawAuditOk(string withwardIds) { bool hasError = false; bool hasSuccess = false; string totalMsg = "审核成功"; if (!string.IsNullOrEmpty(withwardIds)) { string[] ids = withwardIds.Split('#'); Dictionary <string, string> errorResult = new Dictionary <string, string>(); foreach (string item in ids) { string[] realids = item.Split(','); var businessWithdrawLog = new BusinessWithdrawLog() { Operator = UserContext.Current.Name, Remark = "商户提款申请单审核通过", Status = BusinessWithdrawFormStatus.Allow.GetHashCode(), WithwardId = Convert.ToInt64(realids[0]) }; try { bool reg = iBusinessFinanceProvider.BusinessWithdrawAudit(businessWithdrawLog); if (reg == false) { hasError = true; errorResult.Add(realids[1], ""); } else { hasSuccess = true; } } catch (Exception ex) { hasError = true; errorResult.Add(realids[1], ex.Message); } } if (hasError) { totalMsg = ""; string[] error = errorResult.Where(p => p.Value == "").Select(p => p.Key).ToArray(); if (error != null && error.Length > 0) { totalMsg = "以下单号审核失败,请重试!\n" + string.Join("\n", error); } string excepptionMsg = errorResult.Where(p => p.Value != "").Select(p => p.Value).FirstOrDefault(); if (!string.IsNullOrEmpty(excepptionMsg)) { string[] exceptionIDs = errorResult.Where(p => p.Value != "").Select(p => p.Key).ToArray(); totalMsg += string.Format("\n以下单号审核失败:{0}!\n{1}\n", excepptionMsg, string.Join("\n", exceptionIDs)); } } } return(Json(new ResultModel(hasSuccess, totalMsg), JsonRequestBehavior.DenyGet)); }
/// <summary> /// 商户提现申请单确认打款 /// danny-20150511 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool BusinessWithdrawPayOk(BusinessWithdrawLog model) { string sql = string.Format(@" UPDATE BusinessWithdrawForm SET [Status] = @Status, Payer=@Operator, PayTime=getdate() 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("@Id", model.WithwardId); return(DbHelper.ExecuteNonQuery(SuperMan_Write, sql, parm) > 0); }
/// <summary> /// 审核商户提现申请单 /// danny-20150511 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool BusinessWithdrawAudit(BusinessWithdrawLog model) { bool isBussinessIDValid = clienterDao.IsBussinessOrClienterValidByID(0, model.WithwardId); if (isBussinessIDValid) { return(businessFinanceDao.BusinessWithdrawAudit(model)); } throw new Exception("提款单对应的商户已经被取消资格,请联系客服"); }
public JsonResult WithdrawPayOk(string withwardId) { var businessWithdrawLog = new BusinessWithdrawLog() { Operator = UserContext.Current.Name, Remark = "商户提款申请单确认打款", Status = BusinessWithdrawFormStatus.Success.GetHashCode(), WithwardId = Convert.ToInt64(withwardId) }; bool reg = iBusinessFinanceProvider.BusinessWithdrawPayOk(businessWithdrawLog); return(Json(new ResultModel(reg, reg ? "确认打款成功!" : "确认打款失败!"), JsonRequestBehavior.DenyGet)); }
/// <summary> /// 增加一条记录 /// </summary> /// <param name="businessWithdrawLog">参数实体</param> /// <returns></returns> public long Insert(BusinessWithdrawLog businessWithdrawLog) { const string insertSql = @" insert into BusinessWithdrawLog(WithwardId,Status,Remark,Operator) values(@WithwardId,@Status,@Remark,@Operator) select @@IDENTITY"; IDbParameters dbParameters = DbHelper.CreateDbParameters(); dbParameters.AddWithValue("WithwardId", businessWithdrawLog.WithwardId); //提现单ID dbParameters.AddWithValue("Status", businessWithdrawLog.Status); //操作后状态 dbParameters.AddWithValue("Remark", businessWithdrawLog.Remark); //备注 dbParameters.AddWithValue("Operator", businessWithdrawLog.Operator); //操作人 object result = DbHelper.ExecuteScalar(SuperMan_Write, insertSql, dbParameters); return(ParseHelper.ToLong(result)); }
/// <summary> /// 根据ID获取对象 /// </summary> public BusinessWithdrawLog GetById(long id) { BusinessWithdrawLog model = new BusinessWithdrawLog(); const string querysql = @" select Id,WithwardId,Status,Remark,Operator,OperatTime from BusinessWithdrawLog (nolock) where Id=@Id "; IDbParameters dbParameters = DbHelper.CreateDbParameters(); dbParameters.AddWithValue("Id", id); DataTable dt = DataTableHelper.GetTable(DbHelper.ExecuteDataset(SuperMan_Read, querysql, dbParameters)); if (DataTableHelper.CheckDt(dt)) { model = DataTableHelper.ConvertDataTableList <BusinessWithdrawLog>(dt)[0]; } return(model); }
public JsonResult WithdrawAuditOk(string withwardId, string withwardNo) { var businessWithdrawLog = new BusinessWithdrawLog() { Operator = UserContext.Current.Name, Remark = "商户提款申请单审核通过", Status = BusinessWithdrawFormStatus.Allow.GetHashCode(), WithwardId = Convert.ToInt64(withwardId) }; try { bool reg = iBusinessFinanceProvider.BusinessWithdrawAudit(businessWithdrawLog); return(Json(new ResultModel(true, reg ? "审核通过!" : "以下单号审核失败,请重试!\n" + withwardNo), JsonRequestBehavior.DenyGet)); } catch (Exception ex) { return(Json(new ResultModel(false, "以下单号审核失败:" + ex.Message + "!\n" + withwardNo), JsonRequestBehavior.DenyGet)); } }
/// <summary> /// 商户提现申请单确认打款 /// danny-20150511 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool BusinessWithdrawPayOk(BusinessWithdrawLog model) { bool reg = false; using (IUnitOfWork tran = EdsUtilOfWorkFactory.GetUnitOfWorkOfEDS()) { if (businessFinanceDao.BusinessWithdrawPayOk(model)) { if (businessFinanceDao.ModifyBusinessBalanceRecordStatus(model.WithwardId.ToString())) { if (businessFinanceDao.ModifyBusinessTotalAmount(model.WithwardId.ToString())) { reg = true; tran.Complete(); } } } } return(reg); }
/// <summary> /// 更新一条记录 /// </summary> /// <param name="businessWithdrawLog">参数实体</param> public void Update(BusinessWithdrawLog businessWithdrawLog) { }