diff --git a/AMESCoreStudio.Web/Controllers/SYSController.cs b/AMESCoreStudio.Web/Controllers/SYSController.cs index 9e5c1c09..e5f425da 100644 --- a/AMESCoreStudio.Web/Controllers/SYSController.cs +++ b/AMESCoreStudio.Web/Controllers/SYSController.cs @@ -36,7 +36,8 @@ namespace AMESCoreStudio.Web.Controllers var SystemItems = new List(); for (int i = 0; i < result.Count; i++) { - SystemItems.Add(new SelectListItem(result[i].SystemNo + result[i].SystemName, result[i].SystemID.ToString())); + //SystemItems.Add(new SelectListItem(result[i].SystemNo + result[i].SystemName, result[i].SystemID.ToString())); + SystemItems.Add(new SelectListItem(result[i].SystemName, result[i].SystemID.ToString())); } ViewBag.SystemList = SystemItems; } @@ -175,13 +176,14 @@ namespace AMESCoreStudio.Web.Controllers [ResponseCache(Duration = 0)] [HttpGet] - public async Task GetSystemInfoesAsync() + public async Task GetSystemInfoesAsync(int page = 1, int limit = 10) { - var result = await _sysApi.GetSystemInfoes(); + var result = await _sysApi.GetSystemInfoes(page,limit); + var result_total = await _sysApi.GetSystemInfoes(0, limit); if (result.Count > 0) { - return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + return Json(new Table() { code = 0, msg = "", data = result, count = result_total.Count }); } return Json(new Table() { count = 0, data = null }); @@ -191,8 +193,9 @@ namespace AMESCoreStudio.Web.Controllers #region SYS002模组资料维护相关 - public IActionResult SYS002() + public async Task SYS002() { + await GetSystemList(); return View(); } @@ -278,6 +281,22 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetModuleInfoesBySystemAsync(int systemID, int page = 1, int limit = 10) + { + var result = await _sysApi.GetModuleInfoesBySystem(systemID, page, limit); + var result_total = await _sysApi.GetModuleInfoesBySystem(systemID, 0, limit); + + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result_total.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + #endregion #region SYS003功能资料维护相关 diff --git a/AMESCoreStudio.Web/HttpApis/ISYS.cs b/AMESCoreStudio.Web/HttpApis/ISYS.cs index db2f21cf..d660ba49 100644 --- a/AMESCoreStudio.Web/HttpApis/ISYS.cs +++ b/AMESCoreStudio.Web/HttpApis/ISYS.cs @@ -46,7 +46,7 @@ namespace AMESCoreStudio.Web /// /// [WebApiClient.Attributes.HttpGet("api/SystemInfoes")] - ITask> GetSystemInfoes(); + ITask> GetSystemInfoes(int page = 1, int limit = 10); #endregion @@ -87,6 +87,13 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/ModuleInfoes")] ITask> GetModuleInfoes(); + /// + /// 根据系統獲取模組資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/ModuleInfoes/System/{id}")] + ITask> GetModuleInfoesBySystem(int id, int page = 1, int limit = 10); + #endregion #region SYS003功能資料維護相關 diff --git a/AMESCoreStudio.Web/Views/SYS/SYS002.cshtml b/AMESCoreStudio.Web/Views/SYS/SYS002.cshtml index 67af7b5c..f1f1640a 100644 --- a/AMESCoreStudio.Web/Views/SYS/SYS002.cshtml +++ b/AMESCoreStudio.Web/Views/SYS/SYS002.cshtml @@ -9,6 +9,22 @@
@ViewBag.Title
+
+
+ +
+ +
+ +
+
+ +
+
@@ -18,6 +34,18 @@ @section Scripts{ } \ No newline at end of file diff --git a/AMESCoreStudio.WebApi/Controllers/SYS/ModuleInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/SYS/ModuleInfoesController.cs index b0cc8d92..6ccc6b51 100644 --- a/AMESCoreStudio.WebApi/Controllers/SYS/ModuleInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/SYS/ModuleInfoesController.cs @@ -43,6 +43,55 @@ namespace AMESCoreStudio.WebApi.Controllers.SYS //return await _context.ModuleInfoes.ToListAsync(); } + /// + /// 根據流程ID獲取該流程站別資料 + /// + /// + /// + /// + /// + // GET: api/ModuleInfoes/System/5 + [HttpGet("System/{id}")] + public async Task>> GetModuleInfoBySystem(int id, int page = 1, int limit = 10) + { + IQueryable q = _context.ModuleInfoes; + + if (id > 0) + { + q = q.Where(p => p.SystemID.Equals(id)); + } + if (page > 0) + { + q = q.OrderBy(p => p.SortSeq).Skip((page - 1) * limit).Take(limit); + } + else + { + q = q.OrderBy(p => p.SortSeq); + } + + try + { + var moduleInfo = await q.ToListAsync(); + + + + if (moduleInfo == null) + { + return NotFound(); + } + + return moduleInfo; + } + catch (Exception e1) + { + string msg = e1.Message; + } + + return NotFound(); + + + } + /// /// /// diff --git a/AMESCoreStudio.WebApi/Controllers/SYS/SystemInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/SYS/SystemInfoesController.cs index bb8149c3..0d44872c 100644 --- a/AMESCoreStudio.WebApi/Controllers/SYS/SystemInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/SYS/SystemInfoesController.cs @@ -29,14 +29,23 @@ namespace AMESCoreStudio.WebApi.Controllers.SYS /// /// 獲取系統資料 /// + /// + /// /// // GET: api/SystemInfoes [HttpGet] - public async Task>> GetSystemInfo() + public async Task>> GetSystemInfo(int page = 1, int limit = 10) { IQueryable q = _context.SystemInfoes; - q = q.OrderBy(p => p.SystemID); + if (page > 0) + { + q = q.OrderBy(p => p.SystemID).Skip((page - 1) * limit).Take(limit); ; + } + else + { + q = q.OrderBy(p => p.SystemID); + } //q = q.OrderByDescending(p => p.SystemID);