21 changed files with 719 additions and 484 deletions
@ -0,0 +1,185 @@ |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using AMESCoreStudio.WebApi.Models.AMES; |
|||
using AMESCoreStudio.CommonTools.Result; |
|||
using AMESCoreStudio.WebApi.DTO.AMES; |
|||
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class MaterialSopController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public MaterialSopController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// SOPFile資料查詢
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<MaterialSop>>> GetMaterialSop() |
|||
{ |
|||
IQueryable<MaterialSop> q = _context.MaterialSops; |
|||
q = q.OrderBy(p => p.MaterialSopID); |
|||
var materialSops = await q.ToListAsync(); |
|||
return materialSops; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// SOPFile資料查詢 by ID
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<MaterialSop>> GetMaterialSop(int id) |
|||
{ |
|||
IQueryable<MaterialSop> q = _context.MaterialSops; |
|||
|
|||
var materialSop = await q.Where(p => p.MaterialSopID == id).FirstOrDefaultAsync(); |
|||
|
|||
//if (wipSop == null)
|
|||
//{
|
|||
// return NotFound();
|
|||
//}
|
|||
|
|||
return materialSop; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// SOP文件查詢
|
|||
/// </summary>
|
|||
/// <param name="itemNo">料號</param>
|
|||
/// <param name="unitNo">生產單位</param>
|
|||
/// <param name="fileName">檔案名稱</param>
|
|||
/// <param name="state">狀態</param>
|
|||
/// <param name="date_str">建立日期起</param>
|
|||
/// <param name="date_end">建立日期迄</param>
|
|||
/// <returns></returns>
|
|||
[Route("[action]")]
|
|||
[HttpGet] |
|||
public async Task<ResultModel<MaterialSopDto>> GetMaterialSopQuery(string itemNo = null, string unitNo = null |
|||
, string fileName = null, string state = null, string date_str = null, string date_end = null) |
|||
{ |
|||
IQueryable<MaterialSop> q = _context.MaterialSops; |
|||
|
|||
if (!string.IsNullOrWhiteSpace(itemNo)) |
|||
q = q.Where(w => w.ItemNo == itemNo); |
|||
|
|||
if (!string.IsNullOrWhiteSpace(unitNo)) |
|||
q = q.Where(w => w.UnitNo == unitNo); |
|||
|
|||
if (!string.IsNullOrWhiteSpace(fileName)) |
|||
q = q.Where(w => w.FileName.Contains(fileName)); |
|||
|
|||
if (!string.IsNullOrWhiteSpace(state)) |
|||
q = q.Where(w => w.State == state); |
|||
|
|||
|
|||
if (DateTime.TryParse(date_str, out _)) |
|||
{ |
|||
q = q.Where(w => w.CreateDate >= DateTime.Parse(date_str)); |
|||
} |
|||
|
|||
if (DateTime.TryParse(date_end, out _)) |
|||
{ |
|||
q = q.Where(w => w.CreateDate <= DateTime.Parse(date_end)); |
|||
} |
|||
|
|||
ResultModel<MaterialSopDto> result = new ResultModel<MaterialSopDto>(); |
|||
result.Data = await q.Select(s => new MaterialSopDto |
|||
{ |
|||
MaterialSopID = s.MaterialSopID, |
|||
ItemNo = s.ItemNo, |
|||
UnitName = s.FactoryUnit.UnitName, |
|||
FileName = s.FileName, |
|||
FilePath = s.FilePath, |
|||
State = s.State == "Y" ? "使用中" : "停用", |
|||
NewName = s.NewName, |
|||
CreateDate = s.CreateDate, |
|||
CreateUserID = s.CreateUserID, |
|||
UpdateDate = s.UpdateDate, |
|||
UpdateUserID = s.UpdateUserID |
|||
}).ToListAsync(); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task<ResultModel<MaterialSop>> PostMaterialSop([FromBody] MaterialSop materialSop) |
|||
{ |
|||
ResultModel<MaterialSop> result = new ResultModel<MaterialSop>(); |
|||
Helper helper = new Helper(_context); |
|||
materialSop.MaterialSopID = helper.GetIDKey("MATERIAL_SOP_ID").Result; |
|||
materialSop.State = "Y"; |
|||
//wipLog.WipSopID = wipLog.WipID == 0 ? helper.GetIDKeyNoPost("WIP_ID").Result : wipLog.WipID;
|
|||
_context.MaterialSops.Add(materialSop); |
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = ex.Message; |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
|
|||
[HttpPut("{id}/{state}")] |
|||
public async Task<ResultModel<MaterialSop>> PutMaterialSop(int id, string state) |
|||
{ |
|||
ResultModel<MaterialSop> result = new ResultModel<MaterialSop>(); |
|||
var materialSop = new MaterialSop |
|||
{ |
|||
MaterialSopID = id, |
|||
State = state, |
|||
UpdateUserID = 1, |
|||
UpdateDate = System.DateTime.Now |
|||
|
|||
}; |
|||
_context.Attach(materialSop); |
|||
|
|||
// 指定更新某個欄位
|
|||
_context.Entry(materialSop).Property(p => p.State).IsModified = true; |
|||
_context.Entry(materialSop).Property(p => p.UpdateUserID).IsModified = true; |
|||
_context.Entry(materialSop).Property(p => p.UpdateDate).IsModified = true; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = ex.Message; |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
// DELETE api/<WipSopController>/5
|
|||
[HttpDelete("{id}")] |
|||
public void Delete(int id) |
|||
{ |
|||
} |
|||
} |
|||
} |
@ -1,181 +0,0 @@ |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using AMESCoreStudio.WebApi.Models.AMES; |
|||
using AMESCoreStudio.CommonTools.Result; |
|||
using AMESCoreStudio.WebApi.DTO.AMES; |
|||
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class WipSopLogController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public WipSopLogController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 工單投產纪錄資料文件
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<WipSopLog>>> GetWipSopLog() |
|||
{ |
|||
IQueryable<WipSopLog> q = _context.WipSopLogs; |
|||
q = q.OrderBy(p => p.WipSopID); |
|||
var WipSopLog = await q.ToListAsync(); |
|||
return WipSopLog; |
|||
} |
|||
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<WipSopLog>> GetWipSopLog(int id) |
|||
{ |
|||
IQueryable<WipSopLog> q = _context.WipSopLogs; |
|||
|
|||
var WipSopLog = await q.Where(p => p.WipID == id).FirstOrDefaultAsync(); |
|||
|
|||
//if (WipSopLog == null)
|
|||
//{
|
|||
// return NotFound();
|
|||
//}
|
|||
|
|||
return WipSopLog; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// SOP文件查詢
|
|||
/// </summary>
|
|||
/// <param name="itemNo">料號</param>
|
|||
/// <param name="unitNo">生產單位</param>
|
|||
/// <param name="fileName">檔案名稱</param>
|
|||
/// <param name="state">狀態</param>
|
|||
/// <param name="date_str">建立日期起</param>
|
|||
/// <param name="date_end">建立日期迄</param>
|
|||
/// <returns></returns>
|
|||
//[Route("[action]")]
|
|||
//[HttpGet]
|
|||
//public async Task<ResultModel<WipSopLogDto>> GetWipSopLogQuery(string itemNo = null, string unitNo = null
|
|||
// , string fileName = null, string state = null, string date_str = null, string date_end = null)
|
|||
//{
|
|||
// IQueryable<WipSopLog> q = _context.WipSopLogs;
|
|||
|
|||
// if (!string.IsNullOrWhiteSpace(itemNo))
|
|||
// q = q.Where(w => w.ItemNo == itemNo);
|
|||
|
|||
// if (!string.IsNullOrWhiteSpace(unitNo))
|
|||
// q = q.Where(w => w.UnitNo == unitNo);
|
|||
|
|||
// if (!string.IsNullOrWhiteSpace(fileName))
|
|||
// q = q.Where(w => w.FileName.Contains(fileName));
|
|||
|
|||
// if (!string.IsNullOrWhiteSpace(state))
|
|||
// q = q.Where(w => w.State == state);
|
|||
|
|||
|
|||
// DateTime dateValue;
|
|||
// if (DateTime.TryParse(date_str, out dateValue))
|
|||
// {
|
|||
// q = q.Where(w => w.CreateDate >= DateTime.Parse(date_str));
|
|||
// }
|
|||
|
|||
// if (DateTime.TryParse(date_end, out dateValue))
|
|||
// {
|
|||
// q = q.Where(w => w.CreateDate <= DateTime.Parse(date_end));
|
|||
// }
|
|||
|
|||
// ResultModel<WipSopLogDto> result = new ResultModel<WipSopLogDto>();
|
|||
// result.Data = await q.Select(s => new WipSopLogDto
|
|||
// {
|
|||
// WipSopLogID = s.WipSopLogID,
|
|||
// ItemNo = s.ItemNo,
|
|||
// UnitName = s.FactoryUnit.UnitName,
|
|||
// FileName = s.FileName,
|
|||
// FilePath = s.FilePath,
|
|||
// State = s.State == "Y" ? "使用中" : "停用",
|
|||
// NewName = s.NewName,
|
|||
// CreateDate = s.CreateDate,
|
|||
// CreateUserID = s.CreateUserID,
|
|||
// UpdateDate = s.UpdateDate,
|
|||
// UpdateUserID = s.UpdateUserID
|
|||
// }).ToListAsync();
|
|||
|
|||
// return result;
|
|||
//}
|
|||
|
|||
[HttpPost] |
|||
public async Task<ResultModel<WipSopLog>> PostWipSopLog([FromBody] WipSopLog wipSopLog) |
|||
{ |
|||
|
|||
ResultModel<WipSopLog> result = new ResultModel<WipSopLog>(); |
|||
Helper helper = new Helper(_context); |
|||
wipSopLog.WipID = helper.GetIDKeyNoPost("WIP_ID").Result; |
|||
wipSopLog.State = "Y"; |
|||
//wipLog.WipSopLogID = wipLog.WipID == 0 ? helper.GetIDKeyNoPost("WIP_ID").Result : wipLog.WipID;
|
|||
_context.WipSopLogs.Add(wipSopLog); |
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = ex.Message; |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
//// PUT api/<WipSopLogController>/5
|
|||
//[HttpPut("{id}/{state}")]
|
|||
//public async Task<ResultModel<WipSopLog>> PutWipSopLog(int id, string state)
|
|||
//{
|
|||
// ResultModel<WipSopLog> result = new ResultModel<WipSopLog>();
|
|||
// var WipSopLog = new WipSopLog {
|
|||
// WipSopLogID = id,
|
|||
// State = state,
|
|||
// UpdateUserID = 1,
|
|||
// UpdateDate = System.DateTime.Now
|
|||
|
|||
// };
|
|||
// _context.Attach(WipSopLog);
|
|||
|
|||
// // 指定更新某個欄位
|
|||
// _context.Entry(WipSopLog).Property(p => p.State).IsModified = true;
|
|||
// _context.Entry(WipSopLog).Property(p => p.UpdateUserID).IsModified = true;
|
|||
// _context.Entry(WipSopLog).Property(p => p.UpdateDate).IsModified = true;
|
|||
|
|||
// try
|
|||
// {
|
|||
// await _context.SaveChangesAsync();
|
|||
// result.Success = true;
|
|||
// result.Msg = "OK";
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// result.Success = false;
|
|||
// result.Msg = ex.Message;
|
|||
// }
|
|||
// return result;
|
|||
//}
|
|||
|
|||
// DELETE api/<WipSopLogController>/5
|
|||
[HttpDelete("{id}")] |
|||
public void Delete(int id) |
|||
{ |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,160 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System.Runtime.Serialization; |
|||
|
|||
|
|||
#nullable disable |
|||
|
|||
namespace AMESCoreStudio.WebApi.DTO.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 入庫單資料檔 Dto
|
|||
/// </summary>
|
|||
public partial class FqcDto |
|||
{ |
|||
/// <summary>
|
|||
/// 入庫單號碼
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "入庫單號")] |
|||
public string InhouseNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 序號
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "序號")] |
|||
public int SeqID { get; set; } = 1; |
|||
|
|||
/// <summary>
|
|||
/// FqcID
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "FqcID")] |
|||
public int? FqcID { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// 工單號碼
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "工單號碼")] |
|||
public string WipNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 料號
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "料號")] |
|||
public string ItemNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 品名/機種
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "品名")] |
|||
public string ModelNo { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 抽驗狀態 P-PASS(允收);R-REJECT(批退); A-初始狀態
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "抽驗狀態")] |
|||
|
|||
public string StatusName { get; set; } = "A"; |
|||
|
|||
/// <summary>
|
|||
/// 抽驗數量
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "抽驗數量")] |
|||
public int QcQty { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// PASS數量
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "PASS數量")] |
|||
public int PassQty { get; set; } = 0; |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 不良數
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "不良數")] |
|||
public int FailQty { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// 拒收數量
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "拒收數量")] |
|||
public int ReQty { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// 判定備註
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "判定備註")] |
|||
public string QaMeno { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 手動判定備註
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "手動判定備註")] |
|||
public string ManualQaMeno { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 入庫單備註
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "入庫單備註")] |
|||
public string InhouseMemo { get; set; } |
|||
|
|||
public List<FqcDetailDto> fqcDetails { get; set; } |
|||
|
|||
public class FqcDetailDto |
|||
{ |
|||
/// <summary>
|
|||
/// 箱號
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "箱號")] |
|||
public string SerialNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 總數量
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "總數量")] |
|||
public int Qty { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// 已抽驗數
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "已抽驗數")] |
|||
public int HasQty { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// PASS數量
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "PASS數量")] |
|||
public int PassQty { get; set; } = 0; |
|||
|
|||
|
|||
/// <summary>
|
|||
/// FAIL數量
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "不良數")] |
|||
public int FailQty { get; set; } = 0; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,124 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System.Runtime.Serialization; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// SOP文件紀錄
|
|||
/// </summary>
|
|||
[Table("MATERIAL_SOP", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public partial class MaterialSop |
|||
{ |
|||
/// <summary>
|
|||
/// MaterialSopID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("MATERIAL_SOP_ID")] |
|||
[DataMember] |
|||
public int MaterialSopID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 料號
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "料號")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Column("ITEM_NO")] |
|||
[StringLength(20)] |
|||
|
|||
public string ItemNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 生產單位ID
|
|||
/// </summary>
|
|||
[Display(Name = "生產單位")] |
|||
[Required] |
|||
[Column("UNIT_NO")] |
|||
[StringLength(1)] |
|||
[DataMember] |
|||
public string UnitNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 上傳檔案名稱
|
|||
/// </summary>
|
|||
[Display(Name = "檔案名稱")] |
|||
[Required] |
|||
[Column("FILENAME")] |
|||
[StringLength(100)] |
|||
[DataMember] |
|||
public string FileName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 存放檔案名稱
|
|||
/// </summary>
|
|||
[Display(Name = "存放檔案名稱")] |
|||
[Required] |
|||
[Column("NEWNAME")] |
|||
[StringLength(100)] |
|||
[DataMember] |
|||
public string NewName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 檔案路徑
|
|||
/// </summary>
|
|||
[DataMember] |
|||
[Display(Name = "檔案路徑")] |
|||
[Required] |
|||
[Column("FILEPATH")] |
|||
[StringLength(100)] |
|||
public string FilePath { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Y:使用中N:停用
|
|||
/// </summary>
|
|||
[Display(Name = "狀態")] |
|||
[Column("STATE")] |
|||
[StringLength(1)] |
|||
[DataMember] |
|||
public string State { get; set; } = "Y"; |
|||
|
|||
/// <summary>
|
|||
/// 建立UserID
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[Required] |
|||
[DataMember] |
|||
public int CreateUserID { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Required] |
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
public DateTime CreateDate { get; set; } = DateTime.Now; |
|||
|
|||
/// <summary>
|
|||
/// 更新UserID
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
[DataMember] |
|||
public int UpdateUserID { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// 更新日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
public DateTime? UpdateDate { get; set; } = DateTime.Now; |
|||
|
|||
/// <summary>
|
|||
/// 生產單位資料
|
|||
/// </summary>
|
|||
[ForeignKey("UnitNo")] |
|||
public virtual BAS.FactoryUnit FactoryUnit { get; set; } |
|||
|
|||
} |
|||
} |
@ -1,86 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System.Runtime.Serialization; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工單對應SOP文件紀錄
|
|||
/// </summary>
|
|||
[Table("WIP_SOP_LOG", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public partial class WipSopLog |
|||
{ |
|||
/// <summary>
|
|||
/// WIP_ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("WIP_ID")] |
|||
[DataMember] |
|||
public int WipID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// WIP_SOP_ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("WIP_SOP_ID")] |
|||
[DataMember] |
|||
public int WipSopID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 狀態
|
|||
/// </summary>
|
|||
[Column("STATE")] |
|||
[DataMember] |
|||
public string State { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立UserID
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[Required] |
|||
[DataMember] |
|||
public int CreateUserID { get; set; } = 0; |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Required] |
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
public DateTime CreateDate { get; set; } = System.DateTime.Now; |
|||
|
|||
/// <summary>
|
|||
/// 更新UserID
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
[DataMember] |
|||
public int UpdateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 更新日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
public DateTime? UpdateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工單資料
|
|||
/// </summary>
|
|||
[ForeignKey("WipID")] |
|||
[DataMember] |
|||
public virtual WipInfo GetWipInfo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// SOP資料
|
|||
/// </summary>
|
|||
[ForeignKey("WipSopID")] |
|||
[DataMember] |
|||
public virtual WipSop GetWipSop { get; set; } |
|||
} |
|||
} |
Loading…
Reference in new issue