diff --git a/AMESCoreStudio.Web/Controllers/REPController.cs b/AMESCoreStudio.Web/Controllers/REPController.cs index 15461577..8e3d86d9 100644 --- a/AMESCoreStudio.Web/Controllers/REPController.cs +++ b/AMESCoreStudio.Web/Controllers/REPController.cs @@ -16,11 +16,65 @@ namespace AMESCoreStudio.Web.Controllers { private readonly ILogger _logger; public readonly IREP _repApi; + public readonly IPPS _ppsApi; + public readonly IBAS _basApi; - public REPController(ILogger logger, IREP repApi) + public REPController(ILogger logger, IREP repApi, IPPS ppsApi,IBAS basApi) { _logger = logger; _repApi = repApi; + _ppsApi = ppsApi; + _basApi = basApi; + } + + + private async Task GetRMAReasonList() + { + var result = await _ppsApi.GetRMAReasons(); + + var RMAReasonList = new List(); + for (int i = 0; i < result.Count; i++) + { + RMAReasonList.Add(new SelectListItem(result[i].RMAReasonDesc, result[i].RMAReasonNo.ToString())); + } + ViewBag.RMAReasonList = RMAReasonList; + } + + + private async Task GetRepairTypeList() + { + var result = await _ppsApi.GetRepairTypes(); + + var RepairTypeList = new List(); + for (int i = 0; i < result.Count; i++) + { + RepairTypeList.Add(new SelectListItem(result[i].RepairTypeDesc, result[i].RepairTypeNo.ToString())); + } + ViewBag.RepairTypeList = RepairTypeList; + } + + private async Task GetNGReasonList() + { + var result = await _ppsApi.GetNGReasons(); + + var NGReasonList = new List(); + for (int i = 0; i < result.Count; i++) + { + NGReasonList.Add(new SelectListItem(result[i].NGReasonDesc, result[i].NGReasonNo.ToString())); + } + ViewBag.NGReasonList = NGReasonList; + } + + private async Task GetRepairResponsibleUnitList() + { + var result = await _basApi.GetRepairResponsibleUnitses(); + + var RepairResponsibleUnitList = new List(); + for (int i = 0; i < result.Count; i++) + { + RepairResponsibleUnitList.Add(new SelectListItem(result[i].RRDesc, result[i].RRID.ToString())); + } + ViewBag.RepairResponsibleUnitList = RepairResponsibleUnitList; } #region REP001 前判維修輸入 @@ -71,6 +125,11 @@ namespace AMESCoreStudio.Web.Controllers public async Task REP001R(int id) { + await GetRMAReasonList(); + await GetRepairTypeList(); + await GetNGReasonList(); + await GetRepairResponsibleUnitList(); + REP001ViewModel model = new REP001ViewModel(); var result1 = await _repApi.GetNgComponent(id); if (result1.Count != 0) @@ -82,6 +141,18 @@ namespace AMESCoreStudio.Web.Controllers { model.ngInfo = result2[0]; } + + var result3 = await _repApi.GetRepairRecord((int)result1[0].ComponentID); + if (result3.Count != 0) + { + model.repairRecord = result3[0]; + } + + var result4 = await _repApi.GetNgRepairByComponent((int)result1[0].ComponentID); + if (result4.Count != 0) + { + model.ngRepair = result4[0]; + } } return View(model); @@ -108,6 +179,28 @@ namespace AMESCoreStudio.Web.Controllers result = await _repApi.PutNgComponent((int)model.ngComponent.ComponentID,JsonConvert.SerializeObject(model.ngComponent)); + if (model.repairRecord.ComponentID > 0) + { + result = await _repApi.PutRepairRecord((int)model.repairRecord.ComponentID, JsonConvert.SerializeObject(model.repairRecord)); + } + else + { + model.repairRecord.NgID = model.ngComponent.NgID; + model.repairRecord.ComponentID = model.ngComponent.ComponentID; + result = await _repApi.PostRepairRecord(JsonConvert.SerializeObject(model.repairRecord)); + } + + if (model.ngRepair.RepairID > 0) + { + result = await _repApi.PutNgRepair((int)model.ngRepair.RepairID, JsonConvert.SerializeObject(model.ngRepair)); + } + else + { + model.ngRepair.NgID = model.ngComponent.NgID; + model.ngRepair.ComponentID = model.ngComponent.ComponentID; + result = await _repApi.PostNgRepair(JsonConvert.SerializeObject(model.ngRepair)); + } + if (result.Success) { var _msg = "保存成功!"; diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IREP.cs b/AMESCoreStudio.Web/HttpApis/AMES/IREP.cs index 49def78e..8fcf3ba4 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IREP.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IREP.cs @@ -49,6 +49,57 @@ namespace AMESCoreStudio.Web /// [WebApiClient.Attributes.HttpPut("api/NgComponents/{id}")] ITask> PutNgComponent(int id, [FromBody, RawJsonContent] string model); + + /// + /// 根據COMPONENT_ID獲取指定維修過程資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/RepairRecords/{id}")] + ITask> GetRepairRecord(int id); + + /// + /// 新增維修過程資料 + /// + /// + [WebApiClient.Attributes.HttpPost("api/RepairRecords")] + ITask> PostRepairRecord([FromBody, RawJsonContent] string model); + + /// + /// 更新維修過程資料 + /// + /// + [WebApiClient.Attributes.HttpPut("api/RepairRecords/{id}")] + ITask> PutRepairRecord(int id, [FromBody, RawJsonContent] string model); + + + /// + /// 根據ID獲取指定維修過程資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/NgRepairs/{id}")] + ITask> GetNgRepair(int id); + + /// + /// 根據COMPONENT_ID獲取指定維修過程資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/NgRepairs/Component/{id}")] + ITask> GetNgRepairByComponent(int id); + + /// + /// 新增不良維修資料 + /// + /// + [WebApiClient.Attributes.HttpPost("api/NgRepairs")] + ITask> PostNgRepair([FromBody, RawJsonContent] string model); + + /// + /// 更新不良維修資料 + /// + /// + [WebApiClient.Attributes.HttpPut("api/NgRepairs/{id}")] + ITask> PutNgRepair(int id, [FromBody, RawJsonContent] string model); + #endregion } } diff --git a/AMESCoreStudio.Web/ViewModels/REP/REP001ViewModel.cs b/AMESCoreStudio.Web/ViewModels/REP/REP001ViewModel.cs index 2fd44693..caffd52b 100644 --- a/AMESCoreStudio.Web/ViewModels/REP/REP001ViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/REP/REP001ViewModel.cs @@ -14,5 +14,9 @@ namespace AMESCoreStudio.Web.ViewModels public NgComponent ngComponent { get; set; } + public RepairRecord repairRecord { get; set; } + + public NgRepair ngRepair { get; set; } + } } diff --git a/AMESCoreStudio.Web/Views/REP/REP001R.cshtml b/AMESCoreStudio.Web/Views/REP/REP001R.cshtml index a0bb4857..de8539d9 100644 --- a/AMESCoreStudio.Web/Views/REP/REP001R.cshtml +++ b/AMESCoreStudio.Web/Views/REP/REP001R.cshtml @@ -32,6 +32,13 @@ + + + + + + +
@@ -129,10 +136,76 @@
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
@Html.ValidationMessage("error") - +
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgRepairBlobsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgRepairBlobsController.cs new file mode 100644 index 00000000..876b2d38 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgRepairBlobsController.cs @@ -0,0 +1,180 @@ +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 NgRepairBlobsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public NgRepairBlobsController(AMESContext context) + { + _context = context; + } + + /// + /// + /// + /// + // GET: api/NgRepairBlobs + [HttpGet] + public async Task>> GetNgRepairBlob() + { + return await _context.NgRepairBlobs.ToListAsync(); + } + + /// + /// + /// + /// + /// + // GET: api/NgRepairBlobs/5 + [HttpGet("{id}")] + public async Task>> GetNgRepairBlob(int id) + { + IQueryable q = _context.NgRepairBlobs; + q = q.Where(p => p.RepairID.Equals(id)); + + var ngRepairBlob = await q.ToListAsync(); + + if (ngRepairBlob == null) + { + return NotFound(); + } + + return ngRepairBlob; + } + + /// + /// + /// + /// + /// + /// + // PUT: api/NgRepairBlobs/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> PutNgRepairBlob(int id, NgRepairBlob ngRepairBlob) + { + ResultModel result = new ResultModel(); + + if (id != ngRepairBlob.RepairID) + { + result.Success = false; + result.Msg = "不良維修ID錯誤"; + return result; + } + + _context.Entry(ngRepairBlob).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!NgRepairBlobExists(id)) + { + result.Success = false; + result.Msg = "不良維修ID不存在"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // POST: api/NgRepairBlobs + // 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> PostNgRepairBlob(NgRepairBlob ngRepairBlob) + { + ResultModel result = new ResultModel(); + + _context.NgRepairBlobs.Add(ngRepairBlob); + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateException) + { + if (NgRepairBlobExists(ngRepairBlob.RepairID)) + { + result.Success = false; + result.Msg = "不良維修ID重複"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // DELETE: api/NgRepairBlobs/5 + [HttpDelete("{id}")] + public async Task> DeleteNgRepairBlob(decimal id) + { + ResultModel result = new ResultModel(); + + var ngRepairBlob = await _context.NgRepairBlobs.FindAsync(id); + if (ngRepairBlob == null) + { + result.Success = false; + result.Msg = "不良維修ID不存在"; + return result; + } + + _context.NgRepairBlobs.Remove(ngRepairBlob); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool NgRepairBlobExists(decimal id) + { + return _context.NgRepairBlobs.Any(e => e.RepairID == id); + } + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgRepairsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgRepairsController.cs new file mode 100644 index 00000000..274211f1 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgRepairsController.cs @@ -0,0 +1,205 @@ +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 NgRepairsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public NgRepairsController(AMESContext context) + { + _context = context; + } + + /// + /// + /// + /// + // GET: api/NgRepairs + [HttpGet] + public async Task>> GetNgRepair() + { + return await _context.NgRepairs.ToListAsync(); + } + + /// + /// + /// + /// + /// + // GET: api/NgRepairs/5 + [HttpGet("{id}")] + public async Task>> GetNgRepair(int id) + { + IQueryable q = _context.NgRepairs; + q = q.Where(p => p.RepairID.Equals(id)); + + var ngRepair = await q.ToListAsync(); + + if (ngRepair == null) + { + return NotFound(); + } + + return ngRepair; + } + + /// + /// + /// + /// + /// + // GET: api/NgRepairs/5 + [HttpGet("Component/{id}")] + public async Task>> GetNgRepairByComponent(int id) + { + IQueryable q = _context.NgRepairs; + q = q.Where(p => p.ComponentID.Equals(id)); + + var ngRepair = await q.ToListAsync(); + + if (ngRepair == null) + { + return NotFound(); + } + + return ngRepair; + } + + /// + /// + /// + /// + /// + /// + // PUT: api/NgRepairs/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> PutNgRepair(int id, NgRepair ngRepair) + { + ResultModel result = new ResultModel(); + + if (id != ngRepair.RepairID) + { + result.Success = false; + result.Msg = "不良維修ID錯誤"; + return result; + } + + _context.Entry(ngRepair).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!NgRepairExists(id)) + { + result.Success = false; + result.Msg = "不良維修ID不存在"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // POST: api/NgRepairs + // 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> PostNgRepair(NgRepair ngRepair) + { + ResultModel result = new ResultModel(); + + Helper helper = new Helper(_context); + ngRepair.RepairID = helper.GetIDKey("REPAIR_ID").Result; + + _context.NgRepairs.Add(ngRepair); + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateException) + { + if (NgRepairExists(ngRepair.RepairID)) + { + result.Success = false; + result.Msg = "不良維修ID重複"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // DELETE: api/NgRepairs/5 + [HttpDelete("{id}")] + public async Task> DeleteNgRepair(decimal id) + { + ResultModel result = new ResultModel(); + + var ngRepair = await _context.NgRepairs.FindAsync(id); + if (ngRepair == null) + { + result.Success = false; + result.Msg = "不良維修ID不存在"; + return result; + } + + _context.NgRepairs.Remove(ngRepair); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool NgRepairExists(decimal id) + { + return _context.NgRepairs.Any(e => e.RepairID == id); + } + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/RepairRecordsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/RepairRecordsController.cs new file mode 100644 index 00000000..9507106c --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/RepairRecordsController.cs @@ -0,0 +1,178 @@ +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 RepairRecordsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public RepairRecordsController(AMESContext context) + { + _context = context; + } + + /// + /// + /// + /// + // GET: api/RepairRecords + [HttpGet] + public async Task>> GetRepairRecord() + { + return await _context.RepairRecords.ToListAsync(); + } + + /// + /// + /// + /// + /// + // GET: api/RepairRecords/5 + [HttpGet("{id}")] + public async Task>> GetRepairRecord(int id) + { + IQueryable q = _context.RepairRecords; + q = q.Where(p => p.ComponentID.Equals(id)); + + var repairRecord = await q.ToListAsync(); + + if (repairRecord == null) + { + return NotFound(); + } + + return repairRecord; + } + + /// + /// + /// + /// + /// + /// + // PUT: api/RepairRecords/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> PutRepairRecord(int id, RepairRecord repairRecord) + { + ResultModel result = new ResultModel(); + if (id != repairRecord.ComponentID) + { + result.Success = false; + result.Msg = "不良零件ID錯誤"; + return result; + } + + _context.Entry(repairRecord).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!RepairRecordExists(id)) + { + result.Success = false; + result.Msg = "不良零件ID不存在"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // POST: api/RepairRecords + // 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> PostRepairRecord(RepairRecord repairRecord) + { + ResultModel result = new ResultModel(); + + _context.RepairRecords.Add(repairRecord); + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateException) + { + if (RepairRecordExists(repairRecord.ComponentID)) + { + result.Success = false; + result.Msg = "不良零件ID重複"; + return result; + } + else + { + throw; + } + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// + /// + /// + /// + // DELETE: api/RepairRecords/5 + [HttpDelete("{id}")] + public async Task> DeleteRepairRecord(decimal id) + { + ResultModel result = new ResultModel(); + var repairRecord = await _context.RepairRecords.FindAsync(id); + if (repairRecord == null) + { + result.Success = false; + result.Msg = "不良零件ID不存在"; + return result; + } + + _context.RepairRecords.Remove(repairRecord); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool RepairRecordExists(decimal id) + { + return _context.RepairRecords.Any(e => e.ComponentID == id); + } + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/BAS/RepairResponsibleUnitsesController.cs b/AMESCoreStudio.WebApi/Controllers/BAS/RepairResponsibleUnitsesController.cs index 0d279070..9574e0bb 100644 --- a/AMESCoreStudio.WebApi/Controllers/BAS/RepairResponsibleUnitsesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BAS/RepairResponsibleUnitsesController.cs @@ -11,7 +11,7 @@ using AMESCoreStudio.WebApi.Models.BAS; namespace AMESCoreStudio.WebApi.Controllers.BAS { /// - /// 工廠资料维护 + /// 維修責任單位维护 /// [Route("api/[controller]")] [ApiController] @@ -29,7 +29,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS } /// - /// 获取全部工廠资料 + /// 获取維修責任單位资料 /// /// // GET: api/RepairResponsibleUnitses @@ -45,7 +45,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS } /// - /// 用ID获取该工廠资料 + /// 用ID获取維修責任單位资料 /// /// /// @@ -67,7 +67,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS } /// - /// 更新工廠资料 + /// 更新維修責任單位资料 /// /// /// @@ -105,7 +105,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS } /// - /// 新增工廠资料 + /// 新增維修責任單位资料 /// /// /// @@ -126,7 +126,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS } /// - /// 删除工廠资料 + /// 删除維修責任單位资料 /// /// /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/NgRepair.cs b/AMESCoreStudio.WebApi/Models/AMES/NgRepair.cs index 9085ff1c..77e7e8b7 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/NgRepair.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/NgRepair.cs @@ -35,6 +35,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("REPAIR_ID", TypeName = "NUMBER")] [DataMember] [Required] + [Key] public decimal RepairID { get; set; } /// @@ -44,6 +45,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("MISSING")] [StringLength(1)] [DataMember] + [Display(Name = "是否誤判")] public string Missing { get; set; } = "N"; /// @@ -53,6 +55,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("REPAIR_NO")] [StringLength(6)] [DataMember] + [Display(Name = "維修代碼")] public string RepairNo { get; set; } = "N/A"; /// @@ -62,6 +65,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("REPAIR_DESC")] [StringLength(100)] [DataMember] + [Display(Name = "維修說明")] public string RepairDesc { get; set; } /// @@ -71,15 +75,16 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("REPLACE")] [StringLength(1)] [DataMember] + [Display(Name = "更換組件")] public string Replace { get; set; } = "N"; /// /// 備註 /// - [Required] [Column("MEMO")] [StringLength(1024)] [DataMember] + [Display(Name = "備註")] public string Memo { get; set; } /// @@ -89,6 +94,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("PART_NO")] [StringLength(30)] [DataMember] + [Display(Name = "組件料號")] public string PartNo { get; set; } /// @@ -98,6 +104,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("RMA_NO")] [StringLength(20)] [DataMember] + [Display(Name = "RMA單號")] public string RmaNo { get; set; } /// @@ -107,6 +114,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("REPAIR_TYPE_NO")] [StringLength(6)] [DataMember] + [Display(Name = "維修方式")] public string RepairTypeNo { get; set; } /// @@ -114,6 +122,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("REPAIR_RESPONSIBLE_ID")] [DataMember] + [Display(Name = "責任單位")] public int RepairResponsibleID { get; set; } /// @@ -123,6 +132,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("NG_TYPE_NO")] [StringLength(6)] [DataMember] + [Display(Name = "不良類別")] public string NgTypeNo { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/NgRepairBlob.cs b/AMESCoreStudio.WebApi/Models/AMES/NgRepairBlob.cs index 4f54e157..9efb7a9f 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/NgRepairBlob.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/NgRepairBlob.cs @@ -19,6 +19,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("REPAIR_ID", TypeName = "NUMBER")] [DataMember] [Required] + [Key] public decimal RepairID { get; set; } /// @@ -28,6 +29,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("IMAGE_NAME1")] [StringLength(50)] [DataMember] + [Display(Name = "圖檔名稱1")] public string ImageName1 { get; set; } /// @@ -45,6 +47,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("IMAGE_NAME2")] [StringLength(50)] [DataMember] + [Display(Name = "圖檔名稱2")] public string ImageName2 { get; set; } /// @@ -63,6 +66,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("IMAGE_NAME3")] [StringLength(50)] [DataMember] + [Display(Name = "圖檔名稱3")] public string ImageName3 { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/RepairRecord.cs b/AMESCoreStudio.WebApi/Models/AMES/RepairRecord.cs index 0975914c..c902e52d 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/RepairRecord.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/RepairRecord.cs @@ -24,6 +24,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// /// 不良零件ID /// + [Key] [Column("COMPONENT_ID", TypeName = "NUMBER")] [DataMember] [Required] @@ -35,6 +36,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Required] [Column("REPAIR_DESC")] [StringLength(100)] + [Display(Name = "維修過程敘述")] [DataMember] public string RepairDesc { get; set; } diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index ce0ded90..a934bfc8 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -594,6 +594,21 @@ namespace AMESCoreStudio.WebApi /// 測試不良基本資料檔 /// public DbSet NgComponents { get; set; } + + /// + /// 維修紀錄資料檔 + /// + public DbSet RepairRecords { get; set; } + + /// + /// 不良維修資料檔 + /// + public DbSet NgRepairs { get; set; } + + /// + /// 維修解碼上傳圖檔資料表 + /// + public DbSet NgRepairBlobs { get; set; } } } diff --git a/AMESCoreStudio.WebApi/Models/BAS/RepairResponsibleUnits.cs b/AMESCoreStudio.WebApi/Models/BAS/RepairResponsibleUnits.cs index 32f149ab..a272018c 100644 --- a/AMESCoreStudio.WebApi/Models/BAS/RepairResponsibleUnits.cs +++ b/AMESCoreStudio.WebApi/Models/BAS/RepairResponsibleUnits.cs @@ -6,7 +6,7 @@ using System.Runtime.Serialization; namespace AMESCoreStudio.WebApi.Models.BAS { /// - /// 站别資料 + /// 維修責任單位 /// [Table("REPAIR_RESPONSIBLE_UNITS", Schema = "JHAMES")] [DataContract]