diff --git a/AMESCoreStudio.Web/Controllers/RPTController.cs b/AMESCoreStudio.Web/Controllers/RPTController.cs index fe9dc6e0..9444a927 100644 --- a/AMESCoreStudio.Web/Controllers/RPTController.cs +++ b/AMESCoreStudio.Web/Controllers/RPTController.cs @@ -76,5 +76,24 @@ namespace AMESCoreStudio.Web.Controllers return View(model); } + + public async Task RPT002() + { + var sdate = ""; + var edate = ""; + var model = await _rptApi.GetRPT002View(sdate, edate); + return View(model); + } + + [HttpPost] + public async Task RPT002(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.GetRPT002View(sDate, eDate); + model.SerachData = SerachData; + return View(model); + } } } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IRPT.cs b/AMESCoreStudio.Web/HttpApis/AMES/IRPT.cs index 571a78cc..aacaa4ff 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IRPT.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IRPT.cs @@ -19,5 +19,12 @@ namespace AMESCoreStudio.Web /// [WebApiClient.Attributes.HttpGet("api/RPT/GetRPT001View")] ITask GetRPT001View(string sDate, string eDate); + + /// + /// 品質看板 + /// + /// + [WebApiClient.Attributes.HttpGet("api/RPT/GetRPT002View")] + ITask GetRPT002View(string sDate, string eDate); } } diff --git a/AMESCoreStudio.Web/Views/RPT/RPT002.cshtml b/AMESCoreStudio.Web/Views/RPT/RPT002.cshtml new file mode 100644 index 00000000..0469af5a --- /dev/null +++ b/AMESCoreStudio.Web/Views/RPT/RPT002.cshtml @@ -0,0 +1,236 @@ +@model AMESCoreStudio.WebApi.DTO.AMES.RPT001ViewDto + +@{ + ViewData["Title"] = "品質看板"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + + + +
+
+
+
+
+
@ViewBag.Title
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+
+
生產即時看板
+
系統顯示時間:@DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
+
+
+
+
+
+
+
+ 生產指標 + +
+
+ + +
+
生產效率
+
+ @Model.productivity +

%

+
+
+
+
+
+
+
+
+ 生產品質 + +
+
+ + +
+
FQC合格率
+
+ @Model.fqc +

%

+
+
+
+
+
+
+
+
+
+
+ 生產資源 + +
+
+ + +
+
無效工時
+
+ @Model.invalidHours +

H

+
+
+
+
+
+
+
+
+ 線上資訊 + +
+
+ + +
+
異常工時
+
+ @Model.abnormalTime +

H

