wwp 3 months ago
parent
commit
d1eb379514
17 changed files with 342 additions and 18 deletions
  1. +119
    -0
      SafeCampus.API/SafeCampus.Application/Manager/DeepelephManager/DeepelephManager.cs
  2. +30
    -0
      SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml
  3. +2
    -0
      SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/AttendanceService.cs
  4. +26
    -0
      SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/Dto/AttendanceList.cs
  5. +8
    -0
      SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoDto.cs
  6. +4
    -0
      SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs
  7. +1
    -1
      SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/IWarnInfoService.cs
  8. +5
    -2
      SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs
  9. +1
    -1
      SafeCampus.API/SafeCampus.Core/Dto/WarnGroupInfo.cs
  10. +23
    -1
      SafeCampus.API/SafeCampus.Core/Enum/AlarmType.cs
  11. +20
    -0
      SafeCampus.API/SafeCampus.Core/SafeCampus.Core.xml
  12. +5
    -0
      SafeCampus.API/SafeCampus.System/Entity/Attendance.cs
  13. +5
    -0
      SafeCampus.API/SafeCampus.System/SafeCampus.System.xml
  14. +9
    -0
      SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/AlarmApi.cs
  15. +65
    -12
      SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/LargeScreen/LargeScreenController.cs
  16. +18
    -0
      SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml
  17. +1
    -1
      SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user

+ 119
- 0
SafeCampus.API/SafeCampus.Application/Manager/DeepelephManager/DeepelephManager.cs View File

@@ -394,6 +394,123 @@ public class DeepelephManager : IDeepelephManager, IScoped
{ {
dayEnum = AlarmType.class_room_call; dayEnum = AlarmType.class_room_call;
} }

if (dayEnum==AlarmType.lie_on_table)
{
}
else
{
#region 添加预警

var ymmodel = new WarnInfoDto
{
TenantCode = body["tenantCode"]?.ToString(),
PoiId = body["poiId"]?.ToString(),
AlarmId = body["alarmId"]?.ToString(),
AlarmType = body["alarmType"]?.ToString(),
//AlarmTypeDesc = dayEnum.GetDescription(),
CameraId = body["cameraId"]?.ToString(),
Tick = TimestampToDateTime(body["tick"].ToString()),
SnapshotUrl = body["snapshotUrl"]?.ToString(),
Rects = body["rects"]?.ToString(),
Tags = body["tags"]?.ToString(),
Extend = body["extend"]?.ToString(),
//PersonType = personEnum.GetDescription(),
WarnHand = 0,

};
PersonType personEnum;

if (body["extend"] != null)
{
var extend = JsonConvert.DeserializeObject<JObject>(body["extend"].ToString());
ymmodel.PersonId = extend?["personId"]?.ToString();
ymmodel.PersonSetId = extend?["personSetId"]?.ToString();
ymmodel.ClothId = extend?["clothId"]?.ToString();
ymmodel.ClothsSetId = extend?["clothsSetId"]?.ToString();
ymmodel.Gender = extend?["genderScore"]?.ToString();
ymmodel.TrackId = extend?["trackId"]?.ToString();
ymmodel.SpeedLevel = extend?["speedLevel"]?.ToString();
if (extend["clothSimilarity"] != null)
ymmodel.ClothSimilarity = extend?["clothSimilarity"]?.ParseToFloat();
if (extend["count"] != null)
ymmodel.Count = extend?["count"]?.ParseToInt();
if (extend["duration"] != null)
ymmodel.Duration = extend?["duration"]?.ParseToInt();
if (extend["faceSimilarity"] != null)
ymmodel.FaceSimilarity = extend?["faceSimilarity"]?.ParseToFloat();
if (extend["maxAroundTracks"] != null)
ymmodel.MaxAroundTracks = extend?["maxAroundTracks"]?.ParseToInt();

if (extend["genderScore"] != null)
{
if ((float)extend["genderScore"][0] > 0.6)
{
ymmodel.Gender = "男性";
}
else if ((float)extend["genderScore"][1] > 0.6)
{
ymmodel.Gender = "女性";
}
else if ((float)extend["genderScore"][2] > 0.6)
{
ymmodel.Gender = "不确定";
}
}
if (extend["personType"] != null)
{
if (!Enum.TryParse(extend?["personType"]?.ToString(), out personEnum))
{
personEnum = PersonType.unkonwn;
}
}
else
{
personEnum = PersonType.unkonwn;
}

}
else
{
personEnum = PersonType.unkonwn;
}

ymmodel.AlarmTypeDesc = dayEnum.GetDescription();
ymmodel.PersonType = personEnum.GetDescription();

var yjsignImg = Path.Combine(Directory.GetCurrentDirectory(), "Files", App.Configuration["AppInfo:AlarmImg"], ymmodel.AlarmId + ".jpg");
var yjsteam = await ymmodel.SnapshotUrl.GetAsByteArrayAsync();
ymmodel.SnapshotUrl = $"/Files/{App.Configuration["AppInfo:AlarmImg"]}/{ymmodel.AlarmId}.jpg";
using (MemoryStream ms = new MemoryStream(yjsteam))
{
using (Bitmap bmp = new Bitmap(ms))
{
using (Graphics g = Graphics.FromImage(bmp))
{
using (Pen pen = new Pen(Color.Red, 3))
{
foreach (var item in body["rects"])
{
Rectangle rect = new Rectangle((int)item["left"], (int)item["top"], (int)item["width"], (int)item["height"]);
g.DrawRectangle(pen, rect);
}
}
}
bmp.Save(yjsignImg, ImageFormat.Jpeg);
}
}
Scoped.Create((_, scope) =>
{
var services = scope.ServiceProvider;
var _repository = services.GetService<IWarnInfoService>();
_repository.Add(ymmodel);
});

#endregion
}
#region 添加点名

