|
@ -1,6 +1,4 @@ |
|
|
using Cis.Application.Core; |
|
|
using Cis.Application.Core.Component.PtzServer; |
|
|
using Cis.Application.Core.Component.CameraSDK; |
|
|
|
|
|
using Cis.Application.Core.Component.PtzServer; |
|
|
|
|
|
using EC.Helper.CameraSDK; |
|
|
using EC.Helper.CameraSDK; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using Newtonsoft.Json.Linq; |
|
|
|
|
|
|
|
@ -67,21 +65,58 @@ public class CmMarkLabelService : IDynamicApiController, ITransient |
|
|
return entity; |
|
|
return entity; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="queryJson">equal:cbCameraId,cmMarkGroupId; like:name; between:[startTime,endTime];</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
[HttpGet] |
|
|
[HttpGet] |
|
|
public async Task<List<CmMarkLabel>> GetList(string queryJson = "") |
|
|
public async Task<List<CmMarkLabel>> GetList(string queryJson = "") |
|
|
{ |
|
|
{ |
|
|
JObject queryObj = queryJson.ToJObject(); |
|
|
JObject queryObj = queryJson.ToJObject(); |
|
|
List<CmMarkLabel> list = await _baseRep.AsQueryable() |
|
|
|
|
|
|
|
|
var exp = Expressionable.Create<CmMarkLabel>(); |
|
|
|
|
|
if (queryObj.TryGetValue("cbCameraId", StringComparison.OrdinalIgnoreCase, out JToken cbCameraId)) |
|
|
|
|
|
exp.And(it => it.CbCameraId.Equals(cbCameraId)); |
|
|
|
|
|
if (queryObj.TryGetValue("cmMarkGroupId", StringComparison.OrdinalIgnoreCase, out JToken cmMarkGroupId)) |
|
|
|
|
|
exp.And(it => it.CmMarkGroupId.Equals(cmMarkGroupId)); |
|
|
|
|
|
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name)) |
|
|
|
|
|
exp.And(it => it.Name.Contains(name.ToString())); |
|
|
|
|
|
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) |
|
|
|
|
|
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) |
|
|
|
|
|
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); |
|
|
|
|
|
|
|
|
|
|
|
var list = await _baseRep.AsQueryable() |
|
|
|
|
|
.Where(exp.ToExpression()) |
|
|
.ToListAsync(); |
|
|
.ToListAsync(); |
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="queryJson">equal:cbCameraId,cmMarkGroupId; like:name; between:[startTime,endTime];</param>
|
|
|
|
|
|
/// <param name="pagination">index,size</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
[HttpGet] |
|
|
[HttpGet] |
|
|
public async Task<List<CmMarkLabel>> GetPageList(string queryJson, string pagination) |
|
|
public async Task<List<CmMarkLabel>> GetPageList(string queryJson, string pagination) |
|
|
{ |
|
|
{ |
|
|
Pagination pageObj = pagination.ToObject<Pagination>(); |
|
|
|
|
|
JObject queryObj = queryJson.ToJObject(); |
|
|
JObject queryObj = queryJson.ToJObject(); |
|
|
List<CmMarkLabel> list = await _baseRep.AsQueryable() |
|
|
Pagination pageObj = pagination.ToObject<Pagination>(); |
|
|
|
|
|
|
|
|
|
|
|
var exp = Expressionable.Create<CmMarkLabel>(); |
|
|
|
|
|
if (queryObj.TryGetValue("cbCameraId", StringComparison.OrdinalIgnoreCase, out JToken cbCameraId)) |
|
|
|
|
|
exp.And(it => it.CbCameraId.Equals(cbCameraId)); |
|
|
|
|
|
if (queryObj.TryGetValue("cmMarkGroupId", StringComparison.OrdinalIgnoreCase, out JToken cmMarkGroupId)) |
|
|
|
|
|
exp.And(it => it.CmMarkGroupId.Equals(cmMarkGroupId)); |
|
|
|
|
|
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name)) |
|
|
|
|
|
exp.And(it => it.Name.Contains(name.ToString())); |
|
|
|
|
|
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) |
|
|
|
|
|
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) |
|
|
|
|
|
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); |
|
|
|
|
|
|
|
|
|
|
|
var list = await _baseRep.AsQueryable() |
|
|
|
|
|
.Where(exp.ToExpression()) |
|
|
.ToPageListAsync(pageObj.Index, pageObj.Size); |
|
|
.ToPageListAsync(pageObj.Index, pageObj.Size); |
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|