15 changed files with 1607 additions and 10 deletions
@ -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<REPController> _logger; |
||||
|
public readonly IREP _repApi; |
||||
|
|
||||
|
public REPController(ILogger<REPController> logger, IREP repApi) |
||||
|
{ |
||||
|
_logger = logger; |
||||
|
_repApi = repApi; |
||||
|
} |
||||
|
|
||||
|
#region REP001 前判維修輸入
|
||||
|
|
||||
|
public IActionResult REP001() |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> 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<IActionResult> 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<IActionResult> 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<IActionResult> 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<IActionResult> 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
|
||||
|
} |
||||
|
} |
@ -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 前判維修輸入
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據測試不良ID獲取指定不良資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/NgInfo/{id}")] |
||||
|
ITask<List<NgInfo>> GetNgInfo(int id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據條碼獲取指定不良資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/NgInfo/Barcode/{no}")] |
||||
|
ITask<List<NgInfo>> GetNgInfoByBarcode(string no); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據NG_ID獲取指定不良零件資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/NgComponents/NGID/{id}")] |
||||
|
ITask<List<NgComponent>> GetNgComponentByNGID(int id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據COMPONENT_ID獲取指定不良零件資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/NgComponents/{id}")] |
||||
|
ITask<List<NgComponent>> GetNgComponent(int id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新不良零件資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPut("api/NgComponents/{id}")] |
||||
|
ITask<ResultModel<NgComponent>> PutNgComponent(int id, [FromBody, RawJsonContent] string model); |
||||
|
#endregion
|
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,122 @@ |
|||||
|
@model AMESCoreStudio.Web.ViewModels.REP001ViewModel |
||||
|
|
||||
|
@{ |
||||
|
ViewData["Title"] = "前判維修輸入"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
||||
|
} |
||||
|
|
||||
|
<style type="text/css"> |
||||
|
.layui-table-main .layui-table-cell { |
||||
|
/*height: auto !important;*/ |
||||
|
white-space: normal; |
||||
|
} |
||||
|
|
||||
|
.layui-table img { |
||||
|
max-width: 60px; |
||||
|
max-height: 28px; |
||||
|
} |
||||
|
|
||||
|
.layui-tree-main { |
||||
|
cursor: pointer; |
||||
|
padding-right: 10px; |
||||
|
float: left; |
||||
|
border-width: 1px; |
||||
|
border-style: solid; |
||||
|
border-color: #e6e6e6; |
||||
|
margin: 10px 0; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"> |
||||
|
<div class="layui-form"> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label">不良條碼:</label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input id="barcodeNo" name="barcodeNo" autocomplete="off" class="layui-input" placeholder="請輸入不良條碼"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-inline layui-show-xs-block"> |
||||
|
<button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="querysubmit"> |
||||
|
<i class="layui-icon layui-icon-sm"></i> |
||||
|
</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts{ |
||||
|
<script type="text/javascript"> |
||||
|
|
||||
|
|
||||
|
layui.use(['form', 'jquery', 'layer'], function () { |
||||
|
form = layui.form; |
||||
|
|
||||
|
var qs = $('button[lay-filter="querysubmit"]'); |
||||
|
qs.click(); |
||||
|
}); |
||||
|
|
||||
|
//监听表单提交事件 |
||||
|
hg.form.onsubmit('querysubmit', function (data) { |
||||
|
hg.msghide("重新載入資料.."); |
||||
|
table && table.reload(data); |
||||
|
}); |
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'ngID', |
||||
|
title: '測試不良ID' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'typeNo', |
||||
|
width: 120, |
||||
|
title: '測試種類代碼' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'station', |
||||
|
title: '站別名稱', |
||||
|
width: 160, |
||||
|
sort: true, |
||||
|
templet: function (d) { |
||||
|
return d.station['stationName']; |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'testStatus', |
||||
|
width: 120, |
||||
|
title: '測試狀態' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'status', |
||||
|
width: 120, |
||||
|
title: '處理狀態' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" lay-event="detail"> 檢視 </a>' |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
function detail(obj) { |
||||
|
if (obj.data.ngID) { |
||||
|
hg.open('檢視不良資料', '/REP/REP001V/' + obj.data.ngID, '', '', true); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '測試不良資料', '/REP/GetNgInfoByBarcode', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
|
||||
|
</script> |
||||
|
} |
@ -0,0 +1,158 @@ |
|||||
|
@model AMESCoreStudio.Web.ViewModels.REP001ViewModel |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "REP001R"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; } |
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
|
||||
|
.text-error { |
||||
|
color: #dc3545 !important; |
||||
|
} |
||||
|
|
||||
|
.my-read-only-class { |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" class="layui-form" method="post" asp-action="REP001RSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
<input type="hidden" asp-for="ngComponent.ComponentID" /> |
||||
|
<input type="hidden" asp-for="ngComponent.NgID" /> |
||||
|
<input type="hidden" asp-for="ngComponent.PinQty" /> |
||||
|
|
||||
|
<input type="hidden" asp-for="ngComponent.HeightAvg" /> |
||||
|
<input type="hidden" asp-for="ngComponent.AreaAvg" /> |
||||
|
<input type="hidden" asp-for="ngComponent.VolumeAvg" /> |
||||
|
<input type="hidden" asp-for="ngComponent.XOffsetAvg" /> |
||||
|
<input type="hidden" asp-for="ngComponent.YOffsetAvg" /> |
||||
|
|
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label" style="color:red">條碼資料</label> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="ngInfo.Barcode.BarcodeNo" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Barcode.BarcodeNo" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Barcode.BarcodeNo" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.Wip.WipNO" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Wip.WipNO" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Wip.WipNO" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.Station.TestType" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Station.TestType" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Station.TestType" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="ngInfo.TestStatus" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.TestStatus" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.TestStatus" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.OperatorID" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.OperatorID" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.OperatorID" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.StartTime" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.StartTime" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.StartTime" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="ngInfo.Station.StationName" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Station.StationName" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Station.StationName" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.NgMemo" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.NgMemo" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.NgMemo" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label" style="color:red">不良資料</label> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="ngComponent.LocationNo" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngComponent.LocationNo" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngComponent.LocationNo" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngComponent.NgNo" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngComponent.NgNo" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngComponent.NgNo" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngComponent.ErrorDesc" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngComponent.ErrorDesc" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngComponent.ErrorDesc" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="ngComponent.PinNo" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngComponent.PinNo" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngComponent.PinNo" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngComponent.CreateDate" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngComponent.CreateDate" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngComponent.CreateDate" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div style="text-align:center"> |
||||
|
<div class="layui-inline"> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<input type="submit" value="確認" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,162 @@ |
|||||
|
@model AMESCoreStudio.Web.ViewModels.REP001ViewModel |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "REP001V"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; } |
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
|
||||
|
.text-error { |
||||
|
color: #dc3545 !important; |
||||
|
} |
||||
|
|
||||
|
.my-read-only-class { |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" class="layui-form"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label" style="color:red">條碼資料</label> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="ngInfo.Barcode.BarcodeNo" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Barcode.BarcodeNo" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Barcode.BarcodeNo" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.Wip.WipNO" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Wip.WipNO" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Wip.WipNO" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.Station.TestType" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Station.TestType" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Station.TestType" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.TestStatus" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.TestStatus" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.TestStatus" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="ngInfo.OperatorID" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.OperatorID" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.OperatorID" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.StartTime" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.StartTime" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.StartTime" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.Station.StationName" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.Station.StationName" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.Station.StationName" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
<label asp-for="ngInfo.NgMemo" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="ngInfo.NgMemo" class="layui-input" autocomplete="off" /> |
||||
|
<span asp-validation-for="ngInfo.NgMemo" class="layui-bg-red"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
<script type="text/javascript"> |
||||
|
|
||||
|
//监听表单提交事件 |
||||
|
hg.form.onsubmit('querysubmit', function (data) { |
||||
|
table && table.reload(data); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'componentID', |
||||
|
width: 150, |
||||
|
title: '不良零件ID', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'locationNo', |
||||
|
title: '零件位置代碼', |
||||
|
width: 200, |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'pinQty', |
||||
|
title: '不良腳位數量', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'ngNo', |
||||
|
title: '不良原因代碼', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'status', |
||||
|
title: '狀態', |
||||
|
width: 100, |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'createDate', |
||||
|
title: '建立日期', |
||||
|
width: 150, |
||||
|
templet: '<div>{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd") }}</div>' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'updateDate', |
||||
|
title: '更新日期', |
||||
|
width: 150, |
||||
|
templet: '<div>{{ layui.util.toDateString(d.updateDate, "yyyy/MM/dd") }}</div>' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 80, |
||||
|
title: '操作', |
||||
|
align: 'center', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="repair"> 維修 </a>' |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
//通过行tool编辑,lay-event="edit" |
||||
|
function repair(obj) { |
||||
|
if (obj.data.componentID) { |
||||
|
hg.open('維修輸入', '/REP/REP001R/' + obj.data.componentID, 1280, 720); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '測試不良零件維護', '/REP/GetNgComponentByNGID/' + @Model.ngInfo.NgID, {}, tableCols, false, false, 'full-100'); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -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 |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 測試不良零件資料檔
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class NgComponentsController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public NgComponentsController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/NgComponents
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<NgComponent>>> GetNgComponent() |
||||
|
{ |
||||
|
return await _context.NgComponents.ToListAsync(); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/NgComponents/5
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<NgComponent>>> GetNgComponent(int id) |
||||
|
{ |
||||
|
IQueryable<NgComponent> q = _context.NgComponents; |
||||
|
|
||||
|
q = q.Where(p => p.ComponentID.Equals(id)); |
||||
|
|
||||
|
var ngComponent = await q.ToListAsync(); |
||||
|
|
||||
|
if (ngComponent == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return ngComponent; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/NgComponents/5
|
||||
|
[HttpGet("NGID/{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<NgComponent>>> GetNgComponentByNGID(int id) |
||||
|
{ |
||||
|
IQueryable<NgComponent> 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(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="ngComponent"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// 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<ResultModel<NgComponent>> PutNgComponent(int id, NgComponent ngComponent) |
||||
|
{ |
||||
|
ResultModel<NgComponent> result = new ResultModel<NgComponent>(); |
||||
|
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; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="ngComponent"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// 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<ResultModel<NgComponent>> PostNgComponent(NgComponent ngComponent) |
||||
|
{ |
||||
|
ResultModel<NgComponent> result = new ResultModel<NgComponent>(); |
||||
|
|
||||
|
_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; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// DELETE: api/NgComponents/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public async Task<ResultModel<NgComponent>> DeleteNgComponent(decimal id) |
||||
|
{ |
||||
|
ResultModel<NgComponent> result = new ResultModel<NgComponent>(); |
||||
|
|
||||
|
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); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -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 |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 測試不良零件資料檔
|
||||
|
/// </summary>
|
||||
|
[Table("NG_COMPONENT", Schema = "JHAMES")] |
||||
|
public partial class NgComponent |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 不良零件ID
|
||||
|
/// </summary>
|
||||
|
[Key] |
||||
|
[Column("COMPONENT_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
[Display(Name = "不良零件ID")] |
||||
|
public decimal ComponentID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 測試不良ID
|
||||
|
/// </summary>
|
||||
|
[Column("NG_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
[Display(Name = "測試不良ID")] |
||||
|
public decimal NgID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 零件位置代碼
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("LOCATION_NO")] |
||||
|
[StringLength(20)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "零件位置代碼")] |
||||
|
public string LocationNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不良腳位數量
|
||||
|
/// </summary>
|
||||
|
[Column("PIN_QTY", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "不良腳位數量")] |
||||
|
public decimal PinQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不良原因代碼
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("NG_NO")] |
||||
|
[StringLength(6)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "不良原因代碼")] |
||||
|
public string NgNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常描述
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("ERROR_DESC")] |
||||
|
[StringLength(300)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "異常描述")] |
||||
|
public string ErrorDesc { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 平均高度測試值
|
||||
|
/// </summary>
|
||||
|
[Column("HEIGHT_AVG", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "平均高度測試值")] |
||||
|
public decimal HeightAvg { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 平均面積測試值
|
||||
|
/// </summary>
|
||||
|
[Column("AREA_AVG", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "平均面積測試值")] |
||||
|
public decimal AreaAvg { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 平均體積測試值
|
||||
|
/// </summary>
|
||||
|
[Column("VOLUME_AVG", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "平均體積測試值")] |
||||
|
public decimal VolumeAvg { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 平均X軸偏移量測試值
|
||||
|
/// </summary>
|
||||
|
[Column("X_OFFSET_AVG", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "平均X軸偏移量測試值")] |
||||
|
public decimal XOffsetAvg { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 平均Y軸偏移量測試值
|
||||
|
/// </summary>
|
||||
|
[Column("Y_OFFSET_AVG", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "平均Y軸偏移量測試值")] |
||||
|
public decimal YOffsetAvg { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 處理狀態(0:尚未維修處理, 1:已維修處理, 2:誤判)
|
||||
|
/// </summary>
|
||||
|
[Column("STATUS", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "處理狀態")] |
||||
|
public decimal Status { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更換料號
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("CHANGE_MATERIAL")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "更換料號")] |
||||
|
public string ChangeMaterial { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// PIN
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("PIN_NO")] |
||||
|
[StringLength(20)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "PIN")] |
||||
|
public string PinNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 組件代碼
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("KEY_NO")] |
||||
|
[StringLength(4)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "組件代碼")] |
||||
|
public string KeyNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 舊組件序號
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("OLD_PART_NO")] |
||||
|
[StringLength(30)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "舊組件序號")] |
||||
|
public string OldPartNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新組件序號
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("NEW_PART_NO")] |
||||
|
[StringLength(30)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "新組件序號")] |
||||
|
public string NewPartNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 料卷號
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("REEL_NO")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "料卷號")] |
||||
|
public string ReelNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 回覆原因
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("REPLY_REASON")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "回覆原因")] |
||||
|
public string ReplyReason { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 回覆對策
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("REPLY_MEASURE")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "回覆對策")] |
||||
|
public string ReplyMeasure { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 回覆人員ID
|
||||
|
/// </summary>
|
||||
|
[Column("REPLY_USERID")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "回覆人員ID")] |
||||
|
public int ReplyUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 回覆日期
|
||||
|
/// </summary>
|
||||
|
[Column("REPLY_DATE")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "回覆日期")] |
||||
|
public DateTime ReplyDate { get; set; } = System.DateTime.Now; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// DATECODE
|
||||
|
/// </summary>
|
||||
|
//[Required]
|
||||
|
[Column("DATECODE")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "DATECODE")] |
||||
|
public string DateCode { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 供應商
|
||||
|
/// </summary>
|
||||
|
[Column("VENDOR_CODE")] |
||||
|
[StringLength(100)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "供應商")] |
||||
|
public string VendorCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 成品料號
|
||||
|
/// </summary>
|
||||
|
[Column("SEMI_ITEM_NO")] |
||||
|
[StringLength(100)] |
||||
|
[DataMember] |
||||
|
[Display(Name = "成品料號")] |
||||
|
public string SemiItemNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建者ID
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int CreateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建日期
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_DATE")] |
||||
|
[DataMember] |
||||
|
[Display(Name = "不良時間")] |
||||
|
public DateTime CreateDate { get; set; } = System.DateTime.Now; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新者ID
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int UpdateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新日期
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_DATE", TypeName = "DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime UpdateDate { get; set; } = System.DateTime.Now; |
||||
|
} |
||||
|
} |
@ -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 |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 不良維修資料檔
|
||||
|
/// </summary>
|
||||
|
[Table("NG_REPAIR", Schema = "JHAMES")] |
||||
|
public partial class NgRepair |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 測試不良ID
|
||||
|
/// </summary>
|
||||
|
[Column("NG_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
public decimal NgID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不良零件ID
|
||||
|
/// </summary>
|
||||
|
[Column("COMPONENT_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
public decimal ComponentID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不良維修ID
|
||||
|
/// </summary>
|
||||
|
[Column("REPAIR_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
public decimal RepairID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 是否誤判
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("MISSING")] |
||||
|
[StringLength(1)] |
||||
|
[DataMember] |
||||
|
public string Missing { get; set; } = "N"; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 維修代碼
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("REPAIR_NO")] |
||||
|
[StringLength(6)] |
||||
|
[DataMember] |
||||
|
public string RepairNo { get; set; } = "N/A"; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 維修說明
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("REPAIR_DESC")] |
||||
|
[StringLength(100)] |
||||
|
[DataMember] |
||||
|
public string RepairDesc { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更換組件
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("REPLACE")] |
||||
|
[StringLength(1)] |
||||
|
[DataMember] |
||||
|
public string Replace { get; set; } = "N"; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 備註
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("MEMO")] |
||||
|
[StringLength(1024)] |
||||
|
[DataMember] |
||||
|
public string Memo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 組件料號
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("PART_NO")] |
||||
|
[StringLength(30)] |
||||
|
[DataMember] |
||||
|
public string PartNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// RMA單號
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("RMA_NO")] |
||||
|
[StringLength(20)] |
||||
|
[DataMember] |
||||
|
public string RmaNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 維修方式
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("REPAIR_TYPE_NO")] |
||||
|
[StringLength(6)] |
||||
|
[DataMember] |
||||
|
public string RepairTypeNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 責任單位ID
|
||||
|
/// </summary>
|
||||
|
[Column("REPAIR_RESPONSIBLE_ID")] |
||||
|
[DataMember] |
||||
|
public int RepairResponsibleID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不良類別
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("NG_TYPE_NO")] |
||||
|
[StringLength(6)] |
||||
|
[DataMember] |
||||
|
public string NgTypeNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建者ID
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int CreateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建日期
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime CreateDate { get; set; } = System.DateTime.Now; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新者ID
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int UpdateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新日期
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_DATE", TypeName = "DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime UpdateDate { get; set; } = System.DateTime.Now; |
||||
|
} |
||||
|
} |
@ -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 |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 維修解碼上傳圖檔資料表
|
||||
|
/// </summary>
|
||||
|
[Table("NG_REPAIR_BLOB", Schema = "JHAMES")] |
||||
|
public partial class NgRepairBlob |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 不良維修ID
|
||||
|
/// </summary>
|
||||
|
[Column("REPAIR_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
public decimal RepairID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 圖檔名稱1
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("IMAGE_NAME1")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
public string ImageName1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 圖檔1
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("IMAGE_BLOB1")] |
||||
|
[DataMember] |
||||
|
public byte[] ImageBlob1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 圖檔名稱2
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("IMAGE_NAME2")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
public string ImageName2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 圖檔2
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("IMAGE_BLOB2")] |
||||
|
[DataMember] |
||||
|
public byte[] ImageBlob2 { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 圖檔名稱3
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("IMAGE_NAME3")] |
||||
|
[StringLength(50)] |
||||
|
[DataMember] |
||||
|
public string ImageName3 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 圖檔3
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("IMAGE_BLOB3")] |
||||
|
[DataMember] |
||||
|
public byte[] ImageBlob3 { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建者ID
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int CreateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建日期
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime CreateDate { get; set; } = System.DateTime.Now; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新者ID
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int UpdateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新日期
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_DATE", TypeName = "DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime UpdateDate { get; set; } = System.DateTime.Now; |
||||
|
} |
||||
|
} |
@ -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 |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 維修紀錄資料檔
|
||||
|
/// </summary>
|
||||
|
[Table("REPAIR_RECORD", Schema = "JHAMES")] |
||||
|
public partial class RepairRecord |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 測試不良ID
|
||||
|
/// </summary>
|
||||
|
[Column("NG_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
public decimal NgID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不良零件ID
|
||||
|
/// </summary>
|
||||
|
[Column("COMPONENT_ID", TypeName = "NUMBER")] |
||||
|
[DataMember] |
||||
|
[Required] |
||||
|
public decimal ComponentID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 維修過程敘述
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[Column("REPAIR_DESC")] |
||||
|
[StringLength(100)] |
||||
|
[DataMember] |
||||
|
public string RepairDesc { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建者ID
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int CreateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建日期
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime CreateDate { get; set; } = System.DateTime.Now; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新者ID
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int UpdateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新日期
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_DATE", TypeName = "DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime UpdateDate { get; set; } = System.DateTime.Now; |
||||
|
} |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 維修責任單位
|
||||
|
/// </summary>
|
||||
|
[Table("REPAIR_RESPONSIBLE_UNITS", Schema = "JHAMES")] |
||||
|
[DataContract] |
||||
|
public class RepairResponsibleUnits |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 維修責任單位ID
|
||||
|
/// </summary>
|
||||
|
[Key] |
||||
|
[Column("REPAIR_RESPONSIBLE_ID")] |
||||
|
[DataMember] |
||||
|
public int RepairResponsibleID { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 維修責任單位描述
|
||||
|
/// </summary>
|
||||
|
[Column("REPAIR_RESPONSIBLE_DESC")] |
||||
|
[DataMember] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "維修責任單位描述")] |
||||
|
[StringLength(100, ErrorMessage = "{0},不能大于{1}")] |
||||
|
public string RepairResponsibleDesc { get; set; } |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue