打卡点信息
parent
78a10d7df2
commit
22214d2ec5
|
|
@ -75,7 +75,7 @@ namespace OpenAuth.App.ServiceApp.FireManagement
|
|||
}
|
||||
}
|
||||
//查询打卡点
|
||||
public async Task<Response<PageInfo<List<dynamic>>>> GetCheckPointList(long areaid, string pointName, int pageIndex, int pageSize)
|
||||
public async Task<Response<PageInfo<List<CheckPointInfo>>>> GetCheckPointList(long areaid, string pointName, int pageIndex, int pageSize)
|
||||
{
|
||||
using (SugarDbContext db = base.UnitWork.CreateContext())
|
||||
{
|
||||
|
|
@ -88,18 +88,26 @@ namespace OpenAuth.App.ServiceApp.FireManagement
|
|||
.Where((a, b) => a.IsDelete == false)
|
||||
.WhereIF(!string.IsNullOrEmpty(pointName), (a, b, c) => a.PointName.Contains(pointName))
|
||||
.WhereIF(areaid != 0, (a, b, c) => chileorg.Contains(c.AreaId))
|
||||
.Select<dynamic>((a, b) => new
|
||||
.Select((a, b) => new CheckPointInfo
|
||||
{
|
||||
a.Id,
|
||||
a.PointName,
|
||||
a.Lat,
|
||||
a.Lng,
|
||||
a.CreateTime,
|
||||
CreateUserName = b.Name
|
||||
id = a.Id,
|
||||
pointname = a.PointName,
|
||||
lat = a.Lat,
|
||||
lng = a.Lng,
|
||||
createtime = a.CreateTime,
|
||||
//CreateUserName = b.Name,
|
||||
userinfo = SqlFunc.Subqueryable<FmCheckPointUser>()
|
||||
.Where(c => c.PointId == a.Id)
|
||||
.LeftJoin<SysUser>((c, u) => c.UserId == u.Id)
|
||||
.SelectStringJoin((c, u) => u.Account, ","),
|
||||
userid = SqlFunc.Subqueryable<FmCheckPointUser>()
|
||||
.Where(c => c.PointId == a.Id)
|
||||
.LeftJoin<SysUser>((c, u) => c.UserId == u.Id)
|
||||
.SelectStringJoin((c, u) => u.Id.ToString(), ","),
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalNumber);
|
||||
return new Response<PageInfo<List<dynamic>>>
|
||||
return new Response<PageInfo<List<CheckPointInfo>>>
|
||||
{
|
||||
Result = new PageInfo<List<dynamic>> { Items = query, Total = totalNumber }
|
||||
Result = new PageInfo<List<CheckPointInfo>> { Items = query, Total = totalNumber }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenAuth.App.ServiceApp.FireManagement.Response
|
||||
{
|
||||
public class CheckPointInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long id { get; set; }
|
||||
/// <summary>
|
||||
/// 打卡点经度
|
||||
/// </summary>
|
||||
public string lng { get; set; }
|
||||
/// <summary>
|
||||
/// 打卡点维度
|
||||
/// </summary>
|
||||
public string lat { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime createtime { get; set; }
|
||||
/// <summary>
|
||||
/// 打卡点名称
|
||||
/// </summary>
|
||||
public string pointname { get; set; }
|
||||
/// <summary>
|
||||
/// 打卡点人员
|
||||
/// </summary>
|
||||
public string usernames { get; set; }
|
||||
/// <summary>
|
||||
/// 打卡点人员xinxi
|
||||
/// </summary>
|
||||
public string userinfo { get; set; }
|
||||
public string userid { get; set; }
|
||||
public DateTime? lasttime { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -51,9 +51,10 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
|
|||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Response<PageInfo<List<dynamic>>>> GetCheckPointList(long areaid, string pointName, int page, int limit)
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<PageInfo<List<CheckPointInfo>>>> GetCheckPointList(long areaid, string pointName, int page, int limit)
|
||||
{
|
||||
Response<PageInfo<List<dynamic>>> response = new Response<PageInfo<List<dynamic>>>();
|
||||
Response<PageInfo<List<CheckPointInfo>>> response = new Response<PageInfo<List<CheckPointInfo>>>();
|
||||
try
|
||||
{
|
||||
return await _app.GetCheckPointList(areaid, pointName, page, limit);
|
||||
|
|
|
|||
Loading…
Reference in New Issue