@@ -1,4 +1,7 @@ | |||
namespace SafeCampus.Application.Services.Business.BuildingService; | |||
using Newtonsoft.Json; | |||
namespace SafeCampus.Application.Services.Business.BuildingService; | |||
public class BuildingInfoDto | |||
{ | |||
@@ -21,18 +24,22 @@ public class BuildingInfoDto | |||
/// <summary> | |||
/// 进入摄像头id | |||
/// </summary> | |||
[JsonProperty(NullValueHandling = NullValueHandling.Include)] | |||
public string InsCameraId { get; set; } | |||
/// <summary> | |||
/// 摄像头名称 | |||
/// </summary> | |||
[JsonProperty(NullValueHandling = NullValueHandling.Include)] | |||
public string InsCameraName { get; set;} | |||
/// <summary> | |||
/// 出去摄像头id | |||
/// </summary> | |||
[JsonProperty(NullValueHandling = NullValueHandling.Include)] | |||
public string OutCameraId { get; set; } | |||
/// <summary> | |||
/// 出去摄像头名称 | |||
/// </summary> | |||
[JsonProperty(NullValueHandling = NullValueHandling.Include)] | |||
public string OutCameraName { get; set;} | |||
} | |||
@@ -1,7 +1,4 @@ | |||
| |||
using SafeCampus.Application.Services.Business.CameraInfoService; | |||
namespace SafeCampus.Application.Services.Business.BuildingService; | |||
namespace SafeCampus.Application.Services.Business.BuildingService; | |||
public interface IBuildingService:ITransient | |||
{ | |||
@@ -23,6 +23,8 @@ public class CameraGroupService :DbRepository<CameraGroup>, ICameraGroupService | |||
{ | |||
throw Oops.Oh("信息不存在"); | |||
} | |||
if (await Context.Queryable<CameraGroup>().AnyAsync(it => it.Name == input.Name && it.ParentId == model.ParentId&&it.Id!=model.Id))//判断同级是否有名称重复的 | |||
throw Oops.Bah($"存在重复名称:{input.Name}"); | |||
var res = input.Adapt(model); | |||
await UpdateAsync(res); | |||
return true; | |||
@@ -139,8 +139,10 @@ public class DormitoryService:DbRepository<DormitoryInfo>,IDormitoryService | |||
.Includes(x => x.PersonInfos, xx => xx.Attendances.Where(x => | |||
x.Tick.Year == returnTime.Year && x.Tick.Month == returnTime.Month && | |||
x.Tick.Day == returnTime.Day).ToList()) | |||
.Includes(x=>x.PersonInfos,x=>x.PersonSetInfoItem) | |||
.Includes(x=>x.PersonInfos,x=>x.PersonFacesList) | |||
.Includes(x => x.PersonInfos, x => x.PersonFacesList) | |||
.AsNavQueryable() | |||
.Includes(x=>x.PersonInfos,x=>x.PersonSetInfoItem,x=>x.MajorInfoItem,x=>x.DepartmentInfoItem) | |||
.FirstAsync(x => x.Id == id); | |||
return query.Adapt<ReturnDormitoryDto>(); | |||
} |
@@ -129,6 +129,7 @@ public class WarnInfoDto | |||
/// 处理时间 | |||
/// </summary> | |||
public DateTime? HandTime { get; set; } | |||
public string SceneName { get; set; } | |||
} | |||
public class WarnInfoDtoMapper : IRegister | |||
{ | |||
@@ -27,7 +27,6 @@ public class ClothApi | |||
/// <returns></returns> | |||
public async Task<dynamic> AddClothDataBaseA(ClothDataNameInfo input) | |||
{ | |||
var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | |||
var liststr = await $"{appSettings.SXAPIURL}/dfield-api/ecology/cloth/set/query-list" | |||
.SetBody(new | |||
@@ -99,6 +98,26 @@ public class ClothApi | |||
public async Task<dynamic> UpdateClothU(ClothDataBaseInfo info) | |||
{ | |||
var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | |||
var liststr = await $"{appSettings.SXAPIURL}/dfield-api/ecology/cloth/set/query-list" | |||
.SetBody(new | |||
{ | |||
token = _deepelephManager.GetToken(), | |||
tenantCode = appSettings.TenantCode, | |||
poiId = appSettings.PoiId, | |||
}) | |||
.SetContentType("application/json") | |||
.PostAsAsync<string>(); | |||
var list = JsonConvert.DeserializeObject<JObject>(liststr); | |||
var newlist = new List<string>(); | |||
foreach (var item in list["data"]) | |||
{ | |||
newlist.Add(item.Value<string>("clothSetName")); | |||
} | |||
if (newlist.Any(x => x == info.ClothSetName)) | |||
{ | |||
throw Oops.Oh("服装库名称已存在"); | |||
} | |||
var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/cloth/set/update" | |||
.SetBody(new | |||
{ | |||
@@ -139,15 +139,16 @@ public class DfieldApi : IDynamicApiController | |||
if ((bool)model["success"]) | |||
{ | |||
var isOk = model["data"].ToString() == ids; | |||
if (isOk) | |||
{ | |||
await _personSetInfoService.Delete(ids); | |||
} | |||
await _personSetInfoService.Delete(ids); | |||
} | |||
else if (model["message"].ToString().Contains("不存在")) | |||
{ | |||
await _personSetInfoService.Delete(ids); | |||
} | |||
else | |||
{ | |||
throw Oops.Oh(model["message"].ToString()); | |||
} | |||
//else | |||
//{ | |||
// throw Oops.Oh(model["message"].ToString()); | |||
//} | |||
} | |||
return true; | |||
} | |||
@@ -7,6 +7,7 @@ using SafeCampus.Application.Services.Business.CameraInfoService; | |||
using SafeCampus.Application.Services.Business.DormitoryService; | |||
using SafeCampus.Application.Services.Business.PersonSetInfoService; | |||
using System; | |||
using SafeCampus.Application.Services.Business.BuildingService; | |||
using SafeCampus.Core.Extension; | |||
using TencentCloud.Iot.V20180123.Models; | |||
using TencentCloud.Nlp.V20190408.Models; | |||
@@ -25,14 +26,16 @@ public class DormitoryController | |||
private readonly IDeepelephManager _deepelephManager; | |||
private readonly IPersonSetInfoService _personSetInfoService; | |||
private readonly ICameraInfoService _cameraInfoService; | |||
private readonly IBuildingService _buildingService; | |||
public DormitoryController(IDormitoryService dormitoryService, IConfigService configService, IDeepelephManager deepelephManager, IPersonSetInfoService personSetInfoService, ICameraInfoService cameraInfoService) | |||
public DormitoryController(IDormitoryService dormitoryService, IConfigService configService, IDeepelephManager deepelephManager, IPersonSetInfoService personSetInfoService, ICameraInfoService cameraInfoService, IBuildingService buildingService) | |||
{ | |||
_dormitoryService = dormitoryService; | |||
_configService = configService; | |||
_deepelephManager = deepelephManager; | |||
_personSetInfoService = personSetInfoService; | |||
_cameraInfoService = cameraInfoService; | |||
_buildingService = buildingService; | |||
} | |||
/// <summary> | |||
@@ -146,6 +149,7 @@ public class DormitoryController | |||
} | |||
var time = new { timeBegin = input.TimeBegin, timeEnd = input.TimeEnd }; | |||
var personSetIds = await _personSetInfoService.GetPageList(null,null); | |||
var qinshi = await _buildingService.GetUseCameraList(); | |||
var cameras = await _cameraInfoService.GetPageList(new CameraSearch{PageSize = 1000,PageNum = 1}); | |||
var body = new | |||
{ | |||
@@ -158,7 +162,7 @@ public class DormitoryController | |||
funcStart = input.FuncStart, | |||
funcEnd = input.FuncEnd, | |||
enableAlarmRateLimit = false, | |||
cameras = cameras.List.Select(x => new | |||
cameras = cameras.List.Where(x=>qinshi.Contains(x.SensorId)).Select(x => new | |||
{ | |||
cameraId = x.SensorId, | |||
cameraName = x.SensorName, | |||
@@ -65,6 +65,7 @@ public class WarnInfoController | |||
public async Task<WarnInfoDto> GetInfo(long Id) | |||
{ | |||
var model = await _warnInfoService.GetInfo(Id); | |||
var config = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup); | |||
if (!string.IsNullOrEmpty(model.Extend)) | |||
{ | |||
if (string.IsNullOrEmpty(model.PersonId)) | |||
@@ -74,7 +75,15 @@ public class WarnInfoController | |||
} | |||
} | |||
if (model.AlarmType == "crowd") | |||
{ | |||
model.Extend = $"人群聚集数量:{model.Count}"; | |||
} | |||
if (config!=null) | |||
{ | |||
model.SceneName = config.FirstOrDefault(x => x.Subset.Any(xx => xx.Code == model.AlarmType) && x.CameraId.Contains(model.CameraId))?.Name; | |||
} | |||
try | |||
{ | |||
var appSettings = App.GetOptionsMonitor<AppInfoOptions>(); | |||
@@ -114,9 +123,10 @@ public class WarnInfoController | |||
{ | |||
var config = _simpleCacheService.Get<List<WarnGroupInfo>>(SafeCampusConst.WarnGroup); | |||
var page= await _warnInfoService.GetList(input); | |||
if (config == null) return page; | |||
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; | |||
item.SceneName = config.FirstOrDefault(x => x.Subset.Any(xx => xx.Code == item.AlarmType) && x.CameraId.Contains(item.CameraId))?.Name; | |||
} | |||
return page; | |||
} | |||
@@ -176,7 +176,7 @@ public class LargeScreenController | |||
{ | |||
StartTick = startTime, | |||
EndTick = entTime, | |||
CameraId = sushelou.InsCameraId, | |||
//CameraId = sushelou.InsCameraId, | |||
CameraIds=new List<string>{sushelou.InsCameraId,sushelou.OutCameraId} | |||
}); | |||
return new | |||
@@ -184,7 +184,7 @@ public class LargeScreenController | |||
Building=new{TotalNum=Qsrs,InNum=zqrs,NoInNum=bzqrs}, | |||
DormitoryList=list, | |||
ReturnTime=guiqinsj, | |||
AttendList=crjl, | |||
AttendList=crjl.Where(x=>!string.IsNullOrEmpty(x.PersonId)), | |||
}; | |||
} | |||
/// <summary> | |||
@@ -186,7 +186,8 @@ public class VioAnalysisController | |||
StartTick = input.StartTime, | |||
EndTick = input.EndTime.AddDays(1).AddSeconds(-1), | |||
AlarmTypes = warnGroup.Subset.Where(x=>x.State).Select(x => x.Code).ToArray(), | |||
PersonSetIds = input.PersonSetIds | |||
PersonSetIds = input.PersonSetIds, | |||
CameraIds = warnGroup.CameraId | |||
}); | |||
var templatePath = Path.Combine(Directory.GetCurrentDirectory(), "Template", $"WordTemplate.docx"); | |||
await using var fs = new FileStream(templatePath, FileMode.Open, FileAccess.ReadWrite); | |||
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. | |||
<Project> | |||
<PropertyGroup> | |||
<_PublishTargetUrl>F:\Project\QJKJ\SafeCampus\SafeCampus.API\SafeCampus.Web.Entry\bin\Release\net6.0\publish\</_PublishTargetUrl> | |||
<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> | |||
<History>True|2024-10-24T01:34:12.7696084Z;True|2024-10-23T10:41:37.0558539+08:00;True|2024-10-23T09:28:31.4313071+08:00;True|2024-10-23T09:26:31.5501719+08:00;True|2024-10-23T09:23:51.0582343+08:00;True|2024-10-23T09:06:44.5849207+08:00;True|2024-10-22T13:08:17.1569031+08:00;True|2024-10-22T09:42:47.5945039+08:00;True|2024-10-21T17:29:20.3317104+08:00;True|2024-10-21T16:46:26.6984879+08:00;True|2024-10-21T10:12:44.0443975+08:00;True|2024-10-10T10:57:40.0075220+08:00;True|2024-10-10T10:02:41.0397715+08:00;True|2024-10-09T17:39:11.0140701+08:00;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;</History> | |||
<LastFailureDetails /> | |||
</PropertyGroup> | |||
</Project> |
@@ -14,7 +14,7 @@ def main(): | |||
labale = sys.argv[3].split(",") # 接收三个数组参数 | |||
values=[int(x) for x in sys.argv[4].split(",")] | |||
# 打印参数 | |||
plt.pie( values, labels=labale, colors=['gold', 'yellowgreen', 'lightcoral', 'lightskyblue'],autopct='%1.1f%%') | |||
plt.pie( values, labels=labale, colors=['#FF6384','#36A2EB','#4BC0C0','#FFCE56','#FF9F40','#FFB3E6','#C2C2F0','#FF5733','#DAF7A6','#FFC300' ],autopct='%1.1f%%') | |||
# 确保饼图是圆形的 | |||
plt.axis('equal') | |||
# 添加标题 | |||
@@ -65,7 +65,7 @@ | |||
<el-table-column type="index" width="50" /> | |||
<el-table-column prop="personName" label="姓名" align="center"> </el-table-column> | |||
<el-table-column prop="dormitName" label="所在宿舍" align="center"> </el-table-column> | |||
<el-table-column prop="gender" label="宿舍性别" align="center" :formatter="genderFormatter"> </el-table-column> | |||
<el-table-column prop="gender" label="宿舍类型" align="center" :formatter="genderFormatter"> </el-table-column> | |||
<el-table-column prop="$status" label="出入状态" align="center"> </el-table-column> | |||
</el-table> | |||
</div> | |||