Browse Source

1. 修正工單鎖定查詢Bug

2. FQC抽驗附件可以下載檔案
3. 調整工單維護相關取MAC設定及畫面
PTD
ray 2 years ago
parent
commit
4b94eda8bf
  1. 41
      AMESCoreStudio.Web/Controllers/FQCController.cs
  2. 247
      AMESCoreStudio.Web/Controllers/PCSController.cs
  3. 2
      AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs
  4. 4
      AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs
  5. 13
      AMESCoreStudio.Web/Views/FQC/FQC007D.cshtml
  6. 4
      AMESCoreStudio.Web/Views/PCS/PCS001.cshtml
  7. 97
      AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml
  8. 57
      AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml
  9. 106
      AMESCoreStudio.Web/Views/PCS/PCS003.cshtml
  10. 74
      AMESCoreStudio.Web/Views/PCS/PCS034.cshtml
  11. 2
      AMESCoreStudio.WebApi/Controllers/AMES/MACInfoesController.cs
  12. 19
      AMESCoreStudio.WebApi/Controllers/AMES/WipLockController.cs
  13. 17
      AMESCoreStudio.WebApi/Controllers/AMES/WipMACController.cs
  14. 14
      AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs

41
AMESCoreStudio.Web/Controllers/FQCController.cs

@ -22,6 +22,7 @@ using System.ComponentModel.DataAnnotations;
using AspNetCore.Reporting; using AspNetCore.Reporting;
using System.Text.Encodings; using System.Text.Encodings;
using AMESCoreStudio.WebApi.Enum; using AMESCoreStudio.WebApi.Enum;
using Microsoft.AspNetCore.StaticFiles;
namespace AMESCoreStudio.Web.Controllers namespace AMESCoreStudio.Web.Controllers
{ {
@ -1537,6 +1538,46 @@ namespace AMESCoreStudio.Web.Controllers
model.fqcResultMasterBlobs = await _fqcApi.GetFqcResultMasterBlobByFqcID(model.FqcID); model.fqcResultMasterBlobs = await _fqcApi.GetFqcResultMasterBlobByFqcID(model.FqcID);
return View("FQC007D", model); return View("FQC007D", model);
} }
/// <summary>
/// 檔案下載
/// </summary>
/// <param name="Path">路徑</param>
/// <param name="FileName">檔名</param>
/// <returns></returns>
public async Task<IActionResult> FileDownload(string Path, string FileName)
{
var path = $@"{_env.WebRootPath}\{Path}{FileName}";
var memoryStream = new MemoryStream();
using (var stream = new FileStream(path, FileMode.Open))
{
await stream.CopyToAsync(memoryStream);
}
memoryStream.Seek(0, SeekOrigin.Begin);
string contentType = await GetFileContentTypeAsync(FileName);
// 回傳檔案到 Client 需要附上 Content Type,否則瀏覽器會解析失敗。
return File(memoryStream, contentType, FileName);
}
/// <summary>
/// 获取文件ContentType
/// </summary>
/// <param name="fileName">文件名称</param>
/// <returns></returns>
public async static Task<string> GetFileContentTypeAsync(string fileName)
{
return await Task.Run(() =>
{
string suffix = Path.GetExtension(fileName);
var provider = new FileExtensionContentTypeProvider();
if (suffix.ToUpper().Trim() == ".MSG")
{
return "application/octet-stream";
}
var contentType = provider.Mappings[suffix];
return contentType;
});
}
#endregion #endregion
#region 檢驗工項維護 #region 檢驗工項維護