var model = new ClassRoomCallDto var model = new ClassRoomCallDto
{ {
TenantCode = body["tenantCode"]?.ToString(), TenantCode = body["tenantCode"]?.ToString(),
@@ -442,6 +559,8 @@ public class DeepelephManager : IDeepelephManager, IScoped
var _repository = services.GetService<IClassRoomCallService>(); var _repository = services.GetService<IClassRoomCallService>();
_repository.Add(model); _repository.Add(model);
}); });

#endregion
} }
} }
else if (json["type"].ToString() == "cmd") else if (json["type"].ToString() == "cmd")


+ 30
- 0
SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml View File

@@ -225,6 +225,21 @@
人员id 人员id
</summary> </summary>
</member> </member>
<member name="P:SafeCampus.Application.Services.Business.AttendanceService.AttendanceList.PersonName">
<summary>
人员名称
</summary>
</member>
<member name="P:SafeCampus.Application.Services.Business.AttendanceService.AttendanceList.DormitName">
<summary>
寝室名称
</summary>
</member>
<member name="P:SafeCampus.Application.Services.Business.AttendanceService.AttendanceList.PersonSetName">
<summary>
班级名称
</summary>
</member>
<member name="P:SafeCampus.Application.Services.Business.AttendanceService.AttendanceList.IsAuto"> <member name="P:SafeCampus.Application.Services.Business.AttendanceService.AttendanceList.IsAuto">
<summary> <summary>
是否自动上报 是否自动上报
@@ -1357,6 +1372,16 @@
考勤列表 考勤列表
</summary> </summary>
</member> </member>
<member name="P:SafeCampus.Application.Services.Business.PersonInfoService.PersonInfoDto.State">
<summary>
出勤状态
</summary>
</member>
<member name="P:SafeCampus.Application.Services.Business.PersonInfoService.PersonInfoDto.InsTime">
<summary>
进班时间
</summary>
</member>
<member name="P:SafeCampus.Application.Services.Business.PersonInfoService.PersonInfoSearch.PersonName"> <member name="P:SafeCampus.Application.Services.Business.PersonInfoService.PersonInfoSearch.PersonName">
<summary> <summary>
人员名称 人员名称
@@ -1666,6 +1691,11 @@
摄像头快照,原链接有效期为2小时,获取到数据后下载到本地 摄像头快照,原链接有效期为2小时,获取到数据后下载到本地
</summary> </summary>
</member> </member>
<member name="P:SafeCampus.Application.Services.Business.Warn.Dto.WarnInfoList.PersonId">
<summary>
人员id
</summary>
</member>
<member name="P:SafeCampus.Application.Services.Business.Warn.Dto.WarnInfoList.PersonName"> <member name="P:SafeCampus.Application.Services.Business.Warn.Dto.WarnInfoList.PersonName">
<summary> <summary>
人员名称 人员名称


