|
|
@@ -7,6 +7,7 @@ using System.Web;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Diagnostics;
|
|
|
using System.Linq;
|
|
|
+using System.Data;
|
|
|
using System.Threading.Tasks;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
@@ -51,44 +52,32 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 商户退押金申请记录列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(MerchantDepositReturns data, string MerchantIdMerRealName, string MerchantIdMerchantMobile, string MerchantIdMerIdcardNo, string UserIdRealName, string UserIdMakerCode, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(MerchantDepositReturns data, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
- Fields.Add("CreateDate", "3"); //时间
|
|
|
Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
- Fields.Add("OperateMan", "1"); //操作人
|
|
|
+ Fields.Add("SeoKeyword", "1"); //退押订单号
|
|
|
|
|
|
string condition = " and Status>-1";
|
|
|
- //商户商户真实姓名
|
|
|
- if (!string.IsNullOrEmpty(MerchantIdMerRealName))
|
|
|
- {
|
|
|
- condition += " and MerchantId in (select MerchantId from PosMerchantInfoForMerRealName where MerRealName='" + MerchantIdMerRealName + "')";
|
|
|
- }
|
|
|
- //商户商户手机号
|
|
|
- if (!string.IsNullOrEmpty(MerchantIdMerchantMobile))
|
|
|
- {
|
|
|
- condition += " and MerchantId in (select MerchantId from PosMerchantInfoForMerchantMobile where MerchantMobile='" + MerchantIdMerchantMobile + "')";
|
|
|
- }
|
|
|
- //商户商户身份证号
|
|
|
- if (!string.IsNullOrEmpty(MerchantIdMerIdcardNo))
|
|
|
- {
|
|
|
- condition += " and MerchantId in (select MerchantId from PosMerchantInfoForMerIdcardNo where MerIdcardNo='" + MerchantIdMerIdcardNo + "')";
|
|
|
- }
|
|
|
- //创客真实姓名
|
|
|
- if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+
|
|
|
+ //提现状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ //创建时间
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ 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 AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", page, limit, condition);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", 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)
|
|
|
{
|
|
|
@@ -99,7 +88,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
dic.Remove("MerchantId");
|
|
|
- dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
|
|
|
+ int Status = int.Parse(dic["Status"].ToString());
|
|
|
+ if (Status == 0) dic["StatusName"] = "待处理";
|
|
|
+ if (Status == 3) dic["StatusName"] = "处理中";
|
|
|
+ if (Status == 1) dic["StatusName"] = "成功";
|
|
|
+ if (Status == 2) dic["StatusName"] = "失败";
|
|
|
+ if (Status == 4) dic["StatusName"] = "通过";
|
|
|
+ if (Status == 5) dic["StatusName"] = "未通过";
|
|
|
//创客
|
|
|
int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
@@ -145,7 +140,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- int Id = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Add("MerchantDepositReturns", Fields, 0);
|
|
|
+ int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("MerchantDepositReturns", Fields, 0);
|
|
|
AddSysLog(data.Id.ToString(), "MerchantDepositReturns", "add");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -188,7 +183,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MerchantDepositReturns", Fields, data.Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MerchantDepositReturns", Fields, data.Id);
|
|
|
AddSysLog(data.Id.ToString(), "MerchantDepositReturns", "update");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -212,7 +207,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", -1);
|
|
|
- new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MerchantDepositReturns", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MerchantDepositReturns", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -236,7 +231,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 1);
|
|
|
- new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MerchantDepositReturns", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MerchantDepositReturns", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -259,7 +254,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 0);
|
|
|
- new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MerchantDepositReturns", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MerchantDepositReturns", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -274,7 +269,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// <param name="Id"></param>
|
|
|
public string Sort(int Id, int Sort)
|
|
|
{
|
|
|
- new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Sort("MerchantDepositReturns", Sort, Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("MerchantDepositReturns", Sort, Id);
|
|
|
|
|
|
AddSysLog(Id.ToString(), "MerchantDepositReturns", "sort");
|
|
|
return "success";
|
|
|
@@ -293,18 +288,60 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
for (int i = 1; i < list.Count; i++)
|
|
|
{
|
|
|
JsonData dr = list[i];
|
|
|
-
|
|
|
- db.MerchantDepositReturns.Add(new MerchantDepositReturns()
|
|
|
+ int Id = int.Parse(dr[0].ToString()); // 记录Id
|
|
|
+ string SeoDescription = dr[1].ToString(); // 退押订单编号
|
|
|
+ string AlipayAccountNo = dr[2].ToString(); // 支付宝帐号
|
|
|
+ string ReturnAmount = dr[3].ToString(); // 退还金额
|
|
|
+ var s = dr[4].ToString();
|
|
|
+ int Status = int.Parse(dr[4].ToString()); // 审核结果
|
|
|
+ var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.Id == Id && m.Status == 0) ?? new MerchantDepositReturns();
|
|
|
+ if (Status == 1)
|
|
|
+ {
|
|
|
+ Status = 4;
|
|
|
+ }
|
|
|
+ else if (Status == 2)
|
|
|
{
|
|
|
- CreateDate = DateTime.Now,
|
|
|
- UpdateDate = DateTime.Now,
|
|
|
+ Status = 5;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Status = 0;
|
|
|
+ }
|
|
|
+ merchantDepositReturns.Status = Status;
|
|
|
+ merchantDepositReturns.UpdateDate = DateTime.Now;
|
|
|
+ merchantDepositReturns.SeoTitle = SysUserName + "-" + SysRealName;
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
|
|
|
- });
|
|
|
- db.SaveChanges();
|
|
|
+ #region 提交代付平台
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 提交代付平台
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string Cash(string Id)
|
|
|
+ {
|
|
|
+ string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ var Ids = "";
|
|
|
+ AddSysLog(Id, "UserCashRecord", "cash");
|
|
|
+ db.SaveChanges();
|
|
|
+ foreach (string subid in idlist)
|
|
|
+ {
|
|
|
+ int id = int.Parse(subid);
|
|
|
+ var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.Id == id && m.Status == 4) ?? new MerchantDepositReturns();
|
|
|
+ Ids += Id + ",";
|
|
|
}
|
|
|
- AddSysLog("0", "MerchantDepositReturns", "Import");
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("UPDATE MerchantDepositReturns SET `Status`=3 WHERE Id IN(" + Ids.TrimEnd(',') + ")");
|
|
|
+ string text = string.Format("商户押金退还,记录Id: '" + Ids.TrimEnd(',') + "',操作人: '" + SysUserName + "_" + SysRealName + "',Time'" + DateTime.Now + "'");
|
|
|
+ function.WriteLog(text, "商户押金退还");
|
|
|
+ RedisDbconn.Instance.AddList("ToAlipayAccountQueue", Ids.TrimEnd(','));
|
|
|
return "success";
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 导出Excel
|
|
|
@@ -313,43 +350,30 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult ExportExcel(MerchantDepositReturns data, string MerchantIdMerRealName, string MerchantIdMerchantMobile, string MerchantIdMerIdcardNo, string UserIdRealName, string UserIdMakerCode)
|
|
|
+ public JsonResult ExportExcel(MerchantDepositReturns data, string StatusSelect, string CreateDateData)
|
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
- Fields.Add("CreateDate", "3"); //时间
|
|
|
Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
- Fields.Add("OperateMan", "1"); //操作人
|
|
|
-
|
|
|
+ Fields.Add("OrderNo", "1"); //退押订单号
|
|
|
|
|
|
string condition = " and Status>-1";
|
|
|
- //商户商户真实姓名
|
|
|
- if (!string.IsNullOrEmpty(MerchantIdMerRealName))
|
|
|
- {
|
|
|
- condition += " and MerchantId in (select MerchantId from PosMerchantInfoForMerRealName where MerRealName='" + MerchantIdMerRealName + "')";
|
|
|
- }
|
|
|
- //商户商户手机号
|
|
|
- if (!string.IsNullOrEmpty(MerchantIdMerchantMobile))
|
|
|
- {
|
|
|
- condition += " and MerchantId in (select MerchantId from PosMerchantInfoForMerchantMobile where MerchantMobile='" + MerchantIdMerchantMobile + "')";
|
|
|
- }
|
|
|
- //商户商户身份证号
|
|
|
- if (!string.IsNullOrEmpty(MerchantIdMerIdcardNo))
|
|
|
- {
|
|
|
- condition += " and MerchantId in (select MerchantId from PosMerchantInfoForMerIdcardNo where MerIdcardNo='" + MerchantIdMerIdcardNo + "')";
|
|
|
- }
|
|
|
- //创客真实姓名
|
|
|
- if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+
|
|
|
+ //提现状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ //创建时间
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ 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 AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "MerchantId,AlipayAccountNo,ReturnAmount,OperateMan,UserId", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "Id,MerchantId,AlipayAccountNo,ReturnAmount,UserId", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
@@ -360,7 +384,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
dic.Remove("MerchantId");
|
|
|
- dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
|
|
|
+ // dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
|
|
|
//创客
|
|
|
int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
@@ -371,18 +395,19 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
|
|
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
- result.Add("Status", "1");
|
|
|
+ result.Add("Status", "0");
|
|
|
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("MerchantIdMerRealName", "商户商户真实姓名");
|
|
|
- ReturnFields.Add("MerchantIdMerchantMobile", "商户商户手机号");
|
|
|
- ReturnFields.Add("MerchantIdMerIdcardNo", "商户商户身份证号");
|
|
|
+ ReturnFields.Add("Id", "记录ID");
|
|
|
+ // ReturnFields.Add("MerchantIdMerRealName", "商户真实姓名");
|
|
|
+ // ReturnFields.Add("MerchantIdMerchantMobile", "商户手机号");
|
|
|
+ // ReturnFields.Add("MerchantIdMerIdcardNo", "商户身份证号");
|
|
|
+ ReturnFields.Add("SeoDescription", "退押订单号");
|
|
|
ReturnFields.Add("AlipayAccountNo", "支付宝账号");
|
|
|
ReturnFields.Add("ReturnAmount", "返还金额");
|
|
|
- ReturnFields.Add("OperateMan", "操作人");
|
|
|
- ReturnFields.Add("UserIdRealName", "创客真实姓名");
|
|
|
- ReturnFields.Add("UserIdMakerCode", "创客编号");
|
|
|
+ // ReturnFields.Add("UserIdRealName", "创客真实姓名");
|
|
|
+ // ReturnFields.Add("UserIdMakerCode", "创客编号");
|
|
|
|
|
|
result.Add("Fields", ReturnFields);
|
|
|
AddSysLog("0", "MerchantDepositReturns", "ExportExcel");
|