diff --git a/data/SQL/AncestralTabletStatus_script.sql b/data/SQL/AncestralTabletStatus_script.sql new file mode 100644 index 0000000..86204e4 Binary files /dev/null and b/data/SQL/AncestralTabletStatus_script.sql differ diff --git a/data/SQL/完整資料結構(僅限本地,不包含其它分支更新)_script_1029.sql b/data/SQL/完整資料結構(僅限本地,不包含其它分支更新)_script_1029.sql new file mode 100644 index 0000000..1756f98 Binary files /dev/null and b/data/SQL/完整資料結構(僅限本地,不包含其它分支更新)_script_1029.sql differ diff --git a/data/memo/新增 文字文件.md b/data/memo/新增 文字文件.md new file mode 100644 index 0000000..9cbe94c --- /dev/null +++ b/data/memo/新增 文字文件.md @@ -0,0 +1,11 @@ +資料字典: +USE [17168erp_t] +GO +INSERT [dbo].[AncestralTabletStatus] ([StatusCode], [StatusName], [StatusType]) VALUES (N'available', N'可用', N'Position') +INSERT [dbo].[AncestralTabletStatus] ([StatusCode], [StatusName], [StatusType]) VALUES (N'maintenance', N'維護中', N'Position') +INSERT [dbo].[AncestralTabletStatus] ([StatusCode], [StatusName], [StatusType]) VALUES (N'used', N'已使用', N'Position') +GO +代碼中會用到上面表中的狀態,所以必須在該表中插入上面的數據 +AncestralTabletStatus_script.sql文件中的表是神祖牌位功能模組需要用到的表,再運行之前需要先執行該文件 + +執行AncestralTabletStatus_script.sql後要把在item表中新增的URL權限添加到相應的管理員帳號 \ No newline at end of file diff --git a/data/神主牌管理系統資料字典設計.docx b/data/神主牌管理系統資料字典設計.docx new file mode 100644 index 0000000..c817ade Binary files /dev/null and b/data/神主牌管理系統資料字典設計.docx differ diff --git a/web/App_Code/Model/Model.Context.cs b/web/App_Code/Model/Model.Context.cs index b3af8b4..55693ea 100644 --- a/web/App_Code/Model/Model.Context.cs +++ b/web/App_Code/Model/Model.Context.cs @@ -89,6 +89,11 @@ namespace Model public virtual DbSet RegionRoomBedStatus { get; set; } public virtual DbSet RegionType { get; set; } public virtual DbSet Room { get; set; } + public virtual DbSet AncestralTabletArea { get; set; } + public virtual DbSet AncestralTabletPosition { get; set; } + public virtual DbSet AncestralTabletPositionRecord { get; set; } + public virtual DbSet AncestralTabletRegistrant { get; set; } + public virtual DbSet AncestralTabletStatus { get; set; } public virtual int pager_eztrust(Nullable startRowIndex, Nullable pageSize, string tableName, string columnName, string sqlWhere, string orderBy, ObjectParameter rowCount) { diff --git a/web/App_Code/Model/Model.cs b/web/App_Code/Model/Model.cs index 1f090d4..450d467 100644 --- a/web/App_Code/Model/Model.cs +++ b/web/App_Code/Model/Model.cs @@ -523,6 +523,139 @@ namespace Model using System; using System.Collections.Generic; + public partial class AncestralTabletArea + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public AncestralTabletArea() + { + this.AncestralTabletArea1 = new HashSet(); + this.AncestralTabletPosition = new HashSet(); + } + + public int AreaId { get; set; } + public string AreaName { get; set; } + public string AreaCode { get; set; } + public Nullable ParentAreaId { get; set; } + public string AreaType { get; set; } + public Nullable Price { get; set; } + public Nullable SortOrder { get; set; } + public bool IsDisabled { get; set; } + public string Description { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AncestralTabletArea1 { get; set; } + public virtual AncestralTabletArea AncestralTabletArea2 { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AncestralTabletPosition { get; set; } + } +} +namespace Model +{ + using System; + using System.Collections.Generic; + + public partial class AncestralTabletPosition + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public AncestralTabletPosition() + { + this.AncestralTabletRegistrant = new HashSet(); + } + + public int PositionId { get; set; } + public int AreaId { get; set; } + public string PositionCode { get; set; } + public string PositionName { get; set; } + public Nullable Price { get; set; } + public string StatusCode { get; set; } + public string Description { get; set; } + public Nullable RowNo { get; set; } + public Nullable ColumnNo { get; set; } + + public virtual AncestralTabletArea AncestralTabletArea { get; set; } + public virtual AncestralTabletStatus AncestralTabletStatus { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AncestralTabletRegistrant { get; set; } + } +} +namespace Model +{ + using System; + using System.Collections.Generic; + + public partial class AncestralTabletPositionRecord + { + public int RecordId { get; set; } + public string RegistrantCode { get; set; } + public string NPTitle { get; set; } + public System.DateTime NPStandDate { get; set; } + public string NPYangShang { get; set; } + public string WPContent { get; set; } + public System.DateTime CreatedAt { get; set; } + public Nullable UpdatedAt { get; set; } + + public virtual AncestralTabletRegistrant AncestralTabletRegistrant { get; set; } + } +} +namespace Model +{ + using System; + using System.Collections.Generic; + + public partial class AncestralTabletRegistrant + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public AncestralTabletRegistrant() + { + this.AncestralTabletPositionRecord = new HashSet(); + } + + public string RegistrantCode { get; set; } + public string Name { get; set; } + public string Phone { get; set; } + public string Address { get; set; } + public System.DateTime RegisterDate { get; set; } + public Nullable Price { get; set; } + public Nullable PositionId { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public bool IsLongTerm { get; set; } + public bool IsActive { get; set; } + public System.DateTime CreatedAt { get; set; } + public Nullable UpdatedAt { get; set; } + public bool IsEnd { get; set; } + + public virtual AncestralTabletPosition AncestralTabletPosition { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AncestralTabletPositionRecord { get; set; } + } +} +namespace Model +{ + using System; + using System.Collections.Generic; + + public partial class AncestralTabletStatus + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public AncestralTabletStatus() + { + this.AncestralTabletPosition = new HashSet(); + } + + public string StatusCode { get; set; } + public string StatusName { get; set; } + public string StatusType { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AncestralTabletPosition { get; set; } + } +} +namespace Model +{ + using System; + using System.Collections.Generic; + public partial class appellation { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] @@ -857,6 +990,12 @@ namespace Model public partial class GuaDanOrder { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public GuaDanOrder() + { + this.GuaDanOrderGuest = new HashSet(); + } + public Nullable StartDate { get; set; } public Nullable EndDate { get; set; } public Nullable CreateUser { get; set; } @@ -874,6 +1013,8 @@ namespace Model public virtual admin admin { get; set; } public virtual follower followers { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GuaDanOrderGuest { get; set; } } } namespace Model @@ -898,6 +1039,7 @@ namespace Model public Nullable CheckInAt { get; set; } public Nullable CheckOutAt { get; set; } public string StatusCode { get; set; } + public Nullable OrderUuid { get; set; } public virtual follower followers { get; set; } public virtual RegionRoomBed RegionRoomBed { get; set; } @@ -905,6 +1047,7 @@ namespace Model public virtual RegionRoomBedStatus RegionRoomBedStatus { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection RegionAndRoomAndBedSchedule { get; set; } + public virtual GuaDanOrder GuaDanOrder { get; set; } } } namespace Model diff --git a/web/App_Code/Model/Model.edmx b/web/App_Code/Model/Model.edmx index 8e40781..e887b85 100644 --- a/web/App_Code/Model/Model.edmx +++ b/web/App_Code/Model/Model.edmx @@ -254,6 +254,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -454,6 +522,7 @@ + @@ -910,6 +979,18 @@ + + + + + + + + + + + + @@ -1178,6 +1259,18 @@ + + + + + + + + + + + + @@ -1372,6 +1465,18 @@ + + + + + + + + + + + + @@ -1506,6 +1611,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -1718,6 +1847,18 @@ + + + + + + + + + + + + @@ -1966,6 +2107,11 @@ + + + + + @@ -2010,6 +2156,10 @@ + + + + @@ -2094,6 +2244,10 @@ + + + + @@ -2158,6 +2312,10 @@ + + + + @@ -2202,6 +2360,14 @@ + + + + + + + + @@ -2270,6 +2436,10 @@ + + + + @@ -4348,6 +4518,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4641,6 +4840,7 @@ + @@ -4660,6 +4860,8 @@ + + @@ -4912,6 +5114,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5773,6 +6125,7 @@ + @@ -5885,6 +6238,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/App_Code/Model/Model.edmx.diagram b/web/App_Code/Model/Model.edmx.diagram index c1722e4..4de4ec0 100644 --- a/web/App_Code/Model/Model.edmx.diagram +++ b/web/App_Code/Model/Model.edmx.diagram @@ -151,6 +151,17 @@ + + + + + + + + + + + diff --git a/web/App_Code/api/AncestralTabletAreaController.cs b/web/App_Code/api/AncestralTabletAreaController.cs new file mode 100644 index 0000000..614f134 --- /dev/null +++ b/web/App_Code/api/AncestralTabletAreaController.cs @@ -0,0 +1,180 @@ +using Model; +using PagedList; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Data.Entity; +using System.Linq; +using System.Threading.Tasks; +using System.Web; +using System.Web.Http; +using static AncestralTabletPositionController; +using static regionController; + +/// +/// AncestralTabletController 的摘要描述 +/// +public class AncestralTabletAreaController: ApiController +{ + private Model.ezEntities _db = new Model.ezEntities(); + public class AreaViewModel + { + public int? AreaId { get; set; } + public string AreaName { get; set; } + + [Required(ErrorMessage = "區域編號為必填")] + public string AreaCode { get; set; } + public int? ParentAreaId { get; set; } + public string AreaType { get; set; } + public int? Price { get; set; } + public int? SortOrder { get; set; } + public bool IsDisabled { get; set; } = false; + public string Description { get; set; } + } + public class RegionDto + { + public int AreaId { get; set; } + public string AreaName { get; set; } + public string AreaCode { get; set; } + public int? SortOrder { get; set; } + public int? ParentAreaId { get; set; } + public string AreaType { get; set; } + public bool IsDisabled { get; set; } + public string Description { get; set; } + public int? Price { set; get; } + + public List Children { get; set; } = new List(); + } + [HttpGet] + [Route("api/ancestraltablet/area/getlist")] + public IHttpActionResult GetList() + { + var allArea = _db.AncestralTabletArea.ToList(); + + var rootRegions = allArea + .Where(r => r.ParentAreaId == null) + .OrderBy(r => r.SortOrder) + .ToList(); + + var tree = rootRegions + .Select(r => BuildRegionDto(r, allArea)) + .ToList(); + return Ok(tree); + + } + [HttpGet] + [Route("api/ancestraltablet/area/getereawithposition")] + public IHttpActionResult GetEreaWithPosition() + { + //获取有神位位置的区域 + var allArea = _db.AncestralTabletArea + .Where(a => a.AncestralTabletPosition.Count()>0) + .Select(a => new + { + a.AreaId, + a.AreaName, + }) + .ToList(); + return Ok(allArea); + + } + private RegionDto BuildRegionDto(AncestralTabletArea area, List allArea) + { + return new RegionDto + { + AreaId = area.AreaId, + AreaName = area.AreaName, + AreaCode = area.AreaCode, + SortOrder = area.SortOrder, + ParentAreaId = area.ParentAreaId, + AreaType = area.AreaType, + IsDisabled = area.IsDisabled, + Description = area.Description, + Price = area.Price, + Children = allArea + .Where(r => r.ParentAreaId == area.AreaId) + .OrderBy(r => r.SortOrder) + .Select(child => BuildRegionDto(child, allArea)) + .ToList(), + }; + } + [HttpPost] + [Route("api/ancestraltablet/area/create")] + public async Task CreateArea([FromBody] AreaViewModel tabletArea) + { + if (!ModelState.IsValid) + return BadRequest(ModelState); + try + { + var area = new AncestralTabletArea + { + AreaName = tabletArea.AreaName, + AreaCode = tabletArea.AreaCode, + ParentAreaId = tabletArea.ParentAreaId, + AreaType = tabletArea.AreaType, + Price = tabletArea.Price, + SortOrder = tabletArea.SortOrder, + IsDisabled = tabletArea.IsDisabled, + Description = tabletArea.Description + }; + _db.AncestralTabletArea.Add(area); + await _db.SaveChangesAsync(); + tabletArea.AreaId = area.AreaId; + return Ok(new { message = "區域建立成功", area = tabletArea }); + } + catch (Exception ex) + { + return InternalServerError(ex); + } + } + [HttpPost] + [Route("api/ancestraltablet/area/edit")] + public async Task EditArea([FromBody] AreaViewModel tabletArea) + { + if (!ModelState.IsValid) + return BadRequest(ModelState); + try + { + var oldArea = _db.AncestralTabletArea.Find(tabletArea.AreaId); + if (oldArea == null) + { + return NotFound(); + } + oldArea.AreaName = tabletArea.AreaName; + oldArea.AreaCode = tabletArea.AreaCode; + oldArea.ParentAreaId = tabletArea.ParentAreaId; + oldArea.Price = tabletArea.Price; + oldArea.SortOrder = tabletArea.SortOrder; + oldArea.Description = tabletArea.Description; + oldArea.IsDisabled = tabletArea.IsDisabled; + await _db.SaveChangesAsync(); + return Ok(new { message = "區域修改成功", area = tabletArea }); + } + catch (Exception ex) + { + return InternalServerError(ex); + } + } + [HttpGet] + [Route("api/ancestraltablet/area/position/getlist")] + public IHttpActionResult GetPositionList([FromUri] int areaId) + { + var positions = _db.AncestralTabletPosition + .Where(p => p.AreaId == areaId) + .Select(p => new AncestralTabletPositionDto + { + PositionId = p.PositionId, + AreaId = p.AreaId, + PositionCode = p.PositionCode, + PositionName = p.PositionName, + Price = p.Price, + StatusCode = p.StatusCode, + Description = p.Description, + RowNo = p.RowNo, + ColumnNo = p.ColumnNo + }) + .ToList(); + + return Ok(positions); + } +} \ No newline at end of file diff --git a/web/App_Code/api/AncestralTabletPositionController.cs b/web/App_Code/api/AncestralTabletPositionController.cs new file mode 100644 index 0000000..c4e8316 --- /dev/null +++ b/web/App_Code/api/AncestralTabletPositionController.cs @@ -0,0 +1,184 @@ +using Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Web; +using System.Web.Http; + +/// +/// AncestralTabletPositionController 的摘要描述 +/// +public class AncestralTabletPositionController: ApiController +{ + private Model.ezEntities _db = new Model.ezEntities(); + + [HttpGet] + [Route("api/ancestraltablet/position/getlist")] + public IHttpActionResult GetList([FromUri] int areaId) + { + var positions = _db.AncestralTabletPosition + .Where(p => p.AreaId == areaId) + .Select(p => new + { + PositionId = p.PositionId, + AreaId = p.AreaId, + PositionCode = p.PositionCode, + PositionName = p.PositionName, + Price = p.Price, + StatusCode = p.StatusCode, + Description = p.Description, + RowNo = p.RowNo, + ColumnNo = p.ColumnNo, + AncestralTabletRegistrant = _db.AncestralTabletRegistrant + .Where(r => r.PositionId == p.PositionId && r.IsActive == true) + .Select(r => new + { + r.RegistrantCode, + r.Name, + r.Phone, + r.Address, + r.RegisterDate, + r.Price, + r.StartDate, + r.EndDate, + r.IsLongTerm, + r.IsActive, + + // 嵌套查询牌位记录(PositionRecord) + TabletRecord = r.AncestralTabletPositionRecord + .Select(pr => new + { + pr.RecordId, + pr.RegistrantCode, + pr.NPTitle, + pr.NPStandDate, + pr.NPYangShang, + pr.WPContent + }) + .FirstOrDefault() + }) + .FirstOrDefault() + }) + .ToList(); + + return Ok(positions); + } + [HttpGet] + [Route("api/ancestraltablet/position/shortlist")] + public IHttpActionResult GetListWithShort([FromUri] int areaId) + { + //获取位置列表,简单信息 + var positions = _db.AncestralTabletPosition + .Where(p => p.AreaId == areaId) + .Select(p => new + { + PositionId = p.PositionId, + AreaId = p.AreaId, + PositionCode = p.PositionCode, + PositionName = p.PositionName, + Price = p.Price, + StatusCode = p.StatusCode, + Description = p.Description, + RowNo = p.RowNo, + ColumnNo = p.ColumnNo, + isCanUse = p.StatusCode == "available" ? true : false, + }) + .ToList(); + + return Ok(positions); + } + [HttpPost] + [Route("api/ancestraltablet/position/batchcreate")] + public IHttpActionResult BatchCreatePosition([FromBody] List positions) + { + if (positions == null || positions.Count == 0) + return BadRequest("未接收到任何位置数据"); + + try + { + foreach (var dto in positions) + { + var entity = new AncestralTabletPosition + { + AreaId = dto.AreaId, + PositionCode = dto.PositionCode, + PositionName = dto.PositionName, + Price = dto.Price, + StatusCode = dto.StatusCode, + Description = dto.Description, + RowNo = dto.RowNo, + ColumnNo = dto.ColumnNo + }; + + _db.AncestralTabletPosition.Add(entity); + } + + _db.SaveChanges(); + + return Ok(new { message = "批量新增成功", count = positions.Count }); + } + catch (Exception ex) + { + string message = ex.InnerException?.InnerException?.Message ?? ex.Message; + + return Content(HttpStatusCode.InternalServerError, new + { + message = "批量新增失败", + exceptionMessage = message + }); + } + } + + [HttpPost] + [Route("api/ancestraltablet/position/edit")] + public IHttpActionResult EditPosition([FromBody] AncestralTabletPositionDto pos) + { + var oldPos = _db.AncestralTabletPosition + .FirstOrDefault(p => p.AreaId == pos.AreaId && p.PositionCode == pos.PositionCode); + if(oldPos == null) return NotFound(); + try + { + oldPos.PositionName = pos.PositionName; + oldPos.Price = pos.Price; + oldPos.StatusCode = pos.StatusCode; + + // 保存到数据库 + _db.SaveChanges(); + } + catch (Exception ex) + { + return InternalServerError(ex); + } + return Ok(new { message="更新成功", code=200}); + } + [HttpDelete] + [Route("api/ancestraltablet/position/delete/{positionId}")] + public IHttpActionResult DeletePosition(int positionId) + { + var pos = _db.AncestralTabletPosition.FirstOrDefault(p => p.PositionId == positionId); + + if (pos == null) + { + return NotFound(); + } + + _db.AncestralTabletPosition.Remove(pos); + _db.SaveChanges(); + + return Ok("删除成功"); + } + public class AncestralTabletPositionDto + { + public int PositionId { get; set; } + public int AreaId { get; set; } + public string PositionCode { get; set; } + public string PositionName { get; set; } + public int? Price { get; set; } + public string StatusCode { get; set; } + public string Description { get; set; } + public int? RowNo { get; set; } + public int? ColumnNo { get; set; } + } + +} \ No newline at end of file diff --git a/web/App_Code/api/AncestralTabletRecordController.cs b/web/App_Code/api/AncestralTabletRecordController.cs new file mode 100644 index 0000000..22c3e15 --- /dev/null +++ b/web/App_Code/api/AncestralTabletRecordController.cs @@ -0,0 +1,361 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Http; +using System.Web.UI.WebControls; + +/// +/// AncestralTabletRecordController 的摘要描述 +/// +public class AncestralTabletRecordController: ApiController +{ + private Model.ezEntities _db = new Model.ezEntities(); + [HttpGet] + [Route("api/ancestraltablet/registrant/getlist")] + public IHttpActionResult GetRegistrantList() + { + //获取登记人列表 + var data = _db.AncestralTabletRegistrant.Select(x => new + { + x.RegistrantCode, + x.Name, + x.Phone, + x.Address, + x.RegisterDate, + x.Price, + x.PositionId, + x.StartDate, + x.EndDate, + x.IsLongTerm, + x.IsActive, + x.CreatedAt, + x.UpdatedAt + }) + .Take(1000) // 取前1000条 + .ToList(); ; + return Ok(data); + } + [HttpPost] + [Route("api/ancestraltablet/registrant/getlistbypage")] + public IHttpActionResult GetRegistrantListByPage([FromBody] RegistrantSearchDto searchDto) + { + //获取登记人列表 + var query = _db.AncestralTabletRegistrant.AsQueryable(); + if( !string.IsNullOrEmpty(searchDto.searchName)) + { + query = query.Where(r => r.Name == searchDto.searchName); + } + var tatol = query.Count(); + var data = query.Select(x => new + { + x.RegistrantCode, + x.Name, + x.Phone, + x.Address, + x.RegisterDate, + x.Price, + x.PositionId, + x.StartDate, + x.EndDate, + x.IsLongTerm, + x.IsActive, + x.CreatedAt, + x.UpdatedAt + }) + .OrderByDescending(a => a.CreatedAt) + .Skip((searchDto.page - 1) * searchDto.pageSize) + .Take(searchDto.pageSize) // 取前1000条 + .ToList(); + return Ok(new + { + data = data, + total = tatol + + }); + } + + [HttpGet] + [Route("api/ancestraltablet/registrant/getbycode")] + public IHttpActionResult GetRegistrantByCode([FromUri] string registrantCode) + { + var r = _db.AncestralTabletRegistrant.Find(registrantCode); + if (r == null) + { + return NotFound(); + } + var rDto = new + { + r.RegistrantCode, + r.Name, + r.Phone, + r.Address, + r.RegisterDate, + r.Price, + r.StartDate, + r.EndDate, + r.IsLongTerm, + r.IsActive, + r.PositionId, + positionName = r.AncestralTabletPosition?.PositionName, + + + // 嵌套查询牌位记录(PositionRecord) + TabletRecord = r.AncestralTabletPositionRecord + .Select(pr => new + { + pr.RecordId, + pr.RegistrantCode, + pr.NPTitle, + pr.NPStandDate, + pr.NPYangShang, + pr.WPContent, + }) + .FirstOrDefault() + }; + return Ok(rDto); + } + + [HttpPost] + [Route("api/ancestraltablet/registrant/create")] + public IHttpActionResult CreateRegistrant([FromBody] AncestralTabletRegistrantDto dto) + { + //新增登记人api + if (dto == null) + { + return BadRequest("请求体不能为空"); + } + if(!string.IsNullOrEmpty(dto.RegistrantCode)) + { + return BadRequest("RegistrantCode 应传递空"); + } + try + { + dto.RegistrantCode = GenerateRegistrantCode(); + + // 设置默认创建时间 + dto.CreatedAt = DateTime.Now; + var entity = new Model.AncestralTabletRegistrant + { + RegistrantCode = dto.RegistrantCode, + Name = dto.Name, + Phone = dto.Phone, + Address = dto.Address, + RegisterDate = dto.RegisterDate, + Price = dto.Price, + PositionId = dto.PositionId, + StartDate = dto.startDate, + EndDate = dto.endDate, + IsLongTerm = dto.isLongTerm, + IsActive = dto.isActive, + CreatedAt = dto.CreatedAt, + UpdatedAt = dto.UpdatedAt + }; + + // 假设你有一个 EF DbContext(如 _db) + _db.AncestralTabletRegistrant.Add(entity); + if (dto.PositionId != null) + { + var position = _db.AncestralTabletPosition + .FirstOrDefault(p => p.PositionId == dto.PositionId); + + if (position != null) + { + position.StatusCode = "used"; // 或者根据你的枚举/字段设置 + } + } + + _db.SaveChanges(); + + return Ok(new { message = "登记成功", registrantCode = entity.RegistrantCode }); + } + catch (Exception ex) + { + return InternalServerError(ex); + } + } + [HttpPost] + [Route("api/ancestraltablet/registrant/update")] + public IHttpActionResult UpdateRegistrant([FromBody] AncestralTabletRegistrantDto dto) + { + if (dto == null) + { + return BadRequest("请求体不能为空"); + } + + if (string.IsNullOrWhiteSpace(dto.RegistrantCode)) + { + return BadRequest("缺少 RegistrantCode,无法进行更新操作"); + } + + try + { + // 查找原始资料 + var entity = _db.AncestralTabletRegistrant + .FirstOrDefault(r => r.RegistrantCode == dto.RegistrantCode); + + if (entity == null) + { + return NotFound(); // 没有对应记录 + } + + // ===== 处理安位状态 ===== + if (entity.PositionId != dto.PositionId) + { + // 1. 原来的安位设置为可用 + if (entity.PositionId != null) + { + var oldPosition = _db.AncestralTabletPosition + .FirstOrDefault(p => p.PositionId == entity.PositionId); + + if (oldPosition != null) + { + oldPosition.StatusCode = "available"; // 可用 + } + } + + // 2. 新的安位设置为已使用 + if (dto.PositionId != null) + { + var newPosition = _db.AncestralTabletPosition + .FirstOrDefault(p => p.PositionId == dto.PositionId); + + if (newPosition != null) + { + newPosition.StatusCode = "used"; // 已使用 + } + } + + // 更新登记人安位 + entity.PositionId = dto.PositionId; + } + + // 更新其它字段 + entity.Name = dto.Name; + entity.Phone = dto.Phone; + entity.Address = dto.Address; + entity.RegisterDate = dto.RegisterDate; + entity.Price = dto.Price; + entity.StartDate = dto.startDate; + entity.EndDate = dto.endDate; + entity.IsLongTerm = dto.isLongTerm; + entity.IsActive = dto.isActive; + entity.UpdatedAt = DateTime.Now; + + _db.SaveChanges(); + + return Ok(new { message = "登记人更新成功", registrantCode = entity.RegistrantCode }); + } + catch (Exception ex) + { + return InternalServerError(ex); + } + } + + [HttpPost] + [Route("api/ancestraltablet/pw/create")] + public IHttpActionResult CreatePW([FromBody] AncestralTabletPositionRecordDto dto) + { + if (dto == null) + return BadRequest("请求体不能为空"); + + if (string.IsNullOrEmpty(dto.RegistrantCode)) + return BadRequest("登记人编号(RegistrantCode)不能为空"); + + try + { + // 映射到数据库实体 + var entity = new Model.AncestralTabletPositionRecord + { + RegistrantCode = dto.RegistrantCode, + NPTitle = dto.NPTitle, + NPStandDate = dto.NPStandDate, + NPYangShang = dto.NPYangShang, + WPContent = dto.WPContent, + CreatedAt = DateTime.Now, + UpdatedAt = null + }; + + _db.AncestralTabletPositionRecord.Add(entity); + _db.SaveChanges(); + + return Ok(new { message = "牌位登记成功", recordId = entity.RecordId }); + } + catch (Exception ex) + { + return InternalServerError(ex); + } + } + [HttpPost] + [Route("api/ancestraltablet/pw/update")] + public IHttpActionResult UpdatePW([FromBody] AncestralTabletPositionRecordDto dto) + { + if (dto == null) + return BadRequest("请求体不能为空"); + try + { + var entity = _db.AncestralTabletPositionRecord.Find(dto.RecordId); + // 映射到数据库实体 + if (entity == null) + return BadRequest("牌位不存在,更新失败"); + entity.RegistrantCode = dto.RegistrantCode; + entity.NPTitle = dto.NPTitle; + entity.NPStandDate = dto.NPStandDate; + entity.NPYangShang = dto.NPYangShang; + entity.WPContent = dto.WPContent; + entity.UpdatedAt = DateTime.Now; + _db.SaveChanges(); + + return Ok(new { message = "牌位更新成功", recordId = entity.RecordId }); + } + catch (Exception ex) + { + return InternalServerError(ex); + } + } + + public string GenerateRegistrantCode(string prefix = "REG", int randomLength = 6) + { + string datePart = DateTime.Now.ToString("yyyyMMdd"); + + string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + var random = new Random(); + var suffix = new string(Enumerable.Repeat(chars, randomLength) + .Select(s => s[random.Next(s.Length)]).ToArray()); + + return $"{prefix}{datePart}{suffix}"; + } + public class AncestralTabletRegistrantDto + { + public string RegistrantCode { get; set; } + public string Name { get; set; } + public string Phone { get; set; } + public string Address { get; set; } + public DateTime RegisterDate { get; set; } + public int? Price { get; set; } + public int? PositionId { get; set; } + public DateTime startDate { get; set; } + public DateTime? endDate { get; set; } + public bool isLongTerm { get; set; } = false; + public bool isActive { get; set; } = true; + public DateTime CreatedAt { get; set; } + public DateTime? UpdatedAt { get; set; } + } + public class AncestralTabletPositionRecordDto + { + public int? RecordId { get; set; } + public string RegistrantCode { get; set; } + public string NPTitle { get; set; } + public DateTime NPStandDate { get; set; } + public string NPYangShang { get; set; } + public string WPContent { get; set; } + } + public class RegistrantSearchDto + { + public int page { get; set; } = 1; + public int pageSize { get; set; } = 10; + public string searchName { get; set; } + } + + +} \ No newline at end of file diff --git a/web/App_Code/api/AncestralTabletStatisticsController.cs b/web/App_Code/api/AncestralTabletStatisticsController.cs new file mode 100644 index 0000000..7d5f18f --- /dev/null +++ b/web/App_Code/api/AncestralTabletStatisticsController.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Http; + +/// +/// AncestralTabletStatisticsController 的摘要描述 +/// +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); + } + +} \ No newline at end of file diff --git a/web/App_Code/api/AncestralTabletStatusController.cs b/web/App_Code/api/AncestralTabletStatusController.cs new file mode 100644 index 0000000..8221830 --- /dev/null +++ b/web/App_Code/api/AncestralTabletStatusController.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Http; + +/// +/// AncestralTabletStatusController 的摘要描述 +/// +public class AncestralTabletStatusController:ApiController +{ + private Model.ezEntities _db = new Model.ezEntities(); + [HttpGet] + [Route("api/ancestraltablet/status/list")] + public IHttpActionResult GetStatusList() + { + var statusList = _db.AncestralTabletStatus + .Select(s => new + { + s.StatusCode, + s.StatusName, + s.StatusType + }) + .ToList(); + + return Ok(statusList); + } + +} \ No newline at end of file diff --git a/web/App_Code/api/guadanOrderController.cs b/web/App_Code/api/guadanOrderController.cs index 7cb068f..f35f755 100644 --- a/web/App_Code/api/guadanOrderController.cs +++ b/web/App_Code/api/guadanOrderController.cs @@ -7,8 +7,6 @@ using System.Linq; using System.Threading.Tasks; using System.Web; using System.Web.Http; -using static regionController; - /// /// guadanOderController 的摘要描述 /// diff --git a/web/admin/ancestraltablet/ancestraltabletarea/index.aspx b/web/admin/ancestraltablet/ancestraltabletarea/index.aspx new file mode 100644 index 0000000..e00e9a8 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletarea/index.aspx @@ -0,0 +1,908 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="admin_ancestraltablet_ancestraltabletarea_index" %> + + + + + + + + +
+
+
+
+
神主牌區域列表
+
+
    +
  • + +
  • +
+
+
+
+
+
+
+
+ + {{ ' ' + currentSelectArea?.areaName + ' ' }} + + + 資料 + +
+ +
+ +
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+ + +
+
+
+
+
+
+
+
+
+
+ {{currentSelectArea.areaName + ' - ' + '神主牌位置'}} +
+
+ 批次新增神主牌位置 +
+
+
+
+
+
{{ pos.positionName }}
+
+ + + 修改 + 刪除 +
+
+
+
+
+
+
+
+ +
+ + + + 新增區域 + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+ + +
+
+
+
+ + + + 取消 + 確定新增 + +
+
+
+ +
+ + + + 編輯區域 + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+ + +
+
+
+
+ + + + 取消 + 送出修改 + +
+
+
+ +
+ + + + + 批次新增神主牌位置 + + + mdi-close + + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+
+
+

預覽新增位置

+
    +
  • + {{ pos.PositionCode }} - {{ pos.PositionName }} (行: {{ pos.RowNo }}, 列: {{ pos.ColumnNo }}) +
  • +
+
+
+ + + 生成預覽 + 清除預覽 + 確認新增 + +
+
+
+ +
+ + + + 編輯位置:{{ currentEditPosition?.positionName || '未選擇' }} + + + +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + + + 保存 + 取消 + +
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletarea/index.aspx.cs b/web/admin/ancestraltablet/ancestraltabletarea/index.aspx.cs new file mode 100644 index 0000000..b2843c3 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletarea/index.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class admin_ancestraltablet_ancestraltabletarea_index : MyWeb.config +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletposition/index.aspx b/web/admin/ancestraltablet/ancestraltabletposition/index.aspx new file mode 100644 index 0000000..ce85de6 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletposition/index.aspx @@ -0,0 +1,569 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="admin_ancestraltablet_ancestraltabletposition_index" %> + + + + + + +
+
+
+
+
神主牌區域列表
+
+
    +
  • + +
  • +
+
+
+
+
+
+
+
+ {{currentSelectArea.areaName + ' - ' + '神主牌位置'}} +
+
+
+
+
+
{{ pos.positionName }}
+
+ 維護中 + 登記 + +
+
登記人:{{ pos.ancestralTabletRegistrant?.name }}
+
登記日期:{{ pos.ancestralTabletRegistrant?.registerDate|timeString('YYYY/MM/DD') }}
+ + 詳細資訊 + + + +
+ + +
+
已使用
+
使用人:{{ pos.usedBy }}
+
使用日期:{{ pos.usedDate|timeString('YYYY/MM/DD') }}
+
+
+
+
+
+
+
+
+
+ +
+ + + 登記資料({{'位置: ' + selectedPos?.positionName}}) + + +
+
登記人資料
+
+
+
+
+
+
+
+
+
+
+ + +
+ + +
+
牌位資料
+
+
+
+ +
+
+ + +
+
+ + + + +
+
+
+ +
+ + + + + + \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletposition/index.aspx.cs b/web/admin/ancestraltablet/ancestraltabletposition/index.aspx.cs new file mode 100644 index 0000000..73dc75b --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletposition/index.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class admin_ancestraltablet_ancestraltabletposition_index : MyWeb.config +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletstatistics/index.aspx b/web/admin/ancestraltablet/ancestraltabletstatistics/index.aspx new file mode 100644 index 0000000..e3e92fa --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletstatistics/index.aspx @@ -0,0 +1,126 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="admin_ancestraltablet_ancestraltabletstatistics_index" %> + + + + + + +
+

區域牌位統計

+ + + + + + + + + + + + + + + + + +
區域編號區域名稱總位置數可用位置數
{{ area.areaId }}{{ area.areaName }}{{ area.totalPositions }}{{ area.availableCount }}
+
+ +
+ + + + + + \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletstatistics/index.aspx.cs b/web/admin/ancestraltablet/ancestraltabletstatistics/index.aspx.cs new file mode 100644 index 0000000..67c5212 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletstatistics/index.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class admin_ancestraltablet_ancestraltabletstatistics_index : MyWeb.config +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/create.aspx b/web/admin/ancestraltablet/ancestraltabletuselist/create.aspx new file mode 100644 index 0000000..02894f1 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/create.aspx @@ -0,0 +1,15 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="create.aspx.cs" Inherits="admin_ancestraltablet_ancestraltabletuselist_create" %> + + + + + + +
+ 這是新增頁面 +
+
+ + + + \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/create.aspx.cs b/web/admin/ancestraltablet/ancestraltabletuselist/create.aspx.cs new file mode 100644 index 0000000..8ff8b66 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/create.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class admin_ancestraltablet_ancestraltabletuselist_create : MyWeb.config +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/detail.aspx b/web/admin/ancestraltablet/ancestraltabletuselist/detail.aspx new file mode 100644 index 0000000..f2d2927 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/detail.aspx @@ -0,0 +1,99 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="detail.aspx.cs" Inherits="admin_ancestraltablet_ancestraltabletuselist_detail" %> + + + + + + + +
+ {{registrantCode}} +
+
+
+

登記人資訊

+

登記編碼: {{ registrant.registrantCode }}

+

姓名: {{ registrant.name }}

+

電話: {{ registrant.phone }}

+

地址: {{ registrant.address }}

+

登記日期: {{ formatDate(registrant.registerDate) }}

+
+
+ + {{ registrant?.positionName || '未選擇' }} +
+
+

價格: {{ registrant.price }}

+

開始日期: {{ formatDate(registrant.startDate) }}

+

結束日期: {{ formatDate(registrant.endDate) }}

+

是否長期: {{ registrant.isLongTerm ? '是' : '否' }}

+

是否啟用: {{ registrant.isActive ? '是' : '否' }}

+
+ +
+

牌位資料

+

記錄ID: {{ registrant.tabletRecord.recordId }}

+

登記編碼: {{ registrant.tabletRecord.registrantCode }}

+ +

牌位標題: {{ registrant.tabletRecord.npTitle }}

+

立牌日期: {{ formatDate(registrant.tabletRecord.npStandDate) }}

+

陽上: {{ registrant.tabletRecord.npYangShang }}

+

內牌內容: {{ registrant.tabletRecord.wpContent }}

+
+ +
+

牌位資料

+

暫無牌位資料

+
+
+
+ + + + + + \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/detail.aspx.cs b/web/admin/ancestraltablet/ancestraltabletuselist/detail.aspx.cs new file mode 100644 index 0000000..b151511 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/detail.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class admin_ancestraltablet_ancestraltabletuselist_detail : MyWeb.config +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/edit.aspx b/web/admin/ancestraltablet/ancestraltabletuselist/edit.aspx new file mode 100644 index 0000000..ee471af --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/edit.aspx @@ -0,0 +1,419 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="edit.aspx.cs" Inherits="admin_ancestraltablet_ancestraltabletuselist_edit" %> + + + + + + + +
+ +
+

編輯登記人資訊

+ + + + + + + + + + + + + + +
+
+ + {{ registrant?.positionName || '未選擇' }} +
+
+ + {{ this.newPositionEntity?.positionName }} +
+ +
+ + + + + + + + + +
+ + + +
+ +
+ + + +
+ + +
+ + +
+

編輯牌位資料

+ + + + + + + + + + + + + + + + + + + + +
+ +
+

牌位資料

+

暫無牌位資料

+ + +
+ + + + + + + + + + + + + +
+
+ +
+ + + + 選擇位置: + + + + + +
+
+
{{ pos.positionName }}
+
+ + 已被使用 +
+
+
+
+ + +
新位置:{{newPositionEntity?.positionName}}
+ 確定 + 取消 +
+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/edit.aspx.cs b/web/admin/ancestraltablet/ancestraltabletuselist/edit.aspx.cs new file mode 100644 index 0000000..abcb96e --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/edit.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class admin_ancestraltablet_ancestraltabletuselist_edit : MyWeb.config +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/index.aspx b/web/admin/ancestraltablet/ancestraltabletuselist/index.aspx new file mode 100644 index 0000000..13051c4 --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/index.aspx @@ -0,0 +1,192 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="admin_ancestraltablet_ancestraltabletuselist_index" %> + + + + + + + + 神主牌使用記錄 +
+ + + + + + + + + + + + + + + + + 共 {{ total }} 筆, 頁數: + + + + + + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/web/admin/ancestraltablet/ancestraltabletuselist/index.aspx.cs b/web/admin/ancestraltablet/ancestraltabletuselist/index.aspx.cs new file mode 100644 index 0000000..a92db8c --- /dev/null +++ b/web/admin/ancestraltablet/ancestraltabletuselist/index.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class admin_ancestraltablet_ancestraltabletuselist_index : MyWeb.config +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/web/admin/guadan/create.aspx b/web/admin/guadan/create.aspx index d4ee875..e0b8a1b 100644 --- a/web/admin/guadan/create.aspx +++ b/web/admin/guadan/create.aspx @@ -1084,7 +1084,7 @@ newCheckoutDate: this.guadanguest.xuzhu.newCheckoutDate }; - axios.post('/api/guadanorderguest/xuzhu', payload) + axios.post(HTTP_HOST + 'api/guadanorderguest/xuzhu', payload) .then((res) => { this.$refs.messageModal.open({ title: '续住成功', @@ -1113,13 +1113,13 @@ }, //续住相關方法--------------------end getActivityList() { - axios.post('/api/activity/GetList?page=1&pageSize=500', { kind: 0, subject: "" }) + axios.post(HTTP_HOST + 'api/activity/GetList?page=1&pageSize=500', { kind: 0, subject: "" }) .then((res) => { this.activityList = res.data.list }) }, getavailablebedcountbytime(startTime, endTime) { - axios.get('/api/region/bed/getavailablebedcountbytime', { + axios.get(HTTP_HOST + 'api/region/bed/getavailablebedcountbytime', { params: { startTime: startTime, endTime: endTime @@ -1141,7 +1141,7 @@ }, confirmAllocation() { //確認分配 - axios.post('/api/region/bed/confirmallocation', { + axios.post(HTTP_HOST + 'api/region/bed/confirmallocation', { preBeds: this.automaticBedAllocation.preBeds, orderNo: this.guadanorder.order_form.orderNo, checkInAt: this.guadanorder.order_form.startdate, @@ -1169,7 +1169,7 @@ CheckInAt: this.guadanorder.order_form.startdate || new Date(), // 入住時間 CheckOutAt: this.guadanorder.order_form.enddate || null // 退房時間,可為空 }; - axios.post('/api/region/bed/preallocation', payload) + axios.post(HTTP_HOST + 'api/region/bed/preallocation', payload) .then(res => { this.automaticBedAllocation.preBeds = res.data.data; }) @@ -1217,7 +1217,7 @@ getMultiSelectFollowers: function () { var fm = this.automaticBedAllocation.followerModal; var self = this; - axios.post('/api/lianyou/getfollowers', null, { + axios.post(HTTP_HOST + 'api/lianyou/getfollowers', null, { params: { page: fm.page, pageSize: fm.pageSize, @@ -1288,7 +1288,7 @@ }, getGuadanOrderById() { if (this.guadanorder.order_form.uuid) { - axios.get('/api/guadan/getorderbyid', { + axios.get(HTTP_HOST + 'api/guadan/getorderbyid', { params: { orderId: this.guadanorder.order_form.uuid } @@ -1307,7 +1307,7 @@ }, getGuadanOrderGuestByOrderNo() { if (this.guadanorder.order_form.orderNo) { - axios.get('/api/guadanorderguest/getbyorderno', { + axios.get(HTTP_HOST + 'api/guadanorderguest/getbyorderno', { params: { orderNo: this.guadanorder.order_form.orderNo } @@ -1317,7 +1317,7 @@ } }, getGuadanOrderStatus() { - axios.get('/api/region/guadan/status/list') + axios.get(HTTP_HOST + 'api/region/guadan/status/list') .then((res) => { this.guadanorder.status_items = res.data; }) @@ -1326,7 +1326,7 @@ if (!this.validateOrderForm()) { return; } - axios.post('/api/guadan/create', this.guadanorder.order_form) + axios.post(HTTP_HOST + 'api/guadan/create', this.guadanorder.order_form) .then((res => { this.$refs.messageModal.open({ title: '掛單提示', @@ -1350,7 +1350,7 @@ if (!this.validateOrderForm()) { return; } - axios.post('/api/guadan/update', this.guadanorder.order_form) + axios.post(HTTP_HOST + 'api/guadan/update', this.guadanorder.order_form) .then((res => { this.$refs.messageModal.open({ title: '掛單提示', @@ -1495,13 +1495,13 @@ }, createCheckInGuest() { - return axios.post('/api/guadanorderguest/create', this.checkInGuest.inGuest) + return axios.post(HTTP_HOST + 'api/guadanorderguest/create', this.checkInGuest.inGuest) }, checkBedAndFollower() { this.checkInGuest.inGuest }, getGuadanGuestStatus() { - axios.get('/api/region/bed/status/list') + axios.get(HTTP_HOST + 'api/region/bed/status/list') .then((res) => { this.checkInGuest.status = res.data.filter(item => item.category === 4 && item.code != '404'); }) @@ -1524,7 +1524,7 @@ pageSize: itemsPerPage, searchName: this.selectGuestModal.searchNameOrPhone }; - axios.post('/api/lianyou/getfollowers', null, { + axios.post(HTTP_HOST + 'api/lianyou/getfollowers', null, { params: params }).then((res) => { this.selectGuestModal.items = res.data.data @@ -1559,7 +1559,7 @@ }, async saveEditGuadanOrderGuest() { try { - const res = await axios.post('/api/guadanorderguest/update', this.checkInGuest.inGuest) + const res = await axios.post(HTTP_HOST + 'api/guadanorderguest/update', this.checkInGuest.inGuest) this.getGuadanOrderGuestByOrderNo(); this.closeCheckInModal(); } catch (error) { @@ -1570,7 +1570,7 @@ }, deleteGuadanOrderGuest(guest) { - axios.post('/api/guadanorderguest/cancel?uuid=' + guest.uuid) + axios.post(HTTP_HOST + 'api/guadanorderguest/cancel?uuid=' + guest.uuid) .then((res) => { this.guadanguest.items = this.guadanguest.items.filter(i => i.uuid != guest.uuid); }).catch((error) => { @@ -1628,7 +1628,7 @@ //床位選擇相關方法----------------start async loadRegions() { - const res = await axios.post('/api/region/getRegionList'); + const res = await axios.post(HTTP_HOST + 'api/region/getRegionList'); this.region_modal.regions = res.data; }, async loadRegionsByGender() { @@ -1643,7 +1643,7 @@ } } - const res = await axios.post('/api/region/getRegionListByGender', { + const res = await axios.post(HTTP_HOST + 'api/region/getRegionListByGender', { IsMale: isMale }); @@ -1660,7 +1660,7 @@ this.region_modal.selectedType = 'room'; this.region_modal.currentSelectBeds = room.beds; if (this.checkInGuest.inGuest.checkInAt && this.checkInGuest.inGuest.checkOutAt) { - axios.get('/api/region/room/bed/list', { + axios.get(HTTP_HOST + 'api/region/room/bed/list', { params: { roomUuid: room.uuid, StartTime: this.checkInGuest.inGuest.checkInAt, @@ -1678,7 +1678,7 @@ }, GetRegionRoomBedListByRoomId(roomUuid) { if (this.checkInGuest.inGuest.checkInAt && this.checkInGuest.inGuest.checkOutAt) { - axios.get('/api/region/bed/list') + axios.get(HTTP_HOST + 'api/region/bed/list') .then((res) => { }) diff --git a/web/admin/guadan/guest/index.aspx b/web/admin/guadan/guest/index.aspx index 4f8ca6a..943be3b 100644 --- a/web/admin/guadan/guest/index.aspx +++ b/web/admin/guadan/guest/index.aspx @@ -198,7 +198,7 @@ button:hover { } if (this.loading) return; this.loading = true; - axios.post('/api/guadan/guest/query/list', + axios.post(HTTP_HOST + 'api/guadan/guest/query/list', { page: this.options.page, pageSize: this.options.itemsPerPage, diff --git a/web/admin/guadan/index.aspx b/web/admin/guadan/index.aspx index aa28e0d..7ce806d 100644 --- a/web/admin/guadan/index.aspx +++ b/web/admin/guadan/index.aspx @@ -72,40 +72,40 @@ - - - - - - - 共 {{ total }} 筆, 頁數: - - - - - - - - - - + + + + + + + 共 {{ total }} 筆, 頁數: + + + + + + + + + + @@ -198,7 +198,7 @@ }, getGuadanOrder() { if (this.loading) return; - axios.post('/api/guadan/list', { + axios.post(HTTP_HOST + 'api/guadan/list', { startDate: this.search.startDate, endDate: this.search.endDate, guadanUser: this.search.guadanUser, @@ -219,7 +219,7 @@ this.$refs.confirmModal.open({ message: '確認取消掛單?', onConfirm: () => { - axios.post('/api/guadan/cancel', null, { + axios.post(HTTP_HOST + 'api/guadan/cancel', null, { params: { uuid: order.uuid } diff --git a/web/admin/guadan/statistics_table.aspx b/web/admin/guadan/statistics_table.aspx index 699a4d5..f675441 100644 --- a/web/admin/guadan/statistics_table.aspx +++ b/web/admin/guadan/statistics_table.aspx @@ -326,7 +326,7 @@ saveAs(new Blob([wbout], { type: "application/octet-stream" }), "statistics.xlsx"); }, GetGuadanStatistics() { - axios.get('/api/guadanStatistics/GetGuadanStatistics') + axios.get(HTTP_HOST + 'api/guadanStatistics/GetGuadanStatistics') .then((res) => { this.guadanStatistics = res.data.guadanStatistics; }) diff --git a/web/admin/guadan/view.aspx b/web/admin/guadan/view.aspx index 3209306..4c83f22 100644 --- a/web/admin/guadan/view.aspx +++ b/web/admin/guadan/view.aspx @@ -429,7 +429,7 @@ }, methods: { getActivityList() { - axios.post('/api/activity/GetList?page=1&pageSize=500', { kind: 0, subject: "" }) + axios.post(HTTP_HOST + 'api/activity/GetList?page=1&pageSize=500', { kind: 0, subject: "" }) .then((res) => { this.activityList = res.data.list }) @@ -467,7 +467,7 @@ }, getGuadanOrderById() { if (this.guadanorder.order_form.uuid) { - axios.get('/api/guadan/getorderbyid', { + axios.get(HTTP_HOST + 'api/guadan/getorderbyid', { params: { orderId: this.guadanorder.order_form.uuid } @@ -486,7 +486,7 @@ }, getGuadanOrderGuestByOrderNo() { if (this.guadanorder.order_form.orderNo) { - axios.get('/api/guadanorderguest/getbyorderno', { + axios.get(HTTP_HOST + 'api/guadanorderguest/getbyorderno', { params: { orderNo: this.guadanorder.order_form.orderNo } diff --git a/web/admin/region/bed/bedstatus/index.aspx b/web/admin/region/bed/bedstatus/index.aspx index 754acdb..39797a0 100644 --- a/web/admin/region/bed/bedstatus/index.aspx +++ b/web/admin/region/bed/bedstatus/index.aspx @@ -58,7 +58,7 @@ }, methods: { getStatusList() { - axios.get('/api/region/bed/status/list') + axios.get(HTTP_HOST + 'api/region/bed/status/list') .then((res) => { this.items = res.data this.loading = false; @@ -73,7 +73,7 @@ }) }, deleteStatus(item) { - axios.post('/api/region/bed/status/delete', null, { + axios.post(HTTP_HOST + 'api/region/bed/status/delete', null, { params: { code: item.code } }) .then(() => { diff --git a/web/admin/region/bed/index.aspx b/web/admin/region/bed/index.aspx index d514e38..6b38472 100644 --- a/web/admin/region/bed/index.aspx +++ b/web/admin/region/bed/index.aspx @@ -316,7 +316,7 @@ unoccupied: this.filter.unoccupied, gender: this.filter.Gender, }; - axios.post('/api/region/list', payload) + axios.post(HTTP_HOST + 'api/region/list', payload) .then((res) => { this.regions = res.data.regions; this.summary = res.data.summary; // 保存後端統計 @@ -347,7 +347,7 @@ console.log(this.filter.Gender); }, getRegionWithRoom() { - axios.get('/api/region/regionwithroom') + axios.get(HTTP_HOST + 'api/region/regionwithroom') .then((res) => { this.filter.areas = res.data; }) diff --git a/web/admin/region/index.aspx b/web/admin/region/index.aspx index c3f1480..f33d2e9 100644 --- a/web/admin/region/index.aspx +++ b/web/admin/region/index.aspx @@ -578,7 +578,7 @@ this.expandAllFlag = false; }, async loadRegions() { - const res = await axios.post('/api/region/getRegionList'); + const res = await axios.post(HTTP_HOST + 'api/region/getRegionList'); this.regions = res.data; this.flatRegions = this.flatten(res.data); if (this.currentSelectRoom) { @@ -586,7 +586,7 @@ } }, loadRegionType() { - axios.post('/api/region/getRegionType') + axios.post(HTTP_HOST + 'api/region/getRegionType') .then(res => { this.regionTypes = res.data }); @@ -799,7 +799,7 @@ }); }, confirmDeleteBed(bed) { - axios.post('/api/region/bed/delete', null, { + axios.post(HTTP_HOST + 'api/region/bed/delete', null, { params: { uuid: bed.uuid } }) // 假設後端吃的是 id .then(() => { @@ -840,7 +840,7 @@ async saveEditBed() { try { - await axios.post('/api/region/bed/update', this.room_bed.newBedForm); + await axios.post(HTTP_HOST + 'api/region/bed/update', this.room_bed.newBedForm); this.room_bed.showBedModal = false; const updated = this.room_bed.newBedForm; @@ -882,7 +882,7 @@ }, getBedStatus() { //獲取床位狀態 - axios.get('/api/region/bed/status/list') + axios.get(HTTP_HOST + 'api/region/bed/status/list') .then((res) => { this.room_bed.bed_status = res.data; }) @@ -907,7 +907,7 @@ }); return; } - axios.post('/api/region/room/create', this.room.room_form) + axios.post(HTTP_HOST + 'api/region/room/create', this.room.room_form) .then((res) => { this.room.showCreateRoomDialog = false; this.currentSelectRegion.rooms.push(res.data); @@ -924,7 +924,7 @@ }, async roomUpdate() { try { - const res = await axios.post('/api/region/room/update', this.room.room_form); + const res = await axios.post(HTTP_HOST + 'api/region/room/update', this.room.room_form); this.$refs.messageModal.open({ message: '客房資料更新成功' }); @@ -950,7 +950,7 @@ }, roomDelete() { - axios.post('/api/region/room/delete', { uuid: this.currentSelectRoom.uuid }) + axios.post(HTTP_HOST + 'api/region/room/delete', { uuid: this.currentSelectRoom.uuid }) .then((res) => { const region = this.findRegionById(this.regions, this.currentSelectRoom.regionUuid)//當前room所在的region if (region) { diff --git a/web/admin/regiontype/index.aspx b/web/admin/regiontype/index.aspx index 84e0f04..cf90a97 100644 --- a/web/admin/regiontype/index.aspx +++ b/web/admin/regiontype/index.aspx @@ -61,7 +61,7 @@ }, methods: { getRegionTypeList() { - axios.post('/api/regiontype/getreiontypelist') + axios.post(HTTP_HOST + 'api/regiontype/getreiontypelist') .then((res) => { this.items = res.data; }) @@ -71,7 +71,7 @@ 'title': '刪除提示', 'message': `確定要刪除 ${item.name} ?`, onConfirm: () => { - axios.post('/api/regiontype/delete',null, { + axios.post(HTTP_HOST + 'api/regiontype/delete',null, { params: { uuid: item.uuid } }) .then(() => {