+ 2
- 0
SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/AttendanceService.cs View File

@@ -53,6 +53,8 @@ public class AttendanceService:DbRepository<Attendance>, IAttendanceService
{ {
var query = Context.Queryable<Attendance>() var query = Context.Queryable<Attendance>()
//.Includes(x => x.CameraInfoItem) //.Includes(x => x.CameraInfoItem)
.Includes(x=>x.PersonInfoItem,x=>x.DormitoryInfoItem)
.Includes(x=>x.PersonInfoItem,x=>x.PersonSetInfoItem)
.WhereIF(search.IsAuto.HasValue, x => x.IsAuto == search.IsAuto) .WhereIF(search.IsAuto.HasValue, x => x.IsAuto == search.IsAuto)
.WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId) .WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId)
.WhereIF(!string.IsNullOrEmpty(search.PersonId), x => x.PersonId == search.PersonId) .WhereIF(!string.IsNullOrEmpty(search.PersonId), x => x.PersonId == search.PersonId)


+ 26
- 0
SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/Dto/AttendanceList.cs View File

@@ -31,6 +31,20 @@ public class AttendanceList
/// </summary> /// </summary>
public string PersonId { get; set; } public string PersonId { get; set; }
/// <summary> /// <summary>
/// 人员名称
/// </summary>
public string PersonName { get; set; }
/// <summary>
/// 寝室名称
/// </summary>
public string DormitName { get; set; }
//人员性别
public string Gender { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string PersonSetName { get; set; }
/// <summary>
/// 是否自动上报 /// 是否自动上报
/// </summary> /// </summary>
public bool IsAuto { get; set; } public bool IsAuto { get; set; }
@@ -70,4 +84,16 @@ public class AttendanceList
/// 创建时间 /// 创建时间
/// </summary> /// </summary>
public DateTime CreateTime { get; set; } public DateTime CreateTime { get; set; }
}

public class AttendanceListMapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.ForType<Attendance, AttendanceList>()
.Map(x => x.PersonName, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.Name : "")
.Map(x => x.PersonSetName, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.PersonSetInfoItem.PersonSetName : "")
.Map(x => x.DormitName, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.DormitoryInfoItem.Name : "")
.Map(x => x.Gender, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.Gender : "");
}
} }

+ 8
- 0
SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoDto.cs View File

@@ -58,6 +58,14 @@ public class PersonInfoDto
/// 考勤列表 /// 考勤列表
/// </summary> /// </summary>
public List<Attendance> Attendances { get; set; } public List<Attendance> Attendances { get; set; }
/// <summary>
/// 出勤状态
/// </summary>
public string State { get; set; }
/// <summary>
/// 进班时间
/// </summary>
public DateTime? InsTime { get; set; }
} }
public class PersonInfoDtoMapper : IRegister public class PersonInfoDtoMapper : IRegister
{ {


+ 4
- 0
SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs View File

@@ -37,6 +37,10 @@ public class WarnInfoList
/// </summary> /// </summary>
public string SnapshotUrl { get; set; } public string SnapshotUrl { get; set; }
/// <summary> /// <summary>
/// 人员id
/// </summary>
public string PersonId { get; set; }
/// <summary>
/// 人员名称 /// 人员名称
/// </summary> /// </summary>
public string PersonName { get; set; } public string PersonName { get; set; }


+ 1
- 1
SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/IWarnInfoService.cs View File

@@ -15,7 +15,7 @@ public interface IWarnInfoService:IApiBaseInterface<WarnInfoDto, WarnInfoList, W
/// 获取列表不分页 /// 获取列表不分页
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task<List<WarnInfo>> GetListNoPage(WarnInfoSearch search);
Task<List<WarnInfoList>> GetListNoPage(WarnInfoSearch search);
/// <summary> /// <summary>
/// 获取告警分离列表 /// 获取告警分离列表
/// </summary> /// </summary>


+ 5
- 2
SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs View File

@@ -127,9 +127,12 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient
return true; return true;
} }


