diff --git a/AMESCoreStudio.Web/Controllers/BASController.cs b/AMESCoreStudio.Web/Controllers/BASController.cs index 22c719b3..2067def3 100644 --- a/AMESCoreStudio.Web/Controllers/BASController.cs +++ b/AMESCoreStudio.Web/Controllers/BASController.cs @@ -2491,5 +2491,216 @@ namespace AMESCoreStudio.Web.Controllers #endregion + #region BAS019料號治具资料维护相关 + + public IActionResult BAS019() + { + return View(); + } + + //新增頁面 + public async Task BAS019C() + { + GetUserID(); + return View(); + } + + //修改页面 + [HttpGet] + public async Task BAS019UAsync(int id) + { + GetUserID(); + var result = await _basApi.GetSerialRule(id); + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + + public async Task BAS019DAsync(int id) + { + var result = await _basApi.DeleteSerialRule(id); + return Json(new Result() { success = true, msg = "" }); + } + + //頁面提交,id=0 添加,id>0 修改 + [HttpPost] + public async Task BAS019CSaveAsync(SerialRule model) + { + + GetUserID(); + if (ModelState.IsValid) + { + IResultModel result; + + if (model.Rule.Contains("[YYYY]")) //年份 + { + model.YLen = 4; + } + if (model.Rule.Contains("[YY]"))//年份後兩碼 + { + model.YLen = 2; + } + if (model.Rule.Contains("[MM]"))//月份 + { + model.MLen = 2; + } + if (model.Rule.Contains("[WW]")) + { + model.WLen = 2; + + } + if (model.Rule.Contains("[LOT3]")) + { + model.LotLen=3; + } + if (model.Rule.Contains("[LOT4]")) + { + model.LotLen = 4; + } + if (model.Rule.Contains("[SN3]")) + { + model.SnLen = 3; + + } + if (model.Rule.Contains("[SN4]")) + { + model.SnLen = 4; + } + + + result = await _basApi.PostSerialRule(JsonConvert.SerializeObject(model)); + + + if (result.Success) + { + var _msg = "添加成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + await GetOutfitCommodityList(); + ModelState.AddModelError("error", result.Msg); + return View("BAS019C", model); + } + } + else + { + ModelState.AddModelError("error", "缺少必填資料"); + return View("BAS019C", model); + } + + } + + [HttpPost] + public async Task BAS019USaveAsync(SerialRule model) + { + GetUserID(); + + if (ModelState.IsValid) + { + IResultModel result; + + if (model.Rule.Contains("[YYYY]")) //年份 + { + model.YLen = 4; + } + if (model.Rule.Contains("[YY]"))//年份後兩碼 + { + model.YLen = 2; + } + if (model.Rule.Contains("[MM]"))//月份 + { + model.MLen = 2; + } + if (model.Rule.Contains("[WW]")) + { + model.WLen = 2; + + } + if (model.Rule.Contains("[LOT3]")) + { + model.LotLen = 3; + } + if (model.Rule.Contains("[LOT4]")) + { + model.LotLen = 4; + } + if (model.Rule.Contains("[SN3]")) + { + model.SnLen = 3; + + } + if (model.Rule.Contains("[SN4]")) + { + model.SnLen = 4; + } + + result = await _basApi.PutSerialRule(model.SerialRuleID, JsonConvert.SerializeObject(model)); + + + if (result.Success) + { + var _msg = "修改成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + ModelState.AddModelError("error", result.Msg); + return View("BAS019U", model); + + } + } + else + { + ModelState.AddModelError("error", "缺少必填資料"); + return View("BAS019U", model); + } + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetSerialRulesAsync() + { + var result = await _basApi.GetSerialRules(); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + + public async Task GetSerialRuleAsync(int ID) + { + var result = await _basApi.GetSerialRule(ID); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + + public async Task GetSerialRuleByItemNoAsync(string ID) + { + var result = await _basApi.GetSerialRuleByItemNo(ID); + + 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/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 58d0b9e1..0415a7c3 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -4615,6 +4615,8 @@ namespace AMESCoreStudio.Web.Controllers { var FlowRule = result_Wip.FirstOrDefault().FlowRuleID; var result_RuleStation = await _basApi.GetRuleStationsByFlow(FlowRule, 0); + //result_RuleStation = result_RuleStation.Where(w => w.StationType == "M").OrderBy(o => o.Sequence).ToList(); + //var Stations = new List(); result_RuleStation = result_RuleStation.Where(w => w.StationType == "M" && w.StationID != 1000).OrderBy(o => o.Sequence).ToList(); var RuleStations = new List(); for (int i = 0; i < result_RuleStation.Count; i++) @@ -4882,6 +4884,108 @@ namespace AMESCoreStudio.Web.Controllers } return user_id; } + + #region PCS033組件资料维护相关 + + public IActionResult PCS033() + { + return View(); + } + //新增頁面 + public async Task PCS033C() + { + var id = GetLogInUserID(); + ViewBag.UserID = id; + var result = await _sysApi.GetUserInfo(id); + var name = result[0].UserName; + ViewBag.UserName = name; + return View(); + } + + //頁面提交,id=0 添加,id>0 修改 + [HttpPost] + public async Task PCS033CSaveAsync(SampleSipmentSN model) + { + + if (ModelState.IsValid) + { + IResultModel result; + IResultModel result2; + + result2 = await _pcsApi.GetSampleSerialRule(model.Qty); + if (result2.Success) + { + string str, str1; + var strA = result2.Msg.Split("-"); + str = strA[0]; + str1 = strA[1]; + model.StartNo = str; + model.EndNo = str1; + result = await _pcsApi.PostSampleSipmentSN(JsonConvert.SerializeObject(model)); + if (result.Success) + { + var _msg = "取得序號成功!,序號為["+ result2.Msg + "]"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + + ModelState.AddModelError("error", result.Msg); + + } + } + else + { + + ModelState.AddModelError("error", "取得序號失敗"); + + + } + } + return View("PCS033C", model); + + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetSampleSipmentSNsAsync() + { + + var result = await _pcsApi.GetSampleSipmentSNs(); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetSampleSipmentSNsByQueryAsync(string itemNo, string wipNo, string userName, string Sdate, string Edate) + { + if (string.IsNullOrEmpty(wipNo)) + wipNo = "*"; + if (string.IsNullOrEmpty(itemNo)) + itemNo = "*"; + if (string.IsNullOrEmpty(userName)) + userName = "*"; + if (string.IsNullOrEmpty(Sdate)) + Sdate = "*"; + if (string.IsNullOrEmpty(Edate)) + Edate = "*"; + + var result = await _pcsApi.GetSampleSipmentSNsByQurey( itemNo, wipNo, userName, 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/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 10517931..9268fd5e 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -1122,5 +1122,28 @@ namespace AMESCoreStudio.Web ITask> GetSerialRuleByQurey(string itemNo,string lotNo ,int num); #endregion + #region 樣品出貨序號紀錄 + + /// + /// 新增組件 + /// + /// + [WebApiClient.Attributes.HttpPost("api/SampleSipmentSNs")] + ITask> PostSampleSipmentSN([FromBody, RawJsonContent] string model); + + /// + /// 獲取組件 + /// + /// + [WebApiClient.Attributes.HttpGet("api/SampleSipmentSNs")] + ITask> GetSampleSipmentSNs(); + + + [WebApiClient.Attributes.HttpGet("api/SampleSipmentSNs/ByQurey/{itemNo}/{wipNo}/{userName}/{Sdate}/{Edate}")] + ITask> GetSampleSipmentSNsByQurey(string itemNo, string wipNo, string userName, string Sdate, string Edate); + + [WebApiClient.Attributes.HttpGet("api/SerialRules/Sample/num/{num}")] + ITask> GetSampleSerialRule(int num); + #endregion } } diff --git a/AMESCoreStudio.Web/HttpApis/IBAS.cs b/AMESCoreStudio.Web/HttpApis/IBAS.cs index 616d4fe9..54acba8b 100644 --- a/AMESCoreStudio.Web/HttpApis/IBAS.cs +++ b/AMESCoreStudio.Web/HttpApis/IBAS.cs @@ -840,6 +840,53 @@ namespace AMESCoreStudio.Web #endregion + #region BAS019出貨序號編碼規則維護相關 + + /// + /// 新增出貨序號編碼規則 + /// + /// + [WebApiClient.Attributes.HttpPost("api/SerialRules")] + ITask> PostSerialRule([FromBody, RawJsonContent] string model); + + /// + /// 更新出貨序號編碼規則 + /// + /// + [WebApiClient.Attributes.HttpPut("api/SerialRules/{id}")] + ITask> PutSerialRule(int id, [FromBody, RawJsonContent] string model); + + /// + /// 刪除出貨序號編碼規則 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/SerialRules/{id}")] + ITask> DeleteSerialRule(int id); + + /// + /// 根據ID獲取指定出貨序號編碼規則 + /// + /// + [WebApiClient.Attributes.HttpGet("api/SerialRules/{id}")] + ITask> GetSerialRule(int id); + + /// + /// 獲取出貨序號編碼規則資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/SerialRules")] + ITask> GetSerialRules(); + + /// + /// 獲取出貨序號編碼規則ByItemNo + /// + /// + [WebApiClient.Attributes.HttpGet("api/SerialRules/ItemNo/{id}")] + ITask> GetSerialRuleByItemNo(string id); + + + + #endregion } } diff --git a/AMESCoreStudio.Web/Views/BAS/BAS019.cshtml b/AMESCoreStudio.Web/Views/BAS/BAS019.cshtml new file mode 100644 index 00000000..0dced5d6 --- /dev/null +++ b/AMESCoreStudio.Web/Views/BAS/BAS019.cshtml @@ -0,0 +1,132 @@ +@{ + ViewData["Title"] = "出貨序號編碼規則維護"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/BAS/BAS019C.cshtml b/AMESCoreStudio.Web/Views/BAS/BAS019C.cshtml new file mode 100644 index 00000000..c827610e --- /dev/null +++ b/AMESCoreStudio.Web/Views/BAS/BAS019C.cshtml @@ -0,0 +1,76 @@ +@model AMESCoreStudio.WebApi.Models.AMES.SerialRule + + +@{ ViewData["Title"] = "BAS019C"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + + + + +
+
+
+
+ + + + + + +
+ + + +
+
+ + + +
+
+ + + + + + + + + + + + + + + + **如果非以上規則系統將無法判斷** +
+ @Html.ValidationMessage("error") +
+ +
+ +
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/BAS/BAS019U.cshtml b/AMESCoreStudio.Web/Views/BAS/BAS019U.cshtml new file mode 100644 index 00000000..22693738 --- /dev/null +++ b/AMESCoreStudio.Web/Views/BAS/BAS019U.cshtml @@ -0,0 +1,78 @@ +@model AMESCoreStudio.WebApi.Models.AMES.SerialRule + + +@{ ViewData["Title"] = "BAS019U"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + + + + +
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + +
+
+ + + +
+
+ + + + + + + + + **如果非以上規則系統將無法判斷** +
+ @Html.ValidationMessage("error") +
+ +
+ +
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + +} + diff --git a/AMESCoreStudio.Web/Views/PCS/PCS033.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS033.cshtml new file mode 100644 index 00000000..66840d06 --- /dev/null +++ b/AMESCoreStudio.Web/Views/PCS/PCS033.cshtml @@ -0,0 +1,260 @@ +@{ + ViewData["Title"] = "樣本序號取得紀錄"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/PCS/PCS033C.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS033C.cshtml new file mode 100644 index 00000000..265fb1e5 --- /dev/null +++ b/AMESCoreStudio.Web/Views/PCS/PCS033C.cshtml @@ -0,0 +1,129 @@ +@model AMESCoreStudio.WebApi.Models.AMES.SampleSipmentSN + + +@{ ViewData["Title"] = "PCS033C"; + 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 3c6564cf..154fa5b1 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 34a68337..dcd2ff42 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.deps.json b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.deps.json index 5d368154..1c4f4063 100644 --- a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.deps.json +++ b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.deps.json @@ -311,6 +311,14 @@ "runtime": { "AMESCoreStudio.Web.dll": {} }, + "resources": { + "zh-CN/AMESCoreStudio.Web.resources.dll": { + "locale": "zh-CN" + }, + "zh-TW/AMESCoreStudio.Web.resources.dll": { + "locale": "zh-TW" + } + }, "compile": { "AMESCoreStudio.Web.dll": {} } diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll index c781ff7a..8a85f440 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 86fa6e0a..117abea8 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 63e183fc..b4de95e9 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 b25385bf..38499cb8 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 60cccf56..094175aa 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 84334f6f..29eb02db 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 c85f7bad..556e22eb 100644 --- a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml +++ b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml @@ -612,6 +612,13 @@ + + + 工單料號查詢 + + 工單料號 + + @@ -3325,9 +3332,57 @@ + + + 樣本序號取得紀錄基本資料檔Controller + + + + + 建構式 + + + + + + 查詢樣本序號取得紀錄資料檔 + + + + + + 樣本序號取得紀錄基本資料檔 to SampleWipNo + + SampleSipmentSNID + + + + + 取得樣本序號取得紀錄ByQurey + + 料號 + 工單 + 開單人員 + 開單日期 + 開單日期 + + + + + 新增樣本序號取得紀錄資料檔 + + + + + + + 修改料號基本資料檔 + + + - 料號基本資料檔Controller + 出貨序號編碼規則基本資料檔Controller @@ -3338,15 +3393,22 @@ - 查詢料號基本資料檔 + 查詢出貨序號編碼規則資料檔 - 料號基本資料檔 to ItemID + 出貨序號編碼規則基本資料檔 to SerialRuleID - ItemID + SerialRuleID + + + + + 料號基本資料檔 to ItemNo + + ItemNo @@ -3387,7 +3449,7 @@ - + 修改料號基本資料檔 @@ -10718,6 +10780,91 @@ 維修原因狀態 + + + 樣本序號取得紀錄資料檔 + + + + + 工單 + + + + + 料號 + + + + + 年 + + + + + 開工日期 + + + + + 完工日期 + + + + + PowerCord + + + + + ECN + + + + + BIOS + + + + + EAN + + + + + 內部序號 + + + + + 起始序號 + + + + + 結束序號 + + + + + 更新UserID + + + + + 建立UserID + + + + + 建立日期 + + + + + 更新日期 + + 料號出貨序號規則資料檔 @@ -12443,6 +12590,11 @@ 燒機時間 + + + 燒機軟體 + + 燒機備註 @@ -15258,6 +15410,91 @@ 作業站名稱 + + + WipQuery Select Dto + + + + + 工單ID + + + + + 工單號碼 + + + + + 工單數量 + + + + + 生產單位 + + + + + 生產單位Name + + + + + 線別ID + + + + + 線別Name + + + + + 料號 + + + + + 工單狀態 + + + + + 預計開工日期 + + + + + 預計完工日期 + + + + + 廠商中文廠名 + + + + + 工單描述 + + + + + 工單建立日期 + + + + + 開工日 + + + + + 檢驗日 + + 工單製程對應SOP資料檔 DTO @@ -15708,6 +15945,11 @@ H/W AT + + + Other + + 工單資訊 系統工程資訊 Type @@ -15733,6 +15975,106 @@ 備註說明 + + + 工單資訊 系統工程資訊 DMI燒入 Type + + + + + YES + + + + + N/A + + + + + 燒機時間 + + + + + NA + + + + + 室溫 + + + + + -40~+85度 + + + + + -20~+70度 + + + + + 50度 + + + + + 55度 + + + + + 40度 + + + + + 燒機軟體 + + + + + NA + + + + + Memtest86 + + + + + Burnin test + + + + + Memtest86+Burnin test + + + + + Power onoff+Burnin test + + + + + Android APP + + + + + QA Plus + + + + + Stress test + + SOP Type @@ -16587,6 +16929,11 @@ 燒機記錄資料表 + + + 樣本序號取得記錄資料表 + + diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/appsettings.json b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/appsettings.json index 7694543c..51b4cf49 100644 --- a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/appsettings.json +++ b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/appsettings.json @@ -10,5 +10,7 @@ "Microsoft.Hosting.Lifetime": "Information" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + // ww u򥻸ƲΤ@}u{T + "WipSpecial": "Y" } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/SampleSipmentSNsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/SampleSipmentSNsController.cs new file mode 100644 index 00000000..bbd62e01 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/SampleSipmentSNsController.cs @@ -0,0 +1,169 @@ +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 SampleSipmentSNsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// 建構式 + /// + /// + public SampleSipmentSNsController(AMESContext context) + { + _context = context; + } + + /// + /// 查詢樣本序號取得紀錄資料檔 + /// + /// + // GET: api/ + [HttpGet] + public async Task>> GetSampleSipmentSNs() + { + IQueryable q = _context.SampleSipmentSNs; + q = q.OrderBy(p => p.CreateDate); + var SampleSipmentSN = await q.ToListAsync(); + return SampleSipmentSN; + } + + /// + /// 樣本序號取得紀錄基本資料檔 to SampleWipNo + /// + /// SampleSipmentSNID + /// + [HttpGet("{id}")] + public async Task>> GetSampleSipmentSN(string id) + { + IQueryable q = _context.SampleSipmentSNs; + + var SampleSipmentSN = await q.Where(p => p.SampleWipNo == id).ToListAsync(); + return SampleSipmentSN; + } + + /// + /// 取得樣本序號取得紀錄ByQurey + /// + /// 料號 + /// 工單 + /// 開單人員 + /// 開單日期 + /// 開單日期 + /// + [HttpGet("ByQurey/{itemNo}/{wipNo}/{userName}/{Sdate}/{Edate}")] + public async Task>> GetSampleSipmentSNByQurey(string itemNo, string wipNo, string userName, string Sdate, string Edate) + { + IQueryable q = _context.SampleSipmentSNs; + ResultModel result = new ResultModel(); + if(!string.IsNullOrEmpty(itemNo) && itemNo!="*") + q = q.Where(p => p.ItemNo == itemNo); + if (!string.IsNullOrEmpty(wipNo) && wipNo != "*") + q = q.Where(p => p.SampleWipNo == wipNo); + if (!string.IsNullOrEmpty(userName) && userName != "*") + q = q.Where(p => p.CreateName == userName); + + + DateTime dateValue; + if (!string.IsNullOrEmpty(Sdate) && Sdate != "*") + { + + if (DateTime.TryParse(Sdate, out dateValue)) + { + q = q.Where(p => p.CreateDate >= DateTime.Parse(Sdate)); + } + } + if (!string.IsNullOrEmpty(Edate) && Edate != "*") + { + if (DateTime.TryParse(Edate, out dateValue)) + { + q = q.Where(p => p.CreateDate <= DateTime.Parse(Edate)); + } + + } + + + var SampleSipmentSN = await q.ToListAsync(); + + return SampleSipmentSN; + + + } + + /// + /// 新增樣本序號取得紀錄資料檔 + /// + /// + /// + [HttpPost] + public async Task> PostSampleSipmentSN([FromBody] SampleSipmentSN SampleSipmentSN) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + //SampleSipmentSN.SampleSipmentSNID = helper.GetIDKey("SampleSipmentSN_ID").Result; + _context.SampleSipmentSNs.Add(SampleSipmentSN); + 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> PutSampleSipmentSN(int id,[FromBody] SampleSipmentSN SampleSipmentSN) + { + ResultModel result = new ResultModel(); + //_context.Attach(SampleSipmentSN); + // 指定更新某個欄位 + //_context.Entry(SampleSipmentSN).Property(p => p.SampleSipmentSNID).IsModified = true; + _context.Entry(SampleSipmentSN).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 void DeleteSampleSipmentSN(int id) + { + } + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/SerialRulesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/SerialRulesController.cs index 64f00343..60ef60ef 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/SerialRulesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/SerialRulesController.cs @@ -12,7 +12,7 @@ using AMESCoreStudio.WebApi.DTO.AMES; namespace AMESCoreStudio.WebApi.Controllers.AMES { /// - /// 料號基本資料檔Controller + /// 出貨序號編碼規則基本資料檔Controller /// [Route("api/[controller]")] [ApiController] @@ -30,7 +30,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } /// - /// 查詢料號基本資料檔 + /// 查詢出貨序號編碼規則資料檔 /// /// // GET: api/ @@ -43,20 +43,41 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return SerialRule; } - /// - /// 料號基本資料檔 to ItemID + /// 出貨序號編碼規則基本資料檔 to SerialRuleID /// - /// ItemID + /// SerialRuleID /// [HttpGet("{id}")] - public async Task> GetSerialRule(int id) + public async Task>> GetSerialRule(int id) { IQueryable q = _context.SerialRules; - ResultModel result = new ResultModel(); - result.Data = await q.Where(p => p.SerialRuleID == id).ToListAsync(); - return result; + var SerialRule = await q.Where(p => p.SerialRuleID == id).ToListAsync(); + return SerialRule; + } + + /// + /// 料號基本資料檔 to ItemNo + /// + /// ItemNo + /// + [HttpGet("ItemNo/{id}")] + public async Task>> GetSerialRuleByItemNo(string id) + { + IQueryable q = _context.SerialRules; + + q = q.Where(p => p.ItemNo == id); + + var SerialRule = await q.ToListAsync(); + + if (SerialRule == null) + { + return NotFound(); + } + + return SerialRule; + } /// @@ -637,9 +658,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// 修改料號基本資料檔 /// /// - [HttpPut] - - public async Task> PutSerialRule([FromBody] SerialRule SerialRule) + [HttpPut("{id}")] + public async Task> PutSerialRule(int id,[FromBody] SerialRule SerialRule) { ResultModel result = new ResultModel(); //_context.Attach(SerialRule); diff --git a/AMESCoreStudio.WebApi/Models/AMES/SampleSipmentSN.cs b/AMESCoreStudio.WebApi/Models/AMES/SampleSipmentSN.cs new file mode 100644 index 00000000..a230badb --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/SampleSipmentSN.cs @@ -0,0 +1,167 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; +using System.Runtime.Serialization; +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 樣本序號取得紀錄資料檔 + /// + //[Keyless] + [Table("SAMPLE_SHIPMENT_SN", Schema = "JHAMES")] + //[Index(nameof(CreateDate), Name = "SAMPLE_SHIPMENT_SN_PK", IsUnique = true)] + + public partial class SampleSipmentSN + { + /// + /// 工單 + /// + [Required] + [Column("SAMPLE_WIP_NO")] + [StringLength(30)] + [Display(Name = "工單")] + [DataMember] + public string SampleWipNo { get; set; } + + /// + /// 料號 + /// + [Required] + [Column("ITEM_NO")] + [StringLength(20)] + [DataMember] + [Display(Name = "料號")] + public string ItemNo { get; set; } + + /// + /// 年 + /// + [Required] + [Column("QTY")] + [DataMember] + [Display(Name = "數量")] + public int Qty { get; set; } + + /// + /// 開工日期 + /// + [Required] + [Column("START_DATE")] + [DataMember] + [Display(Name = "開工日期")] + public DateTime StartDate { get; set; } + + /// + /// 完工日期 + /// + [Required] + [Column("COMPLETED_DATE")] + [DataMember] + [Display(Name = "完工日期")] + public DateTime CompletedDate { get; set; } + + + /// + /// PowerCord + /// + [Column("POWER_CORD")] + [DataMember] + [Display(Name = "Power Cord")] + [StringLength(20)] + public string PowerCord { get; set; } + + /// + /// ECN + /// + [Column("ECN")] + [DataMember] + [Display(Name = "ECN")] + [StringLength(20)] + public string ECN { get; set; } + + /// + /// BIOS + /// + [Column("BIOS")] + [DataMember] + [Display(Name = "BIOS")] + [StringLength(20)] + public string BIOS { get; set; } + + /// + /// EAN + /// + [Column("EAN")] + [DataMember] + [Display(Name = "EAN")] + [StringLength(20)] + public string EAN { get; set; } + + /// + /// 內部序號 + /// + [Column("BARCODE_NO")] + [StringLength(30)] + [DataMember] + [Display(Name = "內部序號")] + public string BarcodeNo { get; set; } + + /// + /// 起始序號 + /// + [Required] + [Column("START_NO")] + [StringLength(30)] + [DataMember] + [Display(Name = "起始序號")] + public string StartNo { get; set; } + + /// + /// 結束序號 + /// + [Required] + [Column("END_NO")] + [StringLength(30)] + [DataMember] + [Display(Name = "結束序號")] + public string EndNo { get; set; } + + /// + /// 更新UserID + /// + [Column("CREATE_NAME")] + [DataMember] + [Display(Name = "開單人員")] + public string CreateName { get; set; } + + /// + /// 建立UserID + /// + [Column("CREATE_USERID")] + [Required] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 建立日期 + /// + [Key] + [Required] + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = DateTime.Now; + + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = DateTime.Now; + + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/SerialRule.cs b/AMESCoreStudio.WebApi/Models/AMES/SerialRule.cs index 83914bff..f1e89ee8 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/SerialRule.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/SerialRule.cs @@ -28,6 +28,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Required] [Column("ITEM_NO")] [StringLength(20)] + [Display(Name = "料號")] [DataMember] public string ItemNo { get; set; } @@ -38,6 +39,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("RULE")] [StringLength(50)] [DataMember] + [Display(Name = "序號規則")] public string Rule { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index 2aa20813..67404a7e 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -764,6 +764,12 @@ namespace AMESCoreStudio.WebApi /// 燒機記錄資料表 /// public virtual DbSet BurnInfos { get; set; } + + /// + /// 樣本序號取得記錄資料表 + /// + public virtual DbSet SampleSipmentSNs { 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 63e183fc..b4de95e9 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 b25385bf..38499cb8 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 60cccf56..094175aa 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 84334f6f..29eb02db 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 c85f7bad..556e22eb 100644 --- a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml +++ b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml @@ -612,6 +612,13 @@ + + + 工單料號查詢 + + 工單料號 + + @@ -3325,9 +3332,57 @@ + + + 樣本序號取得紀錄基本資料檔Controller + + + + + 建構式 + + + + + + 查詢樣本序號取得紀錄資料檔 + + + + + + 樣本序號取得紀錄基本資料檔 to SampleWipNo + + SampleSipmentSNID + + + + + 取得樣本序號取得紀錄ByQurey + + 料號 + 工單 + 開單人員 + 開單日期 + 開單日期 + + + + + 新增樣本序號取得紀錄資料檔 + + + + + + + 修改料號基本資料檔 + + + - 料號基本資料檔Controller + 出貨序號編碼規則基本資料檔Controller @@ -3338,15 +3393,22 @@ - 查詢料號基本資料檔 + 查詢出貨序號編碼規則資料檔 - 料號基本資料檔 to ItemID + 出貨序號編碼規則基本資料檔 to SerialRuleID - ItemID + SerialRuleID + + + + + 料號基本資料檔 to ItemNo + + ItemNo @@ -3387,7 +3449,7 @@ - + 修改料號基本資料檔 @@ -10718,6 +10780,91 @@ 維修原因狀態 + + + 樣本序號取得紀錄資料檔 + + + + + 工單 + + + + + 料號 + + + + + 年 + + + + + 開工日期 + + + + + 完工日期 + + + + + PowerCord + + + + + ECN + + + + + BIOS + + + + + EAN + + + + + 內部序號 + + + + + 起始序號 + + + + + 結束序號 + + + + + 更新UserID + + + + + 建立UserID + + + + + 建立日期 + + + + + 更新日期 + + 料號出貨序號規則資料檔 @@ -12443,6 +12590,11 @@ 燒機時間 + + + 燒機軟體 + + 燒機備註 @@ -15258,6 +15410,91 @@ 作業站名稱 + + + WipQuery Select Dto + + + + + 工單ID + + + + + 工單號碼 + + + + + 工單數量 + + + + + 生產單位 + + + + + 生產單位Name + + + + + 線別ID + + + + + 線別Name + + + + + 料號 + + + + + 工單狀態 + + + + + 預計開工日期 + + + + + 預計完工日期 + + + + + 廠商中文廠名 + + + + + 工單描述 + + + + + 工單建立日期 + + + + + 開工日 + + + + + 檢驗日 + + 工單製程對應SOP資料檔 DTO @@ -15708,6 +15945,11 @@ H/W AT + + + Other + + 工單資訊 系統工程資訊 Type @@ -15733,6 +15975,106 @@ 備註說明 + + + 工單資訊 系統工程資訊 DMI燒入 Type + + + + + YES + + + + + N/A + + + + + 燒機時間 + + + + + NA + + + + + 室溫 + + + + + -40~+85度 + + + + + -20~+70度 + + + + + 50度 + + + + + 55度 + + + + + 40度 + + + + + 燒機軟體 + + + + + NA + + + + + Memtest86 + + + + + Burnin test + + + + + Memtest86+Burnin test + + + + + Power onoff+Burnin test + + + + + Android APP + + + + + QA Plus + + + + + Stress test + + SOP Type @@ -16587,6 +16929,11 @@ 燒機記錄資料表 + + + 樣本序號取得記錄資料表 + +