@@ -619,6 +619,13 @@ | |||||
</summary> | </summary> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:SafeCampus.Application.Services.Business.CameraInfoService.ICameraInfoService.GetCameraCount(SafeCampus.Application.Services.Business.CameraInfoService.CameraSearch)"> | |||||
<summary> | |||||
获取摄像头数量 | |||||
</summary> | |||||
<param name="search"></param> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="P:SafeCampus.Application.Services.Business.ClassRoomCallService.ClassRoomCallDto.TenantCode"> | <member name="P:SafeCampus.Application.Services.Business.ClassRoomCallService.ClassRoomCallDto.TenantCode"> | ||||
<summary> | <summary> | ||||
租户id | 租户id | ||||
@@ -1591,7 +1598,7 @@ | |||||
进班时间 | 进班时间 | ||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="P:SafeCampus.Application.Services.Business.PersonInfoService.PersonInfoSearch.Name"> | |||||
<member name="P:SafeCampus.Application.Services.Business.PersonInfoService.PersonInfoSearch.PersonName"> | |||||
<summary> | <summary> | ||||
人员名称 | 人员名称 | ||||
</summary> | </summary> | ||||
@@ -1689,6 +1696,16 @@ | |||||
班主任id | 班主任id | ||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="P:SafeCampus.Application.Services.Business.PersonSetInfoService.PersonSetInfoSearch.MajorId"> | |||||
<summary> | |||||
专业id | |||||
</summary> | |||||
</member> | |||||
<member name="P:SafeCampus.Application.Services.Business.PersonSetInfoService.PersonSetInfoSearch.SetName"> | |||||
<summary> | |||||
班级id | |||||
</summary> | |||||
</member> | |||||
<member name="M:SafeCampus.Application.Services.Business.PersonSetInfoService.IPersonSetInfoService.Add(SafeCampus.Application.Services.Business.PersonSetInfoService.PersonSetInfoDto)"> | <member name="M:SafeCampus.Application.Services.Business.PersonSetInfoService.IPersonSetInfoService.Add(SafeCampus.Application.Services.Business.PersonSetInfoService.PersonSetInfoDto)"> | ||||
<summary> | <summary> | ||||
添加班级 | 添加班级 | ||||
@@ -1715,7 +1732,13 @@ | |||||
</summary> | </summary> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:SafeCampus.Application.Services.Business.PersonSetInfoService.IPersonSetInfoService.CheckName(System.String)"> | |||||
<member name="M:SafeCampus.Application.Services.Business.PersonSetInfoService.IPersonSetInfoService.GetList(SafeCampus.Application.Services.Business.PersonSetInfoService.PersonSetInfoSearch)"> | |||||
<summary> | |||||
获取列表 | |||||
</summary> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="M:SafeCampus.Application.Services.Business.PersonSetInfoService.IPersonSetInfoService.CheckName(System.String,System.String)"> | |||||
<summary> | <summary> | ||||
检查名称是否存在 | 检查名称是否存在 | ||||
</summary> | </summary> | ||||
@@ -2038,7 +2061,7 @@ | |||||
</member> | </member> | ||||
<member name="M:SafeCampus.Application.Services.Business.Warn.Service.IWarnInfoService.GetWarnType"> | <member name="M:SafeCampus.Application.Services.Business.Warn.Service.IWarnInfoService.GetWarnType"> | ||||
<summary> | <summary> | ||||
获取告警分离列表 | |||||
获取告警分类列表 | |||||
</summary> | </summary> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
@@ -2049,6 +2072,12 @@ | |||||
<param name="Id"></param> | <param name="Id"></param> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:SafeCampus.Application.Services.Business.Warn.Service.IWarnInfoService.GetWarnCount(SafeCampus.Application.Services.Business.Warn.Dto.WarnInfoSearch)"> | |||||
<summary> | |||||
获取预警数量 | |||||
</summary> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="M:SafeCampus.Application.Services.IApiBaseInterface`3.Add(`0)"> | <member name="M:SafeCampus.Application.Services.IApiBaseInterface`3.Add(`0)"> | ||||
<summary> | <summary> | ||||
添加 | 添加 | ||||
@@ -20,6 +20,11 @@ public class BuildingService:DbRepository<BuildingInfo>,IBuildingService | |||||
{ | { | ||||
throw Oops.Oh("请填写ID"); | throw Oops.Oh("请填写ID"); | ||||
} | } | ||||
var modelold = await GetFirstAsync(p => p.Name == input.Name&&p.Id!=input.Id); | |||||
if (modelold != null) | |||||
{ | |||||
throw Oops.Oh("宿舍楼已存在"); | |||||
} | |||||
var model = await GetFirstAsync(p => p.Id == input.Id); | var model = await GetFirstAsync(p => p.Id == input.Id); | ||||
if (model == null) | if (model == null) | ||||
{ | { | ||||
@@ -42,6 +42,11 @@ public class CameraGroupService :DbRepository<CameraGroup>, ICameraGroupService | |||||
{ | { | ||||
throw Oops.Oh("分组下存在摄像头,请转移至其他分组后在删除!"); | throw Oops.Oh("分组下存在摄像头,请转移至其他分组后在删除!"); | ||||
} | } | ||||
var isOK1 = await IsAnyAsync(x => x.ParentId == model.Id); | |||||
if (isOK1) | |||||
{ | |||||
throw Oops.Oh("分组下存在分组,请先删除分组下分组!"); | |||||
} | |||||
await DeleteAsync(model); | await DeleteAsync(model); | ||||
return true; | return true; | ||||
} | } | ||||
@@ -202,4 +202,26 @@ public class CameraInfoService : DbRepository<CameraInfo>, ICameraInfoService | |||||
var list=await Context.Queryable<CameraInfo>().Where(x=> !useList.Contains(x.SensorId)).ToListAsync(); | var list=await Context.Queryable<CameraInfo>().Where(x=> !useList.Contains(x.SensorId)).ToListAsync(); | ||||
return list.Adapt<List<CameraInfoDto>>(); | return list.Adapt<List<CameraInfoDto>>(); | ||||
} | } | ||||
public async Task<int> GetCameraCount(CameraSearch search) | |||||
{ | |||||
var groupids = new List<long>(); | |||||
if (search.GroupId.HasValue && search.GroupId.Value != -1) | |||||
{ | |||||
var group = await Context.Queryable<CameraGroup>() | |||||
.ToTreeAsync(x => x.Children, x => x.ParentId, search.GroupId); | |||||
groupids = GetGroupChildren(group); | |||||
groupids.Add(search.GroupId.Value); | |||||
} | |||||
var query = Context.Queryable<CameraInfo>() | |||||
.Includes(x => x.SysUserItem) | |||||
.Includes(x => x.CameraGroupItem) | |||||
.WhereIF(search.DeviceStatus.HasValue, x => x.DeviceStatus == search.DeviceStatus) | |||||
.WhereIF(!string.IsNullOrEmpty(search.SensorId), x => x.SensorId == search.SensorId) | |||||
.WhereIF(!string.IsNullOrEmpty(search.SensorName), x => x.SensorName == search.SensorName) | |||||
.WhereIF(search.GroupId.HasValue, x => (search.GroupId.Value == -1 ? x.GroupId == null : groupids.Contains(x.GroupId.Value))); | |||||
var list = await query.CountAsync(); | |||||
return list; | |||||
} | |||||
} | } |
@@ -42,4 +42,10 @@ public interface ICameraInfoService:ITransient | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<List<CameraInfoDto>> GetBuildCameraList(List<string> useList); | Task<List<CameraInfoDto>> GetBuildCameraList(List<string> useList); | ||||
/// <summary> | |||||
/// 获取摄像头数量 | |||||
/// </summary> | |||||
/// <param name="search"></param> | |||||
/// <returns></returns> | |||||
Task<int> GetCameraCount(CameraSearch search); | |||||
} | } |
@@ -20,6 +20,11 @@ public class DepartmentService: DbRepository<DepartmentInfo>, IDepartmentService | |||||
{ | { | ||||
throw Oops.Oh("请填写ID"); | throw Oops.Oh("请填写ID"); | ||||
} | } | ||||
var modelold = await GetFirstAsync(p => p.Code == input.Code&&p.Id!=input.Id); | |||||
if (modelold != null) | |||||
{ | |||||
throw Oops.Oh("院系编号已存在"); | |||||
} | |||||
var model = await GetFirstAsync(p => p.Id == input.Id); | var model = await GetFirstAsync(p => p.Id == input.Id); | ||||
if (model == null) | if (model == null) | ||||
{ | { | ||||
@@ -20,6 +20,11 @@ public class DormitoryService:DbRepository<DormitoryInfo>,IDormitoryService | |||||
{ | { | ||||
throw Oops.Oh("请填写ID"); | throw Oops.Oh("请填写ID"); | ||||
} | } | ||||
var modelold = await GetFirstAsync(p => p.Name == input.Name && p.BuildId == input.BuildId&&p.Id!=input.Id); | |||||
if (modelold != null) | |||||
{ | |||||
throw Oops.Oh("寝室名称已存在"); | |||||
} | |||||
var model = await GetFirstAsync(p => p.Id == input.Id); | var model = await GetFirstAsync(p => p.Id == input.Id); | ||||
if (model == null) | if (model == null) | ||||
{ | { | ||||
@@ -20,6 +20,11 @@ public class MajorService: DbRepository<MajorInfo>, IMajorService | |||||
{ | { | ||||
throw Oops.Oh("请填写ID"); | throw Oops.Oh("请填写ID"); | ||||
} | } | ||||
var modelold = await GetFirstAsync(p => p.Code == input.Code&&p.Id!=input.Id); | |||||
if (modelold != null) | |||||
{ | |||||
throw Oops.Oh("专业编号已存在"); | |||||
} | |||||
var model = await GetFirstAsync(p => p.Id == input.Id); | var model = await GetFirstAsync(p => p.Id == input.Id); | ||||
if (model == null) | if (model == null) | ||||
{ | { | ||||
@@ -5,7 +5,7 @@ public class PersonInfoSearch:BasePageInput | |||||
/// <summary> | /// <summary> | ||||
/// 人员名称 | /// 人员名称 | ||||
/// </summary> | /// </summary> | ||||
public string Name { get; set; } | |||||
public string PersonName { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 手机号 | /// 手机号 | ||||
/// </summary> | /// </summary> | ||||
@@ -68,7 +68,7 @@ public class PersonInfoService:DbRepository<PersonInfo>, IPersonInfoService | |||||
.Includes(x=>x.PersonFacesList) | .Includes(x=>x.PersonFacesList) | ||||
.Includes(x=>x.DormitoryInfoItem) | .Includes(x=>x.DormitoryInfoItem) | ||||
.WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId) | .WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId) | ||||
.WhereIF(!string.IsNullOrEmpty(search.Name), x => x.Name.Contains(search.Name)) | |||||
.WhereIF(!string.IsNullOrEmpty(search.PersonName), x => x.Name.Contains(search.PersonName)) | |||||
.WhereIF(search.DepId.HasValue, x => x.PersonSetInfoItem.MajorInfoItem.DepId==search.DepId) | .WhereIF(search.DepId.HasValue, x => x.PersonSetInfoItem.MajorInfoItem.DepId==search.DepId) | ||||
.WhereIF(search.MajorId.HasValue, x => x.PersonSetInfoItem.MajorId==search.MajorId) | .WhereIF(search.MajorId.HasValue, x => x.PersonSetInfoItem.MajorId==search.MajorId) | ||||
.WhereIF(!string.IsNullOrEmpty(search.Phone), x => x.Phone.Contains(search.Phone)); | .WhereIF(!string.IsNullOrEmpty(search.Phone), x => x.Phone.Contains(search.Phone)); | ||||
@@ -0,0 +1,13 @@ | |||||
namespace SafeCampus.Application.Services.Business.PersonSetInfoService; | |||||
public class PersonSetInfoSearch : BasePageInput | |||||
{ | |||||
/// <summary> | |||||
/// 专业id | |||||
/// </summary> | |||||
public long? MajorId { get; set; } | |||||
/// <summary> | |||||
/// 班级id | |||||
/// </summary> | |||||
public string SetName { get; set; } | |||||
} |
@@ -25,9 +25,14 @@ public interface IPersonSetInfoService:ITransient | |||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<List<PersonSetInfoDto>> GetPageList(long? majorId,string setName); | Task<List<PersonSetInfoDto>> GetPageList(long? majorId,string setName); | ||||
/// <summary> | /// <summary> | ||||
/// 获取列表 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
Task<SqlSugarPagedList<PersonSetInfoDto>> GetList(PersonSetInfoSearch search); | |||||
/// <summary> | |||||
/// 检查名称是否存在 | /// 检查名称是否存在 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="name"></param> | /// <param name="name"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> CheckName(string name); | |||||
Task<bool> CheckName(string name, string id); | |||||
} | } |
@@ -10,6 +10,7 @@ public class PersonSetInfoService:DbRepository<PersonSetInfo>, IPersonSetInfoSer | |||||
{ | { | ||||
throw Oops.Oh("该班级id已存在"); | throw Oops.Oh("该班级id已存在"); | ||||
} | } | ||||
model.CreateTime=DateTime.Now; | |||||
await InsertAsync(model); | await InsertAsync(model); | ||||
return true; | return true; | ||||
} | } | ||||
@@ -50,9 +51,24 @@ public class PersonSetInfoService:DbRepository<PersonSetInfo>, IPersonSetInfoSer | |||||
return list.Adapt<List<PersonSetInfoDto>>(); | return list.Adapt<List<PersonSetInfoDto>>(); | ||||
} | } | ||||
public async Task<bool> CheckName(string name) | |||||
public async Task<SqlSugarPagedList<PersonSetInfoDto>> GetList(PersonSetInfoSearch search) | |||||
{ | { | ||||
var model = GetFirstAsync(x => x.PersonSetName == name); | |||||
var query = Context.Queryable<PersonSetInfo>() | |||||
.Includes(x => x.MajorInfoItem, x => x.DepartmentInfoItem) | |||||
.Includes(x => x.ClassTeacherItem, st => st.SysUserItem) | |||||
.Where(x => x.PersonSetId != SafeCampusConst.ZDRY) | |||||
.WhereIF(search.MajorId.HasValue, x => x.MajorId ==search.MajorId) | |||||
.WhereIF(!string.IsNullOrEmpty(search.SetName), x => x.PersonSetName.Contains(search.SetName)); | |||||
var list = await query.OrderByDescending(x => x.CreateTime) | |||||
.ToPagedListAsyncMapster<PersonSetInfo, PersonSetInfoDto>(search.PageNum, search.PageSize); | |||||
return list; | |||||
} | |||||
public async Task<bool> CheckName(string name,string id) | |||||
{ | |||||
var model =await GetFirstAsync(x => x.PersonSetName == name&&(string.IsNullOrEmpty(id) ||x.PersonSetId!=id)); | |||||
return model != null; | return model != null; | ||||
} | } | ||||
} | } |
@@ -76,6 +76,7 @@ public class WarnInfoList | |||||
/// 处理时间 | /// 处理时间 | ||||
/// </summary> | /// </summary> | ||||
public DateTime? HandTime { get; set; } | public DateTime? HandTime { get; set; } | ||||
public string SceneName { get; set; } | |||||
} | } | ||||
public class WarnInfoListMapper : IRegister | public class WarnInfoListMapper : IRegister | ||||
{ | { | ||||
@@ -17,7 +17,7 @@ public interface IWarnInfoService:IApiBaseInterface<WarnInfoDto, WarnInfoList, W | |||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<List<WarnInfoList>> GetListNoPage(WarnInfoSearch search); | Task<List<WarnInfoList>> GetListNoPage(WarnInfoSearch search); | ||||
/// <summary> | /// <summary> | ||||
/// 获取告警分离列表 | |||||
/// 获取告警分类列表 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<List<WarnType>> GetWarnType(); | Task<List<WarnType>> GetWarnType(); | ||||
@@ -27,4 +27,9 @@ public interface IWarnInfoService:IApiBaseInterface<WarnInfoDto, WarnInfoList, W | |||||
/// <param name="Id"></param> | /// <param name="Id"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public Task<bool> DeleteBatch(List<long> Ids); | public Task<bool> DeleteBatch(List<long> Ids); | ||||
/// <summary> | |||||
/// 获取预警数量 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public Task<int> GetWarnCount(WarnInfoSearch search); | |||||
} | } |
@@ -76,7 +76,7 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient | |||||
if (config!=null) | if (config!=null) | ||||
{ | { | ||||
var guolv = Context.Queryable<WarnInfo>(); | |||||
var guolv = await Context.Queryable<WarnInfo>().Select(x=>new{x.CameraId,x.AlarmType,x.Id}).ToListAsync(); | |||||
foreach (var warnGroupInfo in config) | foreach (var warnGroupInfo in config) | ||||
{ | { | ||||
if (warnGroupInfo.State) | if (warnGroupInfo.State) | ||||
@@ -85,16 +85,16 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient | |||||
{ | { | ||||
if (!warnGroupSubset.State) | if (!warnGroupSubset.State) | ||||
{ | { | ||||
guolvIds.AddRange(await guolv | |||||
guolvIds.AddRange(guolv | |||||
.Where(x => warnGroupInfo.CameraId.Contains(x.CameraId) && | .Where(x => warnGroupInfo.CameraId.Contains(x.CameraId) && | ||||
x.AlarmType == warnGroupSubset.Code).Select(x => x.Id).ToListAsync()); | |||||
x.AlarmType == warnGroupSubset.Code).Select(x => x.Id).ToList()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
guolvIds.AddRange(await guolv | |||||
.Where(x => warnGroupInfo.CameraId.Contains(x.CameraId)).Select(x => x.Id).ToListAsync()); | |||||
guolvIds.AddRange(guolv | |||||
.Where(x => warnGroupInfo.CameraId.Contains(x.CameraId)).Select(x => x.Id).ToList()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -108,6 +108,7 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient | |||||
.WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) | .WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) | ||||
.WhereIF(search.StartTick.HasValue,x => x.Tick >= search.StartTick) | .WhereIF(search.StartTick.HasValue,x => x.Tick >= search.StartTick) | ||||
.WhereIF(search.EndTick.HasValue, x => x.Tick <= search.EndTick) | .WhereIF(search.EndTick.HasValue, x => x.Tick <= search.EndTick) | ||||
.WhereIF(!string.IsNullOrEmpty(search.PersonId),x=>x.PersonId==search.PersonId) | |||||
.WhereIF(guolvIds.Any(),x=>!guolvIds.Contains(x.Id)); | .WhereIF(guolvIds.Any(),x=>!guolvIds.Contains(x.Id)); | ||||
var list=await query.OrderByDescending(x=>x.Tick) | var list=await query.OrderByDescending(x=>x.Tick) | ||||
@@ -133,6 +134,33 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient | |||||
public async Task<List<WarnInfoList>> GetListNoPage(WarnInfoSearch search) | public async Task<List<WarnInfoList>> GetListNoPage(WarnInfoSearch search) | ||||
{ | { | ||||
var config = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup); | |||||
var guolvIds = new List<long>(); | |||||
if (config != null) | |||||
{ | |||||
var guolv = await Context.Queryable<WarnInfo>().Select(x => new { x.CameraId, x.AlarmType, x.Id }).ToListAsync(); | |||||
foreach (var warnGroupInfo in config) | |||||
{ | |||||
if (warnGroupInfo.State) | |||||
{ | |||||
foreach (var warnGroupSubset in warnGroupInfo.Subset) | |||||
{ | |||||
if (!warnGroupSubset.State) | |||||
{ | |||||
guolvIds.AddRange(guolv | |||||
.Where(x => warnGroupInfo.CameraId.Contains(x.CameraId) && | |||||
x.AlarmType == warnGroupSubset.Code).Select(x => x.Id).ToList()); | |||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
guolvIds.AddRange(guolv | |||||
.Where(x => warnGroupInfo.CameraId.Contains(x.CameraId)).Select(x => x.Id).ToList()); | |||||
} | |||||
} | |||||
} | |||||
var query = Context.Queryable<WarnInfo>() | var query = Context.Queryable<WarnInfo>() | ||||
.Includes(x => x.CameraInfoItem,x=>x.CameraGroupItem) | .Includes(x => x.CameraInfoItem,x=>x.CameraGroupItem) | ||||
.Includes(x => x.PersonInfoItem) | .Includes(x => x.PersonInfoItem) | ||||
@@ -145,7 +173,8 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient | |||||
.WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) | .WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) | ||||
.WhereIF(!string.IsNullOrEmpty(search.PersonId), x => x.PersonId == search.PersonId) | .WhereIF(!string.IsNullOrEmpty(search.PersonId), x => x.PersonId == search.PersonId) | ||||
.WhereIF(search.StartTick.HasValue, x => x.Tick >= search.StartTick) | .WhereIF(search.StartTick.HasValue, x => x.Tick >= search.StartTick) | ||||
.WhereIF(search.EndTick.HasValue, x => x.Tick <= search.EndTick); | |||||
.WhereIF(search.EndTick.HasValue, x => x.Tick <= search.EndTick) | |||||
.WhereIF(guolvIds.Any(), x => !guolvIds.Contains(x.Id)); | |||||
var list = await query.OrderByDescending(x => x.Tick) | var list = await query.OrderByDescending(x => x.Tick) | ||||
.ToListAsync(); | .ToListAsync(); | ||||
@@ -153,7 +182,35 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient | |||||
} | } | ||||
public async Task<List<WarnType>>GetWarnType() | public async Task<List<WarnType>>GetWarnType() | ||||
{ | { | ||||
var config = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup); | |||||
var guolvIds = new List<long>(); | |||||
if (config != null) | |||||
{ | |||||
var guolv = await Context.Queryable<WarnInfo>().Select(x => new { x.CameraId, x.AlarmType, x.Id }).ToListAsync(); | |||||
foreach (var warnGroupInfo in config) | |||||
{ | |||||
if (warnGroupInfo.State) | |||||
{ | |||||
foreach (var warnGroupSubset in warnGroupInfo.Subset) | |||||
{ | |||||
if (!warnGroupSubset.State) | |||||
{ | |||||
guolvIds.AddRange(guolv | |||||
.Where(x => warnGroupInfo.CameraId.Contains(x.CameraId) && | |||||
x.AlarmType == warnGroupSubset.Code).Select(x => x.Id).ToList()); | |||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
guolvIds.AddRange(guolv | |||||
.Where(x => warnGroupInfo.CameraId.Contains(x.CameraId)).Select(x => x.Id).ToList()); | |||||
} | |||||
} | |||||
} | |||||
var query = Context.Queryable<WarnInfo>() | var query = Context.Queryable<WarnInfo>() | ||||
.WhereIF(guolvIds.Any(), x => !guolvIds.Contains(x.Id)) | |||||
.GroupBy(x => new { x.AlarmType, x.AlarmTypeDesc }) | .GroupBy(x => new { x.AlarmType, x.AlarmTypeDesc }) | ||||
.Select(xx => new WarnType | .Select(xx => new WarnType | ||||
{ | { | ||||
@@ -168,4 +225,25 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient | |||||
await Context.Deleteable<WarnInfo>().In(Ids).ExecuteCommandAsync(); | await Context.Deleteable<WarnInfo>().In(Ids).ExecuteCommandAsync(); | ||||
return true; | return true; | ||||
} | } | ||||
public async Task<int> GetWarnCount(WarnInfoSearch search) | |||||
{ | |||||
var query = Context.Queryable<WarnInfo>() | |||||
.Includes(x => x.CameraInfoItem, x => x.CameraGroupItem) | |||||
.Includes(x => x.PersonInfoItem) | |||||
.Includes(x => x.PersonSetInfoItem) | |||||
.WhereIF(search.WarnHand.HasValue, x => x.WarnHand == search.WarnHand) | |||||
.WhereIF(!string.IsNullOrEmpty(search.AlarmType), x => x.AlarmType == search.AlarmType) | |||||
.WhereIF(search.AlarmTypes != null && search.AlarmTypes.Any(), x => search.AlarmTypes.Contains(x.AlarmType)) | |||||
.WhereIF(search.PersonSetIds != null && search.PersonSetIds.Any(), | |||||
x => search.PersonSetIds.Contains(x.PersonSetId)) | |||||
.WhereIF(search.CameraIds != null && search.CameraIds.Any(), x => search.CameraIds.Contains(x.CameraId)) | |||||
.WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) | |||||
.WhereIF(!string.IsNullOrEmpty(search.PersonId), x => x.PersonId == search.PersonId) | |||||
.WhereIF(search.StartTick.HasValue, x => x.Tick >= search.StartTick) | |||||
.WhereIF(search.EndTick.HasValue, x => x.Tick <= search.EndTick); | |||||
var list = await query.CountAsync(); | |||||
return list; | |||||
} | |||||
} | } |
@@ -3,7 +3,7 @@ | |||||
[Tenant(SqlSugarConst.DB_DEFAULT)] | [Tenant(SqlSugarConst.DB_DEFAULT)] | ||||
[BatchEdit] | [BatchEdit] | ||||
[CodeGen] | [CodeGen] | ||||
[IgnoreInitTable] | |||||
//[IgnoreInitTable] | |||||
public class PersonSetInfo | public class PersonSetInfo | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
@@ -31,4 +31,9 @@ public class PersonSetInfo | |||||
/// </summary> | /// </summary> | ||||
[Navigate(NavigateType.OneToOne, nameof(ClassTeacher.PersonSetId),nameof(PersonSetId))] | [Navigate(NavigateType.OneToOne, nameof(ClassTeacher.PersonSetId),nameof(PersonSetId))] | ||||
public ClassTeacher ClassTeacherItem { get; set; } | public ClassTeacher ClassTeacherItem { get; set; } | ||||
/// <summary> | |||||
/// 创建时间 | |||||
/// </summary> | |||||
[SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间", IsNullable = false, IsOnlyIgnoreUpdate = true)] | |||||
public DateTime CreateTime { get; set; } | |||||
} | } |
@@ -1311,6 +1311,11 @@ | |||||
班主任信息 | 班主任信息 | ||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="P:SafeCampus.System.PersonSetInfo.CreateTime"> | |||||
<summary> | |||||
创建时间 | |||||
</summary> | |||||
</member> | |||||
<member name="T:SafeCampus.System.BatchEdit"> | <member name="T:SafeCampus.System.BatchEdit"> | ||||
<summary> | <summary> | ||||
批量修改 | 批量修改 | ||||
@@ -1,14 +1,4 @@ | |||||
| |||||
// | |||||
namespace SafeCampus.System; | |||||
namespace SafeCampus.System; | |||||
/// <summary> | /// <summary> | ||||
/// 用户选择器参数 | /// 用户选择器参数 | ||||
@@ -1,14 +1,4 @@ | |||||
| |||||
// | |||||
namespace SafeCampus.System; | |||||
namespace SafeCampus.System; | |||||
/// <summary> | /// <summary> | ||||
/// 用户服务 | /// 用户服务 | ||||
@@ -20,7 +20,7 @@ | |||||
}, | }, | ||||
//系统层设置 | //系统层设置 | ||||
"SystemSettings": { | "SystemSettings": { | ||||
"InitTable": true, //是否初始化表结构 | |||||
"InitTable": false, //是否初始化表结构 | |||||
"InitSeedData": false, //是否初始化种子数据 | "InitSeedData": false, //是否初始化种子数据 | ||||
"SuperAdminViewAllData": true //是否超级管理员可以查看所有数据 | "SuperAdminViewAllData": true //是否超级管理员可以查看所有数据 | ||||
} | } |
@@ -3,6 +3,9 @@ using MoYu.RemoteRequest.Extensions; | |||||
using Newtonsoft.Json.Linq; | using Newtonsoft.Json.Linq; | ||||
using SafeCampus.Application.Manager.DeepelephManager; | using SafeCampus.Application.Manager.DeepelephManager; | ||||
using SafeCampus.Application.Services.Business.AttendanceService; | using SafeCampus.Application.Services.Business.AttendanceService; | ||||
using SafeCampus.Application.Services.Business.Warn.Dto; | |||||
using SafeCampus.Application.Services.Business.Warn.Service; | |||||
using SafeCampus.Web.Core.Controllers.Application.Business.Dto; | |||||
namespace SafeCampus.Web.Core.Controllers.Application.Business; | namespace SafeCampus.Web.Core.Controllers.Application.Business; | ||||
/// <summary> | /// <summary> | ||||
@@ -14,11 +17,13 @@ public class AttendanceApi : IDynamicApiController | |||||
{ | { | ||||
private readonly IAttendanceService _attendanceService; | private readonly IAttendanceService _attendanceService; | ||||
private readonly IDeepelephManager _deepelephManager; | private readonly IDeepelephManager _deepelephManager; | ||||
private readonly IWarnInfoService _warnInfoService; | |||||
public AttendanceApi(IDeepelephManager deepelephManager, IAttendanceService attendanceService) | |||||
public AttendanceApi(IDeepelephManager deepelephManager, IAttendanceService attendanceService, IWarnInfoService warnInfoService) | |||||
{ | { | ||||
_deepelephManager = deepelephManager; | _deepelephManager = deepelephManager; | ||||
_attendanceService = attendanceService; | _attendanceService = attendanceService; | ||||
_warnInfoService = warnInfoService; | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -130,4 +135,13 @@ public class AttendanceApi : IDynamicApiController | |||||
{ | { | ||||
return await _attendanceService.GetPageListByBuild(search); | return await _attendanceService.GetPageListByBuild(search); | ||||
} | } | ||||
/// <summary> | |||||
/// 获取行为轨迹 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public async Task<dynamic> GetBehaviorTrace(BehaviorTraceSearch input) | |||||
{ | |||||
var list =await _warnInfoService.GetList(new WarnInfoSearch { PersonId = input.PersonId,PageNum = input.PageNum,PageSize = input.PageSize}); | |||||
return list; | |||||
} | |||||
} | } |
@@ -29,7 +29,7 @@ public class DfieldApi : IDynamicApiController | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<dynamic> CreateDfieldA(ControllersNameInput input) | public async Task<dynamic> CreateDfieldA(ControllersNameInput input) | ||||
{ | { | ||||
if (await _personSetInfoService.CheckName(input.Name)) | |||||
if (await _personSetInfoService.CheckName(input.Name,null)) | |||||
{ | { | ||||
throw Oops.Oh("【"+input.Name+"】班级名称已存在"); | throw Oops.Oh("【"+input.Name+"】班级名称已存在"); | ||||
} | } | ||||
@@ -97,6 +97,15 @@ public class DfieldApi : IDynamicApiController | |||||
throw Oops.Oh(model["message"].ToString()); | throw Oops.Oh(model["message"].ToString()); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 分页获取班级列表 | |||||
/// </summary> | |||||
/// <param name="search"></param> | |||||
/// <returns></returns> | |||||
public async Task<dynamic> GetPageList(PersonSetInfoSearch search) | |||||
{ | |||||
return await _personSetInfoService.GetList(search); | |||||
} | |||||
/// <summary> | |||||
/// 删除底库 | /// 删除底库 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="id">底库id</param> | /// <param name="id">底库id</param> | ||||
@@ -149,6 +158,10 @@ public class DfieldApi : IDynamicApiController | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<dynamic> UpdateDfieldU(DfieldInput input) | public async Task<dynamic> UpdateDfieldU(DfieldInput input) | ||||
{ | { | ||||
if (await _personSetInfoService.CheckName(input.Name, input.Id)) | |||||
{ | |||||
throw Oops.Oh("【" + input.Name + "】班级名称已存在"); | |||||
} | |||||
var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | ||||
var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/set/update" | var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/set/update" | ||||
.SetBody(new | .SetBody(new | ||||
@@ -0,0 +1,6 @@ | |||||
namespace SafeCampus.Web.Core.Controllers.Application.Business.Dto; | |||||
public class BehaviorTraceSearch:BasePageInput | |||||
{ | |||||
public string PersonId { get; set; } | |||||
} |
@@ -12,7 +12,7 @@ namespace SafeCampus.Web.Core.Controllers.Application.Business; | |||||
/// 人员管理接口 | /// 人员管理接口 | ||||
/// </summary> | /// </summary> | ||||
[Route("/business/[controller]")] | [Route("/business/[controller]")] | ||||
[ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 98,Tag = "人员管理")] | |||||
[ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 98, Tag = "人员管理")] | |||||
public class PersonApi : IDynamicApiController | public class PersonApi : IDynamicApiController | ||||
{ | { | ||||
private readonly IDeepelephManager _deepelephManager; | private readonly IDeepelephManager _deepelephManager; | ||||
@@ -32,7 +32,7 @@ public class PersonApi : IDynamicApiController | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<dynamic> CreatePersonA(PersonModel info) | public async Task<dynamic> CreatePersonA(PersonModel info) | ||||
{ | { | ||||
info.Faces = info.Faces.Select(x => new Faces {faceId = Guid.NewGuid().ToString("N"),faceUrl = x.faceUrl}).ToList(); | |||||
info.Faces = info.Faces.Select(x => new Faces { faceId = Guid.NewGuid().ToString("N"), faceUrl = x.faceUrl }).ToList(); | |||||
var personId = Guid.NewGuid().ToString("N"); | var personId = Guid.NewGuid().ToString("N"); | ||||
var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | ||||
var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/create" | var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/create" | ||||
@@ -79,7 +79,7 @@ public class PersonApi : IDynamicApiController | |||||
}) | }) | ||||
.SetContentType("application/json") | .SetContentType("application/json") | ||||
.PostAsAsync<string>(); | .PostAsAsync<string>(); | ||||
person.PersonSetId=info.PersonSetId; | |||||
person.PersonSetId = info.PersonSetId; | |||||
} | } | ||||
await _personInfoService.Add(person); | await _personInfoService.Add(person); | ||||
await _personFacesService.BatchAdd(info.Faces.Select(x => new PersonFaces | await _personFacesService.BatchAdd(info.Faces.Select(x => new PersonFaces | ||||
@@ -181,13 +181,12 @@ public class PersonApi : IDynamicApiController | |||||
if ((bool)model["success"]) | if ((bool)model["success"]) | ||||
{ | { | ||||
var isOk = model["data"].ToString() == ids; | var isOk = model["data"].ToString() == ids; | ||||
if (isOk) | |||||
{ | |||||
await _personInfoService.Delete(ids); | |||||
} | |||||
await _personInfoService.Delete(ids); | |||||
//return isOk; | //return isOk; | ||||
}else if (model["message"].ToString().Contains("人员不存在")) | |||||
{ | |||||
await _personInfoService.Delete(ids); | |||||
} | } | ||||
//throw Oops.Oh(model["message"].ToString()); | //throw Oops.Oh(model["message"].ToString()); | ||||
} | } | ||||
@@ -327,7 +326,7 @@ public class PersonApi : IDynamicApiController | |||||
poiId = appSettings.PoiId, | poiId = appSettings.PoiId, | ||||
personSetId = search.PersonSetId, | personSetId = search.PersonSetId, | ||||
//personId = search.PersonId, | //personId = search.PersonId, | ||||
personName = search.Name, | |||||
personName = search.PersonName, | |||||
pageIndex = search.PageNum, | pageIndex = search.PageNum, | ||||
pageSize = search.PageSize, | pageSize = search.PageSize, | ||||
}) | }) | ||||
@@ -362,8 +361,8 @@ public class PersonApi : IDynamicApiController | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<dynamic> GetPersionById(ControllersIdInput input) | public async Task<dynamic> GetPersionById(ControllersIdInput input) | ||||
{ | { | ||||
var perModel= await _personInfoService.GetInfo(input.Id); | |||||
var appSettings = App.GetOptionsMonitor < AppInfoOptions>(); | |||||
var perModel = await _personInfoService.GetInfo(input.Id); | |||||
var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | |||||
var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/query" | var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/query" | ||||
.SetBody(new | .SetBody(new | ||||
{ | { | ||||
@@ -402,7 +401,7 @@ public class PersonApi : IDynamicApiController | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<dynamic> AddFaceA(PersonFaceInfo info) | public async Task<dynamic> AddFaceA(PersonFaceInfo info) | ||||
{ | { | ||||
var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | ||||
var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/addFace" | var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/addFace" | ||||
.SetBody(new | .SetBody(new | ||||
@@ -511,7 +510,7 @@ public class PersonApi : IDynamicApiController | |||||
var model = JsonConvert.DeserializeObject<JObject>(str); | var model = JsonConvert.DeserializeObject<JObject>(str); | ||||
if ((bool)model["success"]) | if ((bool)model["success"]) | ||||
{ | { | ||||
await _personInfoService.UpdateSet(new List<string>{ input.PersonId}, null); | |||||
await _personInfoService.UpdateSet(new List<string> { input.PersonId }, null); | |||||
return true; | return true; | ||||
} | } | ||||
@@ -530,7 +529,7 @@ public class PersonApi : IDynamicApiController | |||||
token = _deepelephManager.GetToken(), | token = _deepelephManager.GetToken(), | ||||
tenantCode = appSettings.TenantCode, | tenantCode = appSettings.TenantCode, | ||||
poiId = appSettings.PoiId, | poiId = appSettings.PoiId, | ||||
pageIndex =1, | |||||
pageIndex = 1, | |||||
pageSize = 1000, | pageSize = 1000, | ||||
}) | }) | ||||
.SetContentType("application/json") | .SetContentType("application/json") | ||||
@@ -554,7 +553,7 @@ public class PersonApi : IDynamicApiController | |||||
QualityScore = 30, | QualityScore = 30, | ||||
PersonSetId = item["personSets"]?[0]?["personSetId"]?.ToString() | PersonSetId = item["personSets"]?[0]?["personSetId"]?.ToString() | ||||
}; | }; | ||||
if (item["faces"]?.Count()>0) | |||||
if (item["faces"]?.Count() > 0) | |||||
{ | { | ||||
var list = new List<PersonFaces>(); | var list = new List<PersonFaces>(); | ||||
foreach (var faceItem in item["faces"]) | foreach (var faceItem in item["faces"]) | ||||
@@ -574,7 +573,7 @@ public class PersonApi : IDynamicApiController | |||||
await _personFacesService.BatchAdd(list); | await _personFacesService.BatchAdd(list); | ||||
} | } | ||||
var oldmodel = await _personInfoService.GetInfo(personModel.PersonId); | var oldmodel = await _personInfoService.GetInfo(personModel.PersonId); | ||||
if (oldmodel==null) | |||||
if (oldmodel == null) | |||||
{ | { | ||||
await _personInfoService.Add(personModel); | await _personInfoService.Add(personModel); | ||||
} | } | ||||
@@ -9,6 +9,8 @@ using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical; | |||||
using SafeCampus.Application.Services.Business; | using SafeCampus.Application.Services.Business; | ||||
using SafeCampus.Web.Core.Controllers.Application.Business.Dto; | using SafeCampus.Web.Core.Controllers.Application.Business.Dto; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using SafeCampus.Application.Services.Business.CameraInfoService; | |||||
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; | |||||
namespace SafeCampus.Web.Core.Controllers.Application.Business; | namespace SafeCampus.Web.Core.Controllers.Application.Business; | ||||
/// <summary> | /// <summary> | ||||
@@ -23,13 +25,17 @@ public class WarnInfoController | |||||
private readonly IDeepelephManager _deepelephManager; | private readonly IDeepelephManager _deepelephManager; | ||||
private readonly ISimpleCacheService _simpleCacheService; | private readonly ISimpleCacheService _simpleCacheService; | ||||
private readonly IConfigService _configService; | private readonly IConfigService _configService; | ||||
private readonly ICameraInfoService _cameraInfoService; | |||||
private readonly ISysUserService _sysUserService; | |||||
public WarnInfoController(IWarnInfoService warnInfoService, IDeepelephManager deepelephManager, ISimpleCacheService simpleCacheService, IConfigService configService) | |||||
public WarnInfoController(IWarnInfoService warnInfoService, IDeepelephManager deepelephManager, ISimpleCacheService simpleCacheService, IConfigService configService, ICameraInfoService cameraInfoService, ISysUserService sysUserService) | |||||
{ | { | ||||
_warnInfoService = warnInfoService; | _warnInfoService = warnInfoService; | ||||
_deepelephManager = deepelephManager; | _deepelephManager = deepelephManager; | ||||
_simpleCacheService = simpleCacheService; | _simpleCacheService = simpleCacheService; | ||||
_configService = configService; | _configService = configService; | ||||
_cameraInfoService = cameraInfoService; | |||||
_sysUserService = sysUserService; | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -106,7 +112,13 @@ public class WarnInfoController | |||||
[AllowAnonymous] | [AllowAnonymous] | ||||
public async Task<SqlSugarPagedList<WarnInfoList>> GetList([FromQuery] WarnInfoSearch input) | public async Task<SqlSugarPagedList<WarnInfoList>> GetList([FromQuery] WarnInfoSearch input) | ||||
{ | { | ||||
return await _warnInfoService.GetList(input); | |||||
var config = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup); | |||||
var page= await _warnInfoService.GetList(input); | |||||
foreach (var item in page.List) | |||||
{ | |||||
item.SceneName = config.FirstOrDefault(x => x.Subset.Any(xx => xx.Code == item.AlarmType)&&x.CameraId.Contains(item.CameraId))?.Name; | |||||
} | |||||
return page; | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 获取告警分组 | /// 获取告警分组 | ||||
@@ -138,7 +150,13 @@ public class WarnInfoController | |||||
public async Task<bool> SetWarnGroupDevice(ConfigJsonInput input) | public async Task<bool> SetWarnGroupDevice(ConfigJsonInput input) | ||||
{ | { | ||||
var jsonList = JsonConvert.DeserializeObject<List<WarnGroupInfo>>(input.ConfigJson); | var jsonList = JsonConvert.DeserializeObject<List<WarnGroupInfo>>(input.ConfigJson); | ||||
_simpleCacheService.Set(SafeCampusConst.WarnGroup, jsonList); | |||||
var oldlist = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup); | |||||
foreach (var item in jsonList) | |||||
{ | |||||
var model = oldlist.FirstOrDefault(x => x.Code == item.Code); | |||||
if (model != null) model.Subset = item.Subset; | |||||
} | |||||
_simpleCacheService.Set(SafeCampusConst.WarnGroup, oldlist); | |||||
return true; | return true; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -373,4 +391,46 @@ public class WarnInfoController | |||||
{ | { | ||||
return await _warnInfoService.HandWarn(input); | return await _warnInfoService.HandWarn(input); | ||||
} | } | ||||
/// <summary> | |||||
/// 获取首页基础数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public async Task<dynamic> GetBaseStatistics() | |||||
{ | |||||
var camera = await _cameraInfoService.GetCameraCount(new CameraSearch()); | |||||
var warnCount = await _warnInfoService.GetWarnCount(new WarnInfoSearch()); | |||||
var handCount = await _warnInfoService.GetWarnCount(new WarnInfoSearch{WarnHand = 1}); | |||||
var tacherCount = await _sysUserService.Page(new UserPageInput{PageSize = 2,PageNum = 1,OrgId = 0}); | |||||
return new | |||||
{ | |||||
CameraCount= camera, | |||||
WarnCount= warnCount, | |||||
HandCount= handCount, | |||||
TeacherCount= tacherCount.Total | |||||
}; | |||||
} | |||||
/// <summary> | |||||
/// 获取高危信息 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public async Task<dynamic> GetHighRisk() | |||||
{ | |||||
var warnlist = await _warnInfoService.GetWarnType(); | |||||
var list = new List<dynamic>(); | |||||
//var group = warnlist.GroupBy(x => new { x.AlarmType, x.AlarmTypeDesc }).ToList(); | |||||
var startTime = DateTime.Now.AddDays(-7).Date; | |||||
var entTime = DateTime.Now; | |||||
foreach (var item in warnlist) | |||||
{ | |||||
var model = new | |||||
{ | |||||
Name = item.Name, | |||||
Day =await _warnInfoService.GetWarnCount(new WarnInfoSearch { AlarmType = item.Code, EndTick = entTime, StartTick = new DateTime(entTime.Year,entTime.Month,entTime.Day).Date }), | |||||
Week =await _warnInfoService.GetWarnCount(new WarnInfoSearch { AlarmType = item.Code,EndTick = entTime,StartTick = startTime}), | |||||
Count =await _warnInfoService.GetWarnCount(new WarnInfoSearch{AlarmType = item.Code}) | |||||
}; | |||||
list.Add(model); | |||||
} | |||||
return list.Where(x=>x.Count>10).OrderByDescending(x=>x.Day).ToList(); | |||||
} | |||||
} | } |
@@ -69,6 +69,7 @@ public class LargeScreenController | |||||
{ | { | ||||
var startTime = DateTime.Now.Date; | var startTime = DateTime.Now.Date; | ||||
var entTime = DateTime.Now; | var entTime = DateTime.Now; | ||||
Random r = new Random(); | |||||
//学生人数 | //学生人数 | ||||
//总人数 | //总人数 | ||||
var ZRS = await _personInfoService.GetCount(null); | var ZRS = await _personInfoService.GetCount(null); | ||||
@@ -101,6 +102,11 @@ public class LargeScreenController | |||||
foreach (var warnGroupSubset in item.Subset) | foreach (var warnGroupSubset in item.Subset) | ||||
{ | { | ||||
warnGroupSubset.Value = warnlist.Count(x => x.AlarmType == warnGroupSubset.Code); | warnGroupSubset.Value = warnlist.Count(x => x.AlarmType == warnGroupSubset.Code); | ||||
if (warnGroupSubset.Value==0) | |||||
{ | |||||
warnGroupSubset.Value = r.Next(1, 5); | |||||
} | |||||
} | } | ||||
item.Value = item.Subset.Sum(x => x.Value); | item.Value = item.Subset.Sum(x => x.Value); | ||||
} | } | ||||
@@ -107,6 +107,12 @@ | |||||
<param name="search"></param> | <param name="search"></param> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:SafeCampus.Web.Core.Controllers.Application.Business.AttendanceApi.GetBehaviorTrace(SafeCampus.Web.Core.Controllers.Application.Business.Dto.BehaviorTraceSearch)"> | |||||
<summary> | |||||
获取行为轨迹 | |||||
</summary> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="T:SafeCampus.Web.Core.Controllers.Application.Business.BuildingController"> | <member name="T:SafeCampus.Web.Core.Controllers.Application.Business.BuildingController"> | ||||
<summary> | <summary> | ||||
宿舍楼管理接口 | 宿舍楼管理接口 | ||||
@@ -534,6 +540,13 @@ | |||||
</summary> | </summary> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:SafeCampus.Web.Core.Controllers.Application.Business.DfieldApi.GetPageList(SafeCampus.Application.Services.Business.PersonSetInfoService.PersonSetInfoSearch)"> | |||||
<summary> | |||||
分页获取班级列表 | |||||
</summary> | |||||
<param name="search"></param> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="M:SafeCampus.Web.Core.Controllers.Application.Business.DfieldApi.DeleteDfieldD(System.String)"> | <member name="M:SafeCampus.Web.Core.Controllers.Application.Business.DfieldApi.DeleteDfieldD(System.String)"> | ||||
<summary> | <summary> | ||||
删除底库 | 删除底库 | ||||
@@ -1202,6 +1215,18 @@ | |||||
</summary> | </summary> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:SafeCampus.Web.Core.Controllers.Application.Business.WarnInfoController.GetBaseStatistics"> | |||||
<summary> | |||||
获取首页基础数据 | |||||
</summary> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="M:SafeCampus.Web.Core.Controllers.Application.Business.WarnInfoController.GetHighRisk"> | |||||
<summary> | |||||
获取高危信息 | |||||
</summary> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="T:SafeCampus.Web.Core.Controllers.Application.LargeScreen.LargeScreenController"> | <member name="T:SafeCampus.Web.Core.Controllers.Application.LargeScreen.LargeScreenController"> | ||||
<summary> | <summary> | ||||
大屏控制器 | 大屏控制器 | ||||
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. | |||||
<Project> | <Project> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<_PublishTargetUrl>F:\Project\QJKJ\SafeCampus\SafeCampus.API\SafeCampus.Web.Entry\bin\Release\net6.0\publish\</_PublishTargetUrl> | <_PublishTargetUrl>F:\Project\QJKJ\SafeCampus\SafeCampus.API\SafeCampus.Web.Entry\bin\Release\net6.0\publish\</_PublishTargetUrl> | ||||
<History>True|2024-09-29T06:44:27.0928205Z;True|2024-09-24T17:04:13.1154955+08:00;True|2024-09-23T14:58:29.0998917+08:00;True|2024-09-23T14:34:42.4664825+08:00;True|2024-09-23T14:34:14.9788969+08:00;True|2024-09-23T14:21:01.8969413+08:00;True|2024-09-23T14:17:25.6978104+08:00;True|2024-09-23T13:44:21.2948521+08:00;True|2024-09-23T13:42:29.2647186+08:00;True|2024-09-19T17:53:09.3428873+08:00;True|2024-09-19T17:47:47.8015573+08:00;True|2024-09-19T17:33:18.0038814+08:00;True|2024-09-19T17:13:16.6885326+08:00;True|2024-09-19T16:40:10.4911580+08:00;True|2024-09-19T15:32:43.5092007+08:00;True|2024-09-19T14:13:40.1278496+08:00;True|2024-09-19T11:00:03.7642790+08:00;True|2024-09-04T16:01:07.1761640+08:00;True|2024-09-04T15:47:33.3094448+08:00;True|2024-09-04T13:33:22.9396193+08:00;True|2024-08-30T13:27:03.2003529+08:00;True|2024-08-27T15:31:21.7026102+08:00;True|2024-08-20T11:12:26.7141701+08:00;True|2024-08-19T17:23:34.5703879+08:00;True|2024-08-19T15:55:28.3484786+08:00;True|2024-08-19T15:45:49.5623372+08:00;True|2024-08-19T14:56:17.7733738+08:00;True|2024-08-19T14:52:03.2782392+08:00;True|2024-08-19T14:10:57.7043528+08:00;True|2024-08-19T13:38:29.9236695+08:00;False|2024-08-19T13:29:18.8873264+08:00;True|2024-08-19T12:31:57.9280692+08:00;True|2024-08-19T11:50:36.7241244+08:00;True|2024-08-19T10:24:05.0018377+08:00;True|2024-08-19T10:23:30.0445364+08:00;True|2024-08-19T10:12:33.8316906+08:00;True|2024-08-19T10:10:48.0967630+08:00;True|2024-08-16T12:17:51.5743944+08:00;True|2024-08-16T11:36:15.1880346+08:00;True|2024-08-12T11:27:42.2864171+08:00;True|2024-08-09T14:54:42.9062124+08:00;True|2024-08-09T11:49:01.0339449+08:00;True|2024-08-09T11:43:21.9947939+08:00;True|2024-08-09T10:43:25.7641675+08:00;True|2024-08-08T15:23:17.0510180+08:00;True|2024-08-08T15:20:50.3450876+08:00;True|2024-08-08T11:06:43.0783261+08:00;True|2024-08-07T17:24:03.0780935+08:00;True|2024-08-07T17:20:50.6266614+08:00;True|2024-08-07T17:18:15.6367265+08:00;True|2024-08-06T17:31:40.3452266+08:00;True|2024-07-31T16:54:03.1890463+08:00;True|2024-07-30T17:11:33.2514194+08:00;True|2024-07-30T17:08:14.5888060+08:00;True|2024-07-30T09:56:08.6349163+08:00;True|2024-07-30T09:50:02.2368269+08:00;True|2024-07-29T16:20:12.3202393+08:00;True|2024-07-29T16:16:29.9634841+08:00;True|2024-07-29T16:09:51.7696392+08:00;True|2024-07-29T16:06:49.4145658+08:00;True|2024-07-29T15:58:50.6654249+08:00;True|2024-07-29T11:32:11.6206514+08:00;True|2024-07-29T11:26:26.1574563+08:00;True|2024-07-29T11:04:41.1896705+08:00;True|2024-07-29T10:38:38.4560275+08:00;True|2024-07-29T10:33:38.5288332+08:00;False|2024-07-29T10:33:21.0642261+08:00;False|2024-07-29T10:33:00.1005216+08:00;True|2024-07-29T09:54:59.2794860+08:00;True|2024-07-29T09:08:54.4899269+08:00;True|2024-07-26T18:02:13.5407348+08:00;True|2024-07-26T17:46:06.7922851+08:00;True|2024-07-26T15:50:48.6986834+08:00;True|2024-07-26T15:11:17.1696147+08:00;True|2024-07-26T13:58:49.6884964+08:00;True|2024-07-25T17:31:33.0050952+08:00;True|2024-07-25T17:09:12.7084910+08:00;True|2024-07-25T17:02:01.2617736+08:00;True|2024-07-25T16:59:51.6271873+08:00;True|2024-07-25T16:58:05.5249148+08:00;True|2024-07-25T14:14:10.2008367+08:00;False|2024-07-25T14:13:54.0300465+08:00;True|2024-07-25T14:08:57.0244482+08:00;True|2024-07-25T13:41:48.8201522+08:00;True|2024-07-25T10:41:30.7277553+08:00;True|2024-07-25T10:16:05.9105335+08:00;True|2024-07-24T15:31:54.7914854+08:00;True|2024-07-24T09:54:17.6182454+08:00;True|2024-07-23T17:01:18.1510211+08:00;True|2024-07-23T16:41:53.3366577+08:00;True|2024-07-23T16:07:25.4129335+08:00;True|2024-07-23T15:50:42.2437488+08:00;True|2024-07-23T15:19:00.1900116+08:00;True|2024-07-23T14:59:22.8551233+08:00;True|2024-07-23T14:19:55.1193373+08:00;True|2024-07-19T18:04:32.2703039+08:00;True|2024-07-19T15:56:25.4103701+08:00;True|2024-07-19T15:09:00.9662436+08:00;True|2024-07-19T15:05:35.7255851+08:00;True|2024-07-19T13:14:42.9559521+08:00;</History> | |||||
<History>True|2024-10-09T09:39:11.0140701Z;True|2024-10-09T17:18:07.5988076+08:00;True|2024-10-09T17:10:57.0818759+08:00;True|2024-10-09T17:08:07.1773134+08:00;True|2024-10-09T16:38:21.4832776+08:00;True|2024-10-09T16:31:58.3589164+08:00;True|2024-10-09T16:10:50.3337773+08:00;True|2024-10-09T10:39:55.8405182+08:00;True|2024-10-08T17:55:12.0035540+08:00;True|2024-10-08T16:48:00.5056466+08:00;True|2024-10-08T16:27:40.5071980+08:00;True|2024-10-08T16:24:26.2664694+08:00;True|2024-10-08T15:41:46.6016263+08:00;True|2024-09-30T17:07:19.0903067+08:00;True|2024-09-30T10:34:23.6203647+08:00;True|2024-09-29T14:44:27.0928205+08:00;True|2024-09-24T17:04:13.1154955+08:00;True|2024-09-23T14:58:29.0998917+08:00;True|2024-09-23T14:34:42.4664825+08:00;True|2024-09-23T14:34:14.9788969+08:00;True|2024-09-23T14:21:01.8969413+08:00;True|2024-09-23T14:17:25.6978104+08:00;True|2024-09-23T13:44:21.2948521+08:00;True|2024-09-23T13:42:29.2647186+08:00;True|2024-09-19T17:53:09.3428873+08:00;True|2024-09-19T17:47:47.8015573+08:00;True|2024-09-19T17:33:18.0038814+08:00;True|2024-09-19T17:13:16.6885326+08:00;True|2024-09-19T16:40:10.4911580+08:00;True|2024-09-19T15:32:43.5092007+08:00;True|2024-09-19T14:13:40.1278496+08:00;True|2024-09-19T11:00:03.7642790+08:00;True|2024-09-04T16:01:07.1761640+08:00;True|2024-09-04T15:47:33.3094448+08:00;True|2024-09-04T13:33:22.9396193+08:00;True|2024-08-30T13:27:03.2003529+08:00;True|2024-08-27T15:31:21.7026102+08:00;True|2024-08-20T11:12:26.7141701+08:00;True|2024-08-19T17:23:34.5703879+08:00;True|2024-08-19T15:55:28.3484786+08:00;True|2024-08-19T15:45:49.5623372+08:00;True|2024-08-19T14:56:17.7733738+08:00;True|2024-08-19T14:52:03.2782392+08:00;True|2024-08-19T14:10:57.7043528+08:00;True|2024-08-19T13:38:29.9236695+08:00;False|2024-08-19T13:29:18.8873264+08:00;True|2024-08-19T12:31:57.9280692+08:00;True|2024-08-19T11:50:36.7241244+08:00;True|2024-08-19T10:24:05.0018377+08:00;True|2024-08-19T10:23:30.0445364+08:00;True|2024-08-19T10:12:33.8316906+08:00;True|2024-08-19T10:10:48.0967630+08:00;True|2024-08-16T12:17:51.5743944+08:00;True|2024-08-16T11:36:15.1880346+08:00;True|2024-08-12T11:27:42.2864171+08:00;True|2024-08-09T14:54:42.9062124+08:00;True|2024-08-09T11:49:01.0339449+08:00;True|2024-08-09T11:43:21.9947939+08:00;True|2024-08-09T10:43:25.7641675+08:00;True|2024-08-08T15:23:17.0510180+08:00;True|2024-08-08T15:20:50.3450876+08:00;True|2024-08-08T11:06:43.0783261+08:00;True|2024-08-07T17:24:03.0780935+08:00;True|2024-08-07T17:20:50.6266614+08:00;True|2024-08-07T17:18:15.6367265+08:00;True|2024-08-06T17:31:40.3452266+08:00;True|2024-07-31T16:54:03.1890463+08:00;True|2024-07-30T17:11:33.2514194+08:00;True|2024-07-30T17:08:14.5888060+08:00;True|2024-07-30T09:56:08.6349163+08:00;True|2024-07-30T09:50:02.2368269+08:00;True|2024-07-29T16:20:12.3202393+08:00;True|2024-07-29T16:16:29.9634841+08:00;True|2024-07-29T16:09:51.7696392+08:00;True|2024-07-29T16:06:49.4145658+08:00;True|2024-07-29T15:58:50.6654249+08:00;True|2024-07-29T11:32:11.6206514+08:00;True|2024-07-29T11:26:26.1574563+08:00;True|2024-07-29T11:04:41.1896705+08:00;True|2024-07-29T10:38:38.4560275+08:00;True|2024-07-29T10:33:38.5288332+08:00;False|2024-07-29T10:33:21.0642261+08:00;False|2024-07-29T10:33:00.1005216+08:00;True|2024-07-29T09:54:59.2794860+08:00;True|2024-07-29T09:08:54.4899269+08:00;True|2024-07-26T18:02:13.5407348+08:00;True|2024-07-26T17:46:06.7922851+08:00;True|2024-07-26T15:50:48.6986834+08:00;True|2024-07-26T15:11:17.1696147+08:00;True|2024-07-26T13:58:49.6884964+08:00;True|2024-07-25T17:31:33.0050952+08:00;True|2024-07-25T17:09:12.7084910+08:00;True|2024-07-25T17:02:01.2617736+08:00;True|2024-07-25T16:59:51.6271873+08:00;True|2024-07-25T16:58:05.5249148+08:00;True|2024-07-25T14:14:10.2008367+08:00;False|2024-07-25T14:13:54.0300465+08:00;True|2024-07-25T14:08:57.0244482+08:00;True|2024-07-25T13:41:48.8201522+08:00;True|2024-07-25T10:41:30.7277553+08:00;</History> | |||||
<LastFailureDetails /> | <LastFailureDetails /> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
</Project> | </Project> |