diff --git a/AMESCoreStudio.Web/Controllers/RPTController.cs b/AMESCoreStudio.Web/Controllers/RPTController.cs index 54a24528..22be3309 100644 --- a/AMESCoreStudio.Web/Controllers/RPTController.cs +++ b/AMESCoreStudio.Web/Controllers/RPTController.cs @@ -3,9 +3,17 @@ using AspNetCore.Reporting; using Microsoft.AspNetCore.Hosting; using System.Collections.Generic; using System.Threading.Tasks; +using System; using System.Data; using Oracle.EntityFrameworkCore; using Oracle.ManagedDataAccess.Client; +using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.CommonTools.Result; +using AMESCoreStudio.Web.Models; +using AMESCoreStudio.WebApi.DTO.AMES; +using DocumentFormat.OpenXml.Math; +using AMESCoreStudio.Web.ViewModels.PCS; +using Microsoft.AspNetCore.Http; // For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 @@ -13,19 +21,29 @@ namespace AMESCoreStudio.Web.Controllers { public class RPTController : Controller { - private readonly IWebHostEnvironment environment = null; - public readonly IPCS _pcsApi; + private readonly IWebHostEnvironment environment = null; + public readonly IRPT _rptApi; - public RPTController(IWebHostEnvironment environment,IPCS pcsApi) + public RPTController(IWebHostEnvironment environment, IRPT rptApi) { this.environment = environment; System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); - _pcsApi = pcsApi; - + _rptApi = rptApi; } public async Task RPT001() { + var sdate = ""; + var edate = ""; + + var model = await _rptApi.GetRPT001View(sdate, edate); + // 異常工時 + //var a = await _whsApi.GetExceptionWorktimeByQueryWHS009("", "", "", "", sdate: sdate, edate: edate); + // 未結工單數 + //var b = await _pcsApi.GetWipInfoPCS008(date_str: sdate, date_end: edate); + // 完工入庫數 + //var c = await _pcsApi.GetFqcInhouseMasterMultiQuery(date_str: sdate, date_end: edate); + //string mimeType = ""; //int extension = 1; //var path = $"{this.environment.WebRootPath}\\Reports\\TEST02.rdlc"; @@ -39,8 +57,18 @@ namespace AMESCoreStudio.Web.Controllers //var result = localReport.Execute(RenderType.Pdf, extension, param, mimeType); //return File(result.MainStream, "application/pdf"); + //var model = new WebApi.DTO.AMES.RPT001VIiewDto(); + return View(model); + } - return View(); + [HttpPost] + public async Task RPT001(string SerachData) + { + var Data = DateTime.Parse(SerachData); + var sDate = new DateTime(Data.Year, Data.Month, 1).ToString("yyyy/MM/dd"); + var eDate = new DateTime(Data.Year, Data.Month, DateTime.DaysInMonth(Data.Year, Data.Month)).ToString("yyyy/MM/dd"); + var model = await _rptApi.GetRPT001View(sDate, eDate); + return View(model); } } } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IRPT.cs b/AMESCoreStudio.Web/HttpApis/AMES/IRPT.cs new file mode 100644 index 00000000..571a78cc --- /dev/null +++ b/AMESCoreStudio.Web/HttpApis/AMES/IRPT.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using WebApiClient; +using WebApiClient.Attributes; +using AMESCoreStudio.WebApi; +using Microsoft.AspNetCore.Mvc; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.CommonTools.Result; +using AMESCoreStudio.WebApi.DTO.AMES; + +namespace AMESCoreStudio.Web +{ + [JsonReturn] + public interface IRPT: IHttpApi + { + /// + /// 生產即時效率 + /// + /// + [WebApiClient.Attributes.HttpGet("api/RPT/GetRPT001View")] + ITask GetRPT001View(string sDate, string eDate); + } +} diff --git a/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml b/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml index 61b08dee..fd7cdb3a 100644 --- a/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml +++ b/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml @@ -1,4 +1,6 @@ -@{ +@model AMESCoreStudio.WebApi.DTO.AMES.RPT001ViewDto + +@{ ViewData["Title"] = "生產即時看板"; Layout = "~/Views/Shared/_AMESLayout.cshtml"; } @@ -63,14 +65,28 @@
-
-
-
-
@ViewBag.Title
+
+
+
+
+
@ViewBag.Title
+
+
+
+ +
+ +
+
+
+ +
+
-
- +
@@ -90,7 +106,7 @@ @@ -98,7 +114,7 @@
生產效率
- 93.88 + @Model.productivity

%

@@ -115,21 +131,21 @@