|
|
@@ -96,7 +96,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//提交到代付状态
|
|
|
if (!string.IsNullOrEmpty(QueryCountSelect))
|
|
|
{
|
|
|
- if (QueryCountSelect == "0")
|
|
|
+ if(QueryCountSelect == "0")
|
|
|
{
|
|
|
condition += " and QueryCount=" + QueryCountSelect;
|
|
|
}
|
|
|
@@ -137,6 +137,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
|
|
|
condition += " and Id >=" + minId;
|
|
|
}
|
|
|
+ else if (minId != int.Parse(Info))
|
|
|
+ {
|
|
|
+ function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
|
|
|
+ condition += " and Id >=" + minId;
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
condition += " and Id >=" + Convert.ToInt32(Info);
|
|
|
@@ -528,7 +533,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//提交到代付状态
|
|
|
if (!string.IsNullOrEmpty(QueryCountSelect))
|
|
|
{
|
|
|
- if (QueryCountSelect == "0")
|
|
|
+ if(QueryCountSelect == "0")
|
|
|
{
|
|
|
condition += " and QueryCount=" + QueryCountSelect;
|
|
|
}
|
|
|
@@ -569,6 +574,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
|
|
|
condition += " and Id >=" + minId;
|
|
|
}
|
|
|
+ else if (minId != int.Parse(Info))
|
|
|
+ {
|
|
|
+ function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
|
|
|
+ condition += " and Id >=" + minId;
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
condition += " and Id >=" + Convert.ToInt32(Info);
|
|
|
@@ -610,7 +620,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
ReturnFields.Add("CashOrderNo", "提现单号");
|
|
|
ReturnFields.Add("MakerCode", "创客编号");
|
|
|
- ReturnFields.Add("RealName", "创客姓名");
|
|
|
+ ReturnFields.Add("RealName", "灵工姓名");
|
|
|
ReturnFields.Add("Mobile", "手机号");
|
|
|
ReturnFields.Add("IdCardNo", "身份证号");
|
|
|
ReturnFields.Add("SettleBankName", "开户行名称");
|
|
|
@@ -629,111 +639,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
- #region 快捷导出Excel
|
|
|
- public IActionResult UserQuickExportExcel(string right)
|
|
|
- {
|
|
|
- ViewBag.RightInfo = RightInfo;
|
|
|
- ViewBag.right = right;
|
|
|
-
|
|
|
- return View();
|
|
|
- }
|
|
|
-
|
|
|
- [HttpPost]
|
|
|
- public string UserQuickExportExcelDo(string TradeType, string CashOrderNo, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData)
|
|
|
- {
|
|
|
-
|
|
|
- string condition = " where 1=1 and a.Status>-1 and a.TradeType<3";
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(MakerCode))
|
|
|
- {
|
|
|
- condition += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
|
|
|
- }
|
|
|
- //创客名称
|
|
|
- if (!string.IsNullOrEmpty(RealName))
|
|
|
- {
|
|
|
- condition += " and a.UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
- }
|
|
|
- //提现状态
|
|
|
- if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
- {
|
|
|
- condition += " and a.Status=" + StatusSelect;
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(CashOrderNo))
|
|
|
- {
|
|
|
- condition += " and a.CashOrderNo='" + CashOrderNo + "'";
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(TradeType))
|
|
|
- {
|
|
|
- condition += " and a.TradeType=" + TradeType;
|
|
|
- }
|
|
|
- //提交到代付状态
|
|
|
- if (!string.IsNullOrEmpty(QueryCountSelect))
|
|
|
- {
|
|
|
- if (QueryCountSelect == "0")
|
|
|
- {
|
|
|
- condition += " and a.QueryCount=" + QueryCountSelect;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and a.QueryCount>0";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
- {
|
|
|
- string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
- 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 = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
|
|
|
- var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
|
|
|
- condition += " and a.Id >=" + sId;
|
|
|
- }
|
|
|
- if (checks)
|
|
|
- {
|
|
|
- var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
|
|
|
- condition += " and a.Id <=" + eId;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
|
|
|
- var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
|
|
|
- var Info = function.ReadInstance("/WritePage/UserCashRecord/UserCashRecord.txt");
|
|
|
- if (string.IsNullOrEmpty(Info.ToString()))
|
|
|
- {
|
|
|
- function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
|
|
|
- condition += " and a.Id >=" + minId;
|
|
|
- }
|
|
|
- else if (minId != int.Parse(Info))
|
|
|
- {
|
|
|
- function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
|
|
|
- condition += " and a.Id >=" + minId;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and a.Id >=" + Convert.ToInt32(Info);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and a.Id =0";
|
|
|
- }
|
|
|
- }
|
|
|
- var Sql = "SELECT a.CashOrderNo '提现单号',b.MakerCode '创客编号',b.RealName '创客姓名',b.Mobile '手机号',a.IdCardNo '身份证号',a.SettleBankName '开户行名称',a.SettleBankCardNo '开户行卡号',a.ActualTradeAmount '发佣金额(单位:元)',(CASE WHEN a.QueryCount=0 THEN '待提交' WHEN a.QueryCount>0 THEN '已提交' ELSE '' end) '代付标记',(CASE WHEN a.Status=0 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=2 THEN '失败' ELSE '' end) '状态',a.Remark '备注',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间' FROM UserCashRecord a LEFT JOIN Users b ON a.UserId=b.Id" + condition + "";
|
|
|
- var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
|
|
|
- var FileName = "创客提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
- string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
|
|
|
- RedisDbconn.Instance.AddList("ExportQueue", SendData);
|
|
|
- return "success";
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
|
|
|
|
|
|
#region 盟主提现记录列表
|
|
|
@@ -769,7 +674,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 盟主提现记录列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
+ public JsonResult LeaderIndexData(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>();
|
|
|
@@ -799,6 +704,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
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);
|
|
|
@@ -830,6 +740,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
|
|
|
condition += " and Id >=" + minId;
|
|
|
}
|
|
|
+ else if (minId != int.Parse(Info))
|
|
|
+ {
|
|
|
+ function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
|
|
|
+ condition += " and Id >=" + minId;
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
condition += " and Id >=" + Convert.ToInt32(Info);
|
|
|
@@ -886,11 +801,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus,string CreateDateData)
|
|
|
+ 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"); //创建时间
|
|
|
+ Fields.Add("CreateDate", "3"); //创建时间
|
|
|
|
|
|
string condition = " and Status>-1 and TradeType=3";
|
|
|
//创客编号
|
|
|
@@ -918,47 +833,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
condition += " and QueryCount=" + QueryCount;
|
|
|
}
|
|
|
- if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
- {
|
|
|
- string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
- 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 = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType == 3);
|
|
|
- var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType == 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType == 3).Min(m => m.Id);
|
|
|
- condition += " and Id >=" + sId;
|
|
|
- }
|
|
|
- if (checks)
|
|
|
- {
|
|
|
- var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType == 3).Max(m => m.Id);
|
|
|
- condition += " and Id <=" + eId;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
|
|
|
- var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType == 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var minId = db.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()))
|
|
|
- {
|
|
|
- function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
|
|
|
- condition += " and a.Id >=" + minId;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and a.Id >=" + Convert.ToInt32(Info);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and a.Id =0";
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).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>>;
|
|
|
@@ -991,7 +865,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
ReturnFields.Add("CashOrderNo", "提现单号");
|
|
|
ReturnFields.Add("MakerCode", "创客编号");
|
|
|
- ReturnFields.Add("RealName", "创客姓名");
|
|
|
+ ReturnFields.Add("RealName", "灵工姓名");
|
|
|
ReturnFields.Add("Mobile", "手机号");
|
|
|
ReturnFields.Add("IdCardNo", "身份证号");
|
|
|
ReturnFields.Add("SettleBankName", "开户行名称");
|
|
|
@@ -1010,97 +884,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
-
|
|
|
- #region 快捷导出Excel
|
|
|
- public IActionResult LeaderQuickExportExcel(string right)
|
|
|
- {
|
|
|
- ViewBag.RightInfo = RightInfo;
|
|
|
- ViewBag.right = right;
|
|
|
-
|
|
|
- return View();
|
|
|
- }
|
|
|
-
|
|
|
- [HttpPost]
|
|
|
- public string LeaderQuickExportExcelDo(string CashOrderNo, string MakerCode, string RealName, string StatusSelect, string CreateDateData)
|
|
|
- {
|
|
|
-
|
|
|
- string condition = " where 1=1 and a.Status>-1 and a.TradeType=3";
|
|
|
- //创客编号
|
|
|
- if (!string.IsNullOrEmpty(MakerCode))
|
|
|
- {
|
|
|
- condition += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
|
|
|
- }
|
|
|
- //创客名称
|
|
|
- if (!string.IsNullOrEmpty(RealName))
|
|
|
- {
|
|
|
- condition += " and a.UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
- }
|
|
|
- //提现状态
|
|
|
- if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
- {
|
|
|
- condition += " and a.Status=" + StatusSelect;
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(CashOrderNo))
|
|
|
- {
|
|
|
- condition += " and a.CashOrderNo='" + CashOrderNo + "'";
|
|
|
- }
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
- {
|
|
|
- string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
- 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 = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
|
|
|
- var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
|
|
|
- condition += " and a.Id >=" + sId;
|
|
|
- }
|
|
|
- if (checks)
|
|
|
- {
|
|
|
- var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
|
|
|
- condition += " and a.Id <=" + eId;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
|
|
|
- var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
|
|
|
- if (check)
|
|
|
- {
|
|
|
- var minId = db.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()))
|
|
|
- {
|
|
|
- function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
|
|
|
- condition += " and Id >=" + minId;
|
|
|
- }
|
|
|
- else if (minId != int.Parse(Info))
|
|
|
- {
|
|
|
- function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
|
|
|
- condition += " and Id >=" + minId;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and Id >=" + Convert.ToInt32(Info);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- condition += " and a.Id =0";
|
|
|
- }
|
|
|
- }
|
|
|
- var Sql = "SELECT a.CashOrderNo '提现单号',b.MakerCode '创客编号',b.RealName '创客姓名',b.Mobile '手机号',a.IdCardNo '身份证号',a.SettleBankName '开户行名称',a.SettleBankCardNo '开户行卡号',a.ActualTradeAmount '发佣金额(单位:元)',(CASE WHEN a.QueryCount=0 THEN '待提交' WHEN a.QueryCount>0 THEN '已提交' ELSE '' end) '代付标记',(CASE WHEN a.Status=0 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=2 THEN '失败' ELSE '' end) '状态',a.Remark '备注',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间' FROM UserCashRecord a LEFT JOIN Users b ON a.UserId=b.Id" + condition + "";
|
|
|
- var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
|
|
|
- var FileName = "盟主提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
- string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
|
|
|
- RedisDbconn.Instance.AddList("ExportQueue", SendData);
|
|
|
- return "success";
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
-
|
|
|
#region 助利宝提现记录列表
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -1327,7 +1110,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
AddSysLog(Id, "UserCashRecord", "cash");
|
|
|
db.SaveChanges();
|
|
|
CustomTagSet set = db.CustomTagSet.FirstOrDefault(m => m.Tags == "CashWithoutUser") ?? new CustomTagSet();
|
|
|
- string MakerCodeString = "," + set.Contents + ",";
|
|
|
+ string IdString = "," + set.Contents + ",";
|
|
|
foreach (string subid in idlist)
|
|
|
{
|
|
|
int id = int.Parse(subid);
|
|
|
@@ -1335,16 +1118,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (edit != null)
|
|
|
{
|
|
|
Users user = db.Users.FirstOrDefault(m => m.Id == edit.UserId) ?? new Users();
|
|
|
- if (!MakerCodeString.Contains("," + user.MakerCode + ","))
|
|
|
+ if (!IdString.Contains("," + user.Id + ","))
|
|
|
{
|
|
|
edit.QueryCount = Channel;
|
|
|
edit.UpdateDate = DateTime.Now;
|
|
|
db.SaveChanges();
|
|
|
- if (Channel == 1)
|
|
|
+ if(Channel == 1)
|
|
|
{
|
|
|
RedisDbconn.Instance.AddList("CashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
|
|
|
}
|
|
|
- else if (Channel == 2)
|
|
|
+ else if(Channel == 2)
|
|
|
{
|
|
|
RedisDbconn.Instance.AddList("JkCashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
|
|
|
}
|