From ffe50bddfba95899fcb60f7f9d2dc35afe803190 Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 1 Feb 2023 23:00:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=20FQC=E6=8A=BD=E9=A9=97=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=85=A5=E5=BA=AB=E5=88=A5=E9=A1=AF=E7=A4=BA=E5=8F=8A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=202.=20=E5=B7=A5=E5=96=AE=E8=B3=87=E6=96=99=20?= =?UTF-8?q?=E6=A8=99=E5=B7=A5=E9=A1=AF=E7=A4=BA=E7=A7=BB=E9=99=A4=E7=94=9F?= =?UTF-8?q?=E7=94=A2=E5=96=AE=E4=BD=8D=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FQCController.cs | 20 +- .../Controllers/PCSController.cs | 15 +- AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs | 9 +- AMESCoreStudio.Web/Views/FQC/FQC007.cshtml | 24 ++- .../Views/FQC/FQC007B - 複製.cshtml | 176 ------------------ .../AMES/FqcInhouseMasterController.cs | 35 +++- AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs | 9 + .../Models/AMES/FqcInhouseMaster.cs | 10 + 8 files changed, 104 insertions(+), 194 deletions(-) delete mode 100644 AMESCoreStudio.Web/Views/FQC/FQC007B - 複製.cshtml diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index fab20c49..47d1b8e1 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -886,6 +886,15 @@ namespace AMESCoreStudio.Web.Controllers if (action == "儲存") { + // 更新入庫別 + var fqcInhouseMaster = new FqcInhouseMaster + { + InhouseNo = model.InhouseNo, + SeqID = (int)model.SeqID, + LocationNo = model.LocationNo + }; + await _fqcApi.PutFqcInhouseMasterForLocationNo(JsonConvert.SerializeObject(fqcInhouseMaster)); + var result_FQCResultMaster = await _fqcApi.GetFqcResultMaster(model.FqcID); if (result_FQCResultMaster != null) @@ -973,9 +982,14 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task FQC007AjaxJson(FqcDto model) { - IResultModel result; - - result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); + // 更新入庫別 + var fqcInhouseMaster = new FqcInhouseMaster + { + InhouseNo = model.InhouseNo, + SeqID = (int)model.SeqID, + LocationNo = model.LocationNo + }; + await _fqcApi.PutFqcInhouseMasterForLocationNo(JsonConvert.SerializeObject(fqcInhouseMaster)); var result_FQCResultMaster = await _fqcApi.GetFqcResultMaster(model.FqcID); diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 5327db2e..09bd7769 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -2392,8 +2392,9 @@ namespace AMESCoreStudio.Web.Controllers // 取料號對應工時 var standardWorkTimes = await _pcsApi.GetStandardWorkTimeByItemNo(model.wipAtt.ItemNO); - standardWorkTimes = standardWorkTimes.Where(w => w.LineID == model.wipInfo.LineID && - w.UnitNo == model.wipInfo.UnitNO).ToList(); + // 取消生產單位及線別判斷 + // standardWorkTimes = standardWorkTimes.Where(w => w.LineID == model.wipInfo.LineID && + // w.UnitNo == model.wipInfo.UnitNO).ToList(); if (standardWorkTimes.Count != 0) model.itemNoCT1 = standardWorkTimes.Sum(m => m.TotalCT).ToString(); @@ -2540,8 +2541,9 @@ namespace AMESCoreStudio.Web.Controllers // 取料號對應工時 var standardWorkTimes = await _pcsApi.GetStandardWorkTimeByItemNo(model.wipAtt.ItemNO); - standardWorkTimes = standardWorkTimes.Where(w => w.LineID == model.wipInfo.LineID && - w.UnitNo == model.wipInfo.UnitNO).ToList(); + // 取消生產單位及線別判斷 + // standardWorkTimes = standardWorkTimes.Where(w => w.LineID == model.wipInfo.LineID && + // w.UnitNo == model.wipInfo.UnitNO).ToList(); if (standardWorkTimes.Count != 0) model.itemNoCT1 = standardWorkTimes.Sum(m => m.TotalCT).ToString(); @@ -3081,8 +3083,9 @@ namespace AMESCoreStudio.Web.Controllers // 取料號對應工時 var standardWorkTimes = await _pcsApi.GetStandardWorkTimeByItemNo(model.wipAtt.ItemNO); - standardWorkTimes = standardWorkTimes.Where(w => w.LineID == model.wipInfo.LineID && - w.UnitNo == model.wipInfo.UnitNO).ToList(); + // 取消生產單位及線別判斷 + // standardWorkTimes = standardWorkTimes.Where(w => w.LineID == model.wipInfo.LineID && + // w.UnitNo == model.wipInfo.UnitNO).ToList(); if (standardWorkTimes.Count != 0) model.itemNoCT1 = standardWorkTimes.Sum(m => m.TotalCT).ToString(); diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs index e56bbbb5..e656acdc 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs @@ -319,6 +319,13 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpPut("api/FqcInhouseMaster/PutForCritID")] ITask> PutFqcInhouseMasterForCritID([FromBody, RawJsonContent] string model); + /// + /// 更新入庫單 庫別 + /// + /// + [WebApiClient.Attributes.HttpPut("api/FqcInhouseMaster/PutForLocationNo")] + ITask> PutFqcInhouseMasterForLocationNo([FromBody, RawJsonContent] string model); + /// /// 新增抽驗批退 /// @@ -327,7 +334,7 @@ namespace AMESCoreStudio.Web ITask> PostQngInfo([FromBody, RawJsonContent] string model); /// - /// 查詢過站狀態檔 ID + /// FQC抽驗資料 /// /// [WebApiClient.Attributes.HttpGet("api/FqcInhouseMaster/FqcQuery/{inhouseNo}")] diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index 315af9f4..a7d35ec1 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -127,8 +127,8 @@
@*
- -
*@ + +
*@
@@ -151,12 +151,12 @@ @* - - *@ + + *@
@*
-
*@ + *@
+
+ +
+
+
+
+ +
+
+
@@ -266,8 +276,8 @@
@*
- -
*@ + +
*@
diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007B - 複製.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007B - 複製.cshtml deleted file mode 100644 index f910ea4a..00000000 --- a/AMESCoreStudio.Web/Views/FQC/FQC007B - 複製.cshtml +++ /dev/null @@ -1,176 +0,0 @@ -@model AMESCoreStudio.WebApi.Models.AMES.FqcResultMaster - - -@{ - Layout = "~/Views/Shared/_AMESLayout.cshtml"; } - - - -
- - -
- -
- - - - -
-
-
- -
-
-
-
-
- -
-
- -
- -
-
-
-
-
-
-
-
- -
-
-
-
-
- -
- -
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
- @Html.ValidationMessage("error") -
-
- -
-
- -
-
-@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); - await Html.RenderPartialAsync("_FileinputScriptsPartial"); } - - -} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index 04548602..165107cd 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -271,7 +271,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES ECN_Memo = q2.ECN_Memo, Note = q2.Note, InspectionStatus = q2.InspectionStatus, - Description = q4.Description + Description = q4.Description, + LocationNo = q1.LocationNo }; var query = await q.Distinct().ToListAsync(); @@ -389,6 +390,38 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return result; } + /// + /// 更新入庫別 + /// + /// + /// + [HttpPut("PutForLocationNo")] + public async Task> PutFqcInhouseMasterForLocationNo(FqcInhouseMaster fqcInhouseMaster) + { + ResultModel result = new ResultModel(); + var data = await _context.FqcInhouseMasters.Where(w => w.InhouseNo == fqcInhouseMaster.InhouseNo && + w.SeqID == fqcInhouseMaster.SeqID).FirstOrDefaultAsync(); + data.LocationNo = fqcInhouseMaster.LocationNo; + _context.Entry(data).State = EntityState.Modified; + _context.Entry(data).Property("LocationNo").IsModified = true; + + try + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + + await _context.Database.ExecuteSqlInterpolatedAsync + ($" UPDATE JHAMES.WAREHOUSEING SET LOCATION_NO={fqcInhouseMaster.LocationNo} WHERE INHOUSE_NO={fqcInhouseMaster.InhouseNo} AND SEQ_ID={fqcInhouseMaster.SeqID}"); + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.InnerException.Message; + } + return result; + } + /// /// 新增入庫單 /// diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs index 821e1894..85777e3c 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs @@ -368,6 +368,15 @@ namespace AMESCoreStudio.WebApi.DTO.AMES [DataMember] public string InspectionStatus { get; set; } + /// + /// 入庫別 + /// + [NotMapped] + [DataMember] + [StringLength(5)] + public string LocationNo { get; set; } + + public List fqcDetails { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/FqcInhouseMaster.cs b/AMESCoreStudio.WebApi/Models/AMES/FqcInhouseMaster.cs index 6785690c..04f7e3d3 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/FqcInhouseMaster.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/FqcInhouseMaster.cs @@ -125,6 +125,16 @@ namespace AMESCoreStudio.WebApi.Models.AMES public string Location { get; set; } + /// + /// 庫別 + /// + [DataMember] + [Display(Name = "庫別")] + [Column("LOCATION_NO")] + [StringLength(5)] + public string LocationNo { get; set; } + + /// /// 抽驗標準ID ///