|
@ -34,12 +34,14 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
public readonly IPCB _pcbApi; |
|
|
public readonly IPCB _pcbApi; |
|
|
private readonly IWebHostEnvironment _env; |
|
|
private readonly IWebHostEnvironment _env; |
|
|
public readonly IPCS _pcsApi; |
|
|
public readonly IPCS _pcsApi; |
|
|
public PCBController(ILogger<PCBController> logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi) |
|
|
public readonly IBLL _bllApi; |
|
|
|
|
|
public PCBController(ILogger<PCBController> logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi, IBLL bllApi) |
|
|
{ |
|
|
{ |
|
|
_logger = logger; |
|
|
_logger = logger; |
|
|
_pcbApi = pcbApi; |
|
|
_pcbApi = pcbApi; |
|
|
_env = env; |
|
|
_env = env; |
|
|
_pcsApi = pcsApi; |
|
|
_pcsApi = pcsApi; |
|
|
|
|
|
_bllApi = bllApi; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//#region 下拉選單
|
|
|
//#region 下拉選單
|
|
@ -158,8 +160,21 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
IResultModel result; |
|
|
IResultModel result; |
|
|
|
|
|
// 量測基準 35 小於通知寄信
|
|
|
|
|
|
if (double.Parse(model.Tension1) < 35 || double.Parse(model.Tension2) < 35 || double.Parse(model.Tension3) < 35 || |
|
|
|
|
|
double.Parse(model.Tension4) < 35 || double.Parse(model.Tension5) < 35) |
|
|
|
|
|
{ |
|
|
|
|
|
model.MeasureResult = "F"; |
|
|
|
|
|
//string Subject = $"FQC自動派送發信 FQC單號:{inhouseNo} 料號:{Material}";
|
|
|
|
|
|
//string Body = $@"FQC單號:{inhouseNo} 料號:{Material} <br/>
|
|
|
|
|
|
// 檢驗結果為:{Result}";
|
|
|
|
|
|
|
|
|
|
|
|
//await _bllApi.PostToMail(Subject, Body, string.Join(',', MailGroup), "", false, path);
|
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
model.MeasureResult = "P"; |
|
|
model.MeasureResult = "P"; |
|
|
|
|
|
} |
|
|
model.CreateUserID = GetLogInUserID(); |
|
|
model.CreateUserID = GetLogInUserID(); |
|
|
model.CreateDate = DateTime.Now; |
|
|
model.CreateDate = DateTime.Now; |
|
|
model.UpdateUserID = GetLogInUserID(); |
|
|
model.UpdateUserID = GetLogInUserID(); |
|
@ -249,9 +264,15 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public async Task<IActionResult> PCB014Async(SolderPasteInfo model) |
|
|
public async Task<IActionResult> PCB014Async(SolderPasteInfo model) |
|
|
{ |
|
|
{ |
|
|
if (ModelState.IsValid) |
|
|
// 日期判斷
|
|
|
|
|
|
if (model.EffectiveDate < model.ManufactoringDate) |
|
|
|
|
|
{ |
|
|
|
|
|
ModelState.AddModelError("error", "有效日期不能小於製造日期"); |
|
|
|
|
|
} |
|
|
|
|
|
else if (ModelState.IsValid) |
|
|
{ |
|
|
{ |
|
|
IResultModel result; |
|
|
IResultModel result; |
|
|
|
|
|
|
|
|
if (model.SolderPasteID == 0) |
|
|
if (model.SolderPasteID == 0) |
|
|
{ |
|
|
{ |
|
|
model.CreateUserID = GetLogInUserID(); |
|
|
model.CreateUserID = GetLogInUserID(); |
|
@ -274,11 +295,11 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (model.SolderPasteID == 0) |
|
|
if (model.SolderPasteID == 0) |
|
|
{ |
|
|
{ |
|
|
return View("PCB014C", model); |
|
|
return View("PCB014C", model); |
|
|