|
@@ -569,13 +569,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
- public JsonResult ExportExcel(Leaders data, string UserIdMakerCode, string CreateDateData, string LeaderLevelSelect)
|
|
|
|
|
|
|
+ public JsonResult ExportExcel(Leaders data, string UserIdMakerCode, string LeaderLevelSelect, string LeaderStatusSelect, string LastBuyDateData, string ExpiredDateData, string CreateDateData)
|
|
|
{
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
|
|
|
|
|
|
|
string condition = " and Status>-1";
|
|
string condition = " and Status>-1";
|
|
|
- //创客创客编号
|
|
|
|
|
|
|
+ //创客编号
|
|
|
if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
{
|
|
{
|
|
|
condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
@@ -585,7 +585,20 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
{
|
|
|
condition += " and LeaderLevel=" + LeaderLevelSelect;
|
|
condition += " and LeaderLevel=" + LeaderLevelSelect;
|
|
|
}
|
|
}
|
|
|
- //创建时间
|
|
|
|
|
|
|
+ //状态
|
|
|
|
|
+ if (!string.IsNullOrEmpty(LeaderStatusSelect))
|
|
|
|
|
+ {
|
|
|
|
|
+ var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ if (LeaderStatusSelect == "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and ExpiredDate>'" + time + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and ExpiredDate<='" + time + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //首次购买时间
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
{
|
|
|
string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
@@ -593,6 +606,22 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string end = datelist[1];
|
|
string end = datelist[1];
|
|
|
condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
}
|
|
}
|
|
|
|
|
+ //最后购买时间
|
|
|
|
|
+ if (!string.IsNullOrEmpty(LastBuyDateData))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = LastBuyDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = datelist[0];
|
|
|
|
|
+ string end = datelist[1];
|
|
|
|
|
+ condition += " and LastBuyDate>='" + start + " 00:00:00' and LastBuyDate<='" + end + " 23:59:59'";
|
|
|
|
|
+ }
|
|
|
|
|
+ //盟主到期时间
|
|
|
|
|
+ if (!string.IsNullOrEmpty(ExpiredDateData))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = ExpiredDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = datelist[0];
|
|
|
|
|
+ string end = datelist[1];
|
|
|
|
|
+ condition += " and ExpiredDate>='" + start + " 00:00:00' and ExpiredDate<='" + end + " 23:59:59'";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Leaders", Fields, "Id desc", "0", 1, 20000, condition, "UserId,LeaderLevel,CreateDate", false);
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Leaders", Fields, "Id desc", "0", 1, 20000, condition, "UserId,LeaderLevel,CreateDate", false);
|
|
@@ -630,5 +659,76 @@ 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 UserIdMakerCode, string LeaderLevelSelect, string LeaderStatusSelect, string LastBuyDateData, string ExpiredDateData, string CreateDateData)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ string condition = " and Status>-1";
|
|
|
|
|
+ //创客编号
|
|
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
|
|
+ }
|
|
|
|
|
+ //盟主等级
|
|
|
|
|
+ if (!string.IsNullOrEmpty(LeaderLevelSelect))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and LeaderLevel=" + LeaderLevelSelect;
|
|
|
|
|
+ }
|
|
|
|
|
+ //状态
|
|
|
|
|
+ if (!string.IsNullOrEmpty(LeaderStatusSelect))
|
|
|
|
|
+ {
|
|
|
|
|
+ var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ if (LeaderStatusSelect == "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and ExpiredDate>'" + time + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and ExpiredDate<='" + time + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //首次购买时间
|
|
|
|
|
+ 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'";
|
|
|
|
|
+ }
|
|
|
|
|
+ //最后购买时间
|
|
|
|
|
+ if (!string.IsNullOrEmpty(LastBuyDateData))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = LastBuyDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = datelist[0];
|
|
|
|
|
+ string end = datelist[1];
|
|
|
|
|
+ condition += " and LastBuyDate>='" + start + " 00:00:00' and LastBuyDate<='" + end + " 23:59:59'";
|
|
|
|
|
+ }
|
|
|
|
|
+ //盟主到期时间
|
|
|
|
|
+ if (!string.IsNullOrEmpty(ExpiredDateData))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = ExpiredDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = datelist[0];
|
|
|
|
|
+ string end = datelist[1];
|
|
|
|
|
+ condition += " and ExpiredDate>='" + start + " 00:00:00' and ExpiredDate<='" + end + " 23:59:59'";
|
|
|
|
|
+ }
|
|
|
|
|
+ var Sql = "";
|
|
|
|
|
+ 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
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|