public async Task<List<WarnInfo>> GetListNoPage(WarnInfoSearch search)
public async Task<List<WarnInfoList>> GetListNoPage(WarnInfoSearch search)
{ {
var query = Context.Queryable<WarnInfo>() 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(search.WarnHand.HasValue, x => x.WarnHand == search.WarnHand)
.WhereIF(!string.IsNullOrEmpty(search.AlarmType), x => x.AlarmType == search.AlarmType) .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.AlarmTypes!=null&&search.AlarmTypes.Any(),x=>search.AlarmTypes.Contains(x.AlarmType))
@@ -140,7 +143,7 @@ public class WarnInfoService:DbRepository<WarnInfo>, IWarnInfoService,ITransient


var list = await query.OrderByDescending(x => x.Tick) var list = await query.OrderByDescending(x => x.Tick)
.ToListAsync(); .ToListAsync();
return list;
return list.Adapt<List<WarnInfoList>>();
} }
public async Task<List<WarnType>>GetWarnType() public async Task<List<WarnType>>GetWarnType()
{ {


+ 1
- 1
SafeCampus.API/SafeCampus.Core/Dto/WarnGroupInfo.cs View File

@@ -12,5 +12,5 @@ public class WarnGroupSubset
public string Name { get; set; } public string Name { get; set; }
public string Code { get; set; } public string Code { get; set; }
public bool State {get;set;} public bool State {get;set;}
public int Count { get; set; }
public int Value { get; set; }
} }

+ 23
- 1
SafeCampus.API/SafeCampus.Core/Enum/AlarmType.cs View File

@@ -116,5 +116,27 @@ public enum AlarmType
/// 车辆超速 /// 车辆超速
/// </summary> /// </summary>
[Description("车辆超速")] [Description("车辆超速")]
vehicle_speeding
vehicle_speeding,
/// <summary>
/// 违规占道
/// </summary>
[Description("违规占道")]
violation_occupy,
/// <summary>
/// 玩手机
/// </summary>
[Description("玩手机")]
play_phone,
/// <summary>
/// 骑车未戴头盔
/// </summary>
[Description("骑车未戴头盔")]
bike_without_helmet,
/// <summary>
/// 儿童骑平衡车
/// </summary>
[Description("儿童骑平衡车/滑板车")]
segway_with_child


} }

+ 20
- 0
SafeCampus.API/SafeCampus.Core/SafeCampus.Core.xml View File

@@ -436,6 +436,26 @@
车辆超速 车辆超速
</summary> </summary>
</member> </member>
<member name="F:SafeCampus.Core.AlarmType.violation_occupy">
<summary>
违规占道
</summary>
</member>
<member name="F:SafeCampus.Core.AlarmType.play_phone">
<summary>
玩手机
</summary>
</member>
<member name="F:SafeCampus.Core.AlarmType.bike_without_helmet">
<summary>
骑车未戴头盔
</summary>
</member>
<member name="F:SafeCampus.Core.AlarmType.segway_with_child">
<summary>
儿童骑平衡车
</summary>
</member>
<member name="T:SafeCampus.Core.AuthDeviceTypeEnum"> <member name="T:SafeCampus.Core.AuthDeviceTypeEnum">
<summary> <summary>
登录设备类型枚举 登录设备类型枚举


+ 5
- 0
SafeCampus.API/SafeCampus.System/Entity/Attendance.cs View File

