diff --git a/SafeCampus.API/SafeCampus.Application/Manager/DeepelephManager/DeepelephManager.cs b/SafeCampus.API/SafeCampus.Application/Manager/DeepelephManager/DeepelephManager.cs index b4c63a2..90f7ef2 100644 --- a/SafeCampus.API/SafeCampus.Application/Manager/DeepelephManager/DeepelephManager.cs +++ b/SafeCampus.API/SafeCampus.Application/Manager/DeepelephManager/DeepelephManager.cs @@ -202,8 +202,6 @@ public class DeepelephManager : IDeepelephManager, IScoped if (json["type"].ToString() == "msg") { - //TODO 发送短信 - //TxySmsUtil.SendSms(new[] { "" }, new[] { "" }); var body = json["body"]; if (body != null) { @@ -396,10 +394,6 @@ public class DeepelephManager : IDeepelephManager, IScoped } if (dayEnum==AlarmType.lie_on_table) - { - - } - else { #region 添加预警 @@ -509,58 +503,61 @@ public class DeepelephManager : IDeepelephManager, IScoped #endregion } - #region 添加点名 - - var model = new ClassRoomCallDto - { - TenantCode = body["tenantCode"]?.ToString(), - PoiId = body["poiId"]?.ToString(), - TaskId = body["taskId"]?.ToString(), - AlarmType = body["alarmType"].ToString(), - AlarmTypeDesc = dayEnum.GetDescription(), - EventId = body["eventId"]?.ToString(), - CameraId = body["cameraId"]?.ToString(), - Tick = TimestampToDateTime(body["tick"]?.ToString()), - PersonSetId = body["personSetId"]?.ToString(), - PersonId = body["personId"]?.ToString(), - Similarity = body["similarity"] != null ? (float)body["similarity"] : 0, - FaceScore = body["faceScore"] != null ? (float)body["faceScore"] : 0, - SnapshotUrl = body["snapshotUrl"]?.ToString(), - SnapshotData = body["snapshotData"]?.ToString(), - Rects = body["rects"]?.ToString(), - Extend = body["extend"]?.ToString(), - CreateTime = DateTime.Now, - TrackId = body["TrackId"]?.ToString() - }; - var signImg = Path.Combine(Directory.GetCurrentDirectory(), "Files", App.Configuration["AppInfo:RoomCallImg"], model.EventId + ".jpg"); - var steam = await model.SnapshotUrl.GetAsByteArrayAsync(); - model.SnapshotUrl = $"/Files/{App.Configuration["AppInfo:RoomCallImg"]}/{model.EventId}.jpg"; - using (MemoryStream ms = new MemoryStream(steam)) + else { - using (Bitmap bmp = new Bitmap(ms)) + #region 添加点名 + + var model = new ClassRoomCallDto { - using (Graphics g = Graphics.FromImage(bmp)) + TenantCode = body["tenantCode"]?.ToString(), + PoiId = body["poiId"]?.ToString(), + TaskId = body["taskId"]?.ToString(), + AlarmType = body["alarmType"].ToString(), + AlarmTypeDesc = dayEnum.GetDescription(), + EventId = body["eventId"]?.ToString(), + CameraId = body["cameraId"]?.ToString(), + Tick = TimestampToDateTime(body["tick"]?.ToString()), + PersonSetId = body["personSetId"]?.ToString(), + PersonId = body["personId"]?.ToString(), + Similarity = body["similarity"] != null ? (float)body["similarity"] : 0, + FaceScore = body["faceScore"] != null ? (float)body["faceScore"] : 0, + SnapshotUrl = body["snapshotUrl"]?.ToString(), + SnapshotData = body["snapshotData"]?.ToString(), + Rects = body["rects"]?.ToString(), + Extend = body["extend"]?.ToString(), + CreateTime = DateTime.Now, + TrackId = body["TrackId"]?.ToString() + }; + var signImg = Path.Combine(Directory.GetCurrentDirectory(), "Files", App.Configuration["AppInfo:RoomCallImg"], model.EventId + ".jpg"); + var steam = await model.SnapshotUrl.GetAsByteArrayAsync(); + model.SnapshotUrl = $"/Files/{App.Configuration["AppInfo:RoomCallImg"]}/{model.EventId}.jpg"; + using (MemoryStream ms = new MemoryStream(steam)) + { + using (Bitmap bmp = new Bitmap(ms)) { - using (Pen pen = new Pen(Color.Red, 3)) + using (Graphics g = Graphics.FromImage(bmp)) { - foreach (var item in body["rects"]) + using (Pen pen = new Pen(Color.Red, 3)) { - Rectangle rect = new Rectangle((int)item["left"], (int)item["top"], (int)item["width"], (int)item["height"]); - g.DrawRectangle(pen, rect); + 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(signImg, ImageFormat.Jpeg); } - bmp.Save(signImg, ImageFormat.Jpeg); } - } - Scoped.Create((_, scope) => - { - var services = scope.ServiceProvider; - var _repository = services.GetService(); - _repository.Add(model); - }); + Scoped.Create((_, scope) => + { + var services = scope.ServiceProvider; + var _repository = services.GetService(); + _repository.Add(model); + }); - #endregion + #endregion + } } } else if (json["type"].ToString() == "cmd") diff --git a/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml b/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml index 0372692..4e0ade0 100644 --- a/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml +++ b/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml @@ -941,6 +941,21 @@ 结束时间 + + + 班级名称 + + + + + 院系名称 + + + + + 专业名称 + + 摄像头id @@ -956,6 +971,16 @@ 人员底库id + + + 系部id + + + + + 院系id + + 开始时间 @@ -1569,6 +1594,16 @@ 班级id + + + 系部id + + + + + 院系id + + 添加信息 @@ -1637,6 +1672,11 @@ 专业id + + + 班主任id + + 添加班级 @@ -1983,6 +2023,13 @@ + + + 批量删除 + + + + 添加 diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs index cdca108..c55b708 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs @@ -43,6 +43,12 @@ public class BuildingService:DbRepository,IBuildingService { throw Oops.Oh("信息不存在"); } + var dor = ChangeRepository>();//切换仓储 + var build = await dor.GetListAsync(x=>x.BuildId==model.Id); + if (build.Any()) + { + throw Oops.Oh("宿舍楼下还有寝室不可删除!"); + } await DeleteAsync(model); return true; } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraGroupService/CameraGroupService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraGroupService/CameraGroupService.cs index e31925b..2c3664e 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraGroupService/CameraGroupService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraGroupService/CameraGroupService.cs @@ -5,6 +5,9 @@ public class CameraGroupService :DbRepository, ICameraGroupService public async Task Add(CameraGroupAddInput input) { var model = input.Adapt(); + var sysOrgList = await GetListAsync();//获取全部 + if (sysOrgList.Any(it =>it.Name==model.Name&&it.ParentId==model.ParentId))//判断同级是否有名称重复的 + throw Oops.Bah($"存在重复名称:{model.Name}"); await InsertAsync(model); return true; } @@ -46,6 +49,8 @@ public class CameraGroupService :DbRepository, ICameraGroupService public async Task> GetNoPageList() { var list = await Context.Queryable() + .Includes(x=>x.SysUserItem) + .OrderByDescending(x=>x.Id) .ToTreeAsync(x => x.Children, x => x.ParentId, null); //var list = await GetListAsync(); return list; @@ -53,7 +58,7 @@ public class CameraGroupService :DbRepository, ICameraGroupService public async Task> GetBIList() { - var list = await Context.Queryable().Includes(x => x.CameraInfos).ToListAsync(); + var list = await Context.Queryable().Includes(x => x.CameraInfos).Where(x=>x.CameraInfos.Any()).ToListAsync(); return list; } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs index 9a0bcb7..1e1e265 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs @@ -8,7 +8,7 @@ using System.Drawing.Imaging; namespace SafeCampus.Application.Services.Business.CameraInfoService; -public class CameraInfoService:DbRepository, ICameraInfoService +public class CameraInfoService : DbRepository, ICameraInfoService { private readonly IDeepelephManager _deepelephManager; private readonly ISimpleCacheService _simpleCacheService; @@ -60,7 +60,7 @@ public class CameraInfoService:DbRepository, ICameraInfoService { using (Graphics g = Graphics.FromImage(bmp)) { - + } bmp.Save(signImg, ImageFormat.Jpeg); } @@ -106,15 +106,35 @@ public class CameraInfoService:DbRepository, ICameraInfoService return false; } + private List GetGroupChildren(List node) + { + var list = new List(); + if (node == null) return list; + foreach (var cameraGroup in node) + { + list.Add(cameraGroup.Id); + list.AddRange(GetGroupChildren(cameraGroup.Children)); + } + return list; + } public async Task> GetPageList(CameraSearch search) { + var groupids = new List(); + if (search.GroupId.HasValue && search.GroupId.Value != -1) + { + var group = await Context.Queryable() + .ToTreeAsync(x => x.Children, x => x.ParentId, search.GroupId); + groupids = GetGroupChildren(group); + groupids.Add(search.GroupId.Value); + } + var query = Context.Queryable() - .Includes(x=>x.SysUserItem) - .Includes(x=>x.CameraGroupItem) + .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:x.GroupId==search.GroupId.Value)); + .WhereIF(search.GroupId.HasValue, x => (search.GroupId.Value == -1 ? x.GroupId == null : groupids.Contains(x.GroupId.Value))); var list = await query.OrderBy(x => x.LastTime) .ToPagedListAsyncMapster(search.PageNum, search.PageSize); return list; @@ -122,7 +142,7 @@ public class CameraInfoService:DbRepository, ICameraInfoService public async Task BatchSetGroup(SetGroupInput input) { - if (input.Id==-1) + if (input.Id == -1) { var result = await Context.Updateable() .SetColumns(x => x.GroupId == null) @@ -144,9 +164,11 @@ public class CameraInfoService:DbRepository, ICameraInfoService { var result = await Context.Updateable() .SetColumns(x => x.PushUserId == input.UserId) - .Where(x =>x.GroupId==input.GroupId) + .Where(x => x.GroupId == input.GroupId) .ExecuteCommandAsync(); - return result >0; + await Context.Updateable().SetColumns(x => x.PushUserId == input.UserId) + .Where(x => x.Id == input.GroupId).ExecuteCommandAsync(); + return result > 0; } public async Task BatchSetPushPerson(SetPushPersonInput input) @@ -169,7 +191,7 @@ public class CameraInfoService:DbRepository, ICameraInfoService .SetColumns(x => x.PushUserId == input.UserId) .Where(x => ids.Contains(x.SensorId)) .ExecuteCommandAsync(); - return result >0; + return result > 0; } throw Oops.Oh("分组不存在"); diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/ClassRoomCallTaskService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/ClassRoomCallTaskService.cs index 73b8603..a147e8b 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/ClassRoomCallTaskService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/ClassRoomCallTaskService.cs @@ -26,10 +26,13 @@ public class ClassRoomCallTaskService : DbRepository ,IClassR { var query = Context.Queryable() .Includes(x => x.CameraInfoItem) + .Includes(x=>x.PersonSetInfoItem,x=>x.MajorInfoItem,x=>x.DepartmentInfoItem ) .WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId) .WhereIF(!string.IsNullOrEmpty(search.TaskId), x => x.TaskId == search.TaskId) .WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) .WhereIF(search.StartTime.HasValue, x => x.CreateTime >= search.StartTime) + .WhereIF(search.DepId.HasValue, x => x.PersonSetInfoItem.MajorInfoItem.DepId == search.DepId) + .WhereIF(search.MajorId.HasValue, x => x.PersonSetInfoItem.MajorId == search.MajorId) .WhereIF(search.EndTime.HasValue, x => x.EndTime <= search.EndTime); var list = await query.OrderByDescending(x => x.CreateTime) diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskDto.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskDto.cs index aefa5f9..dd313fd 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskDto.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskDto.cs @@ -42,6 +42,18 @@ public class ClassRoomCallTaskDto /// 结束时间 /// public DateTime EndTime { get; set; } + /// + /// 班级名称 + /// + public string PersonSetName { get; set; } + /// + /// 院系名称 + /// + public string DepName { get; set; } + /// + /// 专业名称 + /// + public string MajorName { get; set; } } public class ClassRoomCallTaskDtoMapper : IRegister { @@ -49,6 +61,9 @@ public class ClassRoomCallTaskDtoMapper : IRegister { config.ForType() //.Map(dest => dest.CameraName, src => src.CameraId.GetDescriptionByEnum()); + .Map(x=>x.PersonSetName,x=>x.PersonSetInfoItem.PersonSetName) + .Map(x=>x.MajorName,x=>x.PersonSetInfoItem.MajorInfoItem.Name) + .Map(x=>x.DepName,x=>x.PersonSetInfoItem.MajorInfoItem.DepartmentInfoItem.Name) .Map(dest => dest.CameraName, src => src.CameraInfoItem.SensorName) .Map(dest => dest.CameraGroup, src => src.CameraInfoItem.CameraGroupItem.Name); } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskSearch.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskSearch.cs index bf2c37f..a78f85f 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskSearch.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/ClassRoomCallTaskService/Dto/ClassRoomCallTaskSearch.cs @@ -15,6 +15,14 @@ public class ClassRoomCallTaskSearch:BasePageInput /// public string PersonSetId { get; set; } /// + /// 系部id + /// + public long? DepId { get; set; } + /// + /// 院系id + /// + public long? MajorId { get; set; } + /// /// 开始时间 /// public DateTime? StartTime { get; set; } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs index 3c329b1..2808a0f 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs @@ -61,7 +61,7 @@ public class MajorService: DbRepository, IMajorService .WhereIF(!string.IsNullOrEmpty(search.Code),x=>x.Code.Contains(search.Code)) .WhereIF(search.DepId.HasValue,x=>x.DepId==search.DepId); - var list = await query.OrderByDescending(x => x.Sort) + var list = await query.OrderBy(x => x.Sort) .ToPagedListAsyncMapster(search.PageNum, search.PageSize); return list; } @@ -74,7 +74,7 @@ public class MajorService: DbRepository, IMajorService .WhereIF(!string.IsNullOrEmpty(search.Code), x => x.Code.Contains(search.Code)) .WhereIF(search.DepId.HasValue, x => x.DepId == search.DepId); - var list = await query.OrderByDescending(x => x.Sort).ToListAsync(); + var list = await query.OrderBy(x => x.Sort).ToListAsync(); return list.Adapt>(); } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonFacesService/PersonFacesService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonFacesService/PersonFacesService.cs index e8f5531..46bc861 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonFacesService/PersonFacesService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonFacesService/PersonFacesService.cs @@ -1,4 +1,6 @@ -namespace SafeCampus.Application.Services.Business.PersonFacesService; +using MoYu.RemoteRequest.Extensions; + +namespace SafeCampus.Application.Services.Business.PersonFacesService; public class PersonFacesService:DbRepository, IPersonFacesService { @@ -6,7 +8,14 @@ public class PersonFacesService:DbRepository, IPersonFacesService { var oldList = await GetListAsync(x => x.PersonId == list[0].PersonId); await DeleteAsync(oldList); - await InsertRangeAsync(list); + foreach (var item in list) + { + var signImg = Path.Combine(Directory.GetCurrentDirectory(), "Files", App.Configuration["AppInfo:PersonImg"], item.FaceId + ".jpg"); + await item.FaceUrl.GetToSaveAsync(signImg); + item.FaceUrl = $"/Files/{App.Configuration["AppInfo:PersonImg"]}/{item.FaceId}.jpg"; + await InsertAsync(item); + } + //await InsertRangeAsync(list); return true; } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoDto.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoDto.cs index 89ece01..8b516c8 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoDto.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoDto.cs @@ -68,7 +68,9 @@ public class PersonInfoDto public DateTime? InsTime { get; set; } public string DepName { get; set; } + public long DepId { get; set; } public string MajorName { get; set; } + public long MajorId { get; set; } } public class PersonInfoDtoMapper : IRegister { @@ -81,6 +83,8 @@ public class PersonInfoDtoMapper : IRegister .Map(dest => dest.Faces, src => src.PersonFacesList) .Map(dest => dest.DormitoryName, src => src.DormitoryInfoItem.Name) .Map(dest => dest.DepName, src => src.PersonSetInfoItem.MajorInfoItem.DepartmentInfoItem.Name) + .Map(x=>x.DepId,x=>x.PersonSetInfoItem.MajorInfoItem.DepId) + .Map(x=>x.MajorId,x=>x.PersonSetInfoItem.MajorInfoItem.Id) .Map(dest => dest.MajorName, src => src.PersonSetInfoItem.MajorInfoItem.Name); } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs index f248a52..861c195 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs @@ -14,4 +14,12 @@ public class PersonInfoSearch:BasePageInput /// 班级id /// public string PersonSetId { get; set; } + /// + /// 系部id + /// + public long? DepId { get; set; } + /// + /// 院系id + /// + public long? MajorId { get; set; } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs index 0ae680a..cc4b65c 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs @@ -69,6 +69,8 @@ public class PersonInfoService:DbRepository, IPersonInfoService .Includes(x=>x.DormitoryInfoItem) .WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId) .WhereIF(!string.IsNullOrEmpty(search.PersonName), x => x.Name.Contains(search.PersonName)) + .WhereIF(search.DepId.HasValue, x => x.PersonSetInfoItem.MajorInfoItem.DepId==search.DepId) + .WhereIF(search.MajorId.HasValue, x => x.PersonSetInfoItem.MajorId==search.MajorId) .WhereIF(!string.IsNullOrEmpty(search.Phone), x => x.Phone.Contains(search.Phone)); var list = await query.OrderByDescending(x => x.CreateTime) diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/Dto/PersonSetInfoDto.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/Dto/PersonSetInfoDto.cs index 2626c1d..053ff95 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/Dto/PersonSetInfoDto.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/Dto/PersonSetInfoDto.cs @@ -14,11 +14,15 @@ public class PersonSetInfoDto /// 专业id /// public long MajorId { get; set; } - - public string UserId { get; set; } + /// + /// 班主任id + /// + public long TeacherId { get; set; } + public string PushUserId { get; set; } public string UserName { get; set; } public string MajorName { get; set; } public string DepartmentName { get; set; } + public SysUser SysUserItem { get; set; } } public class PersonSetInfoDtoMapper : IRegister @@ -26,8 +30,10 @@ public class PersonSetInfoDtoMapper : IRegister public void Register(TypeAdapterConfig config) { config.ForType() - .Map(x => x.UserId, x => x.ClassTeacherItem.UserId) + .Map(x=>x.TeacherId,x=>x.ClassTeacherItem.Id) + .Map(x => x.PushUserId, x => x.ClassTeacherItem.UserId) .Map(x => x.UserName, x => x.ClassTeacherItem.SysUserItem.Name) + .Map(x => x.SysUserItem, x => x.ClassTeacherItem.SysUserItem) .Map(x=>x.DepartmentName,x=>x.MajorInfoItem.DepartmentInfoItem.Name) .Map(x=>x.MajorName,x=>x.MajorInfoItem.Name); } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs index 1f6eb93..0752ca9 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs @@ -42,10 +42,10 @@ public class PersonSetInfoService:DbRepository, IPersonSetInfoSer { var list =await Context.Queryable() .Includes(x=>x.MajorInfoItem,x=>x.DepartmentInfoItem) + .Includes(x => x.ClassTeacherItem, st => st.SysUserItem) .Where(x=>x.PersonSetId!=SafeCampusConst.ZDRY) .WhereIF(majorId.HasValue,x=>x.MajorId==majorId) .WhereIF(!string.IsNullOrEmpty(setName),x=>x.PersonSetName.Contains(setName)) - .Includes(x => x.ClassTeacherItem, st => st.SysUserItem) .ToListAsync(); return list.Adapt>(); } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs index 0cf4238..de96654 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs @@ -55,11 +55,11 @@ public class WarnInfoList /// /// 专业名称 /// - public long MajorName { get; set; } + public string MajorName { get; set; } /// /// 院系名称 /// - public long DepName { get; set; } + public string DepName { get; set; } /// /// 性别 /// @@ -84,10 +84,11 @@ public class WarnInfoListMapper : IRegister config.ForType() //.Map(dest => dest.CameraName, src => src.CameraId.GetDescriptionByEnum()); .Map(dest => dest.CameraName, src => src.CameraInfoItem.SensorName) - .Map(x=>x.PersonName,x=>x.PersonInfoItem.Name) - .Map(x=>x.PersonSetName,x=>x.PersonSetInfoItem.PersonSetName) - .Map(x=>x.MajorName,x=>x.PersonSetInfoItem.MajorInfoItem.Name) - .Map(x=>x.DepName,x=>x.PersonSetInfoItem.MajorInfoItem.DepartmentInfoItem.Name) - .Map(dest => dest.CameraGroup, src => src.CameraInfoItem.CameraGroupItem.Name); + .Map(x => x.PersonName, x => x.PersonInfoItem.Name) + .Map(x => x.PersonSetName, x => x.PersonSetInfoItem.PersonSetName) + .Map(dest => dest.CameraGroup, src => src.CameraInfoItem.CameraGroupItem.Name) + .Map(x=>x.MajorName,x=>x.PersonSetInfoItem.MajorInfoItem.Name) + .Map(x=>x.DepName,x=>x.PersonSetInfoItem.MajorInfoItem.DepartmentInfoItem.Name); + //; } } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/IWarnInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/IWarnInfoService.cs index ee4905b..3e9dd1d 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/IWarnInfoService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/IWarnInfoService.cs @@ -21,4 +21,10 @@ public interface IWarnInfoService:IApiBaseInterface /// Task> GetWarnType(); + /// + /// 批量删除 + /// + /// + /// + public Task DeleteBatch(List Ids); } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs index f45f144..79c1a33 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs @@ -4,6 +4,7 @@ using MoYu.FriendlyException; using SafeCampus.Application.Services.Business; using SafeCampus.Application.Services.Business.Warn.Dto; using SafeCampus.Application.Services.Business.Warn.Service; +using SafeCampus.Core.Utils.TXYSMS; namespace SafeCampus.Web.Core.Controllers.Application.Business.Warn.Service; @@ -18,8 +19,11 @@ public class WarnInfoService:DbRepository, IWarnInfoService,ITransient public async Task Add(WarnInfoDto vm) { + var model = vm.Adapt(); await InsertAsync(model); + //TODO 发送短信 + TxySmsUtil.SendSms(new[] { "" }, new[] { "" }); return true; } @@ -98,7 +102,7 @@ public class WarnInfoService:DbRepository, IWarnInfoService,ITransient var query = Context.Queryable() .Includes(x=>x.CameraInfoItem) .Includes(x=>x.PersonInfoItem) - .Includes(x=>x.PersonSetInfoItem,x1=>x1.MajorInfoItem,x2=>x2.DepartmentInfoItem) + .Includes(x=>x.PersonSetInfoItem,x=>x.MajorInfoItem,x=>x.DepartmentInfoItem) .WhereIF(search.WarnHand.HasValue, x => x.WarnHand == search.WarnHand) .WhereIF(!string.IsNullOrEmpty(search.AlarmType),x => x.AlarmType == search.AlarmType) .WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) @@ -158,4 +162,10 @@ public class WarnInfoService:DbRepository, IWarnInfoService,ITransient }); return await query.ToListAsync(); } + + public async Task DeleteBatch(List Ids) + { + await Context.Deleteable().In(Ids).ExecuteCommandAsync(); + return true; + } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Core/Startup.cs b/SafeCampus.API/SafeCampus.Core/Startup.cs index 4254085..266e317 100644 --- a/SafeCampus.API/SafeCampus.Core/Startup.cs +++ b/SafeCampus.API/SafeCampus.Core/Startup.cs @@ -1,14 +1,4 @@ - -// - - - - - - - - -using SafeCampus.Core.Utils; +using SafeCampus.Core.Utils; namespace SafeCampus.Core; diff --git a/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResult.cs b/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResult.cs index d5191db..4f547c5 100644 --- a/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResult.cs +++ b/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResult.cs @@ -1,14 +1,4 @@ - -// - - - - - - - - -namespace SafeCampus.Core; +namespace SafeCampus.Core; /// /// 全局返回结果 diff --git a/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResultProvider.cs b/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResultProvider.cs index 83efba7..62a75d9 100644 --- a/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResultProvider.cs +++ b/SafeCampus.API/SafeCampus.Core/UnifyResult/SafeCampusResultProvider.cs @@ -1,14 +1,4 @@ - -// - - - - - - - - -namespace SafeCampus.Core; +namespace SafeCampus.Core; /// /// 规范化RESTful风格返回值 @@ -98,7 +88,7 @@ public class SafeCampusResultProvider : IUnifyResultProvider return new SafeCampusResult { Code = statusCode, - Msg = statusCode == StatusCodes.Status200OK ? "请求成功" : errors, + Msg = statusCode == StatusCodes.Status200OK ? "操作成功" : errors, Data = data, Extras = UnifyContext.Take(), Time = DateTime.Now diff --git a/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs b/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs index 787946a..4b09c1d 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs @@ -3,7 +3,7 @@ [Tenant(SqlSugarConst.DB_DEFAULT)] [BatchEdit] [CodeGen] -//[IgnoreInitTable] +[IgnoreInitTable] public class Attendance : PrimaryKeyEntity { /// diff --git a/SafeCampus.API/SafeCampus.System/Entity/BuildingInfo.cs b/SafeCampus.API/SafeCampus.System/Entity/BuildingInfo.cs index bfde359..97395e5 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/BuildingInfo.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/BuildingInfo.cs @@ -6,7 +6,7 @@ [Tenant(SqlSugarConst.DB_DEFAULT)] [BatchEdit] [CodeGen] -//[IgnoreInitTable] +[IgnoreInitTable] public class BuildingInfo : PrimaryKeyEntity { /// diff --git a/SafeCampus.API/SafeCampus.System/Entity/CameraGroup.cs b/SafeCampus.API/SafeCampus.System/Entity/CameraGroup.cs index 0255cc0..e6ba802 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/CameraGroup.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/CameraGroup.cs @@ -17,6 +17,11 @@ public class CameraGroup : PrimaryKeyEntity [SugarColumn(ColumnName = "ParentId", ColumnDescription = "父级id", IsNullable = true)] public long ParentId { get; set; } /// + /// 推送人id + /// + [SugarColumn(ColumnName = "PushUserId", ColumnDescription = "推送人id", IsNullable = true)] + public long? PushUserId { get; set; } + /// /// 子级 /// [SugarColumn(IsIgnore = true)] @@ -26,4 +31,9 @@ public class CameraGroup : PrimaryKeyEntity /// [Navigate(NavigateType.OneToMany, nameof(CameraInfo.GroupId))] public List CameraInfos { get; set; } + /// + /// 推送人信息 + /// + [Navigate(NavigateType.OneToOne, nameof(CameraInfo.PushUserId))] + public SysUser SysUserItem { get; set; } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.System/Entity/ClassRoomCallTask.cs b/SafeCampus.API/SafeCampus.System/Entity/ClassRoomCallTask.cs index dd43a89..c631d44 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/ClassRoomCallTask.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/ClassRoomCallTask.cs @@ -46,4 +46,9 @@ public class ClassRoomCallTask: PrimaryKeyEntity /// [Navigate(NavigateType.OneToOne, nameof(CameraId),nameof(CameraInfo.SensorId)),] public CameraInfo CameraInfoItem { get; set; } + /// + /// 班级信息 + /// + [Navigate(NavigateType.OneToOne, nameof(PersonSetInfo.PersonSetId), nameof(PersonSetId))] + public PersonSetInfo PersonSetInfoItem { get; set; } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.System/Entity/DepartmentInfo.cs b/SafeCampus.API/SafeCampus.System/Entity/DepartmentInfo.cs index 02d03d6..0dc293d 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/DepartmentInfo.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/DepartmentInfo.cs @@ -3,7 +3,7 @@ [Tenant(SqlSugarConst.DB_DEFAULT)] [BatchEdit] [CodeGen] -//[IgnoreInitTable] +[IgnoreInitTable] public class DepartmentInfo : PrimaryKeyEntity { /// diff --git a/SafeCampus.API/SafeCampus.System/Entity/MajorInfo.cs b/SafeCampus.API/SafeCampus.System/Entity/MajorInfo.cs index 98518f9..58fc216 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/MajorInfo.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/MajorInfo.cs @@ -3,7 +3,7 @@ [Tenant(SqlSugarConst.DB_DEFAULT)] [BatchEdit] [CodeGen] -//[IgnoreInitTable] +[IgnoreInitTable] public class MajorInfo : PrimaryKeyEntity { /// diff --git a/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs b/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs index 17f868b..053a1c1 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs @@ -34,7 +34,7 @@ public class PersonInfo /// /// 扩展属性 /// - [SugarColumn(ColumnName = "ExtData", ColumnDescription = "扩展属性", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = false)] + [SugarColumn(ColumnName = "ExtData", ColumnDescription = "扩展属性", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)] public string ExtData { get; set; } /// /// 人脸大小阈值 diff --git a/SafeCampus.API/SafeCampus.System/Entity/PersonSetInfo.cs b/SafeCampus.API/SafeCampus.System/Entity/PersonSetInfo.cs index 70c1f27..be6e2af 100644 --- a/SafeCampus.API/SafeCampus.System/Entity/PersonSetInfo.cs +++ b/SafeCampus.API/SafeCampus.System/Entity/PersonSetInfo.cs @@ -3,7 +3,7 @@ [Tenant(SqlSugarConst.DB_DEFAULT)] [BatchEdit] [CodeGen] -//[IgnoreInitTable] +[IgnoreInitTable] public class PersonSetInfo { /// diff --git a/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml b/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml index 3c2c680..afacee2 100644 --- a/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml +++ b/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml @@ -841,6 +841,11 @@ 父级id + + + 推送人id + + 子级 @@ -851,6 +856,11 @@ 摄像头列表 + + + 推送人信息 + + 摄像头编码 @@ -1056,6 +1066,11 @@ 摄像头信息 + + + 班级信息 + + 班主任用户id diff --git a/SafeCampus.API/SafeCampus.System/System.Development.json b/SafeCampus.API/SafeCampus.System/System.Development.json index e4b9af5..21aca9e 100644 --- a/SafeCampus.API/SafeCampus.System/System.Development.json +++ b/SafeCampus.API/SafeCampus.System/System.Development.json @@ -20,7 +20,7 @@ }, //系统层设置 "SystemSettings": { - "InitTable": false, //是否初始化表结构 + "InitTable": true, //是否初始化表结构 "InitSeedData": false, //是否初始化种子数据 "SuperAdminViewAllData": true //是否超级管理员可以查看所有数据 } diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs index e290e8f..c5e09c0 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs @@ -113,9 +113,15 @@ public class ClassRoomCallApi : IDynamicApiController /// /// /// - public async Task Delete(long id) + [HttpPost] + public async Task Delete(BaseIdListInput input) { - return await _classRoomCallTaskService.Remove(id); + foreach (var inputId in input.Ids) + { + await _classRoomCallTaskService.Remove(inputId); + } + + return true; } /// /// 获取点名任务列表 diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs index e36aba1..3cfe2be 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs @@ -7,10 +7,10 @@ using SafeCampus.Application.Services.Business.PersonSetInfoService; namespace SafeCampus.Web.Core.Controllers.Application.Business; /// -/// 人员底库管理接口 +/// 人员班级管理接口 /// [Route("/business/[controller]")] -[ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 99,Tag = "人员底库管理")] +[ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 99,Tag = "人员班级管理")] public class DfieldApi : IDynamicApiController { private readonly IDeepelephManager _deepelephManager; @@ -55,9 +55,9 @@ public class DfieldApi : IDynamicApiController /// 查询底库列表 /// /// - public async Task QueryAll(long? majorId,string setName) + public async Task QueryAll(long? majorId,string personSetName) { - return await _personSetInfoService.GetPageList(majorId, setName); + return await _personSetInfoService.GetPageList(majorId, personSetName); var appSettings = App.GetOptionsMonitor(); var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/set/queryAll" .SetBody(new @@ -99,29 +99,44 @@ public class DfieldApi : IDynamicApiController /// public async Task DeleteDfieldD(string id) { - var appSettings = App.GetOptionsMonitor(); - var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/set/delete" - .SetBody(new - { - token = _deepelephManager.GetToken(), - tenantCode = appSettings.TenantCode, - poiId = appSettings.PoiId, - personSetId= id - }) - .SetContentType("application/json") - .PostAsAsync(); - var model = JsonConvert.DeserializeObject(str); - if ((bool)model["success"]) + var list = new List(); + if (id.Contains(",")) { - var isOk = model["data"].ToString() == id; - if (isOk) + list = id.Split(",").ToList(); + } + else + { + list.Add(id); + } + + foreach (var ids in list) + { + var appSettings = App.GetOptionsMonitor(); + var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/set/delete" + .SetBody(new + { + token = _deepelephManager.GetToken(), + tenantCode = appSettings.TenantCode, + poiId = appSettings.PoiId, + personSetId = ids + }) + .SetContentType("application/json") + .PostAsAsync(); + var model = JsonConvert.DeserializeObject(str); + if ((bool)model["success"]) { - await _personSetInfoService.Delete(id); + var isOk = model["data"].ToString() == ids; + if (isOk) + { + await _personSetInfoService.Delete(ids); + } + return isOk; } - return isOk; + + throw Oops.Oh(model["message"].ToString()); } - throw Oops.Oh(model["message"].ToString()); + return false; } /// /// 更新底库 diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/Dto/DfieldInput.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/Dto/DfieldInput.cs index 1d1a629..a81be83 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/Dto/DfieldInput.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/Dto/DfieldInput.cs @@ -29,8 +29,8 @@ public class PersonUnBindDfieInput [IdNotNull(ErrorMessage = "人员id不能为空")] public string PersonId { get; set; } /// - /// 底库id + /// 班级id /// - [IdNotNull(ErrorMessage = "底库id不能为空")] + [IdNotNull(ErrorMessage = "班级id不能为空")] public string PersonSetId { get; set; } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs index 4c61b54..3521eb1 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs @@ -153,30 +153,45 @@ public class PersonApi : IDynamicApiController /// public async Task DeletePersonD(string id) { - var appSettings = App.GetOptionsMonitor(); - var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/delete" - .SetBody(new - { - token = _deepelephManager.GetToken(), - tenantCode = appSettings.TenantCode, - poiId = appSettings.PoiId, - personId = id, + var list = new List(); + if (id.Contains(",")) + { + list = id.Split(",").ToList(); + } + else + { + list.Add(id); + } - }) - .SetContentType("application/json") - .PostAsAsync(); - var model = JsonConvert.DeserializeObject(str); - if ((bool)model["success"]) + foreach (var ids in list) { - var isOk = model["data"].ToString() == id; - if (isOk) + var appSettings = App.GetOptionsMonitor(); + var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/delete" + .SetBody(new + { + token = _deepelephManager.GetToken(), + tenantCode = appSettings.TenantCode, + poiId = appSettings.PoiId, + personId = ids, + + }) + .SetContentType("application/json") + .PostAsAsync(); + var model = JsonConvert.DeserializeObject(str); + if ((bool)model["success"]) { - await _personInfoService.Delete(id); + var isOk = model["data"].ToString() == ids; + if (isOk) + { + await _personInfoService.Delete(ids); + } + return isOk; } - return isOk; + + throw Oops.Oh(model["message"].ToString()); } - throw Oops.Oh(model["message"].ToString()); + return false; } /// /// 更新人员信息 @@ -185,6 +200,7 @@ public class PersonApi : IDynamicApiController /// public async Task UpdatePersionU(PersonModel info) { + info.Faces = info.Faces.Select(x => new Faces { faceId = Guid.NewGuid().ToString("N"), faceUrl = x.faceUrl }).ToList(); var appSettings = App.GetOptionsMonitor(); var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/createOrOverride" .SetBody(new @@ -346,7 +362,7 @@ public class PersonApi : IDynamicApiController /// public async Task GetPersionById(ControllersIdInput input) { - return await _personInfoService.GetInfo(input.Id); + var perModel= await _personInfoService.GetInfo(input.Id); var appSettings = App.GetOptionsMonitor < AppInfoOptions>(); var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/query" .SetBody(new @@ -359,6 +375,7 @@ public class PersonApi : IDynamicApiController .SetContentType("application/json") .PostAsAsync(); var model = JsonConvert.DeserializeObject(str); + if ((bool)model["success"]) { if (model["data"]["personSets"].Count() > 0) @@ -371,7 +388,9 @@ public class PersonApi : IDynamicApiController model["data"]["personSetId"] = null; model["data"]["personSetName"] = null; } - return model["data"]; + + perModel.Faces = JsonConvert.DeserializeObject>(model["data"]["faces"].ToString()); + return perModel; } throw Oops.Oh(model["message"].ToString()); diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs index e575baf..b69b847 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs @@ -37,9 +37,10 @@ public class WarnInfoController /// /// /// - public async Task DeleteInfoD(long Id) + [HttpPost] + public async Task DeleteInfoD(BaseIdListInput input) { - return await _warnInfoService.Delete(Id); + return await _warnInfoService.DeleteBatch(input.Ids); } /// /// 编辑预警信息 @@ -61,7 +62,7 @@ public class WarnInfoController if (!string.IsNullOrEmpty(model.Extend)) { var extend = JsonConvert.DeserializeObject(model.Extend); - model.Extend = extend["age"]!=null?$"年龄:{extend["age"]};年龄置信度:{extend["ageProb"]};":""; + model.Extend = extend["age"]!=null?$"年龄:{extend["age"]};年龄置信度:{Convert.ToInt32(Convert.ToDecimal(extend["ageProb"])*100)}%;":""; } try diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/SummarySeach.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/SummarySeach.cs index d286f97..9617d42 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/SummarySeach.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/SummarySeach.cs @@ -1,13 +1,15 @@ -namespace SafeCampus.Web.Core.Controllers.Application.Violation; +using System.ComponentModel.DataAnnotations; + +namespace SafeCampus.Web.Core.Controllers.Application.Violation; public class SummarySeach { /// /// 搜索条件 /// - public SearchType SearchType { get; set; } + public SearchType? SearchType { get; set; } /// /// 人员id /// - public string PersonId { get; set; } + public string Id { get; set; } } \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs index bcc2d4b..1d388ba 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs @@ -3,6 +3,7 @@ using NPOI.XWPF.UserModel; using SafeCampus.Application.Services.Business.Warn.Dto; using SafeCampus.Application.Services.Business.Warn.Service; using System.Diagnostics; +using MoYu.FriendlyException; using SafeCampus.Core.Extension; namespace SafeCampus.Web.Core.Controllers.Application.Violation; @@ -191,6 +192,10 @@ public class VioAnalysisController await using var fs = new FileStream(templatePath, FileMode.Open, FileAccess.ReadWrite); XWPFDocument doc = new XWPFDocument(fs); var content = warnList.GroupBy(x => x.AlarmTypeDesc).ToList(); + if (!content.Any()) + { + throw Oops.Oh("该时间段无数据,无法生成报告!"); + } Dictionary replacements = new Dictionary() { //图片 diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs index bb4afaa..6bae39b 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs @@ -120,7 +120,7 @@ public class VioPortraitSummary { AlarmType = AlarmType.visual_fence.GetDisplay(), CameraIds = cameraIds, - PersonId = seach.PersonId, + PersonId = seach.Id, StartTick = startOfWeek, EndTick = endWeek }); @@ -132,7 +132,7 @@ public class VioPortraitSummary { AlarmType = AlarmType.visual_fence.GetDisplay(), CameraIds = cameraIds, - PersonId = seach.PersonId, + PersonId = seach.Id, StartTick = startOfLastWeek, EndTick = endOfLastWeek }); @@ -143,7 +143,7 @@ public class VioPortraitSummary { AlarmType = AlarmType.visual_fence.GetDisplay(), CameraIds = cameraIds, - PersonId = seach.PersonId, + PersonId = seach.Id, StartTick = startOfMonth, EndTick = endWeek }); @@ -192,7 +192,7 @@ public class VioPortraitSummary { AlarmType = AlarmType.visual_fence.GetDisplay(), CameraIds = cameraIds, - PersonId = seach.PersonId, + PersonId = seach.Id, StartTick = startOfWeek, EndTick = endWeek }); @@ -211,7 +211,7 @@ public class VioPortraitSummary { AlarmType = AlarmType.visual_fence.GetDisplay(), CameraIds = cameraIds, - PersonId = seach.PersonId, + PersonId = seach.Id, StartTick = startOfLastWeek, EndTick = endOfLastWeek }); @@ -229,7 +229,7 @@ public class VioPortraitSummary { AlarmType = AlarmType.visual_fence.GetDisplay(), CameraIds = cameraIds, - PersonId = seach.PersonId, + PersonId = seach.Id, StartTick = startOfMonth, EndTick = endWeek }); diff --git a/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml b/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml index 5be2122..8f521c9 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml +++ b/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml @@ -241,7 +241,7 @@ - + 删除点名任务,删除关联点名数据 @@ -513,7 +513,7 @@ - 人员底库管理接口 + 人员班级管理接口 @@ -855,7 +855,7 @@ - 底库id + 班级id @@ -1107,7 +1107,7 @@ 预警事件查询接口 - + 删除预警信息 @@ -1301,7 +1301,7 @@ 搜索条件 - + 人员id diff --git a/SafeCampus.API/SafeCampus.Web.Core/Startup.cs b/SafeCampus.API/SafeCampus.Web.Core/Startup.cs index afe85fb..8f9a1b3 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Startup.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Startup.cs @@ -27,6 +27,7 @@ public class Startup : AppStartup options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();// 首字母小写(驼峰样式) options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";// 时间格式化 options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;// 忽略循环引用 + options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;// 忽略所有 null 属性 }).AddInjectWithUnifyResult()//配置统一返回模型 ; diff --git a/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user b/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user index 77eb053..64ecd7d 100644 --- a/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. <_PublishTargetUrl>F:\Project\QJKJ\SafeCampus\SafeCampus.API\SafeCampus.Web.Entry\bin\Release\net6.0\publish\ - True|2024-09-04T08:01:07.1761640Z;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;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-09-23T06:58:29.0998917Z;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;False|2024-07-19T11:37:52.4020673+08:00;True|2024-07-19T11:10:22.8661346+08:00; \ No newline at end of file