From 5edd2af35fbaf74a1929d4f74ce5a77dab361e77 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 Dec 2021 18:20:42 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E9=81=8E=E7=AB=99?= =?UTF-8?q?=E7=A8=8B=E5=BC=8F=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 82 +++++--- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 15 ++ .../ViewModels/PCS/PCS021ViewModel.cs | 9 +- AMESCoreStudio.Web/Views/PCS/PCS021.cshtml | 40 +--- AMESCoreStudio.WebApi/Code/BarcodeContext.cs | 15 +- .../AMES/BarcodeInfoesController.cs | 50 +++-- .../Controllers/AMES/NgInfoeController.cs | 127 ++++++++++++ .../Controllers/BLL/BarCodeCheckController.cs | 4 +- .../Models/AMES/BarcodeInfo.cs | 38 ++-- .../Models/AMES/BarcodeStation.cs | 48 +++++ AMESCoreStudio.WebApi/Models/AMES/NgInfo.cs | 191 ++++++++++++++++++ AMESCoreStudio.WebApi/Models/AMESContext.cs | 9 + 12 files changed, 521 insertions(+), 107 deletions(-) create mode 100644 AMESCoreStudio.WebApi/Controllers/AMES/NgInfoeController.cs create mode 100644 AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs create mode 100644 AMESCoreStudio.WebApi/Models/AMES/NgInfo.cs diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 6d76b1c0..d80036d0 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -351,14 +351,14 @@ namespace AMESCoreStudio.Web.Controllers /// 站別 /// /// - private async Task GetStations() + private async Task GetRuleStation(string flowruleID = null) { - var result = await _basApi.GetStationses(); - + var result = await _basApi.GetRuleStationByUnit(flowruleID); + result = result.OrderBy(o => o.Sequence).ToList(); var Stations = new List(); for (int i = 0; i < result.Count; i++) { - Stations.Add(new SelectListItem(result[i].StationName, result[i].StationID.ToString())); + Stations.Add(new SelectListItem(result[i].StationDesc, result[i].StationID.ToString())); } if (Stations.Count == 0) @@ -369,6 +369,34 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.GetStationsList = Stations; } + /// + /// 站別 By 主站 + /// + /// + /// + [HttpPost] + public async Task GetRuleStationByTypeJson(string unit_no) + { + var result = await _basApi.GetRuleStationByUnit(unit_no); + + result = result.Where(w => w.StationType == "M").OrderBy(o => o.Sequence).ToList(); + + var item = new List(); + + for (int i = 0; i < result.Count; i++) + { + item.Add(new SelectListItem(result[i].StationDesc, result[i].StationID.ToString())); + } + + if (item.Count == 0) + { + item.Add(new SelectListItem("N/A", "")); + } + + //将数据Json化并传到前台视图 + return Json(new { data = item }); + } + /// /// 流程ID選單 /// @@ -1352,7 +1380,7 @@ namespace AMESCoreStudio.Web.Controllers { //var fileProvider = _fileServerProvider.GetProvider("/aa"); //var fileInfo = fileProvider.GetFileInfo("/"); - await GetStations(); + await GetRuleStation(); GetLockReasonType(); GetLockType(); //var result = new WipAllViewModel(); @@ -1426,7 +1454,7 @@ namespace AMESCoreStudio.Web.Controllers ModelState.AddModelError("error", result.Msg); } } - await GetStations(); + await GetRuleStation(); GetLockReasonType(); GetLockType(); return View(model); @@ -1444,7 +1472,7 @@ namespace AMESCoreStudio.Web.Controllers var q = await _pcsApi.GetWipLock(id); q.Data = q.Data.Where(w => w.UnLockReason == null).ToList(); - await GetStations(); + await GetRuleStation(); GetLockReasonType(); GetLockType(); //var result = new WipAllViewModel(); @@ -1496,7 +1524,7 @@ namespace AMESCoreStudio.Web.Controllers [HttpGet] public async Task PCS012() { - await GetStations(); + await GetRuleStation(); GetLockReasonType(); GetLockType(); return View(); @@ -1537,7 +1565,7 @@ namespace AMESCoreStudio.Web.Controllers var model = new PCS021ViewModel(); await GetFactoryUnit(); await GetLineInfo(); - await GetStations(); + await GetRuleStation(); return View(model); } @@ -1546,7 +1574,7 @@ namespace AMESCoreStudio.Web.Controllers { await GetFactoryUnit(); await GetLineInfo(); - await GetStations(); + await GetRuleStation(); if (string.IsNullOrWhiteSpace(model.WipNO)) @@ -1564,7 +1592,7 @@ namespace AMESCoreStudio.Web.Controllers ModelState.AddModelError("error", "請選擇線別"); } - if (string.IsNullOrWhiteSpace(model.Station)) + if (model.Station == 0) { ModelState.AddModelError("error", "請選擇作業站"); } @@ -1581,6 +1609,7 @@ namespace AMESCoreStudio.Web.Controllers if (q.Count != 0) { + model.WipID = q.FirstOrDefault().WipID; model.PlanQTY = q.FirstOrDefault().PlanQTY; model.UnitNO = q.FirstOrDefault().UnitNO; model.LineID = q.FirstOrDefault().LineID; @@ -1618,7 +1647,6 @@ namespace AMESCoreStudio.Web.Controllers model.SopPath = wipsop.GetWipSop.FilePath + wipsop.GetWipSop.NewName; } - model.Input = "1234"; } return View("PCS021", model); @@ -1632,12 +1660,12 @@ namespace AMESCoreStudio.Web.Controllers string Data = string.Empty; if (model.MaterialOutfits.Where(w => string.IsNullOrWhiteSpace(w.Inputs)).Any()) - Msg += "請刷入治具編號\n"; + Msg += "請刷入治具編號\r\n"; if (string.IsNullOrWhiteSpace(model.Input)) { - Msg += "請刷讀條碼\n"; + Msg += "請刷讀條碼\r\n"; } else { @@ -1647,19 +1675,19 @@ namespace AMESCoreStudio.Web.Controllers if (!string.IsNullOrWhiteSpace(Msg)) Success = false; - //var aa = TempData["TmpData"]; - //await GetFactoryUnit(); - //await GetLineInfo(); - //model.WipInfo.WipNO = "WO0001A1"; - //var q = await _pcsApi.GetWipInfoByWipNO(model.WipInfo.WipNO); - //if (q.Count() != 0) - //{ - // model.WipInfo = q.Where(w => w.UnitNO == model.WipInfo.UnitNO).FirstOrDefault(); - // model.wipAtt = await _pcsApi.GetWipAtt(model.WipInfo.WipNO); - // model.WipSopLog = await _pcsApi.GetWipSopLog(model.WipInfo.WipID); - // model.wipSop = await _pcsApi.GetWipSop(model.WipSopLog.WipSopID); - // model.materialKpDto = await _pcsApi.GetMaterialKpQuery(model.wipAtt.ItemNO, model.WipInfo.UnitNO); - //} + + // 新增or更新 BarCode_Info + BarcodeInfo barcodeInfo = new BarcodeInfo + { + BarcodeNo = model.Input, + StatusNo = "SMT", + RuleStationID = model.Station, + RuleStatus = "P", //F 不良 + WipID = model.WipID, + StatusID = 1, + CreateUserID = 1 + }; + return Json(new Result() { success = Success, msg = Msg, data = Data }); diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 654673b9..1c5d859e 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -184,6 +184,21 @@ namespace AMESCoreStudio.Web ITask> PostWipBarcodeOther([FromBody, RawJsonContent] string model); #endregion + #region BarCodeInfo 條碼資料檔 PCS021 + //[WebApiClient.Attributes.HttpGet("api/BarcodeInfoes/No/{id}")] + //ITask> GetBarcodeInfoesByNo(string id); + + [WebApiClient.Attributes.HttpPost("api/BarcodeInfoes")] + ITask> PostBarcodeInfoes([FromBody, RawJsonContent] string model); + + [WebApiClient.Attributes.HttpPut("api/BarcodeInfoes")] + ITask> PutBarcodeInfoes([FromBody, RawJsonContent] string model); + #endregion + + #region 條碼過站資料檔 + + #endregion + #region BarcodeType 條碼類別資料檔 PCS001 [WebApiClient.Attributes.HttpGet("api/BarcodeType/TypeName/{id}")] ITask GetBarcodeTypeByTypeName(string id); diff --git a/AMESCoreStudio.Web/ViewModels/PCS/PCS021ViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/PCS021ViewModel.cs index bf7d5f3d..ca5da58d 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/PCS021ViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/PCS021ViewModel.cs @@ -11,10 +11,15 @@ namespace AMESCoreStudio.Web.ViewModels.PCS public class PCS021ViewModel { /// - /// 供單號碼 + /// 工單號碼 /// public string WipNO { get; set; } + /// + /// 工單ID + /// + public int WipID { get; set; } + /// /// 工單數 /// @@ -33,7 +38,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS /// /// 作業站 /// - public string Station { get; set; } + public int Station { get; set; } /// /// SOP路徑 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml index 9ea5666a..388930dc 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml @@ -39,10 +39,6 @@ margin: auto; } - .layui-elem-field { - border-style: groove; - } - .layui-form-item { margin-bottom: auto; } @@ -101,6 +97,7 @@
+
@@ -332,7 +329,7 @@ { $.ajax( { - url: "@Url.Action("GetStationsJson", "BAS")", + url: "@Url.Action("GetRuleStationByTypeJson", "PCS")", dataType: 'json', data: { "unit_no": $("#unit").val()}, type: 'post', @@ -361,7 +358,6 @@ function input(e) { if (e.keyCode == 13) { var Inputs = GetAllEmpData(); - //var data = $("#PCS021Form").serialize(); var data = $("#PCS021Form").serialize(); $.each(Inputs, function (i, item) { data += "&Inputs[" + i + "]=" + item; @@ -405,39 +401,14 @@ }); }); + // 新增trRow function TableAddRow(e) { //var rowCount = $('.data-contact-person').length + 0; var contactdiv = '' + - '' + + '' + '刪除' + ''; $('#tblCustomers').append(contactdiv); - //rollPage('left'); - var txtName = $("#txtInput"); - //Get the reference of the Table's TBODY element. - /* var tBody = $("#tblCustomers > TBODY")[0];*/ - - //Add Row. - /* var row = tBody.insertRow(-1);*/ - - //Add Name cell. - //var input = $(""); - //input.attr("type", "text"); - //input.attr("value", "1111"); - //var cell = $(row.insertCell(-1)); - //cell.html(e); - //cell.append(input); - - //Add Button cell. - //cell = $(row.insertCell(-1)); - //var btnRemove = $(""); - //btnRemove.attr("type", "button"); - //btnRemove.attr("onclick", "Remove(this);"); - //btnRemove.val("Remove"); - //cell.append(btnRemove); - - //Clear the TextBoxes. - //txtName.val(e); AutoWindowSize(); }; @@ -457,10 +428,11 @@ //} }; + // 紀錄表格欄位 function GetAllEmpData() { var data = []; $('tr.data-contact-person').each(function () { - var firstName = $(this).find('.f-name01').val();//Bind to the first name with class f-name01 + var firstName = $(this).find('.td-Input').val(); data.push(firstName); }); return data; diff --git a/AMESCoreStudio.WebApi/Code/BarcodeContext.cs b/AMESCoreStudio.WebApi/Code/BarcodeContext.cs index b396a59f..377a3c7e 100644 --- a/AMESCoreStudio.WebApi/Code/BarcodeContext.cs +++ b/AMESCoreStudio.WebApi/Code/BarcodeContext.cs @@ -63,7 +63,7 @@ namespace AMESCoreStudio.WebApi } /// - /// 是否被鎖定 + /// 內部序號是否被鎖定 /// /// /// @@ -90,5 +90,18 @@ namespace AMESCoreStudio.WebApi } return ""; } + + /// + /// 判斷內部序號對應工單號買 + /// + /// 內部序號 + /// + public async Task CheckBarCodeFromWip(string BarCode) + { + //if (BarCode.Length <= 4) + return "NG, 找不到相關工單號碼"; + + + } } } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs index 313fc2f8..0eaf72ad 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using AMESCoreStudio.WebApi; using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.CommonTools.Result; namespace AMESCoreStudio.WebApi.Controllers.AMES { @@ -99,33 +100,27 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES // PUT: api/BarcodeInfoes/5 // To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. - [HttpPut("{id}")] - public async Task> PutBarcodeInfoes(int id, [FromBody] BarcodeInfo barcodeInfo) + [HttpPut] + public async Task> PutBarcodeInfoes([FromBody] BarcodeInfo barcodeInfo) { - if (id != barcodeInfo.BarcodeID) - { - return BadRequest(); - } - - _context.Entry(barcodeInfo).State = EntityState.Modified; + ResultModel result = new ResultModel(); + _context.Attach(barcodeInfo); + barcodeInfo.UpdateDate = DateTime.Now; + // 指定更新某個欄位 + _context.Entry(barcodeInfo).Property(p => p.UpdateDate).IsModified = true; try { await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; } - catch (DbUpdateConcurrencyException) + catch (Exception ex) { - if (!BarcodeInfoesExists(id)) - { - return NotFound(); - } - else - { - throw; - } + result.Success = false; + result.Msg = ex.Message; } - - return barcodeInfo; + return result; } /// @@ -137,15 +132,26 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES // To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. [HttpPost] - public async Task> PostBarcodeInfoes(BarcodeInfo barcodeInfo) + public async Task> PostBarcodeInfoes([FromBody] BarcodeInfo barcodeInfo) { + ResultModel result = new ResultModel(); Helper helper = new Helper(_context); barcodeInfo.BarcodeID = helper.GetIDKey("BARCODE_ID").Result; _context.BarcodeInfoes.Add(barcodeInfo); - await _context.SaveChangesAsync(); - return CreatedAtAction("GetBarcodeInfoes", new { id = barcodeInfo.BarcodeID }, barcodeInfo); + try + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.Message; + } + return result; } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoeController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoeController.cs new file mode 100644 index 00000000..74f1924b --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoeController.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using AMESCoreStudio.WebApi; +using AMESCoreStudio.WebApi.Models.AMES; + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 測試不良基本資料檔 + /// + [Route("api/[controller]")] + [ApiController] + public class NgInfoeController : ControllerBase + { + private readonly AMESContext _context; + + public NgInfoeController(AMESContext context) + { + _context = context; + } + + // GET: api/NgInfoe + [HttpGet] + public async Task>> GetNgInfos() + { + return await _context.NgInfos.ToListAsync(); + } + + // GET: api/NgInfoe/5 + [HttpGet("{id}")] + public async Task> GetNgInfo(decimal id) + { + var ngInfo = await _context.NgInfos.FindAsync(id); + + if (ngInfo == null) + { + return NotFound(); + } + + return ngInfo; + } + + // PUT: api/NgInfoe/5 + // To protect from overposting attacks, enable the specific properties you want to bind to, for + // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. + [HttpPut("{id}")] + public async Task PutNgInfo(decimal id, NgInfo ngInfo) + { + if (id != ngInfo.NgID) + { + return BadRequest(); + } + + _context.Entry(ngInfo).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!NgInfoExists(id)) + { + return NotFound(); + } + else + { + throw; + } + } + + return NoContent(); + } + + // POST: api/NgInfoe + // To protect from overposting attacks, enable the specific properties you want to bind to, for + // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. + [HttpPost] + public async Task> PostNgInfo(NgInfo ngInfo) + { + _context.NgInfos.Add(ngInfo); + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateException) + { + if (NgInfoExists(ngInfo.NgID)) + { + return Conflict(); + } + else + { + throw; + } + } + + return CreatedAtAction("GetNgInfo", new { id = ngInfo.NgID }, ngInfo); + } + + // DELETE: api/NgInfoe/5 + [HttpDelete("{id}")] + public async Task> DeleteNgInfo(decimal id) + { + var ngInfo = await _context.NgInfos.FindAsync(id); + if (ngInfo == null) + { + return NotFound(); + } + + _context.NgInfos.Remove(ngInfo); + await _context.SaveChangesAsync(); + + return ngInfo; + } + + private bool NgInfoExists(decimal id) + { + return _context.NgInfos.Any(e => e.NgID == id); + } + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index 0e54bc3c..d16f6bc9 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -58,11 +58,11 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// 流程 /// [HttpGet("BarCodeDataCheck")] - public string GetBarCodeDataCheck(string wipno, string unitno, int station, int line, int flowrule) + public IActionResult GetBarCodeDataCheck(string wipno, string unitno, int station, int line, int flowrule) { BarcodeContext barcodeContext = new BarcodeContext(_context); var result = barcodeContext.CheckWipNoSationAsync(WipNo: wipno, UnitNo: unitno, FlowRuleID: flowrule, Station: station, Line: line); - return result.Result; + return Ok(result.Result); } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/BarcodeInfo.cs b/AMESCoreStudio.WebApi/Models/AMES/BarcodeInfo.cs index ad58775e..2c12d14f 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/BarcodeInfo.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/BarcodeInfo.cs @@ -31,49 +31,49 @@ namespace AMESCoreStudio.WebApi.Models.AMES public string BarcodeNo { get; set; } /// - /// + /// 條碼狀態代碼 /// [Column("STATUS_NO")] [DataMember] public string StatusNo { get; set; } /// - /// + /// 客戶條碼 /// [Column("EXTRA_BARCODE_NO")] [DataMember] public string ExtraBarcodeNo { get; set; } - + /// - /// + /// 存放位置ID /// [Column("LOCATION_ID")] [DataMember] - public string LocationID { get; set; } + public int LocationID { get; set; } /// - /// + /// 條碼過站位置 /// [Column("RULE_STATION_ID")] [DataMember] - public string RuleStationID { get; set; } - + public int RuleStationID { get; set; } + /// - /// + /// 條碼過站狀態 /// [Column("RULE_STATUS")] [DataMember] public string RuleStatus { get; set; } - + /// - /// + /// 工單ID /// [Column("WIP_ID")] [DataMember] - public string WipID { get; set; } - + public int WipID { get; set; } + /// - /// + /// 包装箱號 /// [Column("BOX_NO")] [DataMember] @@ -81,18 +81,18 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// - /// + /// 系统狀態 /// [Column("SYSTYPE")] [DataMember] public string SysType { get; set; } - + /// - /// + /// 條碼流程狀態 /// [Column("STATUS_ID")] [DataMember] - public string StatusID { get; set; } + public int StatusID { get; set; } /// /// 建立者 @@ -101,7 +101,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "建立者")] - public decimal CreateUserID { get; set; } = -1; + public int CreateUserID { get; set; } = 0; /// /// 建立時間 diff --git a/AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs b/AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs new file mode 100644 index 00000000..e0cf98a4 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs @@ -0,0 +1,48 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 條碼過站資料檔 + /// + [Table("BARCODE_STATION")] + + public partial class BarcodeStation + { + //[Key] + [Column("BARCODE_ID", TypeName = "NUMBER")] + public decimal BarcodeId { get; set; } + //[Key] + [Column("WIP_ID", TypeName = "NUMBER")] + public decimal WipId { get; set; } + //[Key] + [Column("RULE_STATION_ID", TypeName = "NUMBER")] + public decimal RuleStationId { get; set; } + //[Key] + [Column("RULE_STATUS")] + [StringLength(1)] + public string RuleStatus { get; set; } + [Key] + [Column("INPUT_DATE", TypeName = "DATE")] + public DateTime InputDate { get; set; } + [Required] + [Column("SYSTYPE")] + [StringLength(1)] + public string Systype { get; set; } + [Column("LINE_ID", TypeName = "NUMBER")] + public decimal LineId { get; set; } + [Column("STATION_FLAG", TypeName = "NUMBER")] + public decimal? StationFlag { get; set; } + [Column("STATION_TIMES", TypeName = "NUMBER")] + public decimal StationTimes { get; set; } + [Column("CREATE_USERID", TypeName = "NUMBER")] + public decimal CreateUserid { get; set; } + [Column("CREATE_DATE", TypeName = "DATE")] + public DateTime CreateDate { get; set; } + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/NgInfo.cs b/AMESCoreStudio.WebApi/Models/AMES/NgInfo.cs new file mode 100644 index 00000000..89bfff0a --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/NgInfo.cs @@ -0,0 +1,191 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 測試不良基本資料檔 + /// + [Table("NG_INFO", Schema = "JHAMES")] + public partial class NgInfo + { + /// + /// 測試不良ID + /// + [Key] + [Column("NG_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + public decimal NgID { get; set; } + + /// + /// 測試種類代碼 + /// + [Required] + [Column("TYPE_NO")] + [StringLength(6)] + [DataMember] + public string TypeNo { get; set; } + + /// + /// 測試員代號 + /// + [Column("OPERATOR_ID", TypeName = "NUMBER")] + [DataMember] + public decimal OperatorID { get; set; } + + /// + /// 治具代號 + /// + [Required] + [Column("FIXTURE_NO")] + [StringLength(20)] + [DataMember] + public string FixtureNo { get; set; } + + /// + /// 測試程試代號/名稱 + /// + [Required] + [Column("PROGRAM_NO")] + [StringLength(20)] + [DataMember] + public string ProgramNo { get; set; } + + /// + /// 設備代號 + /// + [Required] + [Column("MACHINE_NO")] + [StringLength(20)] + [DataMember] + public string MachineNo { get; set; } + + /// + /// 測試總點數 + /// + [Column("TEST_QTY", TypeName = "NUMBER")] + [DataMember] + public decimal TestQty { get; set; } + + /// + /// 不良總點數 + /// + [Column("NG_QTY", TypeName = "NUMBER")] + [DataMember] + public decimal NgQty { get; set; } + + /// + /// 開始測試時間 + /// + [Column("START_TIME")] + [DataMember] + public DateTime StartTime { get; set; } = System.DateTime.Now; + + /// + /// 結束測試時間 + /// + [Column("END_TIME")] + [DataMember] + public DateTime EndTime { get; set; } = System.DateTime.Now; + + /// + /// 測試狀態(F-FAIL) + /// + [Required] + [Column("TEST_STATUS")] + [StringLength(1)] + [DataMember] + public string TestStatus { get; set; } = "F"; + + /// + /// 內部條碼ID + /// + [Column("BARCODE_ID", TypeName = "NUMBER")] + [DataMember] + public decimal BarcodeId { get; set; } + + /// + /// 流程站別ID + /// + [Column("RULE_STATION_ID", TypeName = "NUMBER")] + [DataMember] + public decimal RuleStationId { get; set; } + + /// + /// 工單ID + /// + [Column("WIP_ID", TypeName = "NUMBER")] + [DataMember] + public decimal WipId { get; set; } + + /// + /// 處理狀態(0:尚未維修處理, 1:已維修處理, 2:誤判) + /// + [Column("STATUS", TypeName = "NUMBER")] + [DataMember] + public decimal Status { get; set; } = 0; + + /// + /// 不良現象原因代碼 + /// + [Column("REASON_NO")] + [StringLength(6)] + [DataMember] + public string ReasonNo { get; set; } + + /// + /// 不良代碼指向的下一站ID + /// + [Column("NEXT_STATION_ID", TypeName = "NUMBER")] + [DataMember] + public decimal NextStationId { get; set; } = -1; + + /// + /// 不良時的組件數量 + /// + [Column("ITEM_QTY", TypeName = "NUMBER")] + [DataMember] + public decimal ItemQty { get; set; } = -1; + + /// + /// 不良備註 + /// + [Column("NG_MEMO")] + [StringLength(300)] + [DataMember] + public string NgMemo { get; set; } + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE", TypeName = "DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index 77ca9b11..30d4ca92 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -475,6 +475,15 @@ namespace AMESCoreStudio.WebApi /// public virtual DbSet BarcodeWips { get; set; } + /// + /// 測試不良基本資料檔 + /// + public virtual DbSet NgInfos { get; set; } + + /// + /// 條碼過站資料檔 + /// + //public virtual DbSet BarcodeStations { get; set; } } }