@@ -96,4 +96,9 @@ public class Attendance : PrimaryKeyEntity
/// </summary> /// </summary>
[Navigate(NavigateType.OneToOne, nameof(CameraId), nameof(CameraInfo.SensorId))] [Navigate(NavigateType.OneToOne, nameof(CameraId), nameof(CameraInfo.SensorId))]
public CameraInfo CameraInfoItem { get; set; } public CameraInfo CameraInfoItem { get; set; }
/// <summary>
/// 寝室信息
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(PersonId), nameof(PersonInfo.PersonId))]
public PersonInfo PersonInfoItem { get; set; }
} }

+ 5
- 0
SafeCampus.API/SafeCampus.System/SafeCampus.System.xml View File

@@ -786,6 +786,11 @@
摄像头信息 摄像头信息
</summary> </summary>
</member> </member>
<member name="P:SafeCampus.System.Attendance.PersonInfoItem">
<summary>
寝室信息
</summary>
</member>
<member name="T:SafeCampus.System.BuildingInfo"> <member name="T:SafeCampus.System.BuildingInfo">
<summary> <summary>
学生宿舍楼表 学生宿舍楼表


+ 9
- 0
SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/AlarmApi.cs View File

@@ -123,4 +123,13 @@ public class AlarmApi:IDynamicApiController
await _hubContext.Clients.All.ReceiveMessage(user,msg); await _hubContext.Clients.All.ReceiveMessage(user,msg);
return true; return true;
} }
/// <summary>
/// 测试
/// </summary>
/// <returns></returns>
public async Task<bool> Test()
{
Thread.Sleep(5000);
return true;
}
} }

+ 65
- 12
SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/LargeScreen/LargeScreenController.cs View File

@@ -13,6 +13,7 @@ using SafeCampus.Web.Core.Controllers.Application.Business;
using MoYu.RemoteRequest.Extensions; 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.PersonSetInfoService;


namespace SafeCampus.Web.Core.Controllers.Application.LargeScreen; namespace SafeCampus.Web.Core.Controllers.Application.LargeScreen;


@@ -35,9 +36,10 @@ public class LargeScreenController
private readonly IClassRoomCallTaskService _classRoomCallTaskService; private readonly IClassRoomCallTaskService _classRoomCallTaskService;
private readonly IClassRoomCallService _classRoomCallService; private readonly IClassRoomCallService _classRoomCallService;
private readonly IDeepelephManager _deepelephManager; private readonly IDeepelephManager _deepelephManager;
private readonly IPersonSetInfoService _personSetInfoService;




public LargeScreenController(IPersonInfoService personInfoService, ICameraGroupService cameraGroupService, IWarnInfoService warnInfoService, ISimpleCacheService simpleCacheService, IAttendanceService attendanceService, IBuildingService buildingService, IDormitoryService dormitoryService, IConfigService configService, IClassRoomCallTaskService classRoomCallTaskService, IClassRoomCallService classRoomCallService, IDeepelephManager deepelephManager)
public LargeScreenController(IPersonInfoService personInfoService, ICameraGroupService cameraGroupService, IWarnInfoService warnInfoService, ISimpleCacheService simpleCacheService, IAttendanceService attendanceService, IBuildingService buildingService, IDormitoryService dormitoryService, IConfigService configService, IClassRoomCallTaskService classRoomCallTaskService, IClassRoomCallService classRoomCallService, IDeepelephManager deepelephManager, IPersonSetInfoService personSetInfoService)
{ {
_personInfoService = personInfoService; _personInfoService = personInfoService;
_cameraGroupService = cameraGroupService; _cameraGroupService = cameraGroupService;
@@ -50,6 +52,7 @@ public class LargeScreenController
_classRoomCallTaskService = classRoomCallTaskService; _classRoomCallTaskService = classRoomCallTaskService;
_classRoomCallService = classRoomCallService; _classRoomCallService = classRoomCallService;
_deepelephManager = deepelephManager; _deepelephManager = deepelephManager;
_personSetInfoService = personSetInfoService;
} }


