diff --git a/AMESCoreStudio.Web/Controllers/WHSController.cs b/AMESCoreStudio.Web/Controllers/WHSController.cs index 658015d4..4e4e13c8 100644 --- a/AMESCoreStudio.Web/Controllers/WHSController.cs +++ b/AMESCoreStudio.Web/Controllers/WHSController.cs @@ -229,6 +229,17 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.ExceptionCodes = GetExceptionCodes; } + private async Task GetStationList2() + { + var result = await _basApi.GetStationses(); + + var StationItems = new List(); + for (int i = 0; i < result.Count; i++) + { + StationItems.Add(new SelectListItem(result[i].StationName, result[i].StationID.ToString())); + } + ViewBag.StationList = StationItems; + } #endregion @@ -1760,5 +1771,311 @@ namespace AMESCoreStudio.Web.Controllers return View(); } + + + #region WHS018生產工時維護相關 + + public async Task WHS018() + { + var tt = Request.Cookies["UserID"]; + //製程單位 + await GetFactoryUnitsList3(); + //線別 + await GetLineList2(); + //站別 + await GetStationList2(); + + return View(); + } + //新增頁面 + public async Task WHS018C() + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + //製程單位 + await GetFactoryUnitsList2(); + //廠別 + await GetFactoryList(); + //線別 + await GetLineList2(); + //站別 + await GetStationList(); + + + return View(); + } + //修改页面 + [HttpGet] + public async Task WHS018UAsync(string id) + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + //製程單位 + await GetFactoryUnitsList2(); + //廠別 + await GetFactoryList(); + //線別 + await GetLineList2(); + //站別 + await GetStationList(); + + var result = await _whsApi.GetWorkingHoursCollection(id); + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + //完工页面 + [HttpGet] + public async Task WHS018FAsync(string id) + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + //製程單位 + await GetFactoryUnitsList2(); + //廠別 + await GetFactoryList(); + //線別 + await GetLineList2(); + //站別 + await GetStationList(); + //班別 + GetClassList(); + //判定單位部門 + await GetDeptList(); + + var result = await _whsApi.GetWorkingHoursCollection(id); + + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + public async Task WHS018DAsync(int id) + { + var result = await _whsApi.DeleteSupportUser(id); + return Json(new Result() { success = true, msg = "" }); + } + [HttpPost] + public async Task WHS018CSaveAsync(WorkingHoursCollection model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _whsApi.PostWorkingHoursCollection(JsonConvert.SerializeObject(model)); + + if (result.Success) + { + var _msg = "添加成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + if (result.Errors.Count > 0) + { + ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); + } + else + { + ModelState.AddModelError("error", result.Msg); + } + } + } + return View("WHS018C", model); + } + public async Task WHS018USaveAsync(WorkingHoursCollection model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _whsApi.PutWorkingHoursCollection(model.TimeSheetID, JsonConvert.SerializeObject(model)); + + if (result.Success) + { + var _msg = "修改成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + //製程單位 + await GetFactoryUnitsList2(); + //廠別 + await GetFactoryList(); + //線別 + await GetLineList2(); + //站別 + await GetStationList(); + //班別 + GetClassList(); + //判定單位部門 + await GetDeptList(); + + ModelState.AddModelError("error", result.Msg); + + } + } + return View("WHS018U", model); + } + public async Task WHS018FSaveAsync(WorkingHoursCollection model) + { + if (ModelState.IsValid) + { + IResultModel result; + + + result = await _whsApi.PutWorkingHoursCollection(model.TimeSheetID, JsonConvert.SerializeObject(model)); + + if (result.Success) + { + var _msg = "修改成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + //製程單位 + await GetFactoryUnitsList2(); + //廠別 + await GetFactoryList(); + //線別 + await GetLineList2(); + //站別 + await GetStationList(); + //班別 + GetClassList(); + //判定單位部門 + await GetDeptList(); + + + ModelState.AddModelError("error", result.Msg); + + } + } + return View("WHS018F", model); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetWorkingHoursCollectionByQueryAsync(string unitNo, string lineid, string stationid, string wipno, string itemno, string user, string sdate, string edate) + { + if (unitNo == null) + { + unitNo = "*"; + } + if (lineid == null) + { + lineid = "*"; + } + if (stationid == null) + { + stationid = "*"; + } + if (itemno == null) + { + itemno = "*"; + } + if (user == null) + { + user = "*"; + } + if (sdate == null || edate == null) + { + sdate = "*"; + edate = "*"; + } + + var result = await _whsApi.GetWorkingHoursCollectionByQuery( unitNo, lineid, stationid, wipno, itemno, user, sdate, edate); + + + if (result.Count > 0) + { + //List < AMESCoreStudio.WebApi.DTO.AMES.WorkingHoursCollectionDto > workingHoursCollectionDto = new List(); + + //foreach (var data in result) + //{ + // var dd = _context.StandardWorkTimes.Where(w => w.ItemNo == data.ItemNo); + // var d1 = dd.Where(w => w.UnitNo == data.UnitNo); + // var d2 = d1.Where(w => w.LineID == data.LineID); + // var d3 = d2.Where(w => w.StationID == data.StationID).FirstOrDefault(); + // data.RuleCNT = d3.OPCNT; + // data.RuleTime = d3.TotalCT; + // var p1 = _context.UserInfoes.Where(w => w.UserID == data.CreateUserID).FirstOrDefault(); + // data.CreateUser = p1.UserName; + // if (data.UpdateUserID != null) + // { + // var p2 = _context.UserInfoes.Where(w => w.UserID == data.UpdateUserID).FirstOrDefault(); + // data.UpdateUser = p2.UserName; + // } + // if (data.TotalCT != null) + // { + // data.Effective = (data.RuleCNT * data.RuleTime) / (data.TotalCT * data.OPCNT); //標準工時 * 人數 / 該筆資料的實際標工(TOTAL_CT) * 人數 * 100 % + // } + // + //} + + + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + public async Task GetWorkingHoursCollectionDtoByQueryAsync(string unitNo, string lineid, string stationid, string wipno, string itemno, string user, string sdate, string edate) + { + if (unitNo == null) + { + unitNo = "*"; + } + if (lineid == null) + { + lineid = "*"; + } + if (stationid == null) + { + stationid = "*"; + } + if (itemno == null) + { + itemno = "*"; + } + if (wipno == null) + { + wipno = "*"; + } + + if (user == null) + { + user = "*"; + } + if (sdate == null || edate == null) + { + sdate = "*"; + edate = "*"; + } + + var result = await _whsApi.GetWorkingHoursCollectionDtoByQuery(unitNo, lineid, stationid, wipno, itemno, user, sdate, edate); + + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + + #endregion + + } } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IWHS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IWHS.cs index 16611e5a..adae5704 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IWHS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IWHS.cs @@ -5,6 +5,7 @@ using AMESCoreStudio.WebApi; using Microsoft.AspNetCore.Mvc; using AMESCoreStudio.WebApi.Models.AMES; using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.WebApi.DTO.AMES; using AMESCoreStudio.CommonTools.Result; namespace AMESCoreStudio.Web @@ -534,6 +535,60 @@ namespace AMESCoreStudio.Web #endregion + #region WHS018 生產工時維護 + + /// + /// 新增異常工時 + /// + /// + [WebApiClient.Attributes.HttpPost("api/WorkingHoursCollections")] + ITask> PostWorkingHoursCollection([FromBody, RawJsonContent] string model); + + /// + /// 更新異常工時 + /// + /// + [WebApiClient.Attributes.HttpPut("api/WorkingHoursCollections/{id}")] + ITask> PutWorkingHoursCollection(int id, [FromBody, RawJsonContent] string model); + + /// + /// 刪除異常工時 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/WorkingHoursCollections/{id}")] + ITask> DeleteWorkingHoursCollection(int id); + + /// + /// 根據ID獲取指定異常工時查詢資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WorkingHoursCollections/{id}")] + ITask> GetWorkingHoursCollection(string id); + + /// + /// 獲取異常工時查詢資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WorkingHoursCollections")] + ITask> GetWorkingHoursCollections(); + + /// + /// 查詢線上異常工時 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WorkingHoursCollections/ByQuery/{unitNo}/{lineid}/{stationid}/{wipno}/{itemno}/{user}/{sdate}/{edate}")] + ITask> GetWorkingHoursCollectionByQuery(string unitNo, string lineid, string stationid, string wipno, string itemno, string user, string sdate, string edate); + + /// + /// 查詢線上異常工時 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WorkingHoursCollections/DtoByQuery/{unitNo}/{lineid}/{stationid}/{wipno}/{itemno}/{user}/{sdate}/{edate}")] + ITask> GetWorkingHoursCollectionDtoByQuery(string unitNo, string lineid, string stationid, string wipno, string itemno, string user, string sdate, string edate); + + + #endregion + } } diff --git a/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml index 7c0a8d8e..641fadbc 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml @@ -120,13 +120,13 @@ laydate.render({ elem: '#sdate' , trigger: 'click' - , format: 'yyyy/MM/dd' + , format: 'yyyy-MM-dd' , theme: 'grid' }); laydate.render({ elem: '#edate' , trigger: 'click' - , format: 'yyyy/MM/dd' + , format: 'yyyy-MM-dd' , theme: 'grid' }); diff --git a/AMESCoreStudio.Web/Views/WHS/WHS017.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS017.cshtml index 342d8170..299e2012 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS017.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS017.cshtml @@ -120,13 +120,13 @@ laydate.render({ elem: '#sdate' , trigger: 'click' - , format: 'yyyy/MM/dd' + , format: 'yyyy-MM-dd' , theme: 'grid' }); laydate.render({ elem: '#edate' , trigger: 'click' - , format: 'yyyy/MM/dd' + , format: 'yyyy-MM-dd' , theme: 'grid' }); diff --git a/AMESCoreStudio.Web/Views/WHS/WHS018.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS018.cshtml new file mode 100644 index 00000000..92e2c0e4 --- /dev/null +++ b/AMESCoreStudio.Web/Views/WHS/WHS018.cshtml @@ -0,0 +1,347 @@ +@{ + ViewData["Title"] = "生產工時資料維護"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + + + + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +@section Scripts{ + +} diff --git a/AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml new file mode 100644 index 00000000..cad72963 --- /dev/null +++ b/AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml @@ -0,0 +1,319 @@ +@model AMESCoreStudio.WebApi.Models.AMES.WorkingHoursCollection + + +@{ ViewData["Title"] = "WHS018C"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + +
+
+
+
+ + + + + +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + + +
+
+ + + + @**@ +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+ @Html.ValidationMessage("error") +
+ +
+
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/WHS/WHS018F.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS018F.cshtml new file mode 100644 index 00000000..ad98eeaf --- /dev/null +++ b/AMESCoreStudio.Web/Views/WHS/WHS018F.cshtml @@ -0,0 +1,355 @@ +@model AMESCoreStudio.WebApi.Models.AMES.WorkingHoursCollection + + +@{ ViewData["Title"] = "WHS018C"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + +
+
+
+
+ + + + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + @**@ +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+ @Html.ValidationMessage("error") +
+ +
+
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/WHS/WHS018U.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS018U.cshtml new file mode 100644 index 00000000..b5628b64 --- /dev/null +++ b/AMESCoreStudio.Web/Views/WHS/WHS018U.cshtml @@ -0,0 +1,319 @@ +@model AMESCoreStudio.WebApi.Models.AMES.WorkingHoursCollection + + +@{ ViewData["Title"] = "WHS018U"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + +
+
+
+
+ + + + + + +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+ @Html.ValidationMessage("error") +
+ +
+
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll index d57cb429..e27e500d 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb index a37c8f1e..78a5ccb3 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll index c13fa7ad..ef141b0a 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb index da298964..a47ea724 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll index 443ab62f..a28a454a 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb index 6ee32138..905870d2 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll index 725253e6..aa250481 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb index 28a3578f..4d1ffc87 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml index c891be8c..c512e923 100644 --- a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml +++ b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml @@ -1132,7 +1132,7 @@ - + FQC查詢 by Table @@ -1145,6 +1145,7 @@ 抽驗結果 頁數 筆數 + 委外廠商ID @@ -4210,6 +4211,8 @@ 查詢工單KeyParts資料QRS013 + + @@ -4801,6 +4804,77 @@ + + + 生產工時資料檔Controller + + + + + 建構式 + + + + + + 查詢生產工時資料檔 + + + + + + 生產工時資料檔 by ID + + WorkingHoursCollectionID + + + + + 生產工時查詢 + + + + + + + + 料號 + + + + + 生產工時Dto查詢 wipno + + + + + + + + 料號 + 料號 + + + + + 生產工時資料檔 to ItemNo + + 料號No + + + + + 新增生產工時資料檔 + + + + + + + 修改生產工時資料檔 + + + 每日工時維護 @@ -13383,6 +13457,131 @@ 有效工時 + + + 工時收集資料檔 + + + + + 工時收集ID + + + + + 生產單位 + + + + + 線別ID + + + + + 站別 + + + + + 板面 + + + + + 工單號碼 + + + + + 料號 + + + + + 作業人數 + + + + + 開工時間 + + + + + 完工時間 + + + + + 扣除無工作時間 + + + + + 合併生產數量 + + + + + 生產數量 + + + + + CT + + + + + 起始Sensor ID + + + + + 結止Sensor + + + + + 備註 + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + + + + 工單機種資料 + + + + + 工單機種資料 + + + + + 料號StationID主檔 + + 每日出勤資料檔 @@ -15208,7 +15407,12 @@ - 委外廠 + 委外廠ID + + + + + 委外廠No @@ -16233,6 +16437,138 @@ 生產單位 + + + WorkingHoursCollectionDtp Select Dtos + + + + + + + + + + WorkingHoursCollectionDtp Select Dto + + + + + 料號KP_ID + + + + + 生產單位 + + + + + 生產單位 + + + + + 線別 + + + + + 線別 + + + + + 站別 + + + + + 站別 + + + + + 板面 + + + + + 工單號碼 + + + + + 料號 + + + + + 作業人數 + + + + + 開工時間 + + + + + 完工時間 + + + + + 生產數量 + + + + + CT + + + + + 標準工時 + + + + + 標準人數 + + + + + 效率 + 效率的計算:依據料號所對應的製程別、線別、站別,看標準工時Table內所對應到的 + 標準工時 * 人數 / 該筆資料的實際標工(TOTAL_CT) * 人數 * 100% + + + + + 備註 + + + + + 開工人員 + + + + + 完工人員 + + + + + 開工人員 + + + + + 完工人員 + + (過站資料)BarCodeCheck Dto @@ -17647,6 +17983,11 @@ 工單警報資料 + + + 工時收集資料檔 + + diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs index 1a0ffa41..4e0f327f 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs @@ -88,9 +88,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (unitid != "*") q = q.Where(p => p.UnitNo.Equals(unitid)); if (deptid != "*") - q = q.Where(p => p.DecideDept.Equals(deptid)); + q = q.Where(p => p.DecidDeptID ==int.Parse(deptid)); if (lineid != "*") - q = q.Where(p => p.LineID.Equals(lineid)); + q = q.Where(p => p.LineID == int.Parse(lineid)); DateTime dateValue; if (sdate != "*") diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WorkingHoursCollectionsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WorkingHoursCollectionsController.cs new file mode 100644 index 00000000..933d97f4 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WorkingHoursCollectionsController.cs @@ -0,0 +1,421 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.CommonTools.Result; +using AMESCoreStudio.WebApi.DTO.AMES; + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 生產工時資料檔Controller + /// + [Route("api/[controller]")] + [ApiController] + public class WorkingHoursCollectionsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// 建構式 + /// + /// + public WorkingHoursCollectionsController(AMESContext context) + { + _context = context; + } + + /// + /// 查詢生產工時資料檔 + /// + /// + // GET: api/ + [HttpGet] + public async Task>> GetWorkingHoursCollection() + { + IQueryable q = _context.WorkingHoursCollections; + q = q.OrderBy(p => p.TimeSheetID); + var WorkingHoursCollection = await q.ToListAsync(); + return WorkingHoursCollection; + } + + /// + /// 生產工時資料檔 by ID + /// + /// WorkingHoursCollectionID + /// + [HttpGet("{id}")] + public async Task> GetWorkingHoursCollection(int id) + { + IQueryable q = _context.WorkingHoursCollections; + var result = await q.Where(p => p.TimeSheetID == id).ToListAsync(); + return result; + } + + /// + /// 生產工時查詢 + /// + /// + /// + /// + /// + /// + /// + /// 料號 + /// + [HttpGet("ByQuery/{unitNo}/{lineid}/{stationid}/{itemno}/{user}/{sdate}/{edate}")] + public async Task>> GetWorkingHoursCollectionsByQuery(string unitNo, string lineid, string stationid, string itemno, string user, string sdate, string edate) + { + IQueryable q = _context.WorkingHoursCollections; + + if (unitNo != "*") + q = q.Where(p => p.UnitNo.Equals(unitNo)); + if (lineid != "*") + q = q.Where(p => p.LineID.Equals(lineid)); + if (stationid != "*") + q = q.Where(p => p.StationID.Equals(stationid)); + if (itemno != "*") + q = q.Where(p => p.ItemNo.Equals(itemno)); + if (user != "*") + q = q.Where(p => p.CreateUserID.Equals(user)); + + DateTime dateValue; + if (sdate != "*") + { + if (DateTime.TryParse(sdate, out dateValue)) + { + q = q.Where(p => p.OpenTime >= DateTime.Parse(sdate)); + } + } + if (edate != "*") + { + if (DateTime.TryParse(edate, out dateValue)) + { + q = q.Where(p => p.CloseTime <= DateTime.Parse(edate)); + } + + } + + + var workingHoursCollections = await q.ToListAsync(); + + return workingHoursCollections; + } + + + + /// + /// 生產工時Dto查詢 wipno + /// + /// + /// + /// + /// + /// + /// + /// 料號 + /// 料號 + /// + [HttpGet("DtoByQuery/{unitNo}/{lineid}/{stationid}/{wipno}/{itemno}/{user}/{sdate}/{edate}")] + public async Task>> GetWorkingHoursCollectionDtoByQuery(string unitNo, string lineid, string stationid,string wipno, string itemno, string user, string sdate, string edate) + { + IQueryable q = _context.WorkingHoursCollections; + + if (unitNo != "*") + q = q.Where(p => p.UnitNo.Equals(unitNo)); + if (lineid != "*") + q = q.Where(p => p.LineID==int.Parse(lineid)); + if (stationid != "*") + q = q.Where(p => p.StationID == int.Parse(stationid)); + if (itemno != "*") + q = q.Where(p => p.ItemNo.Equals(itemno)); + var user1 = _context.UserInfoes.Where(w => w.UserName == user).FirstOrDefault(); + if (user1 != null) + q = q.Where(p => p.CreateUserID.Equals(user1.UserID)); + + DateTime dateValue; + if (sdate != "*") + { + if (DateTime.TryParse(sdate, out dateValue)) + { + q = q.Where(p => p.OpenTime >= DateTime.Parse(sdate)); + } + } + if (edate != "*") + { + if (DateTime.TryParse(edate, out dateValue)) + { + q = q.Where(p => p.OpenTime <= DateTime.Parse(edate)); + } + + } + + + var workingHoursCollectionDtos = await q.Select(s => new WorkingHoursCollectionDto + { + TimeSheetID = s.TimeSheetID, + UnitNo = s.UnitNo, + LineID = s.LineID, + StationID = s.StationID, + UnitName = s.Unit.UnitName, + //LineName = s.Line.LineDesc, + //StationName = s.Station.StationName, + WipNo = s.WipNo, + ItemNo = s.ItemNo, + OPCNT = s.OPCNT, + OpenTime = s.OpenTime, + CloseTime = s.CloseTime, + ProductionQty = s.ProductionQty, + TotalCT = s.TotalCT, + Memo = s.Memo, + CreateUserID = s.CreateUserID, + UpdateUserID = s.UpdateUserID + }).ToListAsync(); + + foreach (var data in workingHoursCollectionDtos) + { + var p1 = _context.UserInfoes.Where(w => w.UserID == data.CreateUserID).FirstOrDefault(); + data.CreateUser = p1.UserName; + var dd = _context.StandardWorkTimes.Where(w => w.ItemNo == data.ItemNo); + var d1 = dd.Where(w => w.UnitNo == data.UnitNo); + var d2 = d1.Where(w => w.LineID == data.LineID); + var d3 = d2.Where(w => w.StationID == data.StationID).FirstOrDefault(); + var l = _context.LineInfoes.Where(w => w.LineID == data.LineID).FirstOrDefault(); + var s = _context.Stationses.Where(w => w.StationID == data.StationID).FirstOrDefault(); + if (l != null) + { + data.LineName = l.LineDesc; + } + if (s != null) + { + data.StationName = s.StationName; + } + if (d3 != null) + { + data.RuleCNT = d3.OPCNT; + data.RuleTime = d3.TotalCT; + if (data.TotalCT != null) + { + var tt = (double)((data.RuleCNT * data.RuleTime) / (data.TotalCT * data.OPCNT)); //標準工時 * 人數 / 該筆資料的實際標工(TOTAL_CT) * 人數 * 100 % + data.Effective = double.Parse(tt.ToString("0.00")); //標準工時 * 人數 / 該筆資料的實際標工(TOTAL_CT) * 人數 * 100 % + } + } + else { + + data.Effective = 0.0; + } + if (data.UpdateUserID != null && data.UpdateUserID !=-1) + { + var p2 = _context.UserInfoes.Where(w => w.UserID == data.UpdateUserID).FirstOrDefault(); + data.UpdateUser = p2.UserName; + } + + } + return workingHoursCollectionDtos; + } + //public async Task>> GetWorkingHoursCollectionDtoByQuery(string unitNo, string lineid, string stationid, string wipno, string itemno, string user, string sdate, string edate) + //{ + // IQueryable q = _context.WorkingHoursCollections; + // + // if (unitNo != "*") + // q = q.Where(p => p.UnitNo.Equals(unitNo)); + // if (lineid != "*") + // q = q.Where(p => p.LineID.Equals(lineid)); + // if (stationid != "*") + // q = q.Where(p => p.StationID.Equals(stationid)); + // if (itemno != "*") + // q = q.Where(p => p.ItemNo.Equals(itemno)); + // if (user != "*") + // q = q.Where(p => p.CreateUserID.Equals(user)); + // + // DateTime dateValue; + // if (sdate != "*") + // { + // if (DateTime.TryParse(sdate, out dateValue)) + // { + // q = q.Where(p => p.OpenTime >= DateTime.Parse(sdate)); + // } + // } + // if (edate != "*") + // { + // if (DateTime.TryParse(edate, out dateValue)) + // { + // q = q.Where(p => p.CloseTime <= DateTime.Parse(edate)); + // } + // + // } + // + // + // var workingHoursCollectionDtos = await q.Select(s => new WorkingHoursCollectionDto + // { + // TimeSheetID = s.TimeSheetID, + // UnitNo = s.Unit.UnitNo, + // LineID = s.Line.LineID, + // StationID = s.Station.StationID, + // UnitName = s.Unit.UnitName, + // LineName = s.Line.LineDesc, + // StationName = s.Station.StationName, + // WipNo = s.WipNo, + // ItemNo = s.ItemNo, + // OPCNT = s.OPCNT, + // OpenTime = s.OpenTime, + // CloseTime = s.CloseTime, + // ProductionQty = s.ProductionQty, + // TotalCT = s.TotalCT, + // Memo = s.Memo, + // CreateUserID = s.CreateUserID, + // UpdateUserID = s.UpdateUserID + // }).ToListAsync(); + // + // foreach (var data in workingHoursCollectionDtos) + // { + // var p1 = _context.UserInfoes.Where(w => w.UserID == data.CreateUserID).FirstOrDefault(); + // data.CreateUser = p1.UserName; + // var dd = _context.StandardWorkTimes.Where(w => w.ItemNo == data.ItemNo); + // var d1 = dd.Where(w => w.UnitNo == data.UnitNo); + // var d2 = d1.Where(w => w.LineID == data.LineID); + // var d3 = d2.Where(w => w.StationID == data.StationID).FirstOrDefault(); + // if (d3 != null) + // { + // data.RuleCNT = d3.OPCNT; + // data.RuleTime = d3.TotalCT; + // if (data.TotalCT != null) + // { + // data.Effective = (double)((data.RuleCNT * data.RuleTime) / (data.TotalCT * data.OPCNT)); //標準工時 * 人數 / 該筆資料的實際標工(TOTAL_CT) * 人數 * 100 % + // } + // } + // else + // { + // + // data.Effective = 0.0; + // } + // if (data.UpdateUserID != null) + // { + // var p2 = _context.UserInfoes.Where(w => w.UserID == data.UpdateUserID).FirstOrDefault(); + // data.UpdateUser = p2.UserName; + // } + // + // } + // return workingHoursCollectionDtos; + //} + + + + /// + /// 生產工時資料檔 to ItemNo + /// + /// 料號No + /// + [HttpGet("ByItemNo/{id}")] + public async Task> GetWorkingHoursCollectionByItemNo(string id) + { + MaterialItemController materialItemController = new MaterialItemController(_context); + var result_Item = materialItemController.GetMaterialItemByItemNO(id); + int ItemID = 0; + + if (result_Item.Result != null) + ItemID = result_Item.Result.ItemID; + + IQueryable q = _context.WorkingHoursCollections.Where(w => w.ItemNo == id); + return await q.ToListAsync(); + } + + /// + /// 新增生產工時資料檔 + /// + /// + /// + [HttpPost] + public async Task> PostWorkingHoursCollection([FromBody] WorkingHoursCollection WorkingHoursCollection) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + WorkingHoursCollection.TimeSheetID = helper.GetIDKey("TIMESHEET_ID").Result; + + _context.WorkingHoursCollections.Add(WorkingHoursCollection); + try + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.InnerException.Message; + } + return result; + } + + + /// + /// 修改生產工時資料檔 + /// + /// + [HttpPut("{id}")] + public async Task> PutWorkingHoursCollection(int id,[FromBody] WorkingHoursCollection WorkingHoursCollection) + { + ResultModel result = new ResultModel(); + + //2020-05-20 BB.Wang Modify 把總工時 - 扣除時間(0.10.30.60) + //2021-03-29 Neil.Chyi Modify 組合板數量列入CT計算(Multi_B) + //System.DateTime dtOpen = System.DateTime.Parse(model.OpenTime); + if (WorkingHoursCollection.CloseTime != null) + { + System.DateTime dtClose = System.DateTime.Parse(WorkingHoursCollection.CloseTime.ToString()); + System.TimeSpan ts = dtClose.Subtract(WorkingHoursCollection.OpenTime); + var totalCT = (ts.TotalMinutes - WorkingHoursCollection.DeductionTime) / WorkingHoursCollection.MultipleCount / WorkingHoursCollection.ProductionQty; + + WorkingHoursCollection.TotalCT = totalCT; + } + + if (id != WorkingHoursCollection.TimeSheetID) + { + result.Success = false; + result.Msg = "序號錯誤"; + return result; + } + + _context.Entry(WorkingHoursCollection).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.InnerException.Message; + } + return result; + } + + + // DELETE api//5 + [HttpDelete("{id}")] + public async Task> DeleteWorkingHoursCollection(int id) + { + ResultModel result = new ResultModel(); + var WorkingHoursCollection = await _context.WorkingHoursCollections.Where(m => m.TimeSheetID == id).FirstOrDefaultAsync(); + if (WorkingHoursCollection == null) + { + result.Success = false; + result.Msg = "序號不存在"; + return result; + } + + _context.WorkingHoursCollections.Remove(WorkingHoursCollection); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + } +} diff --git a/AMESCoreStudio.WebApi/DTO/AMES/WorkingHoursCollectionDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/WorkingHoursCollectionDto.cs new file mode 100644 index 00000000..ecfb6bb9 --- /dev/null +++ b/AMESCoreStudio.WebApi/DTO/AMES/WorkingHoursCollectionDto.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace AMESCoreStudio.WebApi.DTO.AMES +{ + /// + /// WorkingHoursCollectionDtp Select Dtos + /// + public class WorkingHoursCollectionDtos + { + /// + /// + /// + public List workingHoursCollectionDtos { get; set; } + } + + /// + /// WorkingHoursCollectionDtp Select Dto + /// + public class WorkingHoursCollectionDto + { + /// + /// 料號KP_ID + /// + + public int TimeSheetID { get; set; } + + /// + /// 生產單位 + /// + + public string UnitNo { get; set; } + + /// + /// 生產單位 + /// + + public string UnitName { get; set; } + + /// + /// 線別 + /// + + public int LineID { get; set; } + + /// + /// 線別 + /// + + public string LineName { get; set; } + + /// + /// 站別 + /// + + public int StationID { get; set; } + + /// + /// 站別 + /// + + public string StationName { get; set; } + + /// + /// 板面 + /// + + public int Side { get; set; } + + /// + /// 工單號碼 + /// + + public string WipNo { get; set; } + + /// + /// 料號 + /// + + public string ItemNo { get; set; } + + /// + /// 作業人數 + /// + + public int OPCNT { get; set; } + + /// + /// 開工時間 + /// + + public DateTime OpenTime { get; set; } + + /// + /// 完工時間 + /// + + public DateTime? CloseTime { get; set; } + + /// + /// 生產數量 + /// + + public int? ProductionQty { get; set; } + + /// + /// CT + /// + + public double? TotalCT { get; set; } + + /// + /// 標準工時 + /// + + public int? RuleTime { get; set; } + + /// + /// 標準人數 + /// + + public int? RuleCNT { get; set; } + + /// + /// 效率 + /// 效率的計算:依據料號所對應的製程別、線別、站別,看標準工時Table內所對應到的 + /// 標準工時 * 人數 / 該筆資料的實際標工(TOTAL_CT) * 人數 * 100% + /// + + public double? Effective { get; set; } + + /// + /// 備註 + /// + + public string Memo { get; set; } + + + + /// + /// 開工人員 + /// + + public int CreateUserID { get; set; } + + /// + /// 完工人員 + /// + + public string UpdateUser { get; set; } + + + /// + /// 開工人員 + /// + + public string CreateUser { get; set; } + + /// + /// 完工人員 + /// + + public int? UpdateUserID { get; set; } + + + + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/StandardWorkTime.cs b/AMESCoreStudio.WebApi/Models/AMES/StandardWorkTime.cs index e95e043a..12d74dd9 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/StandardWorkTime.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/StandardWorkTime.cs @@ -72,7 +72,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Display(Name = "C/T(分)")] [Required(ErrorMessage = "{0},不能空白")] - public decimal TotalCT { get; set; } + public int TotalCT { get; set; } /// /// 節拍時間 diff --git a/AMESCoreStudio.WebApi/Models/AMES/WorkingHoursCollection.cs b/AMESCoreStudio.WebApi/Models/AMES/WorkingHoursCollection.cs new file mode 100644 index 00000000..d706998f --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/WorkingHoursCollection.cs @@ -0,0 +1,221 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 工時收集資料檔 + /// + [Table("WORKING_HOURS_COLLECTION", Schema = "JHAMES")] + [DataContract] + + public partial class WorkingHoursCollection + { + /// + /// 工時收集ID + /// + [Key] + [Column("TIMESHEET_ID")] + [Required(ErrorMessage = "{0},不能空白")] + [DataMember] + public int TimeSheetID { get; set; } + + /// + /// 生產單位 + /// + [Column("UNIT_NO")] + [StringLength(20)] + [Display(Name = "生產單位")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string UnitNo { get; set; } + + /// + /// 線別ID + /// + [DataMember] + [Column("LINE_ID")] + [Display(Name = "線別")] + [Required(ErrorMessage = "{0},不能空白")] + public int LineID { get; set; } + + /// + /// 站別 + /// + [DataMember] + [Column("STATION_ID")] + [Display(Name = "站別")] + [Required(ErrorMessage = "{0},不能空白")] + public int StationID { get; set; } + + /// + /// 板面 + /// + [Column("SIDE")] + [StringLength(6)] + [DataMember] + [Display(Name = "板面")] + public string Side { get; set; } + + /// + /// 工單號碼 + /// + [Column("WIP_NO")] + [StringLength(30)] + [DataMember] + [Display(Name = "工單號碼")] + public string WipNo { get; set; } + + /// + /// 料號 + /// + [Column("ITEM_NO")] + [StringLength(40)] + [DataMember] + [Display(Name = "料號")] + [Required(ErrorMessage = "{0},不能空白")] + public string ItemNo { get; set; } + + /// + /// 作業人數 + /// + [DataMember] + [Display(Name = "作業人數")] + [Column("OP_CNT")] + [Required(ErrorMessage = "{0},不能空白")] + public int OPCNT { get; set; } = 1; + + /// + /// 開工時間 + /// + [Column("OPEN_TIME")] + [DataMember] + [Display(Name = "開工時間")] + [Required(ErrorMessage = "{0},不能空白")] + public DateTime OpenTime { get; set; } = System.DateTime.Now; + + /// + /// 完工時間 + /// + [Column("CLOSE_TIME")] + [DataMember] + [Display(Name = "完工時間")] + public DateTime? CloseTime { get; set; } + + /// + /// 扣除無工作時間 + /// + [Column("DEDUCTION_TIME")] + [DataMember] + [Display(Name = "扣除無工作時間")] + public int? DeductionTime { get; set; } + + /// + /// 合併生產數量 + /// + [Column("MULTIPLE_COUNT")] + [DataMember] + [Display(Name = "合併生產數量")] + public int? MultipleCount { get; set; } + + /// + /// 生產數量 + /// + [Column("PRODUCTION_QTY")] + [DataMember] + [Display(Name = "生產數量")] + public int? ProductionQty { get; set; } + + /// + /// CT + /// + [Column("TOTAL_CT")] + [DataMember] + [Display(Name = "CT")] + public double? TotalCT { get; set; } + + /// + /// 起始Sensor ID + /// + [Column("INPUT_SENSOR_ID")] + [StringLength(16)] + [DataMember] + [Display(Name = "起始Sensor")] + public string InputSensorID { get; set; } + + /// + /// 結止Sensor + /// + [Column("OUTPUT_SENSOR_ID")] + [StringLength(16)] + [DataMember] + [Display(Name = "結止Sensor")] + public string OutputSensorID { get; set; } + + /// + /// 備註 + /// + [Column("MEMO")] + [StringLength(200)] + [DataMember] + [Display(Name = "備註")] + public string Memo { get; set; } + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE", TypeName = "DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + + + /// + /// 工單機種資料 + /// + [ForeignKey("UnitNo")] + public virtual AMESCoreStudio.WebApi.Models.BAS.FactoryUnit Unit { get; set; } + + /// + /// 工單機種資料 + /// + [ForeignKey("LineID")] + public virtual AMESCoreStudio.WebApi.Models.BAS.LineInfo Line { get; set; } + + /// + /// 料號StationID主檔 + /// + [ForeignKey("StationID")] + public virtual AMESCoreStudio.WebApi.Models.BAS.Stations Station { get; set; } + + /// + /// PE工程師姓名 Engineer + /// + //[NotMapped] + //public string Engineer_Name { get; set; } + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index 622a2ea9..02c7b3b5 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -796,6 +796,10 @@ namespace AMESCoreStudio.WebApi /// public DbSet WipAlarms { get; set; } + /// + /// 工時收集資料檔 + /// + public DbSet WorkingHoursCollections { get; set; } } } diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll index 443ab62f..a28a454a 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb index 6ee32138..905870d2 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll index 725253e6..aa250481 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb index 28a3578f..4d1ffc87 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml index c891be8c..c512e923 100644 --- a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml +++ b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml @@ -1132,7 +1132,7 @@ - + FQC查詢 by Table @@ -1145,6 +1145,7 @@ 抽驗結果 頁數 筆數 + 委外廠商ID @@ -4210,6 +4211,8 @@ 查詢工單KeyParts資料QRS013 + + @@ -4801,6 +4804,77 @@ + + + 生產工時資料檔Controller + + + + + 建構式 + + + + + + 查詢生產工時資料檔 + + + + + + 生產工時資料檔 by ID + + WorkingHoursCollectionID + + + + + 生產工時查詢 + + + + + + + + 料號 + + + + + 生產工時Dto查詢 wipno + + + + + + + + 料號 + 料號 + + + + + 生產工時資料檔 to ItemNo + + 料號No + + + + + 新增生產工時資料檔 + + + + + + + 修改生產工時資料檔 + + + 每日工時維護 @@ -13383,6 +13457,131 @@ 有效工時 + + + 工時收集資料檔 + + + + + 工時收集ID + + + + + 生產單位 + + + + + 線別ID + + + + + 站別 + + + + + 板面 + + + + + 工單號碼 + + + + + 料號 + + + + + 作業人數 + + + + + 開工時間 + + + + + 完工時間 + + + + + 扣除無工作時間 + + + + + 合併生產數量 + + + + + 生產數量 + + + + + CT + + + + + 起始Sensor ID + + + + + 結止Sensor + + + + + 備註 + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + + + + 工單機種資料 + + + + + 工單機種資料 + + + + + 料號StationID主檔 + + 每日出勤資料檔 @@ -15208,7 +15407,12 @@ - 委外廠 + 委外廠ID + + + + + 委外廠No @@ -16233,6 +16437,138 @@ 生產單位 + + + WorkingHoursCollectionDtp Select Dtos + + + + + + + + + + WorkingHoursCollectionDtp Select Dto + + + + + 料號KP_ID + + + + + 生產單位 + + + + + 生產單位 + + + + + 線別 + + + + + 線別 + + + + + 站別 + + + + + 站別 + + + + + 板面 + + + + + 工單號碼 + + + + + 料號 + + + + + 作業人數 + + + + + 開工時間 + + + + + 完工時間 + + + + + 生產數量 + + + + + CT + + + + + 標準工時 + + + + + 標準人數 + + + + + 效率 + 效率的計算:依據料號所對應的製程別、線別、站別,看標準工時Table內所對應到的 + 標準工時 * 人數 / 該筆資料的實際標工(TOTAL_CT) * 人數 * 100% + + + + + 備註 + + + + + 開工人員 + + + + + 完工人員 + + + + + 開工人員 + + + + + 完工人員 + + (過站資料)BarCodeCheck Dto @@ -17647,6 +17983,11 @@ 工單警報資料 + + + 工時收集資料檔 + +