Browse Source

1. 修正過站程式判斷

PTD
Ray 3 years ago
parent
commit
5edd2af35f
  1. 82
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 15
      AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs
  3. 9
      AMESCoreStudio.Web/ViewModels/PCS/PCS021ViewModel.cs
  4. 40
      AMESCoreStudio.Web/Views/PCS/PCS021.cshtml
  5. 15
      AMESCoreStudio.WebApi/Code/BarcodeContext.cs
  6. 50
      AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs
  7. 127
      AMESCoreStudio.WebApi/Controllers/AMES/NgInfoeController.cs
  8. 4
      AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs
  9. 28
      AMESCoreStudio.WebApi/Models/AMES/BarcodeInfo.cs
  10. 48
      AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs
  11. 191
      AMESCoreStudio.WebApi/Models/AMES/NgInfo.cs
  12. 9
      AMESCoreStudio.WebApi/Models/AMESContext.cs

82
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -351,14 +351,14 @@ namespace AMESCoreStudio.Web.Controllers
/// 站別
/// </summary>
/// <returns></returns>
private async Task GetStations()
private async Task GetRuleStation(string flowruleID = null)
{
var result = await _basApi.GetStationses();
var result = await _basApi.GetRuleStationByUnit(flowruleID);
result = result.OrderBy(o => o.Sequence).ToList();
var Stations = new List<SelectListItem>();
for (int i = 0; i < result.Count; i++)
{
Stations.Add(new SelectListItem(result[i].StationName, result[i].StationID.ToString()));
Stations.Add(new SelectListItem(result[i].StationDesc, result[i].StationID.ToString()));
}
if (Stations.Count == 0)
@ -369,6 +369,34 @@ namespace AMESCoreStudio.Web.Controllers
ViewBag.GetStationsList = Stations;
}
/// <summary>
/// 站別 By 主站
/// </summary>
/// <param name="unit_no"></param>
/// <returns></returns>
[HttpPost]
public async Task<JsonResult> GetRuleStationByTypeJson(string unit_no)
{
var result = await _basApi.GetRuleStationByUnit(unit_no);
result = result.Where(w => w.StationType == "M").OrderBy(o => o.Sequence).ToList();
var item = new List<SelectListItem>();
for (int i = 0; i < result.Count; i++)
{
item.Add(new SelectListItem(result[i].StationDesc, result[i].StationID.ToString()));
}
if (item.Count == 0)
{
item.Add(new SelectListItem("N/A", ""));
}
//将数据Json化并传到前台视图
return Json(new { data = item });
}
/// <summary>
/// 流程ID選單
/// </summary>
@ -1352,7 +1380,7 @@ namespace AMESCoreStudio.Web.Controllers
{
//var fileProvider = _fileServerProvider.GetProvider("/aa");
//var fileInfo = fileProvider.GetFileInfo("/");
await GetStations();
await GetRuleStation();
GetLockReasonType();
GetLockType();
//var result = new WipAllViewModel();
@ -1426,7 +1454,7 @@ namespace AMESCoreStudio.Web.Controllers
ModelState.AddModelError("error", result.Msg);
}
}
await GetStations();
await GetRuleStation();
GetLockReasonType();
GetLockType();
return View(model);
@ -1444,7 +1472,7 @@ namespace AMESCoreStudio.Web.Controllers
var q = await _pcsApi.GetWipLock(id);
q.Data = q.Data.Where(w => w.UnLockReason == null).ToList();
await GetStations();
await GetRuleStation();
GetLockReasonType();
GetLockType();
//var result = new WipAllViewModel();
@ -1496,7 +1524,7 @@ namespace AMESCoreStudio.Web.Controllers
[HttpGet]
public async Task<IActionResult> PCS012()
{
await GetStations();
await GetRuleStation();
GetLockReasonType();
GetLockType();
return View();
@ -1537,7 +1565,7 @@ namespace AMESCoreStudio.Web.Controllers
var model = new PCS021ViewModel();
await GetFactoryUnit();
await GetLineInfo();
await GetStations();
await GetRuleStation();
return View(model);
}
@ -1546,7 +1574,7 @@ namespace AMESCoreStudio.Web.Controllers
{
await GetFactoryUnit();
await GetLineInfo();
await GetStations();
await GetRuleStation();
if (string.IsNullOrWhiteSpace(model.WipNO))
@ -1564,7 +1592,7 @@ namespace AMESCoreStudio.Web.Controllers
ModelState.AddModelError("error", "請選擇線別");
}
if (string.IsNullOrWhiteSpace(model.Station))
if (model.Station == 0)
{
ModelState.AddModelError("error", "請選擇作業站");
}
@ -1581,6 +1609,7 @@ namespace AMESCoreStudio.Web.Controllers
if (q.Count != 0)
{
model.WipID = q.FirstOrDefault().WipID;
model.PlanQTY = q.FirstOrDefault().PlanQTY;
model.UnitNO = q.FirstOrDefault().UnitNO;
model.LineID = q.FirstOrDefault().LineID;
@ -1618,7 +1647,6 @@ namespace AMESCoreStudio.Web.Controllers
model.SopPath = wipsop.GetWipSop.FilePath + wipsop.GetWipSop.NewName;
}
model.Input = "1234";
}
return View("PCS021", model);
@ -1632,12 +1660,12 @@ namespace AMESCoreStudio.Web.Controllers
string Data = string.Empty;
if (model.MaterialOutfits.Where(w => string.IsNullOrWhiteSpace(w.Inputs)).Any())
Msg += "請刷入治具編號\n";
Msg += "請刷入治具編號\r\n";
if (string.IsNullOrWhiteSpace(model.Input))
{
Msg += "請刷讀條碼\n";
Msg += "請刷讀條碼\r\n";
}
else
{
@ -1647,19 +1675,19 @@ namespace AMESCoreStudio.Web.Controllers
if (!string.IsNullOrWhiteSpace(Msg))
Success = false;
//var aa = TempData["TmpData"];
//await GetFactoryUnit();
//await GetLineInfo();
//model.WipInfo.WipNO = "WO0001A1";
//var q = await _pcsApi.GetWipInfoByWipNO(model.WipInfo.WipNO);
//if (q.Count() != 0)
//{
// model.WipInfo = q.Where(w => w.UnitNO == model.WipInfo.UnitNO).FirstOrDefault();
// model.wipAtt = await _pcsApi.GetWipAtt(model.WipInfo.WipNO);
// model.WipSopLog = await _pcsApi.GetWipSopLog(model.WipInfo.WipID);
// model.wipSop = await _pcsApi.GetWipSop(model.WipSopLog.WipSopID);
// model.materialKpDto = await _pcsApi.GetMaterialKpQuery(model.wipAtt.ItemNO, model.WipInfo.UnitNO);
//}
// 新增or更新 BarCode_Info
BarcodeInfo barcodeInfo = new BarcodeInfo
{
BarcodeNo = model.Input,
StatusNo = "SMT",
RuleStationID = model.Station,
RuleStatus = "P", //F 不良
WipID = model.WipID,
StatusID = 1,
CreateUserID = 1
};
return Json(new Result() { success = Success, msg = Msg, data = Data });

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

@ -184,6 +184,21 @@ namespace AMESCoreStudio.Web
ITask<ResultModel<WipBarcodeOther>> PostWipBarcodeOther([FromBody, RawJsonContent] string model);
#endregion
#region BarCodeInfo 條碼資料檔 PCS021
//[WebApiClient.Attributes.HttpGet("api/BarcodeInfoes/No/{id}")]
//ITask<IEnumerable<BarcodeInfo>> GetBarcodeInfoesByNo(string id);
[WebApiClient.Attributes.HttpPost("api/BarcodeInfoes")]
ITask<ResultModel<WipBarcodeOther>> PostBarcodeInfoes([FromBody, RawJsonContent] string model);
[WebApiClient.Attributes.HttpPut("api/BarcodeInfoes")]
ITask<ResultModel<WipBarcodeOther>> PutBarcodeInfoes([FromBody, RawJsonContent] string model);
#endregion
#region 條碼過站資料檔
#endregion
#region BarcodeType 條碼類別資料檔 PCS001
[WebApiClient.Attributes.HttpGet("api/BarcodeType/TypeName/{id}")]
ITask<BarcodeType> GetBarcodeTypeByTypeName(string id);

9
AMESCoreStudio.Web/ViewModels/PCS/PCS021ViewModel.cs

@ -11,10 +11,15 @@ namespace AMESCoreStudio.Web.ViewModels.PCS
public class PCS021ViewModel
{
/// <summary>
/// 單號碼
/// 單號碼
/// </summary>
public string WipNO { get; set; }
/// <summary>
/// 工單ID
/// </summary>
public int WipID { get; set; }
/// <summary>
/// 工單數
/// </summary>
@ -33,7 +38,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS
/// <summary>
/// 作業站
/// </summary>
public string Station { get; set; }
public int Station { get; set; }
/// <summary>
/// SOP路徑

40
AMESCoreStudio.Web/Views/PCS/PCS021.cshtml

@ -39,10 +39,6 @@
margin: auto;
}
.layui-elem-field {
border-style: groove;
}
.layui-form-item {
margin-bottom: auto;
}
@ -101,6 +97,7 @@
<label class="layui-form-label">工單號碼:</label>
<div class="layui-input-inline" style="width:100px">
<input type="text" onkeydown="SearchNo(event);" asp-for="WipNO" asp-action="PCS021_GetWip" class="layui-input" autocomplete="off" />
<input type="hidden" asp-for="WipID" />
<input type="submit" id="GetWipData" asp-action="PCS021_GetWip" style="display:none;" />
</div>
</div>
@ -332,7 +329,7 @@
{
$.ajax(
{
url: "@Url.Action("GetStationsJson", "BAS")",
url: "@Url.Action("GetRuleStationByTypeJson", "PCS")",
dataType: 'json',
data: { "unit_no": $("#unit").val()},
type: 'post',
@ -361,7 +358,6 @@
function input(e) {
if (e.keyCode == 13) {
var Inputs = GetAllEmpData();
//var data = $("#PCS021Form").serialize();
var data = $("#PCS021Form").serialize();
$.each(Inputs, function (i, item) {
data += "&Inputs[" + i + "]=" + item;
@ -405,39 +401,14 @@
});
});
// 新增trRow
function TableAddRow(e) {
//var rowCount = $('.data-contact-person').length + 0;
var contactdiv = '<tr class="data-contact-person">' +
'<td><input type="text" name="f-name" class="form-control f-name01" value='+ e +' /></td>' +
'<td><input type="text" name="f-name" class="form-control td-Input" value='+ e +' /></td>' +
'<td><a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a></td>' +
'</tr>';
$('#tblCustomers').append(contactdiv);
//rollPage('left');
var txtName = $("#txtInput");
//Get the reference of the Table's TBODY element.
/* var tBody = $("#tblCustomers > TBODY")[0];*/
//Add Row.
/* var row = tBody.insertRow(-1);*/
//Add Name cell.
//var input = $("<input/>");
//input.attr("type", "text");
//input.attr("value", "1111");
//var cell = $(row.insertCell(-1));
//cell.html(e);
//cell.append(input);
//Add Button cell.
//cell = $(row.insertCell(-1));
//var btnRemove = $("<input />");
//btnRemove.attr("type", "button");
//btnRemove.attr("onclick", "Remove(this);");
//btnRemove.val("Remove");
//cell.append(btnRemove);
//Clear the TextBoxes.
//txtName.val(e);
AutoWindowSize();
};
@ -457,10 +428,11 @@
//}
};
// 紀錄表格欄位
function GetAllEmpData() {
var data = [];
$('tr.data-contact-person').each(function () {
var firstName = $(this).find('.f-name01').val();//Bind to the first name with class f-name01
var firstName = $(this).find('.td-Input').val();
data.push(firstName);
});
return data;

15
AMESCoreStudio.WebApi/Code/BarcodeContext.cs

@ -63,7 +63,7 @@ namespace AMESCoreStudio.WebApi
}
/// <summary>
/// 是否被鎖定
/// 內部序號是否被鎖定
/// </summary>
/// <param name="WipNo"></param>
/// <param name="BarCode"></param>
@ -90,5 +90,18 @@ namespace AMESCoreStudio.WebApi
}
return "";
}
/// <summary>
/// 判斷內部序號對應工單號買
/// </summary>
/// <param name="BarCode">內部序號</param>
/// <returns></returns>
public async Task<string> CheckBarCodeFromWip(string BarCode)
{
//if (BarCode.Length <= 4)
return "NG, 找不到相關工單號碼";
}
}
}