/// <summary> /// <summary>
@@ -82,23 +85,41 @@ public class LargeScreenController
var alarmStatistics = warnType.Select(x => new var alarmStatistics = warnType.Select(x => new
{ {
Name = x.Description, Name = x.Description,
Code = x.Name,
Count = warnlist.Count(xx => xx.AlarmType == x.Name)
}).Where(x => x.Count > 0).ToList();
//Code = x.Name,
Value = warnlist.Count(xx => xx.AlarmType == x.Name)
}).Where(x => x.Value > 0).ToList();
//按场景统计告警类型 //按场景统计告警类型
var warnGroup= _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup); var warnGroup= _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup);
foreach (var item in warnGroup) foreach (var item in warnGroup)
{ {
foreach (var warnGroupSubset in item.Subset) foreach (var warnGroupSubset in item.Subset)
{ {
warnGroupSubset.Count = warnlist.Count(x => x.AlarmType == warnGroupSubset.Code);
warnGroupSubset.Value = warnlist.Count(x => x.AlarmType == warnGroupSubset.Code);
} }
item.Count = item.Subset.Sum(x => x.Count);
item.Value = item.Subset.Sum(x => x.Value);
} }

var list = new List<object>
{
new { Name = "男生人数", Value = nan },
new { Name = "女生人数", Value = nv }
};
return new return new
{ {
//数字统计
StudentPersonNum=new{TotalNum=ZRS,MaleNum=nan,FemaleNum=nv}, StudentPersonNum=new{TotalNum=ZRS,MaleNum=nan,FemaleNum=nv},
AlarmStatisti=new{TypeStatisti=alarmStatistics,GroupStatisti=warnGroup,WarnList=warnlist},
StudentPersonStatistion=list,
//统计图表
AlarmStatisti =new
{
//按类型统计
TypeStatisti=alarmStatistics,
//按告警分组 统计
GroupStatisti=warnGroup,
//告警列表
WarnList=warnlist
},
//设备
Camera= SheBei, Camera= SheBei,
}; };
} }
@@ -178,22 +199,38 @@ public class LargeScreenController
//告警信息 //告警信息
var warnGroup = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup).FirstOrDefault(x=>x.Code=="ZHKT"); var warnGroup = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup).FirstOrDefault(x=>x.Code=="ZHKT");
var warnlist = await _warnInfoService.GetListNoPage(new WarnInfoSearch var warnlist = await _warnInfoService.GetListNoPage(new WarnInfoSearch
{ AlarmTypes = warnGroup.Subset.Select(x => x.Code).ToArray(),StartTick = startTime, EndTick = entTime });
{ AlarmTypes = warnGroup.Subset.Select(x => x.Code).ToArray(),StartTick = startTime, EndTick = entTime,CameraId = personSetId == "YS001" ? "SXT001" : "SXT002" });
//告警信息统计 //告警信息统计
var tongji = warnlist.GroupBy(x => x.AlarmTypeDesc).Select(x=>new{Labale=x.Key,Value=x.Count()}).ToList(); var tongji = warnlist.GroupBy(x => x.AlarmTypeDesc).Select(x=>new{Labale=x.Key,Value=x.Count()}).ToList();
foreach (var personInfoDto in xuesheng.List)
{
var rollCall=classRoom.Where(x=>x.PersonId==personInfoDto.PersonId).MinBy(x=>x.Tick);
if (rollCall != null)
{
personInfoDto.State = rollCall.Tick.TimeOfDay> TimeSpan.Parse("09:00:00")?"迟到":"正常";
personInfoDto.InsTime = rollCall.Tick;
}
else
{
personInfoDto.State = "缺勤";
personInfoDto.InsTime = null;
}
}
return new return new
{ {
ClassRoom=new ClassRoom=new
{ {
Teacher="王明祥", Teacher="王明祥",
ClassTime=DateTime.Now.ToString("yyyy-MM-dd 09:00:00"), ClassTime=DateTime.Now.ToString("yyyy-MM-dd 09:00:00"),
ClassBreakTime=DateTime.Now.ToString("yyyy-MM-dd 12:00:00")
ClassBreakTime=DateTime.Now.ToString("yyyy-MM-dd 12:00:00"),
CameraId= personSetId== "YS001" ? "SXT001": "SXT002"
}, },
AlarmList= warnlist, AlarmList= warnlist,
Statisti=new{Labale= tongji.Select(x=>x.Labale).ToList(),Value=tongji.Select(x=>x.Value).ToList()},
NormalClass= xuesheng.List.Count(x=>warnlist.Any(xx=>xx.PersonId==x.PersonId)),
//AlarmListCount= warnlist.GroupBy(x=>x.PersonId).Count(),
Statisti =new{Labale= tongji.Select(x=>x.Labale).ToList(),Value=tongji.Select(x=>x.Value).ToList()},
NormalClass= xuesheng.List.Count(x=>!warnlist.Any(xx=>xx.PersonId==x.PersonId)),
StudentList=xuesheng.List, StudentList=xuesheng.List,
RollCall= classRoom
//RollCall= classRoom.Where(x=>x.AlarmType!= "class_room_call").ToList()
}; };
} }
/// <summary> /// <summary>
@@ -253,4 +290,20 @@ public class LargeScreenController


