|
|
@@ -62,7 +62,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 提现记录列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(UserCashRecord data, string OpCode, string StatusSelect, string QueryCountSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(UserCashRecord data, string OpCode, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
@@ -88,11 +88,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and TradeType=" + data.TradeType;
|
|
|
}
|
|
|
- //提交到代付状态
|
|
|
- if (!string.IsNullOrEmpty(QueryCountSelect))
|
|
|
- {
|
|
|
- condition += " and QueryCount=" + QueryCountSelect;
|
|
|
- }
|
|
|
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
@@ -362,8 +357,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
|
|
|
decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
|
|
|
decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
|
|
|
- account.WithdrawAmount += userCashRecord.TradeAmount;
|
|
|
- account.FreezeAmount -= userCashRecord.TradeAmount;
|
|
|
decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
|
|
|
decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
|
|
|
decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
|
|
|
@@ -574,485 +567,69 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- #region 盟主提现记录列表
|
|
|
+ #region 拒绝
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 根据条件查询盟主提现记录列表
|
|
|
+ /// 拒绝
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public IActionResult LeaderIndex(UserCashRecord data, string right)
|
|
|
+ public IActionResult Reduce(string right, int Id = 0)
|
|
|
{
|
|
|
ViewBag.RightInfo = RightInfo;
|
|
|
ViewBag.right = right;
|
|
|
|
|
|
+ UserCashRecord editData = opdb.UserCashRecord.FirstOrDefault(m => m.Id == Id) ?? new UserCashRecord();
|
|
|
+ ViewBag.data = editData;
|
|
|
|
|
|
- string Condition = "";
|
|
|
- Condition += "CashOrderNo:\"" + data.CashOrderNo + "\",";
|
|
|
- Condition += "TradeType:\"" + data.TradeType + "\",";
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(Condition))
|
|
|
- {
|
|
|
- Condition = Condition.TrimEnd(',');
|
|
|
- Condition = ", where: {" + Condition + "}";
|
|
|
- }
|
|
|
- ViewBag.Condition = Condition;
|
|
|
return View();
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region 根据条件查询盟主提现记录列表
|
|
|
+ #region 拒绝
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 盟主提现记录列表
|
|
|
+ /// 拒绝
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
+ public string ReduceDo(int Id, string Remark)
|
|
|
{
|
|
|
-
|
|
|
- Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
- Fields.Add("CashOrderNo", "1"); //提现单号
|
|
|
-
|
|
|
- string condition = " and Status>-1 and TradeType=3";
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(MakerCode))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
|
|
|
- }
|
|
|
- //创客名称
|
|
|
- if (!string.IsNullOrEmpty(RealName))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
- // condition += " and UserId in (select Id from Users where RealName='" + RealName + "')";
|
|
|
- }
|
|
|
- //提现状态
|
|
|
- if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
- {
|
|
|
- condition += " and Status=" + StatusSelect;
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(data.CashOrderNo))
|
|
|
- {
|
|
|
- condition += " and CashOrderNo='" + data.CashOrderNo + "'";
|
|
|
- }
|
|
|
- if (data.TradeType > 0)
|
|
|
- {
|
|
|
- condition += " and TradeType=" + data.TradeType;
|
|
|
- }
|
|
|
- //提交到代付状态
|
|
|
- if (!string.IsNullOrEmpty(QueryCountSelect))
|
|
|
- {
|
|
|
- condition += " and QueryCount=" + QueryCountSelect;
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
- {
|
|
|
- string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
- // string start = datelist[0];
|
|
|
- // string end = datelist[1];
|
|
|
- // condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
- var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
|
|
|
- var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
|
|
|
- var check = opdb.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType == 3);
|
|
|
- var checks = opdb.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType == 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var sId = opdb.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType == 3).Min(m => m.Id);
|
|
|
- condition += " and Id >=" + sId;
|
|
|
- }
|
|
|
- if (checks)
|
|
|
+ AddSysLog(Id, "UserCashRecord", "Reduce");
|
|
|
+ UserCashRecord edit = opdb.UserCashRecord.FirstOrDefault(m => m.Id == Id);
|
|
|
+ if (edit != null)
|
|
|
+ {
|
|
|
+ edit.Status = 2;
|
|
|
+ edit.Remark = Remark;
|
|
|
+ edit.UpdateMan = SysUserName;
|
|
|
+ UserAccount account = opdb.UserAccount.FirstOrDefault(m => m.Id == edit.UserId);
|
|
|
+ if (account != null)
|
|
|
{
|
|
|
- var eId = opdb.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType == 3).Max(m => m.Id);
|
|
|
- condition += " and Id <=" + eId;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // var start = DateTime.Now.ToString("yyyy-MM") + "-01";
|
|
|
- // var end = Convert.ToDateTime(start).AddMonths(1);
|
|
|
- // condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<'" + end + " 00:00:00'";
|
|
|
-
|
|
|
- var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
|
|
|
- var check = opdb.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType == 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var minId = opdb.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType == 3).Min(m => m.Id);
|
|
|
- var Info = function.ReadInstance("/WritePage/UserCashRecord/LeaderUserCashRecord.txt");
|
|
|
- if (string.IsNullOrEmpty(Info.ToString()))
|
|
|
+ decimal TradeAmount = edit.TradeAmount;
|
|
|
+ decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
|
|
|
+ decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
|
|
|
+ decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
|
|
|
+ account.BalanceAmount += TradeAmount;//返回余额
|
|
|
+ decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
|
|
|
+ decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
|
|
|
+ decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
|
|
|
+ opdb.UserAccountRecord.Add(new UserAccountRecord()
|
|
|
{
|
|
|
- function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
|
|
|
- condition += " and Id >=" + minId;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and Id >=" + Convert.ToInt32(Info);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and Id =0";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).IndexData("UserCashRecord", Fields, "Id desc", "0", page, limit, condition);
|
|
|
- List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
- foreach (Dictionary<string, object> dic in diclist)
|
|
|
- {
|
|
|
- int UserId = int.Parse(dic["UserId"].ToString());
|
|
|
- var user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Models.Users();
|
|
|
- dic["MakerCode"] = user.MakerCode;
|
|
|
- dic["RealName"] = user.RealName;
|
|
|
- dic["TradeType"] = RelationClassForConst.GetTradeTypeInfo(int.Parse(dic["TradeType"].ToString()));
|
|
|
- int Status = int.Parse(dic["Status"].ToString());
|
|
|
- if (Status == 0) dic["StatusName"] = "处理中";
|
|
|
- if (Status == 1) dic["StatusName"] = "成功";
|
|
|
- if (Status == 2) dic["StatusName"] = "失败";
|
|
|
-
|
|
|
- int QueryCount = int.Parse(dic["QueryCount"].ToString());
|
|
|
- if (QueryCount == 0) dic["LockName"] = "待提交";
|
|
|
- if (QueryCount == 1) dic["LockName"] = "已提交";
|
|
|
- }
|
|
|
- Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
-
|
|
|
- string WaitAmount = "0.00";//待处理总金额
|
|
|
- string SuccessAmount = "0.00";//提现成功总金额
|
|
|
- string FailAmount = "0.00";//提现失败总金额
|
|
|
- DataTable dt = OtherMySqlConn.dtable("SELECT SUM(if(Status=0,TradeAmount,0)),SUM(if(Status=1,TradeAmount,0)),SUM(if(Status=2,TradeAmount,0)) FROM UserCashRecord where 1=1 " + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- WaitAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
|
|
|
- SuccessAmount = decimal.Parse(function.CheckNum(dt.Rows[0][1].ToString())).ToString("f2");
|
|
|
- FailAmount = decimal.Parse(function.CheckNum(dt.Rows[0][2].ToString())).ToString("f2");
|
|
|
- }
|
|
|
- other.Add("WaitAmount", WaitAmount);
|
|
|
- other.Add("SuccessAmount", SuccessAmount);
|
|
|
- other.Add("FailAmount", FailAmount);
|
|
|
- obj.Add("other", other);
|
|
|
- return Json(obj);
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 导出盟主Excel
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 导出Excel
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus)
|
|
|
- {
|
|
|
- Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
- Fields.Add("CashOrderNo", "1"); //提现单号
|
|
|
- Fields.Add("CreateDate", "3"); //创建时间
|
|
|
-
|
|
|
- string condition = " and Status>-1 and TradeType=3";
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(MakerCode))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
|
|
|
- }
|
|
|
- //创客名称
|
|
|
- if (!string.IsNullOrEmpty(RealName))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
- }
|
|
|
- //提现状态
|
|
|
- if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
- {
|
|
|
- condition += " and Status=" + StatusSelect;
|
|
|
- }
|
|
|
- //提交到代付状态
|
|
|
- if (!string.IsNullOrEmpty(PayStatus))
|
|
|
- {
|
|
|
- int QueryCount = int.Parse(function.CheckInt(PayStatus));
|
|
|
- if (QueryCount == 2)
|
|
|
- {
|
|
|
- QueryCount = 0;
|
|
|
- }
|
|
|
- condition += " and QueryCount=" + QueryCount;
|
|
|
- }
|
|
|
-
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).IndexData("UserCashRecord", Fields, "Id desc", "0", 1, 20000, condition, "CashOrderNo,UserId,IdCardNo,ActualTradeAmount,Remark,Status,QueryCount,CreateDate", false);
|
|
|
- List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
- foreach (Dictionary<string, object> dic in diclist)
|
|
|
- {
|
|
|
- int UserId = int.Parse(dic["UserId"].ToString());
|
|
|
- var user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Models.Users();
|
|
|
- dic["MakerCode"] = user.MakerCode;
|
|
|
- dic["RealName"] = user.RealName;
|
|
|
- dic["Mobile"] = user.Mobile;
|
|
|
- dic["SettleBankName"] = user.SettleBankName;
|
|
|
- dic["SettleBankCardNo"] = user.SettleBankCardNo;
|
|
|
- dic.Remove("UserId");
|
|
|
- // dic["TradeType"] = RelationClassForConst.GetTradeTypeInfo(int.Parse(dic["TradeType"].ToString()));
|
|
|
- int Status = int.Parse(dic["Status"].ToString());
|
|
|
- if (Status == 0) dic["StatusName"] = "处理中";
|
|
|
- if (Status == 1) dic["StatusName"] = "成功";
|
|
|
- if (Status == 2) dic["StatusName"] = "失败";
|
|
|
- dic.Remove("Status");
|
|
|
-
|
|
|
- int QueryCount = int.Parse(dic["QueryCount"].ToString());
|
|
|
- if (QueryCount == 0) dic["LockName"] = "待提交";
|
|
|
- if (QueryCount == 1) dic["LockName"] = "已提交";
|
|
|
- dic.Remove("QueryCount");
|
|
|
- }
|
|
|
-
|
|
|
- Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
- result.Add("Status", "1");
|
|
|
- result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
|
|
|
- result.Add("Obj", diclist);
|
|
|
- Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
- ReturnFields.Add("CashOrderNo", "提现单号");
|
|
|
- ReturnFields.Add("MakerCode", "创客编号");
|
|
|
- ReturnFields.Add("RealName", "灵工姓名");
|
|
|
- ReturnFields.Add("Mobile", "手机号");
|
|
|
- ReturnFields.Add("IdCardNo", "身份证号");
|
|
|
- ReturnFields.Add("SettleBankName", "开户行名称");
|
|
|
- ReturnFields.Add("SettleBankCardNo", "开户行卡号");
|
|
|
- ReturnFields.Add("ActualTradeAmount", "发佣金额(单位:元)");
|
|
|
- ReturnFields.Add("LockName", "代付标记");
|
|
|
- ReturnFields.Add("StatusName", "状态");
|
|
|
- ReturnFields.Add("Remark", "备注");
|
|
|
- ReturnFields.Add("CreateDate", "创建时间");
|
|
|
-
|
|
|
- result.Add("Fields", ReturnFields);
|
|
|
- AddSysLog("0", "UserCashRecord", "ExportExcel");
|
|
|
- return Json(result);
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
-
|
|
|
- #region 助利宝提现记录列表
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 根据条件查询助利宝提现记录列表
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- public IActionResult HelpProfitIndex(UserCashRecord data, string right)
|
|
|
- {
|
|
|
- ViewBag.RightInfo = RightInfo;
|
|
|
- ViewBag.right = right;
|
|
|
-
|
|
|
-
|
|
|
- string Condition = "";
|
|
|
- Condition += "CashOrderNo:\"" + data.CashOrderNo + "\",";
|
|
|
- Condition += "TradeType:\"" + data.TradeType + "\",";
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(Condition))
|
|
|
- {
|
|
|
- Condition = Condition.TrimEnd(',');
|
|
|
- Condition = ", where: {" + Condition + "}";
|
|
|
- }
|
|
|
- ViewBag.Condition = Condition;
|
|
|
- return View();
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
-
|
|
|
- #region
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 助利宝提现记录列表
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- public JsonResult HelpProfitIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
- {
|
|
|
-
|
|
|
- Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
- Fields.Add("CashOrderNo", "1"); //提现单号
|
|
|
-
|
|
|
- string condition = " and Status>-1 and TradeType=4";
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(MakerCode))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
|
|
|
- }
|
|
|
- //创客名称
|
|
|
- if (!string.IsNullOrEmpty(RealName))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
- // condition += " and UserId in (select Id from Users where RealName='" + RealName + "')";
|
|
|
- }
|
|
|
- //提现状态
|
|
|
- if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
- {
|
|
|
- condition += " and Status=" + StatusSelect;
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(data.CashOrderNo))
|
|
|
- {
|
|
|
- condition += " and CashOrderNo='" + data.CashOrderNo + "'";
|
|
|
- }
|
|
|
- if (data.TradeType > 0)
|
|
|
- {
|
|
|
- condition += " and TradeType=" + data.TradeType;
|
|
|
- }
|
|
|
- //提交到代付状态
|
|
|
- if (!string.IsNullOrEmpty(QueryCountSelect))
|
|
|
- {
|
|
|
- condition += " and QueryCount=" + QueryCountSelect;
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
- {
|
|
|
- string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
- string start = datelist[0];
|
|
|
- string end = datelist[1];
|
|
|
- condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
- }
|
|
|
-
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).IndexData("UserCashRecord", Fields, "Id desc", "0", page, limit, condition);
|
|
|
- List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
- foreach (Dictionary<string, object> dic in diclist)
|
|
|
- {
|
|
|
- int UserId = int.Parse(dic["UserId"].ToString());
|
|
|
- var user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Models.Users();
|
|
|
- dic["MakerCode"] = user.MakerCode;
|
|
|
- dic["RealName"] = user.RealName;
|
|
|
- dic["TradeType"] = RelationClassForConst.GetTradeTypeInfo(int.Parse(dic["TradeType"].ToString()));
|
|
|
- int Status = int.Parse(dic["Status"].ToString());
|
|
|
- if (Status == 0) dic["StatusName"] = "处理中";
|
|
|
- if (Status == 1) dic["StatusName"] = "成功";
|
|
|
- if (Status == 2) dic["StatusName"] = "失败";
|
|
|
-
|
|
|
- int QueryCount = int.Parse(dic["QueryCount"].ToString());
|
|
|
- if (QueryCount == 0) dic["LockName"] = "待提交";
|
|
|
- if (QueryCount == 1) dic["LockName"] = "已提交";
|
|
|
- }
|
|
|
- Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
-
|
|
|
- string WaitAmount = "0.00";//待处理总金额
|
|
|
- string SuccessAmount = "0.00";//提现成功总金额
|
|
|
- string FailAmount = "0.00";//提现失败总金额
|
|
|
- DataTable dt = OtherMySqlConn.dtable("SELECT SUM(if(Status=0,TradeAmount,0)),SUM(if(Status=1,TradeAmount,0)),SUM(if(Status=2,TradeAmount,0)) FROM UserCashRecord where 1=1 " + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- WaitAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
|
|
|
- SuccessAmount = decimal.Parse(function.CheckNum(dt.Rows[0][1].ToString())).ToString("f2");
|
|
|
- FailAmount = decimal.Parse(function.CheckNum(dt.Rows[0][2].ToString())).ToString("f2");
|
|
|
- }
|
|
|
- other.Add("WaitAmount", WaitAmount);
|
|
|
- other.Add("SuccessAmount", SuccessAmount);
|
|
|
- other.Add("FailAmount", FailAmount);
|
|
|
- obj.Add("other", other);
|
|
|
- return Json(obj);
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 导出助利宝Excel
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 导出Excel
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- public JsonResult HelpProfitExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus)
|
|
|
- {
|
|
|
- Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
- Fields.Add("CashOrderNo", "1"); //提现单号
|
|
|
- Fields.Add("CreateDate", "3"); //创建时间
|
|
|
-
|
|
|
- string condition = " and Status>-1 and TradeType=4";
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(MakerCode))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
|
|
|
- }
|
|
|
- //创客名称
|
|
|
- if (!string.IsNullOrEmpty(RealName))
|
|
|
- {
|
|
|
- condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
- }
|
|
|
- //提现状态
|
|
|
- if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
- {
|
|
|
- condition += " and Status=" + StatusSelect;
|
|
|
- }
|
|
|
- //提交到代付状态
|
|
|
- if (!string.IsNullOrEmpty(PayStatus))
|
|
|
- {
|
|
|
- int QueryCount = int.Parse(function.CheckInt(PayStatus));
|
|
|
- if (QueryCount == 2)
|
|
|
- {
|
|
|
- QueryCount = 0;
|
|
|
- }
|
|
|
- condition += " and QueryCount=" + QueryCount;
|
|
|
- }
|
|
|
-
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).IndexData("UserCashRecord", Fields, "Id desc", "0", 1, 20000, condition, "CashOrderNo,UserId,IdCardNo,ActualTradeAmount,Remark,Status,QueryCount,CreateDate", false);
|
|
|
- List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
- foreach (Dictionary<string, object> dic in diclist)
|
|
|
- {
|
|
|
- int UserId = int.Parse(dic["UserId"].ToString());
|
|
|
- var user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Models.Users();
|
|
|
- dic["MakerCode"] = user.MakerCode;
|
|
|
- dic["RealName"] = user.RealName;
|
|
|
- dic["Mobile"] = user.Mobile;
|
|
|
- dic["SettleBankName"] = user.SettleBankName;
|
|
|
- dic["SettleBankCardNo"] = user.SettleBankCardNo;
|
|
|
- dic.Remove("UserId");
|
|
|
- // dic["TradeType"] = RelationClassForConst.GetTradeTypeInfo(int.Parse(dic["TradeType"].ToString()));
|
|
|
- int Status = int.Parse(dic["Status"].ToString());
|
|
|
- if (Status == 0) dic["StatusName"] = "处理中";
|
|
|
- if (Status == 1) dic["StatusName"] = "成功";
|
|
|
- if (Status == 2) dic["StatusName"] = "失败";
|
|
|
- dic.Remove("Status");
|
|
|
-
|
|
|
- int QueryCount = int.Parse(dic["QueryCount"].ToString());
|
|
|
- if (QueryCount == 0) dic["LockName"] = "待提交";
|
|
|
- if (QueryCount == 1) dic["LockName"] = "已提交";
|
|
|
- dic.Remove("QueryCount");
|
|
|
- }
|
|
|
-
|
|
|
- Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
- result.Add("Status", "1");
|
|
|
- result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
|
|
|
- result.Add("Obj", diclist);
|
|
|
- Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
- ReturnFields.Add("CashOrderNo", "提现单号");
|
|
|
- ReturnFields.Add("MakerCode", "创客编号");
|
|
|
- ReturnFields.Add("RealName", "灵工姓名");
|
|
|
- ReturnFields.Add("Mobile", "手机号");
|
|
|
- ReturnFields.Add("IdCardNo", "身份证号");
|
|
|
- ReturnFields.Add("SettleBankName", "开户行名称");
|
|
|
- ReturnFields.Add("SettleBankCardNo", "开户行卡号");
|
|
|
- ReturnFields.Add("ActualTradeAmount", "发佣金额(单位:元)");
|
|
|
- ReturnFields.Add("LockName", "代付标记");
|
|
|
- ReturnFields.Add("StatusName", "状态");
|
|
|
- ReturnFields.Add("Remark", "备注");
|
|
|
- ReturnFields.Add("CreateDate", "创建时间");
|
|
|
-
|
|
|
- result.Add("Fields", ReturnFields);
|
|
|
- AddSysLog("0", "UserCashRecord", "ExportExcel");
|
|
|
- return Json(result);
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
-
|
|
|
- #region 提交代付平台
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 提交代付平台
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- public string Cash(string Id)
|
|
|
- {
|
|
|
- string[] idlist = Id.Split(new char[] { ',' });
|
|
|
- AddSysLog(Id, "UserCashRecord", "cash");
|
|
|
- opdb.SaveChanges();
|
|
|
- foreach (string subid in idlist)
|
|
|
- {
|
|
|
- int id = int.Parse(subid);
|
|
|
- UserCashRecord edit = opdb.UserCashRecord.FirstOrDefault(m => m.Id == id && m.QueryCount == 0);
|
|
|
- if (edit != null)
|
|
|
- {
|
|
|
- edit.QueryCount = 1;
|
|
|
- edit.UpdateDate = DateTime.Now;
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
+ UserId = edit.UserId, //创客
|
|
|
+ ChangeType = 6, //变动类型
|
|
|
+ ProductType = 99, //产品类型
|
|
|
+ ChangeAmount = TradeAmount, //变更金额
|
|
|
+ BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
|
|
|
+ AfterTotalAmount = AfterTotalAmount, //变更后总金额
|
|
|
+ BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
|
|
|
+ AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
|
|
|
+ BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
|
|
|
+ AfterBalanceAmount = AfterBalanceAmount, //变更后余额
|
|
|
+ });
|
|
|
opdb.SaveChanges();
|
|
|
- RedisDbconn.Instance.AddList("CashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
|
|
|
}
|
|
|
+
|
|
|
+ opdb.SaveChanges();
|
|
|
}
|
|
|
return "success";
|
|
|
}
|