247
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -139,11 +139,6 @@ namespace AMESCoreStudio.Web.Controllers
Msg += ",客戶序號未填完整"; Msg += ",客戶序號未填完整";
} }
// MAC
if (string.IsNullOrWhiteSpace(model.wipMAC.StartNO) != string.IsNullOrWhiteSpace(model.wipMAC.EndNO))
{
Msg += ",MAC未填完整";
}
if (!string.IsNullOrWhiteSpace(Msg)) if (!string.IsNullOrWhiteSpace(Msg))
Msg = "必填欄位未填寫:" + Msg.Substring(0, (Msg.Length - 1)); Msg = "必填欄位未填寫:" + Msg.Substring(0, (Msg.Length - 1));
@ -1616,13 +1611,6 @@ namespace AMESCoreStudio.Web.Controllers
model.ruleStations = await _pcsApi.GetRuleStationByWipNo(model.wipInfo.WipNO); model.ruleStations = await _pcsApi.GetRuleStationByWipNo(model.wipInfo.WipNO);
model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO);
if (model.wipMAC != null)
{
model.wipMAC.StartNO = model.wipMAC.Title + model.wipMAC.StartNO;
model.wipMAC.EndNO = model.wipMAC.Title + model.wipMAC.EndNO;
}
model.wipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.wipInfo.WipNO); model.wipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.wipInfo.WipNO);
model.WipKps = await _pcsApi.GetWipKpByWipNo(model.wipInfo.WipNO); model.WipKps = await _pcsApi.GetWipKpByWipNo(model.wipInfo.WipNO);
@ -1666,11 +1654,11 @@ namespace AMESCoreStudio.Web.Controllers
} }
// 判斷MAC是否正確 // 判斷MAC是否正確
var CheckMACMsg = CheckMACData(model); //var CheckMACMsg = CheckMACData(model);
if (!string.IsNullOrWhiteSpace(CheckMACMsg)) //if (!string.IsNullOrWhiteSpace(CheckMACMsg))
{ //{
Msg += CheckMACMsg; // Msg += CheckMACMsg;
} //}
if (!string.IsNullOrWhiteSpace(Msg)) if (!string.IsNullOrWhiteSpace(Msg))
{ {
@ -1760,33 +1748,6 @@ namespace AMESCoreStudio.Web.Controllers
// } // }
//} //}
// MAC
if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO))
{
if (model.wipMAC.StartNO.Length == 12)
{
model.wipMAC.Title = model.wipMAC.StartNO.Substring(0, 6).ToUpper();
model.wipMAC.StartNO = model.wipMAC.StartNO.Substring(model.wipMAC.StartNO.Length - 6, 6).ToUpper();
model.wipMAC.EndNO = model.wipMAC.EndNO.Substring(model.wipMAC.EndNO.Length - 6, 6).ToUpper();
// 確認MAC Table是否有料號資料
var mACInfo = await _pcsApi.GetMACInfo(model.wipAtt.ItemNO);
if (mACInfo != null)
{
model.wipMAC.ClassGroup = mACInfo.ClassGroup;
//result = await _pcsApi.PutMACInfoByClassGroup(mACInfo.ClassGroup, model.wipMAC.EndNO);
}
if (!string.IsNullOrWhiteSpace(model.wipMAC.WipNO))
result = await _pcsApi.PutWipMAC(JsonConvert.SerializeObject(model.wipMAC));
else
{
model.wipMAC.WipNO = model.wipInfo.WipNO;
model.wipMAC.CreateUserID = UserID;
result = await _pcsApi.PostWipMAC(JsonConvert.SerializeObject(model.wipMAC));
}
}
}
// 料號相關 // 料號相關
var materialItem = await _pcsApi.GetMaterialItemByItemNO(model.wipAtt.ItemNO); var materialItem = await _pcsApi.GetMaterialItemByItemNO(model.wipAtt.ItemNO);
@ -2143,21 +2104,6 @@ namespace AMESCoreStudio.Web.Controllers
} }
} }
// MAC
if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO))
{
var mACInfo = await _pcsApi.GetMACInfo(model.wipAtt.ItemNO);
if (mACInfo != null)
{
model.wipMAC.WipNO = model.wipInfo.WipNO;
model.wipMAC.Title = mACInfo.Title;
model.wipMAC.ClassGroup = mACInfo.ClassGroup;
model.wipMAC.CreateUserID = UserID;
result = await _pcsApi.PostWipMAC(JsonConvert.SerializeObject(model.wipMAC));
result = await _pcsApi.PutMACInfoByClassGroup(mACInfo.ClassGroup, model.wipMAC.EndNO);
}
}
// 料號相關 // 料號相關
var materialItem = await _pcsApi.GetMaterialItemByItemNO(model.wipAtt.ItemNO); var materialItem = await _pcsApi.GetMaterialItemByItemNO(model.wipAtt.ItemNO);
if (materialItem != null) if (materialItem != null)
@ -2279,7 +2225,7 @@ namespace AMESCoreStudio.Web.Controllers
model.wipSystem = await _pcsApi.GetWipSystem(model.wipInfo.WipNO); model.wipSystem = await _pcsApi.GetWipSystem(model.wipInfo.WipNO);
model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO);
model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO);
@ -2372,12 +2318,7 @@ namespace AMESCoreStudio.Web.Controllers
} }
} }
model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO);
if (model.wipMAC != null)
{
model.wipMAC.StartNO = model.wipMAC.Title + model.wipMAC.StartNO;
model.wipMAC.EndNO = model.wipMAC.Title + model.wipMAC.EndNO;
}
model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO);
@ -2523,12 +2464,7 @@ namespace AMESCoreStudio.Web.Controllers
} }
} }
model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO);
if (model.wipMAC != null)
{
model.wipMAC.StartNO = model.wipMAC.Title + model.wipMAC.StartNO;
model.wipMAC.EndNO = model.wipMAC.Title + model.wipMAC.EndNO;
}
model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO);
@ -2615,7 +2551,6 @@ namespace AMESCoreStudio.Web.Controllers
wipDataViewModel.wipInfo = model.wipInfo; wipDataViewModel.wipInfo = model.wipInfo;
wipDataViewModel.wipSystem = model.wipSystem; wipDataViewModel.wipSystem = model.wipSystem;
wipDataViewModel.wipBoard = model.wipBoard; wipDataViewModel.wipBoard = model.wipBoard;
wipDataViewModel.wipMAC = model.wipMAC;
wipDataViewModel.wipBarcodeOther = model.wipBarcodeOther; wipDataViewModel.wipBarcodeOther = model.wipBarcodeOther;
var Msg = CheckWipInfoInsert(wipDataViewModel); var Msg = CheckWipInfoInsert(wipDataViewModel);
@ -2644,12 +2579,12 @@ namespace AMESCoreStudio.Web.Controllers
Msg += ",SOP文件 請填寫SOP文件敘述 "; Msg += ",SOP文件 請填寫SOP文件敘述 ";
} }
// 判斷MAC是否正確 //// 判斷MAC是否正確
var CheckMACMsg = CheckMACData(model); //var CheckMACMsg = CheckMACData(model);
if (!string.IsNullOrWhiteSpace(CheckMACMsg)) //if (!string.IsNullOrWhiteSpace(CheckMACMsg))
{ //{
Msg += "," + CheckMACMsg; // Msg += "," + CheckMACMsg;
} //}
// 判斷標籤 工單性質選擇 WipAttr非標96工單時,則旁邊欄位必填 // 判斷標籤 工單性質選擇 WipAttr非標96工單時,則旁邊欄位必填
if (model.wipLabel.WipAttr == "B" && string.IsNullOrWhiteSpace(model.wipLabel.NonstandardWoMemo)) if (model.wipLabel.WipAttr == "B" && string.IsNullOrWhiteSpace(model.wipLabel.NonstandardWoMemo))
@ -3078,12 +3013,7 @@ namespace AMESCoreStudio.Web.Controllers
} }
} }
model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO);
if (model.wipMAC != null)
{
model.wipMAC.StartNO = model.wipMAC.Title + model.wipMAC.StartNO;
model.wipMAC.EndNO = model.wipMAC.Title + model.wipMAC.EndNO;
}
model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO);
@ -3169,7 +3099,6 @@ namespace AMESCoreStudio.Web.Controllers
wipDataViewModel.wipInfo = model.wipInfo; wipDataViewModel.wipInfo = model.wipInfo;
wipDataViewModel.wipSystem = model.wipSystem; wipDataViewModel.wipSystem = model.wipSystem;
wipDataViewModel.wipBoard = model.wipBoard; wipDataViewModel.wipBoard = model.wipBoard;
wipDataViewModel.wipMAC = model.wipMAC;
wipDataViewModel.wipBarcodeOther = model.wipBarcodeOther; wipDataViewModel.wipBarcodeOther = model.wipBarcodeOther;
var Msg = CheckWipInfoInsert(wipDataViewModel); var Msg = CheckWipInfoInsert(wipDataViewModel);
@ -3185,12 +3114,12 @@ namespace AMESCoreStudio.Web.Controllers
Msg += ",SOP文件 請填寫SOP文件敘述 "; Msg += ",SOP文件 請填寫SOP文件敘述 ";
} }
// 判斷MAC是否正確 //// 判斷MAC是否正確
var CheckMACMsg = CheckMACData(model); //var CheckMACMsg = CheckMACData(model);
if (!string.IsNullOrWhiteSpace(CheckMACMsg)) //if (!string.IsNullOrWhiteSpace(CheckMACMsg))
{ //{
Msg += "," + CheckMACMsg; // Msg += "," + CheckMACMsg;
} //}
// 判斷標籤 工單性質選擇 WipAttr非標96工單時,則旁邊欄位必填 // 判斷標籤 工單性質選擇 WipAttr非標96工單時,則旁邊欄位必填
if (model.wipLabel.WipAttr == "B" && string.IsNullOrWhiteSpace(model.wipLabel.NonstandardWoMemo)) if (model.wipLabel.WipAttr == "B" && string.IsNullOrWhiteSpace(model.wipLabel.NonstandardWoMemo))
@ -3382,54 +3311,68 @@ namespace AMESCoreStudio.Web.Controllers
/// <returns></returns> /// <returns></returns>
public string CheckMACData(WipDataViewModel model) public string CheckMACData(WipDataViewModel model)
{ {
if (model.wipMAC == null)
return ""; return "";
string StartNO = model.wipMAC.StartNO ?? ""; //if (model.wipMAC == null)
string EndNO = model.wipMAC.EndNO ?? ""; // return "";
// 資料為空
if (string.IsNullOrWhiteSpace(StartNO) && string.IsNullOrWhiteSpace(EndNO))
return "";
if (StartNO.Length != 12 || EndNO.Length != 12) //string StartNO = model.wipMAC.StartNO ?? "";
return "MAC長度有誤"; //string EndNO = model.wipMAC.EndNO ?? "";
//// 資料為空
//if (string.IsNullOrWhiteSpace(StartNO) && string.IsNullOrWhiteSpace(EndNO))
// return "";
if (StartNO.ToUpper().Substring(0, 6) != EndNO.ToUpper().Substring(0, 6)) //if (StartNO.Length != 12 || EndNO.Length != 12)
return "MAC前綴不一樣"; // return "MAC長度有誤";
// 轉十進位 //if (StartNO.ToUpper().Substring(0, 6) != EndNO.ToUpper().Substring(0, 6))
var Entire = new Code.Entire(); // return "MAC前綴不一樣";
try
{
// 最小值
var StartNONum = int.Parse(Entire.DecHex(StartNO.Substring(StartNO.Length - 6, 6), "HexToDec"));
// 最大值
var EndNONum = int.Parse(Entire.DecHex(EndNO.Substring(EndNO.Length - 6, 6), "HexToDec"));
// 取MAC區間小於工單數 //// 轉十進位
if (EndNONum - StartNONum + 1 < model.wipInfo.PlanQTY) //var Entire = new Code.Entire();
return "MAC區間小於工單數量"; //try
//{
// // 最小值
// var StartNONum = int.Parse(Entire.DecHex(StartNO.Substring(StartNO.Length - 6, 6), "HexToDec"));
// // 最大值
// var EndNONum = int.Parse(Entire.DecHex(EndNO.Substring(EndNO.Length - 6, 6), "HexToDec"));
// 判斷MAC區間是否有重複使用 // // 取MAC區間小於工單數
var result = _pcsApi.GetCheckMAC(model.wipInfo.WipNO, StartNO, EndNO).InvokeAsync().Result; // if (EndNONum - StartNONum + 1 < model.wipInfo.PlanQTY)
// return "MAC區間小於工單數量";
if (!result.Success) // // 判斷MAC區間是否有重複使用
return result.Msg; // var result = _pcsApi.GetCheckMAC(model.wipInfo.WipNO, StartNO, EndNO).InvokeAsync().Result;
else
return ""; // if (!result.Success)
} // return result.Msg;
catch // else
{ // return "";
return "MAC後6碼格式有誤"; //}
} //catch
//{
// return "MAC後6碼格式有誤";
//}
} }
public async Task<JsonResult> GetMAC(string itemno, int planQTY) public async Task<JsonResult> GetMAC(string itemno, string wipNo , int planQTY)
{ {
var q = await _pcsApi.GetMACInfo(itemno); var q = await _pcsApi.GetMACInfo(itemno);
if (q != null) if (q != null)
{ {
// 工單數量*單板MAC數
var MacQty = planQTY * q.Qty;
var wipMAC = await _pcsApi.GetWipMAC(wipNo);
var getWipMacQty = wipMAC.Select(s => s.Qty).Sum();
// 判斷目前工單數量*單板MAC數 == DB已記使用MAC數量
if (planQTY * q.Qty <= getWipMacQty)
{
return Json(new { _msg = "已取滿MAC數量,請在確認" });
}
MacQty = MacQty - getWipMacQty;
// 當前值 16 進位 // 當前值 16 進位
var Value = q.Value; var Value = q.Value;
@ -3438,7 +3381,7 @@ namespace AMESCoreStudio.Web.Controllers
// 最小值 // 最小值
var Mix = (int.Parse(Entire.DecHex(Value, "HexToDec")) + 1); var Mix = (int.Parse(Entire.DecHex(Value, "HexToDec")) + 1);
// 最大值 // 最大值
var Max = (int.Parse(Entire.DecHex(Value, "HexToDec")) + planQTY * q.Qty); var Max = (int.Parse(Entire.DecHex(Value, "HexToDec")) + MacQty);
// 當最大值 > DB設定最大值 // 當最大值 > DB設定最大值
if (Max > int.Parse(Entire.DecHex(q.Max.ToString(), "HexToDec"))) if (Max > int.Parse(Entire.DecHex(q.Max.ToString(), "HexToDec")))
@ -3454,10 +3397,25 @@ namespace AMESCoreStudio.Web.Controllers
} }
var MACstr = q.Title + Entire.DecHex(Mix.ToString(), "DecToHex").ToUpper();
var MACend = q.Title + Entire.DecHex(Max.ToString(), "DecToHex").ToUpper();
// 新增WipMAC
var model = new WipMAC();
model.StartNO = Entire.DecHex(Mix.ToString(), "DecToHex").ToUpper();
model.EndNO = Entire.DecHex(Max.ToString(), "DecToHex").ToUpper();
model.Qty = MacQty;
model.WipNO = wipNo;
model.Title = q.Title;
model.ClassGroup = q.ClassGroup;
model.CreateUserID = GetLogInUserID();
var result = await _pcsApi.PostWipMAC(JsonConvert.SerializeObject(model));
await _pcsApi.PutMACInfoByClassGroup(q.ClassGroup, Entire.DecHex(Max.ToString(), "DecToHex").ToUpper());
var x = new var x = new
{ {
mix = q.Title + Entire.DecHex(Mix.ToString(), "DecToHex").ToUpper(), mix = MACstr,
max = q.Title + Entire.DecHex(Max.ToString(), "DecToHex").ToUpper(), max = MACend,
}; };
return Json(x); return Json(x);
} }
@ -4547,7 +4505,7 @@ namespace AMESCoreStudio.Web.Controllers
result.BoxNo = result_barcodeinfo.BoxNo; result.BoxNo = result_barcodeinfo.BoxNo;
result.StatusNo = result_barcodeinfo.StatusNo; result.StatusNo = result_barcodeinfo.StatusNo;
// 取入庫單號 // 取入庫單號
if(!string.IsNullOrWhiteSpace(result.BoxNo)) if (!string.IsNullOrWhiteSpace(result.BoxNo))
{ {
var FqcInhouse = await _pcsApi.GetFqcInhouseDetailBySerialNo(result.BoxNo); var FqcInhouse = await _pcsApi.GetFqcInhouseDetailBySerialNo(result.BoxNo);
if (FqcInhouse.Count() != 0) if (FqcInhouse.Count() != 0)
@ -8205,37 +8163,6 @@ namespace AMESCoreStudio.Web.Controllers
} }
} }
// 工單MAC WipMAC
if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO))
{
if (model.wipMAC.StartNO.Length == 12)
{
model.wipMAC.Title = model.wipMAC.StartNO.Substring(0, 6).ToUpper();
model.wipMAC.StartNO = model.wipMAC.StartNO.Substring(model.wipMAC.StartNO.Length - 6, 6).ToUpper();
model.wipMAC.EndNO = model.wipMAC.EndNO.Substring(model.wipMAC.EndNO.Length - 6, 6).ToUpper();
// 確認MAC Table是否有料號資料
var mACInfo = await _pcsApi.GetMACInfo(model.wipAtt.ItemNO);
if (mACInfo != null)
{
model.wipMAC.ClassGroup = mACInfo.ClassGroup;
}
if (!string.IsNullOrWhiteSpace(model.wipMAC.WipNO))
result = await _pcsApi.PutWipMAC(JsonConvert.SerializeObject(model.wipMAC));
else
{
model.wipMAC.WipNO = model.wipInfo.WipNO;
model.wipMAC.CreateUserID = UserID;
result = await _pcsApi.PostWipMAC(JsonConvert.SerializeObject(model.wipMAC));
}
if (!result.Success)
{
Msg += result.Msg;
}
}
}
// 工單 KeyParts WipKp // 工單 KeyParts WipKp
// 判斷料號KP有資料 沒有資料時 一起新增到料號KP // 判斷料號KP有資料 沒有資料時 一起新增到料號KP