throw Oops.Oh(model["message"].ToString()); throw Oops.Oh(model["message"].ToString());
} }
/// <summary>
/// 获取宿舍楼列表
/// </summary>
/// <returns></returns>
public async Task<List<BuildingInfoDto>> GetNoPageList()
{
return await _buildingService.GetNoPageList();
}
/// <summary>
/// 获取班级列表
/// </summary>
/// <returns></returns>
public async Task<dynamic> GetPersonSetNoPageList()
{
return await _personSetInfoService.GetPageList();
}
} }

+ 18
- 0
SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml View File

@@ -61,6 +61,12 @@
<param name="msg"></param> <param name="msg"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:SafeCampus.Web.Core.Controllers.Application.Business.AlarmApi.Test">
<summary>
测试
</summary>
<returns></returns>
</member>
<member name="T:SafeCampus.Web.Core.Controllers.Application.Business.AttendanceApi"> <member name="T:SafeCampus.Web.Core.Controllers.Application.Business.AttendanceApi">
<summary> <summary>
考勤事件管理接口 考勤事件管理接口
@@ -1116,6 +1122,18 @@
<param name="streamId">流ID</param> <param name="streamId">流ID</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:SafeCampus.Web.Core.Controllers.Application.LargeScreen.LargeScreenController.GetNoPageList">
<summary>
获取宿舍楼列表
</summary>
<returns></returns>
</member>
<member name="M:SafeCampus.Web.Core.Controllers.Application.LargeScreen.LargeScreenController.GetPersonSetNoPageList">
<summary>
获取班级列表
</summary>
<returns></returns>
</member>
<member name="P:SafeCampus.Web.Core.Controllers.Application.Violation.ReportExportInput.GroupCode"> <member name="P:SafeCampus.Web.Core.Controllers.Application.Violation.ReportExportInput.GroupCode">
<summary> <summary>
场景code 场景code


+ 1
- 1
SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user View File

