神祖牌位管理模組,掛單模組前端URL添加HTTP_HOST

This commit is contained in:
2025-10-29 13:48:20 +08:00
parent 7d36d6b0a6
commit e9f17a5037
36 changed files with 3889 additions and 77 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
/// <summary>
/// AncestralTabletStatisticsController 的摘要描述
/// </summary>
public class AncestralTabletStatisticsController:ApiController
{
private Model.ezEntities db = new Model.ezEntities();
[HttpGet]
[Route("api/ancestraltablet/statistics/positions/availablepositions")]
public IHttpActionResult GetAvailablePositions()
{
var query =
from a in db.AncestralTabletArea // 区域表
join p in db.AncestralTabletPosition
on a.AreaId equals p.AreaId into ap
from p in ap.DefaultIfEmpty()
join r in db.AncestralTabletRegistrant
on p.PositionId equals r.PositionId into pr
from r in pr.DefaultIfEmpty()
group new { a, p, r } by new { a.AreaId, a.AreaName } into g
select new
{
AreaId = g.Key.AreaId,
AreaName = g.Key.AreaName,
TotalPositions = g.Count(x => x.p != null), // 总位置数
AvailableCount = g.Count(x => x.p != null && x.r == null) // 可用位置数(未登记)
};
var result = query.ToList();
return Ok(result);
}
}