特种设备修改,车辆管理人员管理合并,考试接口创建试卷和答题使用redis

This commit is contained in:
2024-04-02 14:28:52 +08:00
parent 1b96387adc
commit d87b2d5be9
49 changed files with 4175 additions and 179 deletions
+22 -19
View File
@@ -1,7 +1,9 @@
using FineUIPro;
using Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
@@ -23,7 +25,7 @@ namespace BLL
get;
set;
}
public static List<Model.Sys_HttpLog> GetSys_HttpLogByModle(Model.Sys_HttpLog table)
public static IQueryable<Model.Sys_HttpLog> GetSys_HttpLogByModle(Model.Sys_HttpLog table)
{
var q = from x in db.Sys_HttpLog
where
@@ -32,15 +34,15 @@ namespace BLL
(string.IsNullOrEmpty(table.HttpUrl) || x.HttpUrl.Contains(table.HttpUrl)) &&
(string.IsNullOrEmpty(table.LogTxt) || x.LogTxt.Contains(table.LogTxt)) &&
(string.IsNullOrEmpty(table.MeThod) || x.MeThod.Contains(table.MeThod)) //&&
// (!table.LogTime.HasValue || (x.LogTime.HasValue && x.LogTime.Value.Date == table.LogTime.Value.Date))
// (!table.LogTime.HasValue || (x.LogTime.HasValue && x.LogTime.Value.Date == table.LogTime.Value.Date))
select x
select x
;
if (table.LogTime.HasValue)
{
q=q.Where(x=> x.LogTime.Value.Date.CompareTo(table.LogTime.Value.Date) == 0);
q = q.Where(x => x.LogTime.Value.Date.CompareTo(table.LogTime.Value.Date) == 0);
}
return q.OrderByDescending(x=>x.LogTime ).ToList();
return q;
}
/// 获取分页列表
@@ -48,7 +50,7 @@ namespace BLL
/// <param name="PageIndex">页码</param>
/// <param name="PageSize">每页数量</param>
/// <returns></returns>
public static IEnumerable getListData(Model.Sys_HttpLog table, Grid Grid1)
public static List<Sys_HttpLog> getListData(Model.Sys_HttpLog table, Grid Grid1)
{
var q = GetSys_HttpLogByModle(table);
count = q.Count();
@@ -56,19 +58,10 @@ namespace BLL
{
return null;
}
q= q.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList();
q = q.OrderByDescending(x => x.LogTime).Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize);
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
x.HttpLogId,
x.LogTime,
x.UserName,
x.HttpUrl,
x.LogTxt,
x.MeThod,
};
return (from x in q
select x).ToList();
}
#endregion
@@ -76,7 +69,10 @@ namespace BLL
{
return db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId);
}
public static DateTime? GetSys_HttpLogMaxDate()
{
return db.Sys_HttpLog.Max(x => x.LogTime);
}
public static void AddSys_HttpLog(Model.Sys_HttpLog newtable)
{
@@ -139,5 +135,12 @@ namespace BLL
}
}
public static void aa()
{
}
}
}
+42 -7
View File
@@ -20,13 +20,17 @@ namespace BLL
var list = (from x in Funs.DB.Sys_Menu where x.SuperMenu == superMenu orderby x.SortIndex select x).ToList();
return list;
}
public static Model.Sys_Menu GetSys_MenuById(string MenuId)
/// <summary>
/// 根据MenuId获取菜单名称项
/// </summary>
/// <param name="menuId"></param>
/// <returns></returns>
public static Model.Sys_Menu GetSupMenuBySuperMenu(string superMenu)
{
return Funs.DB.Sys_Menu.FirstOrDefault(e => e.MenuId == MenuId);
}
/// <summary>
/// 根据MenuId获取菜单名称项
/// </summary>
/// <param name="menuId"></param>
/// <returns></returns>
public static Model.Sys_Menu GetSupMenuBySuperMenu(string superMenu)
{
return Funs.DB.Sys_Menu.FirstOrDefault(x => x.SuperMenu == superMenu);
}
@@ -91,6 +95,37 @@ namespace BLL
}
return lists;
}
}
public static void UpdateSys_Menu(Model.Sys_Menu newtable)
{
Model.Sys_Menu table = Funs.DB.Sys_Menu.FirstOrDefault(e => e.MenuId == newtable.MenuId);
if (table != null)
{
table.MenuId = newtable.MenuId;
table.IsUsed = newtable.IsUsed;
table.MenuName = newtable.MenuName;
table.Icon = newtable.Icon;
table.Url = newtable.Url;
table.SortIndex = newtable.SortIndex;
table.SuperMenu = newtable.SuperMenu;
table.MenuType = newtable.MenuType;
table.IsOffice = newtable.IsOffice;
table.IsEnd = newtable.IsEnd;
Funs.DB.SubmitChanges();
}
}
public static void SetAllIsUsed(string MenuType)
{
var q = from x in Funs.DB.Sys_Menu
where x.MenuType == MenuType
select x;
foreach (var p in q)
{
p.IsUsed = false;
}
db.SubmitChanges();
}
}
}