@@ -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-07-31T08:54:03.1890463Z;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;False|2024-07-19T11:37:52.4020673+08:00;True|2024-07-19T11:10:22.8661346+08:00;True|2024-07-19T11:00:00.8819251+08:00;True|2024-07-19T10:45:46.8271770+08:00;True|2024-07-19T10:45:03.8183458+08:00;True|2024-07-18T18:04:42.1000382+08:00;True|2024-07-18T18:01:51.3964409+08:00;True|2024-07-18T17:57:50.3509206+08:00;True|2024-07-18T16:32:46.2184830+08:00;True|2024-07-18T16:00:11.1381449+08:00;True|2024-07-18T15:11:52.6472758+08:00;True|2024-07-18T11:54:49.4848006+08:00;True|2024-07-18T09:25:58.7204846+08:00;True|2024-07-17T17:29:28.6175272+08:00;True|2024-07-17T17:10:54.5184246+08:00;True|2024-07-17T16:57:59.8174060+08:00;True|2024-07-17T16:18:13.8137834+08:00;True|2024-07-17T15:59:16.2360757+08:00;True|2024-07-17T15:31:41.9159909+08:00;True|2024-07-17T14:41:14.6127340+08:00;True|2024-07-17T14:28:53.4455461+08:00;True|2024-07-17T14:09:44.1826222+08:00;True|2024-07-17T13:57:12.3372528+08:00;True|2024-07-17T11:39:19.5754602+08:00;True|2024-07-16T17:44:10.6162562+08:00;True|2024-07-16T17:13:48.3928403+08:00;True|2024-07-16T17:00:47.7458109+08:00;True|2024-07-16T14:07:19.3463408+08:00;True|2024-07-15T16:05:13.3561511+08:00;True|2024-07-15T16:03:45.7866063+08:00;True|2024-07-15T13:25:00.0791938+08:00;True|2024-07-12T13:45:20.6945520+08:00;True|2024-07-12T13:07:01.3911178+08:00;False|2024-07-12T13:06:45.7048568+08:00;True|2024-07-12T13:06:03.7557254+08:00;False|2024-07-12T11:51:55.8228106+08:00;True|2024-07-12T09:11:11.9982410+08:00;True|2024-07-12T09:10:42.9689716+08:00;True|2024-07-12T09:08:04.7560729+08:00;False|2024-07-12T09:07:07.7298589+08:00;True|2024-07-12T08:46:51.1170229+08:00;True|2024-07-11T18:30:09.2678639+08:00;True|2024-07-11T17:24:01.3152273+08:00;True|2024-07-10T16:39:46.3177813+08:00;True|2024-07-10T15:11:58.9145970+08:00;True|2024-07-09T16:25:08.5009553+08:00;True|2024-07-09T16:20:39.2341016+08:00;False|2024-07-09T16:20:17.8406033+08:00;True|2024-07-09T15:52:31.4276391+08:00;True|2024-07-08T17:13:08.0190137+08:00;True|2024-07-08T16:57:04.2357740+08:00;</History>
<History>True|2024-08-12T03:27:42.2864171Z;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;False|2024-07-19T11:37:52.4020673+08:00;True|2024-07-19T11:10:22.8661346+08:00;True|2024-07-19T11:00:00.8819251+08:00;True|2024-07-19T10:45:46.8271770+08:00;True|2024-07-19T10:45:03.8183458+08:00;True|2024-07-18T18:04:42.1000382+08:00;True|2024-07-18T18:01:51.3964409+08:00;True|2024-07-18T17:57:50.3509206+08:00;True|2024-07-18T16:32:46.2184830+08:00;True|2024-07-18T16:00:11.1381449+08:00;True|2024-07-18T15:11:52.6472758+08:00;True|2024-07-18T11:54:49.4848006+08:00;True|2024-07-18T09:25:58.7204846+08:00;True|2024-07-17T17:29:28.6175272+08:00;True|2024-07-17T17:10:54.5184246+08:00;True|2024-07-17T16:57:59.8174060+08:00;True|2024-07-17T16:18:13.8137834+08:00;True|2024-07-17T15:59:16.2360757+08:00;True|2024-07-17T15:31:41.9159909+08:00;True|2024-07-17T14:41:14.6127340+08:00;True|2024-07-17T14:28:53.4455461+08:00;True|2024-07-17T14:09:44.1826222+08:00;True|2024-07-17T13:57:12.3372528+08:00;True|2024-07-17T11:39:19.5754602+08:00;True|2024-07-16T17:44:10.6162562+08:00;True|2024-07-16T17:13:48.3928403+08:00;True|2024-07-16T17:00:47.7458109+08:00;True|2024-07-16T14:07:19.3463408+08:00;True|2024-07-15T16:05:13.3561511+08:00;True|2024-07-15T16:03:45.7866063+08:00;True|2024-07-15T13:25:00.0791938+08:00;True|2024-07-12T13:45:20.6945520+08:00;True|2024-07-12T13:07:01.3911178+08:00;False|2024-07-12T13:06:45.7048568+08:00;True|2024-07-12T13:06:03.7557254+08:00;False|2024-07-12T11:51:55.8228106+08:00;True|2024-07-12T09:11:11.9982410+08:00;True|2024-07-12T09:10:42.9689716+08:00;True|2024-07-12T09:08:04.7560729+08:00;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>

Loading…
Cancel
Save