+
+
+
+
+
+
+ +
+@section Scripts { + +} \ No newline at end of file diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index db874730..5402744e 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -115,7 +115,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var q = from q1 in _context.FqcInhouseMasters join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID } into j0 from q2 in j0.DefaultIfEmpty() - join q3 in _context.FqcResultMasters on q1.InhouseNo equals q3.InhouseNo into j1 + join q3 in _context.FqcResultMasters on new { q1.InhouseNo, q1.SeqID } equals new { q3.InhouseNo, q3.SeqID } into j1 from q3 in j1.DefaultIfEmpty() join q4 in _context.WipInfos on q1.WipNo equals q4.WipNO into s from q4 in s.DefaultIfEmpty() diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs index 346ca946..b4e106dd 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs @@ -108,7 +108,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL foreach (var data in d.Data) { string str = data.ToString(); - string[] str2 = str.Replace("{","").Replace("}","").Split(','); + string[] str2 = str.Replace("{", "").Replace("}", "").Split(','); string str3 = ""; for (int i = 0; i < str2.Length; i++) { @@ -384,7 +384,107 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL result.productiveForces = double.Parse(productivity.ToString("0.00")); result.overtime = sumPI_OverTime; - result.invalidHours = sumPI_InvalidTIme; + result.invalidHours = sumPI_InvalidTIme; + + return result; + } + + /// + /// 品質看板 + /// + /// 開始日期 + /// 結束日期 + /// + [HttpGet("GetRPT002View")] + public async Task GetRPT002View(string sDate, string eDate) + { + if (string.IsNullOrWhiteSpace(sDate) || string.IsNullOrWhiteSpace(eDate)) + { + sDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("yyyy/MM/dd"); + eDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)).ToString("yyyy/MM/dd"); + } + + var result = new RPT002ViewDto(); + // 進料批退率 電子 + result.IQLRR_EE = 0.0; + + // 進料批退率 機構 + result.IQLRR_ME = 0.0; + + // 線上材料品質 + result.LQC = 0.0; + + // QRC件數 新增筆數 + result.QRCNew = 0; + + // QRC件數 結案筆數 + result.QRCClose = 0; + + // QRC件數 總筆數 + result.QRCTotal = 0; + + //IPQC異常件數 新增筆數 + result.IPQCNew = 0; + + // IPQC異常件數 結案筆數 + result.IPQCClose = 0; + + // IPQC異常件數 總筆數 + result.IPQCTotal = 0; + + // FQC批退率 Board + result.FQCRRBoard = 0.0; + + // FQC批退率 System + result.FQCRRSystem = 0.0; + + // FQC批退率 Medical + result.FQCRRMedical = 0.0; + + // DOA Board + result.DOABoard = 0.0; + + // DOA System + result.DOASystem = 0.0; + + // DOA Medical + result.DOAMedical = 0.0; + + // FPY 立德 Board + result.FPYBoard_LEI = 0.0; + + // FPY 立德 System + result.FPYSystem_LEI = 0.0; + + // FPY 立德 Medical + result.FPYMedical_LEI = 0.0; + + // FPY Board + result.FPYBoard = 0.0; + + // FPY System + result.FPYSystem = 0.0; + + // FPY Medical + result.FPYMedical = 0.0; + + // RMA Board + result.RMABoard = 0.0; + + // RMA System + result.RMASystem = 0.0; + + // RMA Medical + result.RMAMedical = 0.0; + + // CFQR件數 新增筆數 + result.CFQRNew = 0; + + // CFQR件數 結案筆數 + result.CFQRClose = 0; + + // CFQR件數 總筆數 + result.CFQRTotal = 0; return result; } diff --git a/AMESCoreStudio.WebApi/DTO/AMES/RPT002VIiewDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/RPT002VIiewDto.cs new file mode 100644 index 00000000..5e9288b8 --- /dev/null +++ b/AMESCoreStudio.WebApi/DTO/AMES/RPT002VIiewDto.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +#nullable disable + +namespace AMESCoreStudio.WebApi.DTO.AMES +{ + public partial class RPT002ViewDto + { + public RPT002ViewDto() + { + + } + + /// + /// 查詢月份 + /// + public string SerachData { get; set; } + + /// + /// 進料批退率 電子 + /// + public double IQLRR_EE { get; set; } = 0.0; + + /// + /// 進料批退率 機構 + /// + public double IQLRR_ME { get; set; } = 0.0; + + /// + /// 線上材料品質 + /// + public double LQC { get; set; } = 0.0; + + /// + /// QRC件數 新增筆數 + /// + public int QRCNew { get; set; } = 0; + + /// + /// QRC件數 結案筆數 + /// + public int QRCClose { get; set; } = 0; + + /// + /// QRC件數 總筆數 + /// + public int QRCTotal { get; set; } = 0; + + /// + /// IPQC異常件數 新增筆數 + /// + public int IPQCNew { get; set; } = 0; + + /// + /// IPQC異常件數 結案筆數 + /// + public int IPQCClose { get; set; } = 0; + + /// + /// IPQC異常件數 總筆數 + /// + public int IPQCTotal { get; set; } = 0; + + /// + /// FQC批退率 Board + /// + public double FQCRRBoard { get; set; } = 0.0; + + /// + /// FQC批退率 System + /// + public double FQCRRSystem { get; set; } = 0.0; + + /// + /// FQC批退率 Medical + /// + public double FQCRRMedical { get; set; } = 0.0; + + /// + /// DOA Board + /// + public double DOABoard { get; set; } = 0.0; + + /// + /// DOA System + /// + public double DOASystem { get; set; } = 0.0; + + /// + /// DOA Medical + /// + public double DOAMedical { get; set; } = 0.0; + + /// + /// FPY 立德 Board + /// + public double FPYBoard_LEI { get; set; } = 0.0; + + /// + /// FPY 立德 System + /// + public double FPYSystem_LEI { get; set; } = 0.0; + + /// + /// FPY 立德 Medical + /// + public double FPYMedical_LEI { get; set; } = 0.0; + + /// + /// FPY Board + /// + public double FPYBoard { get; set; } = 0.0; + + /// + /// FPY System + /// + public double FPYSystem { get; set; } = 0.0; + + /// + /// FPY Medical + /// + public double FPYMedical { get; set; } = 0.0; + + /// + /// RMA Board + /// + public double RMABoard { get; set; } = 0.0; + + /// + /// RMA System + /// + public double RMASystem { get; set; } = 0.0; + + /// + /// RMA Medical + /// + public double RMAMedical { get; set; } = 0.0; + + /// + /// CFQR件數 新增筆數 + /// + public int CFQRNew { get; set; } = 0; + + /// + /// CFQR件數 結案筆數 + /// + public int CFQRClose { get; set; } = 0; + + /// + /// CFQR件數 總筆數 + /// + public int CFQRTotal { get; set; } = 0; + + } +}