|
@@ -76,7 +76,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//创客名称
|
|
//创客名称
|
|
|
if (!string.IsNullOrEmpty(RealName))
|
|
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(data.CashOrderNo))
|
|
if (!string.IsNullOrEmpty(data.CashOrderNo))
|
|
|
{
|
|
{
|
|
@@ -234,5 +234,91 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ #region 快捷导出Excel
|
|
|
|
|
+ public IActionResult QuickExportExcel(string right)
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
|
|
+ ViewBag.right = right;
|
|
|
|
|
+
|
|
|
|
|
+ return View();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [HttpPost]
|
|
|
|
|
+ public string QuickExportExcelDo(string CashOrderNo, string MakerCode, string RealName, string CreateDateData)
|
|
|
|
|
+ {
|
|
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
+
|
|
|
|
|
+ string condition = " where 1=1 and a.Status>-1";
|
|
|
|
|
+ //创客编号
|
|
|
|
|
+ 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 Id from Users where RealName='" + RealName + "')";
|
|
|
|
|
+ }
|
|
|
|
|
+ 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.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
|
|
|
|
|
+ var checks = db.UserCashRecordForBusiness.Any(m => m.CreateDate <= end);
|
|
|
|
|
+ if (check)
|
|
|
|
|
+ {
|
|
|
|
|
+ var sId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
|
|
|
|
|
+ condition += " and a.Id >=" + sId;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (checks)
|
|
|
|
|
+ {
|
|
|
|
|
+ var eId = db.UserCashRecordForBusiness.Where(m => m.CreateDate <= end).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.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
|
|
|
|
|
+ if (check)
|
|
|
|
|
+ {
|
|
|
|
|
+ var minId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
|
|
|
|
|
+ var Info = function.ReadInstance("/WritePage/UserCashRecord/UserCashRecordForBusiness.txt");
|
|
|
|
|
+ if (string.IsNullOrEmpty(Info.ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
|
|
|
|
|
+ condition += " and a.Id >=" + minId;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (minId != int.Parse(Info))
|
|
|
|
|
+ {
|
|
|
|
|
+ function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.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 b.MakerCode '创客编号',b.RealName '创客姓名',a.CashOrderNo '提现单号',a.TradeAmount '提现金额',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '提现时间',a.SeoKeyword '备注',a.CreateMan '操作人' FROM UserCashRecordForBusiness 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
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|