2
AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs

@ -238,7 +238,7 @@ namespace AMESCoreStudio.Web
#region WipMAC 工單MAC資料檔 PCS001 #region WipMAC 工單MAC資料檔 PCS001
[WebApiClient.Attributes.HttpGet("api/WipMAC/{id}")] [WebApiClient.Attributes.HttpGet("api/WipMAC/{id}")]
ITask<WipMAC> GetWipMAC(string id); ITask<List<WipMAC>> GetWipMAC(string id);
[WebApiClient.Attributes.HttpGet("api/WipMAC/CheckMAC/{id}/{startNo}/{endNo}")] [WebApiClient.Attributes.HttpGet("api/WipMAC/CheckMAC/{id}/{startNo}/{endNo}")]
ITask<ResultModel<WipMAC>> GetCheckMAC(string id, string startNo, string endNo); ITask<ResultModel<WipMAC>> GetCheckMAC(string id, string startNo, string endNo);

4
AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs

@ -20,7 +20,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS
WipSops = new List<WipSopDto>(); WipSops = new List<WipSopDto>();
WipOutfits = new List<WipOutfitDto>(); WipOutfits = new List<WipOutfitDto>();
wipInfoBlobs = new List<WipInfoBlob>(); wipInfoBlobs = new List<WipInfoBlob>();
wipMAC = new WipMAC(); wipMACs = new List<WipMAC>();
wipBarcodeOther = new WipBarcodeOther(); wipBarcodeOther = new WipBarcodeOther();
} }
@ -74,7 +74,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS
/// <summary> /// <summary>
/// MAC /// MAC
/// </summary> /// </summary>
public WipMAC wipMAC { get; set; } public IEnumerable<WipMAC> wipMACs { get; set; }
/// <summary> /// <summary>
/// 條碼區間設定 /// 條碼區間設定