50
AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using AMESCoreStudio.WebApi;
using AMESCoreStudio.WebApi.Models.AMES;
using AMESCoreStudio.CommonTools.Result;
namespace AMESCoreStudio.WebApi.Controllers.AMES
{
@ -99,33 +100,27 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
// PUT: api/BarcodeInfoes/5
// To protect from overposting attacks, enable the specific properties you want to bind to, for
// more details, see https://go.microsoft.com/fwlink/?linkid=2123754.
[HttpPut("{id}")]
public async Task<ActionResult<BarcodeInfo>> PutBarcodeInfoes(int id, [FromBody] BarcodeInfo barcodeInfo)
[HttpPut]
public async Task<ResultModel<BarcodeInfo>> PutBarcodeInfoes([FromBody] BarcodeInfo barcodeInfo)
{
if (id != barcodeInfo.BarcodeID)
{
return BadRequest();
}
_context.Entry(barcodeInfo).State = EntityState.Modified;
ResultModel<BarcodeInfo> result = new ResultModel<BarcodeInfo>();
_context.Attach(barcodeInfo);
barcodeInfo.UpdateDate = DateTime.Now;
// 指定更新某個欄位
_context.Entry(barcodeInfo).Property(p => p.UpdateDate).IsModified = true;
try
{
await _context.SaveChangesAsync();
result.Success = true;
result.Msg = "OK";
}
catch (DbUpdateConcurrencyException)
catch (Exception ex)
{
if (!BarcodeInfoesExists(id))
{
return NotFound();
}
else
{
throw;
result.Success = false;
result.Msg = ex.Message;
}
}
return barcodeInfo;
return result;
}
/// <summary>
@ -137,15 +132,26 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
// To protect from overposting attacks, enable the specific properties you want to bind to, for
// more details, see https://go.microsoft.com/fwlink/?linkid=2123754.
[HttpPost]
public async Task<ActionResult<BarcodeInfo>> PostBarcodeInfoes(BarcodeInfo barcodeInfo)
public async Task<ResultModel<BarcodeInfo>> PostBarcodeInfoes([FromBody] BarcodeInfo barcodeInfo)
{
ResultModel<BarcodeInfo> result = new ResultModel<BarcodeInfo>();
Helper helper = new Helper(_context);
barcodeInfo.BarcodeID = helper.GetIDKey("BARCODE_ID").Result;
_context.BarcodeInfoes.Add(barcodeInfo);
await _context.SaveChangesAsync();
return CreatedAtAction("GetBarcodeInfoes", new { id = barcodeInfo.BarcodeID }, barcodeInfo);
try
{
await _context.SaveChangesAsync();
result.Success = true;
result.Msg = "OK";
}
catch (Exception ex)
{
result.Success = false;
result.Msg = ex.Message;
}
return result;
}

127
AMESCoreStudio.WebApi/Controllers/AMES/NgInfoeController.cs

@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using AMESCoreStudio.WebApi;
using AMESCoreStudio.WebApi.Models.AMES;
namespace AMESCoreStudio.WebApi.Controllers.AMES
{
/// <summary>
/// 測試不良基本資料檔
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class NgInfoeController : ControllerBase
{
private readonly AMESContext _context;
public NgInfoeController(AMESContext context)
{
_context = context;
}
// GET: api/NgInfoe
[HttpGet]
public async Task<ActionResult<IEnumerable<NgInfo>>> GetNgInfos()
{
return await _context.NgInfos.ToListAsync();
}
// GET: api/NgInfoe/5
[HttpGet("{id}")]
public async Task<ActionResult<NgInfo>> GetNgInfo(decimal id)
{
var ngInfo = await _context.NgInfos.FindAsync(id);
if (ngInfo == null)
{
return NotFound();
}
return ngInfo;
}
// PUT: api/NgInfoe/5
// To protect from overposting attacks, enable the specific properties you want to bind to, for
// more details, see https://go.microsoft.com/fwlink/?linkid=2123754.
[HttpPut("{id}")]
public async Task<IActionResult> PutNgInfo(decimal id, NgInfo ngInfo)
{
if (id != ngInfo.NgID)
{
return BadRequest();
}
_context.Entry(ngInfo).State = EntityState.Modified;
try
{
await _context.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!NgInfoExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return NoContent();
}
// POST: api/NgInfoe
// To protect from overposting attacks, enable the specific properties you want to bind to, for
// more details, see https://go.microsoft.com/fwlink/?linkid=2123754.
[HttpPost]
public async Task<ActionResult<NgInfo>> PostNgInfo(NgInfo ngInfo)
{
_context.NgInfos.Add(ngInfo);
try
{
await _context.SaveChangesAsync();
}
catch (DbUpdateException)
{
if (NgInfoExists(ngInfo.NgID))
{
return Conflict();
}
else
{
throw;
}
}
return CreatedAtAction("GetNgInfo", new { id = ngInfo.NgID }, ngInfo);
}
// DELETE: api/NgInfoe/5
[HttpDelete("{id}")]
public async Task<ActionResult<NgInfo>> DeleteNgInfo(decimal id)
{
var ngInfo = await _context.NgInfos.FindAsync(id);
if (ngInfo == null)
{
return NotFound();
}
_context.NgInfos.Remove(ngInfo);
await _context.SaveChangesAsync();
return ngInfo;
}
private bool NgInfoExists(decimal id)
{
return _context.NgInfos.Any(e => e.NgID == id);
}
}
}

4
AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs

@ -58,11 +58,11 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
/// <param name="flowrule">流程</param>
/// <returns></returns>
[HttpGet("BarCodeDataCheck")]
public string GetBarCodeDataCheck(string wipno, string unitno, int station, int line, int flowrule)
public IActionResult GetBarCodeDataCheck(string wipno, string unitno, int station, int line, int flowrule)
{
BarcodeContext barcodeContext = new BarcodeContext(_context);
var result = barcodeContext.CheckWipNoSationAsync(WipNo: wipno, UnitNo: unitno, FlowRuleID: flowrule, Station: station, Line: line);
return result.Result;
return Ok(result.Result);
}
/// <summary>

28
AMESCoreStudio.WebApi/Models/AMES/BarcodeInfo.cs

@ -31,49 +31,49 @@ namespace AMESCoreStudio.WebApi.Models.AMES
public string BarcodeNo { get; set; }
/// <summary>
///
/// 條碼狀態代碼
/// </summary>
[Column("STATUS_NO")]
[DataMember]
public string StatusNo { get; set; }
/// <summary>
///
/// 客戶條碼
/// </summary>
[Column("EXTRA_BARCODE_NO")]
[DataMember]
public string ExtraBarcodeNo { get; set; }
/// <summary>
///
/// 存放位置ID
/// </summary>
[Column("LOCATION_ID")]
[DataMember]
public string LocationID { get; set; }
public int LocationID { get; set; }
/// <summary>
///
/// 條碼過站位置
/// </summary>
[Column("RULE_STATION_ID")]
[DataMember]
public string RuleStationID { get; set; }
public int RuleStationID { get; set; }
/// <summary>
///
/// 條碼過站狀態
/// </summary>
[Column("RULE_STATUS")]
[DataMember]
public string RuleStatus { get; set; }
/// <summary>
///
/// 工單ID
/// </summary>
[Column("WIP_ID")]
[DataMember]
public string WipID { get; set; }
public int WipID { get; set; }
/// <summary>
///
/// 包装箱號
/// </summary>
[Column("BOX_NO")]
[DataMember]
@ -81,18 +81,18 @@ namespace AMESCoreStudio.WebApi.Models.AMES
/// <summary>
///
/// 系统狀態
/// </summary>
[Column("SYSTYPE")]
[DataMember]
public string SysType { get; set; }
/// <summary>
///
/// 條碼流程狀態
/// </summary>
[Column("STATUS_ID")]
[DataMember]
public string StatusID { get; set; }
public int StatusID { get; set; }
/// <summary>
/// 建立者
@ -101,7 +101,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES
[DataMember]
[Required(ErrorMessage = "{0},不能空白")]
[Display(Name = "建立者")]
public decimal CreateUserID { get; set; } = -1;
public int CreateUserID { get; set; } = 0;
/// <summary>
/// 建立時間

48
AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs

@ -0,0 +1,48 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
#nullable disable
namespace AMESCoreStudio.WebApi.Models.AMES
{
/// <summary>
/// 條碼過站資料檔
/// </summary>
[Table("BARCODE_STATION")]
public partial class BarcodeStation
{
//[Key]
[Column("BARCODE_ID", TypeName = "NUMBER")]
public decimal BarcodeId { get; set; }
//[Key]
[Column("WIP_ID", TypeName = "NUMBER")]
public decimal WipId { get; set; }
//[Key]
[Column("RULE_STATION_ID", TypeName = "NUMBER")]
public decimal RuleStationId { get; set; }
//[Key]
[Column("RULE_STATUS")]
[StringLength(1)]
public string RuleStatus { get; set; }
[Key]
[Column("INPUT_DATE", TypeName = "DATE")]
public DateTime InputDate { get; set; }
[Required]
[Column("SYSTYPE")]
[StringLength(1)]
public string Systype { get; set; }
[Column("LINE_ID", TypeName = "NUMBER")]
public decimal LineId { get; set; }
[Column("STATION_FLAG", TypeName = "NUMBER")]
public decimal? StationFlag { get; set; }
[Column("STATION_TIMES", TypeName = "NUMBER")]
public decimal StationTimes { get; set; }
[Column("CREATE_USERID", TypeName = "NUMBER")]
public decimal CreateUserid { get; set; }
[Column("CREATE_DATE", TypeName = "DATE")]
public DateTime CreateDate { get; set; }
}
}

191
AMESCoreStudio.WebApi/Models/AMES/NgInfo.cs

@ -0,0 +1,191 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
#nullable disable
namespace AMESCoreStudio.WebApi.Models.AMES
{
/// <summary>
/// 測試不良基本資料檔
/// </summary>
[Table("NG_INFO", Schema = "JHAMES")]
public partial class NgInfo
{
/// <summary>
/// 測試不良ID
/// </summary>
[Key]
[Column("NG_ID", TypeName = "NUMBER")]
[DataMember]
[Required]
public decimal NgID { get; set; }
/// <summary>
/// 測試種類代碼
/// </summary>
[Required]
[Column("TYPE_NO")]
[StringLength(6)]
[DataMember]
public string TypeNo { get; set; }
/// <summary>
/// 測試員代號
/// </summary>
[Column("OPERATOR_ID", TypeName = "NUMBER")]
[DataMember]
public decimal OperatorID { get; set; }
/// <summary>
/// 治具代號
/// </summary>
[Required]
[Column("FIXTURE_NO")]
[StringLength(20)]
[DataMember]
public string FixtureNo { get; set; }
/// <summary>
/// 測試程試代號/名稱
/// </summary>
[Required]
[Column("PROGRAM_NO")]
[StringLength(20)]
[DataMember]
public string ProgramNo { get; set; }
/// <summary>
/// 設備代號
/// </summary>
[Required]
[Column("MACHINE_NO")]
[StringLength(20)]
[DataMember]
public string MachineNo { get; set; }
/// <summary>
/// 測試總點數
/// </summary>
[Column("TEST_QTY", TypeName = "NUMBER")]
[DataMember]
public decimal TestQty { get; set; }
/// <summary>
/// 不良總點數
/// </summary>
[Column("NG_QTY", TypeName = "NUMBER")]
[DataMember]
public decimal NgQty { get; set; }
/// <summary>
/// 開始測試時間
/// </summary>
[Column("START_TIME")]
[DataMember]
public DateTime StartTime { get; set; } = System.DateTime.Now;
/// <summary>
/// 結束測試時間
/// </summary>
[Column("END_TIME")]
[DataMember]
public DateTime EndTime { get; set; } = System.DateTime.Now;
/// <summary>
/// 測試狀態(F-FAIL)
/// </summary>
[Required]
[Column("TEST_STATUS")]
[StringLength(1)]
[DataMember]
public string TestStatus { get; set; } = "F";
/// <summary>
/// 內部條碼ID
/// </summary>
[Column("BARCODE_ID", TypeName = "NUMBER")]
[DataMember]
public decimal BarcodeId { get; set; }
/// <summary>
/// 流程站別ID
/// </summary>
[Column("RULE_STATION_ID", TypeName = "NUMBER")]
[DataMember]
public decimal RuleStationId { get; set; }
/// <summary>
/// 工單ID
/// </summary>
[Column("WIP_ID", TypeName = "NUMBER")]
[DataMember]
public decimal WipId { get; set; }
/// <summary>
/// 處理狀態(0:尚未維修處理, 1:已維修處理, 2:誤判)
/// </summary>
[Column("STATUS", TypeName = "NUMBER")]
[DataMember]
public decimal Status { get; set; } = 0;
/// <summary>
/// 不良現象原因代碼
/// </summary>
[Column("REASON_NO")]
[StringLength(6)]
[DataMember]
public string ReasonNo { get; set; }
/// <summary>
/// 不良代碼指向的下一站ID
/// </summary>
[Column("NEXT_STATION_ID", TypeName = "NUMBER")]
[DataMember]
public decimal NextStationId { get; set; } = -1;
/// <summary>
/// 不良時的組件數量
/// </summary>
[Column("ITEM_QTY", TypeName = "NUMBER")]
[DataMember]
public decimal ItemQty { get; set; } = -1;
/// <summary>
/// 不良備註
/// </summary>
[Column("NG_MEMO")]
[StringLength(300)]
[DataMember]
public string NgMemo { 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;
}
}

9
AMESCoreStudio.WebApi/Models/AMESContext.cs

@ -475,6 +475,15 @@ namespace AMESCoreStudio.WebApi
/// </summary>
public virtual DbSet<BarcodeWip> BarcodeWips { get; set; }
/// <summary>
/// 測試不良基本資料檔
/// </summary>
public virtual DbSet<NgInfo> NgInfos { get; set; }
/// <summary>
/// 條碼過站資料檔
/// </summary>
//public virtual DbSet<BarcodeStation> BarcodeStations { get; set; }
}
}

Loading…
Cancel
Save