diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 00d0766c..63f936be 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -2317,7 +2317,7 @@ namespace AMESCoreStudio.Web.Controllers TypeNo = model.StationTestType, OperatorID = 0, FixtureNo = string.Join(",", model.MaterialOutfits.Select(s => s.Inputs).ToArray()), - BarcodeId = model.BarCodeID, + BarcodeID = model.BarCodeID, ProgramNo = "N/A", MachineNo = "N/A", RuleStationId = model.RuleStation, @@ -2395,7 +2395,7 @@ namespace AMESCoreStudio.Web.Controllers TypeNo = model.StationTestType, OperatorID = 0, FixtureNo = string.Join(",", model.MaterialOutfits.Select(s => s.Inputs).ToArray()), - BarcodeId = id, + BarcodeID = id, ProgramNo = "N/A", MachineNo = "N/A", RuleStationId = model.RuleStation, diff --git a/AMESCoreStudio.Web/Controllers/REPController.cs b/AMESCoreStudio.Web/Controllers/REPController.cs new file mode 100644 index 00000000..15461577 --- /dev/null +++ b/AMESCoreStudio.Web/Controllers/REPController.cs @@ -0,0 +1,135 @@ +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using AMESCoreStudio.Web.Models; +using Newtonsoft.Json; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.CommonTools.Result; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc.Rendering; +using AMESCoreStudio.Web.ViewModels; +using System.ComponentModel.DataAnnotations; + +namespace AMESCoreStudio.Web.Controllers +{ + public class REPController : Controller + { + private readonly ILogger _logger; + public readonly IREP _repApi; + + public REPController(ILogger logger, IREP repApi) + { + _logger = logger; + _repApi = repApi; + } + + #region REP001 前判維修輸入 + + public IActionResult REP001() + { + return View(); + } + + public async Task REP001V(int id) + { + REP001ViewModel model = new REP001ViewModel(); + var result = await _repApi.GetNgInfo(id); + if (result.Count != 0) + { + model.ngInfo = result[0]; + } + return View(model); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetNgInfoByBarcode(string barcodeNo) + { + var result = await _repApi.GetNgInfoByBarcode(barcodeNo); + + if (result.Count>0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetNgComponentByNGID(int id) + { + var result = await _repApi.GetNgComponentByNGID(id); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + public async Task REP001R(int id) + { + REP001ViewModel model = new REP001ViewModel(); + var result1 = await _repApi.GetNgComponent(id); + if (result1.Count != 0) + { + model.ngComponent = result1[0]; + + var result2 = await _repApi.GetNgInfo((int)result1[0].NgID); + if (result2.Count != 0) + { + model.ngInfo = result2[0]; + } + } + + return View(model); + } + + //頁面提交,id=0 添加,id>0 修改 + [HttpPost] + public async Task REP001RSaveAsync(REP001ViewModel model) + { + IResultModel result; + var userID = ""; + HttpContext.Request.Cookies.TryGetValue("UserID", out userID); + int user_id = 0; + if (userID != null) + { + if (int.Parse(userID.ToString()) >= 0) + { + user_id = int.Parse(userID.ToString()); + } + } + model.ngComponent.ReplyUserID = user_id; + model.ngComponent.ReplyDate = System.DateTime.Now; + model.ngComponent.Status = 1; + + result = await _repApi.PutNgComponent((int)model.ngComponent.ComponentID,JsonConvert.SerializeObject(model.ngComponent)); + + if (result.Success) + { + var _msg = "保存成功!"; + //return RedirectToAction("REP001V", "REP", new { id = model.ngComponent.NgID, msg = _msg }); + return RedirectToAction("Refresh", "Home", new { id = model.ngComponent.NgID, msg = _msg }); + } + else + { + if (result.Errors.Count > 0) + { + ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); + } + else + { + ModelState.AddModelError("error", result.Msg); + } + } + + return View("REP001R", model); + //return RedirectToAction("REP001V", "REP", new { id = model.ngComponent.NgID }); + } + + #endregion + } +} diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IREP.cs b/AMESCoreStudio.Web/HttpApis/AMES/IREP.cs new file mode 100644 index 00000000..49def78e --- /dev/null +++ b/AMESCoreStudio.Web/HttpApis/AMES/IREP.cs @@ -0,0 +1,54 @@ +using System.Collections.Generic; +using WebApiClient; +using WebApiClient.Attributes; +using AMESCoreStudio.WebApi; +using Microsoft.AspNetCore.Mvc; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.CommonTools.Result; + +namespace AMESCoreStudio.Web +{ + [JsonReturn] + public interface IREP:IHttpApi + { + #region REP001 前判維修輸入 + + + /// + /// 根據測試不良ID獲取指定不良資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/NgInfo/{id}")] + ITask> GetNgInfo(int id); + + /// + /// 根據條碼獲取指定不良資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/NgInfo/Barcode/{no}")] + ITask> GetNgInfoByBarcode(string no); + + /// + /// 根據NG_ID獲取指定不良零件資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/NgComponents/NGID/{id}")] + ITask> GetNgComponentByNGID(int id); + + /// + /// 根據COMPONENT_ID獲取指定不良零件資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/NgComponents/{id}")] + ITask> GetNgComponent(int id); + + /// + /// 更新不良零件資料 + /// + /// + [WebApiClient.Attributes.HttpPut("api/NgComponents/{id}")] + ITask> PutNgComponent(int id, [FromBody, RawJsonContent] string model); + #endregion + } +} diff --git a/AMESCoreStudio.Web/ViewModels/REP/REP001ViewModel.cs b/AMESCoreStudio.Web/ViewModels/REP/REP001ViewModel.cs new file mode 100644 index 00000000..2fd44693 --- /dev/null +++ b/AMESCoreStudio.Web/ViewModels/REP/REP001ViewModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.WebApi.DTO.AMES; + +namespace AMESCoreStudio.Web.ViewModels +{ + public class REP001ViewModel + { + public NgInfo ngInfo { get; set; } + + public NgComponent ngComponent { get; set; } + + } +} diff --git a/AMESCoreStudio.Web/Views/REP/REP001.cshtml b/AMESCoreStudio.Web/Views/REP/REP001.cshtml new file mode 100644 index 00000000..89358031 --- /dev/null +++ b/AMESCoreStudio.Web/Views/REP/REP001.cshtml @@ -0,0 +1,122 @@ +@model AMESCoreStudio.Web.ViewModels.REP001ViewModel + +@{ + ViewData["Title"] = "前判維修輸入"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + + + + +
+
+
+
+
@ViewBag.Title
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/REP/REP001R.cshtml b/AMESCoreStudio.Web/Views/REP/REP001R.cshtml new file mode 100644 index 00000000..a0bb4857 --- /dev/null +++ b/AMESCoreStudio.Web/Views/REP/REP001R.cshtml @@ -0,0 +1,158 @@ +@model AMESCoreStudio.Web.ViewModels.REP001ViewModel + + +@{ ViewData["Title"] = "REP001R"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; } + + + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+
+ +
+ + +
+ +
+ + +
+
+
+
+
+ +
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+
+ +
+ + +
+ +
+ + +
+
+
+
+
+ @Html.ValidationMessage("error") + +
+
+ +
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/REP/REP001V.cshtml b/AMESCoreStudio.Web/Views/REP/REP001V.cshtml new file mode 100644 index 00000000..ac4e562b --- /dev/null +++ b/AMESCoreStudio.Web/Views/REP/REP001V.cshtml @@ -0,0 +1,162 @@ +@model AMESCoreStudio.Web.ViewModels.REP001ViewModel + + +@{ ViewData["Title"] = "REP001V"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; } + + + +
+
+
+
+
+
+ +
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+
+
+
+
+
+ +@section Scripts { + + + +} + diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgComponentsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgComponentsController.cs new file mode 100644 index 00000000..67b20a80 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgComponentsController.cs @@ -0,0 +1,210 @@ +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; +using AMESCoreStudio.CommonTools.Result; + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 測試不良零件資料檔 + /// + [Route("api/[controller]")] + [ApiController] + public class NgComponentsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public NgComponentsController(AMESContext context) + { + _context = context; + } + + /// + /// + /// + /// + // GET: api/NgComponents + [HttpGet] + public async Task>> GetNgComponent() + { + return await _context.NgComponents.ToListAsync(); + } + + /// + /// + /// + /// + /// + // GET: api/NgComponents/5 + [HttpGet("{id}")] + public async Task>> GetNgComponent(int id) + { + IQueryable q = _context.NgComponents; + + q = q.Where(p => p.ComponentID.Equals(id)); + + var ngComponent = await q.ToListAsync(); + + if (ngComponent == null) + { + return NotFound(); + } + + return ngComponent; + } + + /// + /// + /// + /// + /// + // GET: api/NgComponents/5 + [HttpGet("NGID/{id}")] + public async Task>> GetNgComponentByNGID(int id) + { + IQueryable q = _context.NgComponents; + + q = q.Where(p => p.NgID.Equals(id)); + + try + { + var ngComponent = await q.ToListAsync(); + + if (ngComponent == null) + { + return NotFound(); + } + + return ngComponent; + } + catch (Exception e1) + { + return NotFound(); + } + } + + /// + /// + /// + /// + /// + /// + // PUT: api/NgComponents/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> PutNgComponent(int id, NgComponent ngComponent) + { + ResultModel result = new ResultModel(); + if (id != ngComponent.ComponentID) + { + result.Success = false; + result.Msg = "不良零件ID錯誤"; + return result; + } + + _context.Entry(ngComponent).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!NgComponentExists(id)) + { + result.Success = false; + result.Msg = "不良零件ID不存在"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // POST: api/NgComponents + // 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> PostNgComponent(NgComponent ngComponent) + { + ResultModel result = new ResultModel(); + + _context.NgComponents.Add(ngComponent); + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateException) + { + if (NgComponentExists(ngComponent.ComponentID)) + { + result.Success = false; + result.Msg = "不良零件ID重複"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // DELETE: api/NgComponents/5 + [HttpDelete("{id}")] + public async Task> DeleteNgComponent(decimal id) + { + ResultModel result = new ResultModel(); + + var ngComponent = await _context.NgComponents.FindAsync(id); + if (ngComponent == null) + { + result.Success = false; + result.Msg = "不良零件ID不存在"; + return result; + } + + _context.NgComponents.Remove(ngComponent); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool NgComponentExists(decimal id) + { + return _context.NgComponents.Any(e => e.ComponentID == id); + } + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs index 1e5c942c..e1e8bc5b 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs @@ -20,23 +20,106 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES { private readonly AMESContext _context; + /// + /// + /// + /// public NgInfoController(AMESContext context) { _context = context; } - // GET: api/NgInfoe + /// + /// + /// + /// + // GET: api/NgInfo [HttpGet] public async Task>> GetNgInfos() { - return await _context.NgInfos.ToListAsync(); + var ngInfo = await _context.NgInfos.ToListAsync(); + + foreach (var data in ngInfo) + { + data.Barcode = _context.BarcodeInfoes.Find(data.BarcodeID); + data.Wip = _context.WipInfos.Find(data.WipId); + data.Station = _context.Stationses.Find(data.RuleStationId); + //data.User = _context.UserInfoes.Find(data.OperatorID); + //data.OperatorName = _context.UserInfoes.Find(data.OperatorID).UserName; + } + + return ngInfo; } - // GET: api/NgInfoe/5 + /// + /// + /// + /// + /// + // GET: api/NgInfo/5 [HttpGet("{id}")] - public async Task> GetNgInfo(decimal id) + public async Task>> GetNgInfo(int id) { - var ngInfo = await _context.NgInfos.FindAsync(id); + //var ngInfo = await _context.NgInfos.FindAsync(id); + + IQueryable q = _context.NgInfos; + + q = q.Where(p => p.NgID.Equals(id)); + + var ngInfo = await q.ToListAsync(); + + foreach (var data in ngInfo) + { + data.Barcode = _context.BarcodeInfoes.Find(data.BarcodeID); + data.Wip = _context.WipInfos.Find(data.WipId); + data.Station = _context.Stationses.Find(data.RuleStationId); + //data.User = _context.UserInfoes.Find(data.OperatorID); + //data.OperatorName = _context.UserInfoes.Find(data.OperatorID).UserName; + } + + if (ngInfo == null) + { + return NotFound(); + } + + return ngInfo; + } + + /// + /// + /// + /// + /// + // GET: api/NgInfo/Barcode/S + [HttpGet("Barcode/{no}")] + public async Task>> GetNgInfoByBarcode(string no) + { + IQueryable q1 = _context.BarcodeInfoes; + + q1 = q1.Where(p1 => p1.BarcodeNo.Equals(no)); + + var barcodeInfo = await q1.ToListAsync(); + + int barcodeId = -1; + if (barcodeInfo != null) + { + barcodeId = barcodeInfo[0].BarcodeID; + } + + IQueryable q = _context.NgInfos; + + q = q.Where(p => p.BarcodeID.Equals(barcodeId)); + + var ngInfo = await q.ToListAsync(); + + foreach (var data in ngInfo) + { + data.Barcode = _context.BarcodeInfoes.Find(data.BarcodeID); + data.Wip = _context.WipInfos.Find(data.WipId); + data.Station = _context.Stationses.Find(data.RuleStationId); + //data.User = _context.UserInfoes.Find(data.OperatorID); + //data.OperatorName = _context.UserInfoes.Find(data.OperatorID).UserName; + } if (ngInfo == null) { @@ -46,7 +129,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return ngInfo; } - // PUT: api/NgInfoe/5 + /// + /// + /// + /// + /// + // PUT: api/NgInfo/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] @@ -72,7 +160,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return result; } - // POST: api/NgInfoe + /// + /// + /// + /// + /// + // POST: api/NgInfo // 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] @@ -96,7 +189,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return result; } - // DELETE: api/NgInfoe/5 + /// + /// + /// + /// + /// + // DELETE: api/NgInfo/5 [HttpDelete("{id}")] public async Task> DeleteNgInfo(decimal id) { diff --git a/AMESCoreStudio.WebApi/Models/AMES/NgComponent.cs b/AMESCoreStudio.WebApi/Models/AMES/NgComponent.cs new file mode 100644 index 00000000..a6c05da0 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/NgComponent.cs @@ -0,0 +1,275 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 測試不良零件資料檔 + /// + [Table("NG_COMPONENT", Schema = "JHAMES")] + public partial class NgComponent + { + /// + /// 不良零件ID + /// + [Key] + [Column("COMPONENT_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + [Display(Name = "不良零件ID")] + public decimal ComponentID { get; set; } + + /// + /// 測試不良ID + /// + [Column("NG_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + [Display(Name = "測試不良ID")] + public decimal NgID { get; set; } + + /// + /// 零件位置代碼 + /// + [Required] + [Column("LOCATION_NO")] + [StringLength(20)] + [DataMember] + [Display(Name = "零件位置代碼")] + public string LocationNo { get; set; } + + /// + /// 不良腳位數量 + /// + [Column("PIN_QTY", TypeName = "NUMBER")] + [DataMember] + [Display(Name = "不良腳位數量")] + public decimal PinQty { get; set; } + + /// + /// 不良原因代碼 + /// + [Required] + [Column("NG_NO")] + [StringLength(6)] + [DataMember] + [Display(Name = "不良原因代碼")] + public string NgNo { get; set; } + + /// + /// 異常描述 + /// + [Required] + [Column("ERROR_DESC")] + [StringLength(300)] + [DataMember] + [Display(Name = "異常描述")] + public string ErrorDesc { get; set; } + + /// + /// 平均高度測試值 + /// + [Column("HEIGHT_AVG", TypeName = "NUMBER")] + [DataMember] + [Display(Name = "平均高度測試值")] + public decimal HeightAvg { get; set; } + + /// + /// 平均面積測試值 + /// + [Column("AREA_AVG", TypeName = "NUMBER")] + [DataMember] + [Display(Name = "平均面積測試值")] + public decimal AreaAvg { get; set; } + + /// + /// 平均體積測試值 + /// + [Column("VOLUME_AVG", TypeName = "NUMBER")] + [DataMember] + [Display(Name = "平均體積測試值")] + public decimal VolumeAvg { get; set; } + + /// + /// 平均X軸偏移量測試值 + /// + [Column("X_OFFSET_AVG", TypeName = "NUMBER")] + [DataMember] + [Display(Name = "平均X軸偏移量測試值")] + public decimal XOffsetAvg { get; set; } + + /// + /// 平均Y軸偏移量測試值 + /// + [Column("Y_OFFSET_AVG", TypeName = "NUMBER")] + [DataMember] + [Display(Name = "平均Y軸偏移量測試值")] + public decimal YOffsetAvg { get; set; } + + /// + /// 處理狀態(0:尚未維修處理, 1:已維修處理, 2:誤判) + /// + [Column("STATUS", TypeName = "NUMBER")] + [DataMember] + [Display(Name = "處理狀態")] + public decimal Status { get; set; } = 0; + + /// + /// 更換料號 + /// + //[Required] + [Column("CHANGE_MATERIAL")] + [StringLength(50)] + [DataMember] + [Display(Name = "更換料號")] + public string ChangeMaterial { get; set; } + + /// + /// PIN + /// + //[Required] + [Column("PIN_NO")] + [StringLength(20)] + [DataMember] + [Display(Name = "PIN")] + public string PinNo { get; set; } + + /// + /// 組件代碼 + /// + //[Required] + [Column("KEY_NO")] + [StringLength(4)] + [DataMember] + [Display(Name = "組件代碼")] + public string KeyNo { get; set; } + + /// + /// 舊組件序號 + /// + //[Required] + [Column("OLD_PART_NO")] + [StringLength(30)] + [DataMember] + [Display(Name = "舊組件序號")] + public string OldPartNo { get; set; } + + /// + /// 新組件序號 + /// + //[Required] + [Column("NEW_PART_NO")] + [StringLength(30)] + [DataMember] + [Display(Name = "新組件序號")] + public string NewPartNo { get; set; } + + /// + /// 料卷號 + /// + //[Required] + [Column("REEL_NO")] + [StringLength(50)] + [DataMember] + [Display(Name = "料卷號")] + public string ReelNo { get; set; } + + /// + /// 回覆原因 + /// + //[Required] + [Column("REPLY_REASON")] + [StringLength(50)] + [DataMember] + [Display(Name = "回覆原因")] + public string ReplyReason { get; set; } + + /// + /// 回覆對策 + /// + //[Required] + [Column("REPLY_MEASURE")] + [StringLength(50)] + [DataMember] + [Display(Name = "回覆對策")] + public string ReplyMeasure { get; set; } + + /// + /// 回覆人員ID + /// + [Column("REPLY_USERID")] + [DataMember] + [Display(Name = "回覆人員ID")] + public int ReplyUserID { get; set; } = 0; + + /// + /// 回覆日期 + /// + [Column("REPLY_DATE")] + [DataMember] + [Display(Name = "回覆日期")] + public DateTime ReplyDate { get; set; } = System.DateTime.Now; + + /// + /// DATECODE + /// + //[Required] + [Column("DATECODE")] + [StringLength(50)] + [DataMember] + [Display(Name = "DATECODE")] + public string DateCode { get; set; } + + + /// + /// 供應商 + /// + [Column("VENDOR_CODE")] + [StringLength(100)] + [DataMember] + [Display(Name = "供應商")] + public string VendorCode { get; set; } + + /// + /// 成品料號 + /// + [Column("SEMI_ITEM_NO")] + [StringLength(100)] + [DataMember] + [Display(Name = "成品料號")] + public string SemiItemNo { get; set; } + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + [Display(Name = "不良時間")] + 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/AMES/NgRepair.cs b/AMESCoreStudio.WebApi/Models/AMES/NgRepair.cs new file mode 100644 index 00000000..9085ff1c --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/NgRepair.cs @@ -0,0 +1,156 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 不良維修資料檔 + /// + [Table("NG_REPAIR", Schema = "JHAMES")] + public partial class NgRepair + { + /// + /// 測試不良ID + /// + [Column("NG_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + public decimal NgID { get; set; } + + /// + /// 不良零件ID + /// + [Column("COMPONENT_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + public decimal ComponentID { get; set; } + + /// + /// 不良維修ID + /// + [Column("REPAIR_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + public decimal RepairID { get; set; } + + /// + /// 是否誤判 + /// + [Required] + [Column("MISSING")] + [StringLength(1)] + [DataMember] + public string Missing { get; set; } = "N"; + + /// + /// 維修代碼 + /// + [Required] + [Column("REPAIR_NO")] + [StringLength(6)] + [DataMember] + public string RepairNo { get; set; } = "N/A"; + + /// + /// 維修說明 + /// + [Required] + [Column("REPAIR_DESC")] + [StringLength(100)] + [DataMember] + public string RepairDesc { get; set; } + + /// + /// 更換組件 + /// + [Required] + [Column("REPLACE")] + [StringLength(1)] + [DataMember] + public string Replace { get; set; } = "N"; + + /// + /// 備註 + /// + [Required] + [Column("MEMO")] + [StringLength(1024)] + [DataMember] + public string Memo { get; set; } + + /// + /// 組件料號 + /// + [Required] + [Column("PART_NO")] + [StringLength(30)] + [DataMember] + public string PartNo { get; set; } + + /// + /// RMA單號 + /// + [Required] + [Column("RMA_NO")] + [StringLength(20)] + [DataMember] + public string RmaNo { get; set; } + + /// + /// 維修方式 + /// + [Required] + [Column("REPAIR_TYPE_NO")] + [StringLength(6)] + [DataMember] + public string RepairTypeNo { get; set; } + + /// + /// 責任單位ID + /// + [Column("REPAIR_RESPONSIBLE_ID")] + [DataMember] + public int RepairResponsibleID { get; set; } + + /// + /// 不良類別 + /// + [Required] + [Column("NG_TYPE_NO")] + [StringLength(6)] + [DataMember] + public string NgTypeNo { 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/AMES/NgRepairBlob.cs b/AMESCoreStudio.WebApi/Models/AMES/NgRepairBlob.cs new file mode 100644 index 00000000..4f54e157 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/NgRepairBlob.cs @@ -0,0 +1,105 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 維修解碼上傳圖檔資料表 + /// + [Table("NG_REPAIR_BLOB", Schema = "JHAMES")] + public partial class NgRepairBlob + { + /// + /// 不良維修ID + /// + [Column("REPAIR_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + public decimal RepairID { get; set; } + + /// + /// 圖檔名稱1 + /// + [Required] + [Column("IMAGE_NAME1")] + [StringLength(50)] + [DataMember] + public string ImageName1 { get; set; } + + /// + /// 圖檔1 + /// + [Required] + [Column("IMAGE_BLOB1")] + [DataMember] + public byte[] ImageBlob1 { get; set; } + + /// + /// 圖檔名稱2 + /// + [Required] + [Column("IMAGE_NAME2")] + [StringLength(50)] + [DataMember] + public string ImageName2 { get; set; } + + /// + /// 圖檔2 + /// + [Required] + [Column("IMAGE_BLOB2")] + [DataMember] + public byte[] ImageBlob2 { get; set; } + + + /// + /// 圖檔名稱3 + /// + [Required] + [Column("IMAGE_NAME3")] + [StringLength(50)] + [DataMember] + public string ImageName3 { get; set; } + + /// + /// 圖檔3 + /// + [Required] + [Column("IMAGE_BLOB3")] + [DataMember] + public byte[] ImageBlob3 { 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/AMES/RepairRecord.cs b/AMESCoreStudio.WebApi/Models/AMES/RepairRecord.cs new file mode 100644 index 00000000..0975914c --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/RepairRecord.cs @@ -0,0 +1,70 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 維修紀錄資料檔 + /// + [Table("REPAIR_RECORD", Schema = "JHAMES")] + public partial class RepairRecord + { + /// + /// 測試不良ID + /// + [Column("NG_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + public decimal NgID { get; set; } + + /// + /// 不良零件ID + /// + [Column("COMPONENT_ID", TypeName = "NUMBER")] + [DataMember] + [Required] + public decimal ComponentID { get; set; } + + /// + /// 維修過程敘述 + /// + [Required] + [Column("REPAIR_DESC")] + [StringLength(100)] + [DataMember] + public string RepairDesc { 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/AMES/RepairResponsibleUnits.cs b/AMESCoreStudio.WebApi/Models/AMES/RepairResponsibleUnits.cs new file mode 100644 index 00000000..049c1728 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/RepairResponsibleUnits.cs @@ -0,0 +1,34 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 維修責任單位 + /// + [Table("REPAIR_RESPONSIBLE_UNITS", Schema = "JHAMES")] + [DataContract] + public class RepairResponsibleUnits + { + /// + /// 維修責任單位ID + /// + [Key] + [Column("REPAIR_RESPONSIBLE_ID")] + [DataMember] + public int RepairResponsibleID { get; set; } + + + /// + /// 維修責任單位描述 + /// + [Column("REPAIR_RESPONSIBLE_DESC")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "維修責任單位描述")] + [StringLength(100, ErrorMessage = "{0},不能大于{1}")] + public string RepairResponsibleDesc { get; set; } + } +} diff --git a/開發文件/Table(維修管理模組).docx b/開發文件/Table(維修管理模組).docx index 9a86a1be..7ff59a4a 100644 --- a/開發文件/Table(維修管理模組).docx +++ b/開發文件/Table(維修管理模組).docx @@ -443,7 +443,7 @@ VARCHAR2 17 -NES_PRAR_NO +NEW_PRAR_NO 新組件序號 VARCHAR2 30 @@ -472,14 +472,14 @@ VARCHAR2 21 REPLY_USERID -'回覆人員 +回覆人員 Number 22 REPLY_DATE -'回覆人員 +回覆日期 DATE