13
AMESCoreStudio.Web/Views/FQC/FQC007D.cshtml

@ -13,6 +13,7 @@
<div asp-validation-summary="ModelOnly" class="text-danger"></div> <div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="layui-card-body"> <div class="layui-card-body">
<input type="hidden" asp-for="FqcID" value="@Model.FqcID" /> <input type="hidden" asp-for="FqcID" value="@Model.FqcID" />
<span style="color:red">**預覽只能顯示圖檔、PDF、文字檔**</span>
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3" id="error"></span> <span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3" id="error"></span>
<table lay-filter="demo" class="layui-table"> <table lay-filter="demo" class="layui-table">
<thead> <thead>
@ -20,6 +21,7 @@
<th lay-data="{field:'username', width:100}">檔案名稱</th> <th lay-data="{field:'username', width:100}">檔案名稱</th>
<th lay-data="{field:'experience', width:80, sort:true}">檔案路徑</th> <th lay-data="{field:'experience', width:80, sort:true}">檔案路徑</th>
<th lay-data="{field:'right', width:80, sort:true}">預覽</th> <th lay-data="{field:'right', width:80, sort:true}">預覽</th>
<th lay-data="{field:'right', width:80, sort:true}">下載</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -35,6 +37,9 @@
<td> <td>
<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" onclick="show(this)">預覽</a> <a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" onclick="show(this)">預覽</a>
</td> </td>
<td>
<a class="layui-btn layui-btn-normal layui-btn-xs" onclick="filedownload(this)">下載</a>
</td>
</tr> </tr>
} }
</tbody> </tbody>
@ -86,6 +91,14 @@
}); });
}; };
// 檔案下載
function filedownload(obj) {
var Path = $(obj).closest("TR").find('span[id*=Filepath]').text();
var FileName = $(obj).closest("TR").find('span[id*=FileName]').text();
filePath = `/PCS/FileDownload?Path=${Path}&FileName=${FileName}`;
$(obj).attr("href", filePath);
};
$(document).ready(function () { $(document).ready(function () {
var error = '@Html.ValidationMessage("error")'; var error = '@Html.ValidationMessage("error")';
if ($(error).text() != '') { if ($(error).text() != '') {

4
AMESCoreStudio.Web/Views/PCS/PCS001.cshtml

@ -263,7 +263,7 @@
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> @*<div class="layui-inline">
<label class="layui-form-label">MAC</label> <label class="layui-form-label">MAC</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input asp-for="wipMAC.StartNO" readonly class="layui-input" /> <input asp-for="wipMAC.StartNO" readonly class="layui-input" />
@ -275,7 +275,7 @@
<div class="layui-input-inline"> <div class="layui-input-inline">
<input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" /> <input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" />
</div> </div>
</div> </div>*@
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">

97
AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml

@ -217,23 +217,38 @@
<div class="layui-tab-item"> <div class="layui-tab-item">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">生產序號</label> <label class="layui-form-label" style="font-weight: bold;">生產序號</label>
<div class="layui-input-inline"> <table id="MydataTable" class="layui-table">
<input asp-for="wipBarcode.StartNO" class="layui-input" /> <thead>
</div> <tr>
<div class="layui-form-mid">-</div> <th>
<div class="layui-input-inline"> 起始生產序號
<input asp-for="wipBarcode.EndNO" class="layui-input" /> </th>
</div>
<div class="layui-input-inline"> <th>
<input id="GetBarCode" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生條碼" /> 結束生產序號
</div> </th>
</tr>
</thead>
<tbody>
@foreach (var index in Model.wipBarcodes)
{
<tr>
<td>
@index.StartNO
</td>
<td>
@index.EndNO
</td>
</tr>
}
</tbody>
</table>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">出貨序號</label> <label class="layui-form-label" style="font-weight: bold;">出貨序號</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input asp-for="wipBarcodeOther.StartNO" class="layui-input" readonly="readonly" /> <input asp-for="wipBarcodeOther.StartNO" class="layui-input" readonly="readonly" />
</div> </div>
@ -252,20 +267,38 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">MAC</label> <label class="layui-form-label" style="font-weight: bold;">MAC</label>
<div class="layui-input-inline">
<input asp-for="wipMAC.StartNO" class="layui-input" />
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input asp-for="wipMAC.EndNO" class="layui-input" />
</div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" /> <input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" />
</div> </div>
<input type="hidden" value=@Model.wipMACs.Count() id="WipMacCount" />
<table id="MACTable" class="layui-table">
<thead>
<tr>
<th>
MAC區間起
</th>
<th>
MAC區間迄
</th>
</tr>
</thead>
<tbody>
@foreach (var index in Model.wipMACs)
{
<tr>
<td>
@index.Title@index.StartNO
</td>
<td>
@index.Title@index.EndNO
</td>
</tr>
}
</tbody>
</table>
</div> </div>
</div> </div>
@ -403,11 +436,6 @@
$("#barcodeOtherDiv").hide(); $("#barcodeOtherDiv").hide();
} }
// DIV MAC
if ($('#wipMAC_StartNO').val() != "" && $('#wipMAC_EndNO').val() != "") {
$("#GetMAC").hide();
}
getLineInfoList($("#unit").val()); getLineInfoList($("#unit").val());
// 產生條碼 // 產生條碼
@ -482,7 +510,7 @@
var wipNO = $('#wipAtt_ItemNO').val(); var wipNO = $('#wipAtt_ItemNO').val();
var planQTY = $('#wipInfo_PlanQTY').val(); var planQTY = $('#wipInfo_PlanQTY').val();
if (wipNO == '' || !wipNO) { if (wipNO == '' || !wipNO) {
parent.hg.msg("請輸入工單號碼"); parent.hg.msg("請輸入料號");
return; return;
} }
if (planQTY == '' || !planQTY || planQTY == 0) { if (planQTY == '' || !planQTY || planQTY == 0) {
@ -492,19 +520,18 @@
$.ajax({ $.ajax({
url: '@Url.Action("GetMAC", "PCS")', url: '@Url.Action("GetMAC", "PCS")',
dataType: 'json', dataType: 'json',
data: { "itemno": $("#wipAtt_ItemNO").val(), "planQTY": $('#wipInfo_PlanQTY').val() }, data: { "itemno": $("#wipAtt_ItemNO").val(), "wipNo": $('#wipInfo_WipNO').val() ,"planQTY": $('#wipInfo_PlanQTY').val() },
cache: false, cache: false,
type: "POST", type: "POST",
success: function (data, textStatus, jqXHR) { success: function (data, textStatus, jqXHR) {
if (data._msg != undefined) { if (data._msg != undefined) {
parent.hg.msg(data._msg); parent.hg.msg(data._msg);
} }
else else {
{ var contactdiv = '<tr>' +
$("#wipMAC_StartNO").val(data.mix); `<td>${data.mix}</td>
$("#wipMAC_EndNO").val(data.max); <td>${data.max}</td></tr>`;
$("#wipMAC_StartNO").attr("readonly", "readonly"); $('#MACTable').append(contactdiv);
$("#wipMAC_EndNO").attr("readonly", "readonly");
} }
}, },
error: function (jqXHR, textStatus, errorThrown) { error: function (jqXHR, textStatus, errorThrown) {

57
AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml

@ -228,7 +228,9 @@
@* 序號編碼sheet *@ @* 序號編碼sheet *@
<div class="layui-tab-item"> <div class="layui-tab-item">
<label class="layui-form-label">生產序號</label> <div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" style="font-weight: bold;">生產序號</label>
<table id="MydataTable" class="layui-table"> <table id="MydataTable" class="layui-table">
<thead> <thead>
<tr> <tr>
@ -255,6 +257,8 @@
} }
</tbody> </tbody>
</table> </table>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
@ -271,14 +275,33 @@
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">MAC</label> <label class="layui-form-label" style="font-weight: bold;">MAC</label>
<div class="layui-input-inline"> <input type="hidden" value=@Model.wipMACs.Count() id="WipMacCount" />
<input asp-for="wipMAC.StartNO" class="layui-input" /> <table id="MACTable" class="layui-table">
</div> <thead>
<div class="layui-form-mid">-</div> <tr>
<div class="layui-input-inline"> <th>
<input asp-for="wipMAC.EndNO" class="layui-input" /> MAC區間起
</div> </th>
<th>
MAC區間迄
</th>
</tr>
</thead>
<tbody>
@foreach (var index in Model.wipMACs)
{
<tr>
<td>
@index.Title@index.StartNO
</td>
<td>
@index.Title@index.EndNO
</td>
</tr>
}
</tbody>
</table>
</div> </div>
</div> </div>
@ -489,9 +512,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">燒錄</label> <label class="layui-form-label">燒錄</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.Burn == "Y" ? "checked" : "") } type="checkbox" title="是否燒入" name="wipBoard.Burn" />
@(Model.wipBoard.Burn == "Y" ? "checked" : "")
} type="checkbox" title="是否燒入" name="wipBoard.Burn" />
</div> </div>
<label class="layui-form-label">燒機位置</label> <label class="layui-form-label">燒機位置</label>
@ -512,9 +533,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">零件烘烤</label> <label class="layui-form-label">零件烘烤</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "") } type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
@(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "")
} type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
</div> </div>
<label class="layui-form-label">零件烘烤溫度</label> <label class="layui-form-label">零件烘烤溫度</label>
<div class="layui-input-inline" style="width:100px"> <div class="layui-input-inline" style="width:100px">
@ -527,9 +546,7 @@
</div> </div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.PartsBakeOvertime == "Y" ? "checked" : "") } type="checkbox" title="零件烘烤超過48hrs" name="wipBoard.PartsBakeOvertime" />
@(Model.wipBoard.PartsBakeOvertime == "Y" ? "checked" : "")
} type="checkbox" title="零件烘烤超過48hrs" name="wipBoard.PartsBakeOvertime" />
</div> </div>
</div> </div>
</div> </div>
@ -545,9 +562,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">PCB烘烤</label> <label class="layui-form-label">PCB烘烤</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.ISPcbBake == "Y" ? "checked" : "") } type="checkbox" title="PCB是否需要烘烤" name="wipBoard.ISPcbBake" />
@(Model.wipBoard.ISPcbBake == "Y" ? "checked" : "")
} type="checkbox" title="PCB是否需要烘烤" name="wipBoard.ISPcbBake" />
</div> </div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select disabled asp-items="@ViewBag.GetPCBBakeTypeSelect" asp-for="wipBoard.PcbBake" class=""></select> <select disabled asp-items="@ViewBag.GetPCBBakeTypeSelect" asp-for="wipBoard.PcbBake" class=""></select>

106
AMESCoreStudio.Web/Views/PCS/PCS003.cshtml

@ -30,9 +30,7 @@
<input asp-for="wipBarcodeOther.OtherID" type="hidden" value="@if(Model.wipBarcodeOther != null){ <input asp-for="wipBarcodeOther.OtherID" type="hidden" value="@if(Model.wipBarcodeOther != null){
@Model.wipBarcodeOther.OtherID @Model.wipBarcodeOther.OtherID
}" /> }" />
<input asp-for="wipMAC.WipNO" type="hidden" value="@if(Model.wipMAC != null){
@Model.wipMAC.WipNO
}" />
<div class="layui-form-item " style="padding-left:30px"> <div class="layui-form-item " style="padding-left:30px">
<input @(Model.wipInfo.InputFlag == "Y" ? "checked" : "") type="checkbox" name="wipInfo.InputFlag" title="判斷前製程是否已經投入" /> <input @(Model.wipInfo.InputFlag == "Y" ? "checked" : "") type="checkbox" name="wipInfo.InputFlag" title="判斷前製程是否已經投入" />
</div> </div>
@ -231,7 +229,9 @@
@* 序號編碼sheet *@ @* 序號編碼sheet *@
<div class="layui-tab-item"> <div class="layui-tab-item">
<label class="layui-form-label">生產序號</label> <div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" style="font-weight: bold;">生產序號</label>
<table id="MydataTable" class="layui-table"> <table id="MydataTable" class="layui-table">
<thead> <thead>
<tr> <tr>
@ -258,25 +258,11 @@
} }
</tbody> </tbody>
</table> </table>
@*<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">生產序號</label>
<div class="layui-input-inline">
<input asp-for="wipBarcode.StartNO" class="layui-input" />
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input asp-for="wipBarcode.EndNO" class="layui-input" />
</div>
<div class="layui-input-inline">
<input id="GetBarCode" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生條碼" />
</div> </div>
</div> </div>
</div>*@
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">出貨序號</label> <label class="layui-form-label" style="font-weight: bold;">出貨序號</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input asp-for="wipBarcodeOther.StartNO" class="layui-input" readonly="readonly" /> <input asp-for="wipBarcodeOther.StartNO" class="layui-input" readonly="readonly" />
</div> </div>
@ -295,20 +281,38 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">MAC</label> <label class="layui-form-label" style="font-weight: bold;">MAC</label>
<div class="layui-input-inline">
<input asp-for="wipMAC.StartNO" class="layui-input" />
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input asp-for="wipMAC.EndNO" class="layui-input" />
</div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" /> <input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" />
</div> </div>
<input type="hidden" value=@Model.wipMACs.Count() id="WipMacCount" />
<table id="MACTable" class="layui-table">
<thead>
<tr>
<th>
MAC區間起
</th>
<th>
MAC區間迄
</th>
</tr>
</thead>
<tbody>
@foreach (var index in Model.wipMACs)
{
<tr>
<td>
@index.Title@index.StartNO
</td>
<td>
@index.Title@index.EndNO
</td>
</tr>
}
</tbody>
</table>
</div> </div>
</div> </div>
@ -491,15 +495,9 @@
<label class="layui-form-label">DIP</label> <label class="layui-form-label">DIP</label>
<div class="layui-input-block"> <div class="layui-input-block">
<cl-checkbox asp-items="@ViewBag.GetCheckboxDIP" asp-for="wipBoard.DipSides" asp-skin="defult"></cl-checkbox> <cl-checkbox asp-items="@ViewBag.GetCheckboxDIP" asp-for="wipBoard.DipSides" asp-skin="defult"></cl-checkbox>
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipCarrier == "Y" ? "checked" : "") } type="checkbox" title="CARRIER" name="wipBoard.DipCarrier" />
@(Model.wipBoard.DipCarrier == "Y" ? "checked" : "") <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipTape == "Y" ? "checked" : "") } type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
} type="checkbox" title="CARRIER" name="wipBoard.DipCarrier" /> <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipSolderMask == "Y" ? "checked" : "") } type="checkbox" title="點防焊膠" name="wipBoard.DipSolderMask" />
<input @if (Model.wipBoard != null) {
@(Model.wipBoard.DipTape == "Y" ? "checked" : "")
} type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
<input @if (Model.wipBoard != null) {
@(Model.wipBoard.DipSolderMask == "Y" ? "checked" : "")
} type="checkbox" title="點防焊膠" name="wipBoard.DipSolderMask" />
</div> </div>
</div> </div>
</div> </div>
@ -515,9 +513,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">燒錄</label> <label class="layui-form-label">燒錄</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.Burn == "Y" ? "checked" : "") } type="checkbox" title="是否燒入" name="wipBoard.Burn" />
@(Model.wipBoard.Burn == "Y" ? "checked" : "")
} type="checkbox" title="是否燒入" name="wipBoard.Burn" />
</div> </div>
<label class="layui-form-label">燒機位置</label> <label class="layui-form-label">燒機位置</label>
@ -538,9 +534,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">零件烘烤</label> <label class="layui-form-label">零件烘烤</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "") } type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
@(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "")
} type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
</div> </div>
<label class="layui-form-label">零件烘烤溫度</label> <label class="layui-form-label">零件烘烤溫度</label>
<div class="layui-input-inline" style="width:100px"> <div class="layui-input-inline" style="width:100px">
@ -553,9 +547,7 @@
</div> </div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.PartsBakeOvertime == "Y" ? "checked" : "") } type="checkbox" title="零件烘烤超過48hrs" name="wipBoard.PartsBakeOvertime" />
@(Model.wipBoard.PartsBakeOvertime == "Y" ? "checked" : "")
} type="checkbox" title="零件烘烤超過48hrs" name="wipBoard.PartsBakeOvertime" />
</div> </div>
</div> </div>
</div> </div>
@ -571,9 +563,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">PCB烘烤</label> <label class="layui-form-label">PCB烘烤</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipBoard != null) { <input @if (Model.wipBoard != null) { @(Model.wipBoard.ISPcbBake == "Y" ? "checked" : "") } type="checkbox" title="PCB是否需要烘烤" name="wipBoard.ISPcbBake" />
@(Model.wipBoard.ISPcbBake == "Y" ? "checked" : "")
} type="checkbox" title="PCB是否需要烘烤" name="wipBoard.ISPcbBake" />
</div> </div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select asp-items="@ViewBag.GetPCBBakeTypeSelect" asp-for="wipBoard.PcbBake" class=""></select> <select asp-items="@ViewBag.GetPCBBakeTypeSelect" asp-for="wipBoard.PcbBake" class=""></select>
@ -879,9 +869,7 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">FINE_PACKAGE</label> <label class="layui-form-label">FINE_PACKAGE</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input @if (Model.wipSystem != null) { <input @if (Model.wipSystem != null) { @(Model.wipSystem.FinePackage == "Y" ? "checked" : "") } type="checkbox" title="是否為精裝" name="wipSystem.FinePackage" />
@(Model.wipSystem.FinePackage == "Y" ? "checked" : "")
} type="checkbox" title="是否為精裝" name="wipSystem.FinePackage" />
</div> </div>
</div> </div>
</div> </div>
@ -1177,10 +1165,6 @@
// $("#barcodeOtherDiv").hide(); // $("#barcodeOtherDiv").hide();
//} //}
// DIV MAC
if ($('#wipMAC_StartNO').val() != "" && $('#wipMAC_EndNO').val() != "") {
$("#GetMAC").hide();
}
// DIV keyPartsExcel // DIV keyPartsExcel
@if (Model.wipInfo.WipNO.StartsWith("981")) @if (Model.wipInfo.WipNO.StartsWith("981"))
@ -1307,7 +1291,7 @@
$.ajax({ $.ajax({
url: '@Url.Action("GetMAC", "PCS")', url: '@Url.Action("GetMAC", "PCS")',
dataType: 'json', dataType: 'json',
data: { "itemno": $("#wipAtt_ItemNO").val(), "planQTY": $('#wipInfo_PlanQTY').val() }, data: { "itemno": $("#wipAtt_ItemNO").val(), "wipNo": $('#wipInfo_WipNO').val() ,"planQTY": $('#wipInfo_PlanQTY').val() },
cache: false, cache: false,
type: "POST", type: "POST",
success: function (data, textStatus, jqXHR) { success: function (data, textStatus, jqXHR) {
@ -1315,10 +1299,10 @@
parent.hg.msg(data._msg); parent.hg.msg(data._msg);
} }
else { else {
$("#wipMAC_StartNO").val(data.mix); var contactdiv = '<tr>' +
$("#wipMAC_EndNO").val(data.max); `<td>${data.mix}</td>
$("#wipMAC_StartNO").attr("readonly", "readonly"); <td>${data.max}</td></tr>`;
$("#wipMAC_EndNO").attr("readonly", "readonly"); $('#MACTable').append(contactdiv);
} }
}, },
error: function (jqXHR, textStatus, errorThrown) { error: function (jqXHR, textStatus, errorThrown) {

74
AMESCoreStudio.Web/Views/PCS/PCS034.cshtml

@ -32,9 +32,6 @@
<input asp-for="wipInfo.CompleteQTY" type="hidden" value="@Model.wipInfo.CompleteQTY" /> <input asp-for="wipInfo.CompleteQTY" type="hidden" value="@Model.wipInfo.CompleteQTY" />
<input asp-for="wipBarcodeOther.OtherID" type="hidden" value="@if(Model.wipBarcodeOther != null){ <input asp-for="wipBarcodeOther.OtherID" type="hidden" value="@if(Model.wipBarcodeOther != null){
@Model.wipBarcodeOther.OtherID @Model.wipBarcodeOther.OtherID
}" />
<input asp-for="wipMAC.WipNO" type="hidden" value="@if(Model.wipMAC != null){
@Model.wipMAC.WipNO
}" /> }" />
<div class="layui-form-item " style="padding-left:30px"> <div class="layui-form-item " style="padding-left:30px">
<input @(Model.wipInfo.InputFlag == "Y" ? "checked" : "") type="checkbox" name="wipInfo.InputFlag" title="判斷前製程是否已經投入" /> <input @(Model.wipInfo.InputFlag == "Y" ? "checked" : "") type="checkbox" name="wipInfo.InputFlag" title="判斷前製程是否已經投入" />
@ -234,7 +231,9 @@
@* 序號編碼sheet *@ @* 序號編碼sheet *@
<div class="layui-tab-item"> <div class="layui-tab-item">
<label class="layui-form-label">生產序號</label> <div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" style="font-weight: bold;">生產序號</label>
<table id="MydataTable" class="layui-table"> <table id="MydataTable" class="layui-table">
<thead> <thead>
<tr> <tr>
@ -261,25 +260,11 @@
} }
</tbody> </tbody>
</table> </table>
@*<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">生產序號</label>
<div class="layui-input-inline">
<input asp-for="wipBarcode.StartNO" class="layui-input" />
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input asp-for="wipBarcode.EndNO" class="layui-input" />
</div>
<div class="layui-input-inline">
<input id="GetBarCode" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生條碼" />
</div> </div>
</div> </div>
</div>*@
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">出貨序號</label> <label class="layui-form-label" style="font-weight: bold;">出貨序號</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input asp-for="wipBarcodeOther.StartNO" class="layui-input" readonly="readonly" /> <input asp-for="wipBarcodeOther.StartNO" class="layui-input" readonly="readonly" />
</div> </div>
@ -298,20 +283,38 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">MAC</label> <label class="layui-form-label" style="font-weight: bold;">MAC</label>
<div class="layui-input-inline">
<input asp-for="wipMAC.StartNO" class="layui-input" />
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input asp-for="wipMAC.EndNO" class="layui-input" />
</div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" /> <input id="GetMAC" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生MAC" />
</div> </div>
<input type="hidden" value=@Model.wipMACs.Count() id="WipMacCount" />
<table id="MACTable" class="layui-table">
<thead>
<tr>
<th>
MAC區間起
</th>
<th>
MAC區間迄
</th>
</tr>
</thead>
<tbody>
@foreach (var index in Model.wipMACs)
{
<tr>
<td>
@index.Title@index.StartNO
</td>
<td>
@index.Title@index.EndNO
</td>
</tr>
}
</tbody>
</table>
</div> </div>
</div> </div>
@ -1146,11 +1149,6 @@
$("#barcodeOtherDiv").hide(); $("#barcodeOtherDiv").hide();
} }
// DIV MAC
if ($('#wipMAC_StartNO').val() != "" && $('#wipMAC_EndNO').val() != "") {
$("#GetMAC").hide();
}
getLineInfoList($("#unitNo").val()); getLineInfoList($("#unitNo").val());
// 產生條碼 // 產生條碼
@ -1230,7 +1228,7 @@
$.ajax({ $.ajax({
url: '@Url.Action("GetMAC", "PCS")', url: '@Url.Action("GetMAC", "PCS")',
dataType: 'json', dataType: 'json',
data: { "itemno": $("#wipAtt_ItemNO").val(), "planQTY": $('#wipInfo_PlanQTY').val() }, data: { "itemno": $("#wipAtt_ItemNO").val(), "wipNo": $('#wipInfo_WipNO').val() ,"planQTY": $('#wipInfo_PlanQTY').val() },
cache: false, cache: false,
type: "POST", type: "POST",
success: function (data, textStatus, jqXHR) { success: function (data, textStatus, jqXHR) {
@ -1238,10 +1236,10 @@
parent.hg.msg(data._msg); parent.hg.msg(data._msg);
} }
else { else {
$("#wipMAC_StartNO").val(data.mix); var contactdiv = '<tr>' +
$("#wipMAC_EndNO").val(data.max); `<td>${data.mix}</td>
$("#wipMAC_StartNO").attr("readonly", "readonly"); <td>${data.max}</td></tr>`;
$("#wipMAC_EndNO").attr("readonly", "readonly"); $('#MACTable').append(contactdiv);
} }
}, },
error: function (jqXHR, textStatus, errorThrown) { error: function (jqXHR, textStatus, errorThrown) {

2
AMESCoreStudio.WebApi/Controllers/AMES/MACInfoesController.cs

@ -218,7 +218,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
try try
{ {
await _context.Database.ExecuteSqlInterpolatedAsync($"UPDATE JHAMES.C_PARAMETER_INI SET VALUE={value} WHERE CLASS_GROUP={id}"); await _context.Database.ExecuteSqlInterpolatedAsync($"UPDATE JHAMES.C_PARAMETER_INI SET VALUE={value},UPDATE_DATE={DateTime.Now} WHERE CLASS_GROUP={id}");
//_context.SaveChangesAsync(); //_context.SaveChangesAsync();
result.Success = true; result.Success = true;
result.Msg = "OK"; result.Msg = "OK";

19
AMESCoreStudio.WebApi/Controllers/AMES/WipLockController.cs

@ -97,7 +97,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
[Route("[action]")] [Route("[action]")]
[HttpGet] [HttpGet]
public async Task<ResultModel<WipLockDto>> GetWipLockQuery(string wipNO, string lockstatus, string locktype public async Task<ResultModel<WipLockDto>> GetWipLockQuery(string wipNO, string lockstatus, string locktype
, string itemno, string lockreasontype, int stations = 0, string date_str = null, string date_end = null , string itemno, string lockreasontype, int? stations, string date_str = null, string date_end = null
, int page = 0, int limit = 10) , int page = 0, int limit = 10)
{ {
IQueryable<WipLockDto> q = from s in _context.WipLocks IQueryable<WipLockDto> q = from s in _context.WipLocks
@ -114,12 +114,11 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
UnLockDate = s.UnLockDate, UnLockDate = s.UnLockDate,
LockUserID = s.LockUserID, LockUserID = s.LockUserID,
LockReason = s.LockReason, LockReason = s.LockReason,
LockStatus = s.LockStatus == "0" ? "鎖定" : "解鎖", LockStatus = s.LockStatus,
UnLockUserID = s.UnLockUserID, UnLockUserID = s.UnLockUserID,
UnLockReason = s.UnLockReason, UnLockReason = s.UnLockReason,
LockReasonType = s.LockReasonType, LockReasonType = s.LockReasonType,
LockReasonTypeName = s.LockReasonType == "0" ? "3C認證工單" : LockReasonTypeName = s.LockReasonType,
s.LockReasonType == "1" ? "驗證工單" : "維修換料待分析",
LockType = s.LockType, LockType = s.LockType,
LockUserName = q2.UserName, LockUserName = q2.UserName,
UnLockUserName = q3.UserName, UnLockUserName = q3.UserName,
@ -142,7 +141,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
if (!string.IsNullOrWhiteSpace(itemno)) if (!string.IsNullOrWhiteSpace(itemno))
q = q.Where(w => w.ItemNO == itemno); q = q.Where(w => w.ItemNO == itemno);
if (stations != 0) if (stations != null)
q = q.Where(w => w.StationID == stations); q = q.Where(w => w.StationID == stations);
if (DateTime.TryParse(date_str, out _)) if (DateTime.TryParse(date_str, out _))
@ -166,7 +165,15 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
q = q.Skip((page - 1) * limit).Take(limit); q = q.Skip((page - 1) * limit).Take(limit);
} }
result.Data = await q.ToListAsync(); var qq = await q.ToListAsync();
qq = qq.Select(s =>
{
s.LockStatus = s.LockStatus == "0" ? "鎖定" : "解鎖";
s.LockReasonTypeName = s.LockReasonType == "0" ? "3C認證工單" :
s.LockReasonType == "1" ? "驗證工單" : "維修換料待分析"; return s;
}).ToList();
result.Data = qq;
return result; return result;
} }

17
AMESCoreStudio.WebApi/Controllers/AMES/WipMACController.cs

@ -40,17 +40,16 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
return WipMAC; return WipMAC;
} }
/// <summary>
/// 工單MAC資料檔 By 工單號碼
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{id}")] [HttpGet("{id}")]
public async Task<ActionResult<WipMAC>> GetWipMAC(string id) public async Task<ActionResult<IEnumerable<WipMAC>>> GetWipMAC(string id)
{ {
IQueryable<WipMAC> q = _context.WipMACs; IQueryable<WipMAC> q = _context.WipMACs;
var WipMAC = await q.Where(p => p.WipNO == id).ToListAsync();
var WipMAC = await q.Where(p => p.WipNO == id).FirstOrDefaultAsync();
//if (WipMAC == null)
//{
// return NotFound();
//}
return WipMAC; return WipMAC;
} }
@ -115,7 +114,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
{ {
ResultModel<WipMAC> result = new ResultModel<WipMAC>(); ResultModel<WipMAC> result = new ResultModel<WipMAC>();
var getWipMAC = GetWipMAC(wipMAC.WipNO).Result.Value; var getWipMAC = GetWipMAC(wipMAC.WipNO).Result.Value.FirstOrDefault();
if (getWipMAC != null) if (getWipMAC != null)
{ {
_context.WipMACs.Remove(getWipMAC); _context.WipMACs.Remove(getWipMAC);

14
AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs

@ -30,6 +30,11 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
public string InspectionDate { get; set; } public string InspectionDate { get; set; }
/// <summary>
/// 檢驗時間
/// </summary>
public string EndTime { get; set; }
/// <summary> /// <summary>
/// 工單料號 /// 工單料號
/// </summary> /// </summary>
@ -70,6 +75,9 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
public string BIOSVer { get; set; } public string BIOSVer { get; set; }
/// <summary>
/// ECN
/// </summary>
public string ECN { get; set; } public string ECN { get; set; }
/// <summary> /// <summary>
@ -108,6 +116,9 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
public string QuotDescription { get; set; } public string QuotDescription { get; set; }
/// <summary>
///
/// </summary>
public string AQL { get; set; } public string AQL { get; set; }
/// <summary> /// <summary>
@ -162,6 +173,9 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
public string FactoryRemark { get; set; } = "N/A"; public string FactoryRemark { get; set; } = "N/A";
/// <summary>
///
/// </summary>
public string ECNMemo { get; set; } = "N/A"; public string ECNMemo { get; set; } = "N/A";
/// <summary> /// <summary>

Loading…
Cancel
Save