diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 4dec6c0e..79cc0af8 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -38,6 +38,7 @@ namespace AMESCoreStudio.Web.Controllers public readonly IPPS _ppsApi; public readonly IFQC _fqcApi; public readonly IKCS _kcsApi; + public readonly IBLL _bllApi; public readonly IFileServerProvider _fileServerProvider; private readonly IWebHostEnvironment _env; private readonly IStringLocalizer _sharedLocalizer; @@ -50,7 +51,7 @@ namespace AMESCoreStudio.Web.Controllers public PCSController(ILogger logger, ILogger log, ISYS sysApi, IPCS pcsApi, IBAS basApi, IPPS ppsApi, IFQC fqcApi , IFileServerProvider fileServerProvider, IWebHostEnvironment env, IKCS kcsApi, IStringLocalizer sharedLocalizer - , IConfiguration configuration) + , IConfiguration configuration, IBLL bllApi) { _logger = logger; _log = log; @@ -64,7 +65,7 @@ namespace AMESCoreStudio.Web.Controllers _env = env; _sharedLocalizer = sharedLocalizer; _configuration = configuration; - + _bllApi = bllApi; } #region Funcion BLL @@ -177,8 +178,8 @@ namespace AMESCoreStudio.Web.Controllers !string.IsNullOrWhiteSpace(model.Ec) || !string.IsNullOrWhiteSpace(model.OsVer) || !string.IsNullOrWhiteSpace(model.Jumper) || - !string.IsNullOrWhiteSpace(model.BabMemo)|| - !string.IsNullOrWhiteSpace(model.TestMemo)|| + !string.IsNullOrWhiteSpace(model.BabMemo) || + !string.IsNullOrWhiteSpace(model.TestMemo) || !string.IsNullOrWhiteSpace(model.PackingMemo)) { @@ -1457,14 +1458,14 @@ namespace AMESCoreStudio.Web.Controllers //public async Task GetKeyPartTypeByWip(string KeyPartMaterial, string KeyPartsType) //{ // var result = await _kcsApi.GetItems(); - + // if (KeyPartMaterial.ToUpper().Trim().StartsWith()) - + // return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } }); //} - //#endregion + #endregion [ResponseCache(Duration = 0)] [HttpGet] @@ -2625,6 +2626,13 @@ namespace AMESCoreStudio.Web.Controllers return View("PCS003", model); } + // 判斷標籤 工單性質選擇 WipAttr非標96工單時,則旁邊欄位必填 + if (model.wipLabel.WipAttr == "B" && string.IsNullOrWhiteSpace(model.wipLabel.NonstandardWoMemo)) + { + ModelState.AddModelError("error", "標籤:工單性質選擇非標96工單時,需填入資料"); + return View("PCS003", model); + } + // 判斷治具中生產單位與作業站吻合 var result_wipNo = await _pcsApi.GetWipInfoByWipNO(model.wipInfo.WipNO); foreach (var item in result_wipNo) @@ -2894,11 +2902,13 @@ namespace AMESCoreStudio.Web.Controllers if (action == "生管確認") { wipCheck.PMCUserID = UserID; + await CheckPCS003ToMail(model.wipInfo.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO, model.wipInfo.WipScheduleDate.ToString(), action); await _pcsApi.PutWipCheckByPMC(JsonConvert.SerializeObject(wipCheck)); } else if (action == "工程確認") { wipCheck.PEUserID = UserID; + await CheckPCS003ToMail(model.wipInfo.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO, model.wipInfo.WipScheduleDate.ToString(), action); await _pcsApi.PutWipCheckByPE(JsonConvert.SerializeObject(wipCheck)); } else if (action == "製造確認") @@ -2932,6 +2942,42 @@ namespace AMESCoreStudio.Web.Controllers } } + #region 自動寄信 + /// + /// 工單維護儲存時寄信通知 + /// + /// 工單號碼 + /// 工單料號 + /// 製程 + /// 預計開工日期 + /// 確認狀態 + /// + private async Task CheckPCS003ToMail(string WipNo, string Material, string Process, string StrDate, string ReviewType) + { + //工單Review,生管確認,完成後通知工程,mail群組名稱,請建立為[WOVIEW_PE] + //工單Review,工程確認,完成後通知製造,mail群組名稱,請建立為[WOVIEW_MF] + string MailGroup = string.Empty; + if (ReviewType == "生管確認") + MailGroup = "WOVIEW_PE"; + else + MailGroup = "WOVIEW_MF"; + + var result = await _basApi.GetFactoryUnits(); + Process = result.Where(w => w.UnitNo == Process).FirstOrDefault().UnitName; + + string Subject = $"[AMES系統通知] 工單:{WipNo},請工程單位進行確認"; + string Body = $@"說明:
+ 工單編號:{WipNo}
+ 生產料號:{Material}
+ 所屬製程:{Process}
+ 預計開工日:{StrDate}
+
{ReviewType}單位,已review完畢,請接續生產參數之確認"; + + await _bllApi.PostToMail(Subject, Body, MailGroup, "", false); + + } + #endregion + /// /// 工單資料畫面 Select All /// @@ -5309,7 +5355,7 @@ namespace AMESCoreStudio.Web.Controllers // 工程工單備註 var wipsystem = await _pcsApi.GetWipSystem(model.WipNO); if (wipsystem != null) - { + { model.SystemMemo = wipsystem.BabMemo; } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index ae25f095..a97b9c6b 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -868,6 +868,10 @@
+ +
+ +
@@ -1010,6 +1014,7 @@
+
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 0b650144..b5c9839e 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -885,6 +885,10 @@
+ +
+ +
@@ -895,7 +899,7 @@ -
+
@@ -1052,6 +1056,7 @@
+
diff --git a/AMESCoreStudio.WebApi/Enums/EnumPCS.cs b/AMESCoreStudio.WebApi/Enums/EnumPCS.cs index 26c5d7bc..075de1b7 100644 --- a/AMESCoreStudio.WebApi/Enums/EnumPCS.cs +++ b/AMESCoreStudio.WebApi/Enums/EnumPCS.cs @@ -54,6 +54,12 @@ namespace AMESCoreStudio.WebApi.Enum [Display(Name = "FCC")] FCC, + /// + /// CE/FCC + /// + [Display(Name = "CE/FCC")] + CE_FCC, + /// /// ROHS /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipLabel.cs b/AMESCoreStudio.WebApi/Models/AMES/WipLabel.cs index 39a9b9ec..4451e94c 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipLabel.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipLabel.cs @@ -67,6 +67,16 @@ namespace AMESCoreStudio.WebApi.Models.AMES public string Remarks { get; set; } + /// + /// 非標96工單說明 + /// + [Column("NONSTANDARD_WO_MEMO")] + [DataMember] + + public string NonstandardWoMemo { get; set; } + + + /// /// 建立UserID /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs index b65c603f..0ebeccbd 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs @@ -253,6 +253,15 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Display(Name = "DMI燒入")] public string DmiBi { get; set; } + /// + /// DMI燒入說明 + /// + [Column("DMI_BI_MEMO")] + [StringLength(200)] + [DataMember] + [Display(Name = "DMI燒入說明")] + public string DmiBiMemo { get; set; } + /// /// JUMPER設定 ///