diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs
index 763df28f..def62b9d 100644
--- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs
+++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs
@@ -266,6 +266,17 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
#endregion
#region 組件代碼-組件序號是否重複
+ //WINDOWS驗證-取得安勤 + 昶亨的KP SN
+ #region 取消
+ #endregion
+ //改抓C_SFIS_KEYPARTS (安勤轉拋)
+ #region
+ if (await _context.CSfisKeyparts.Where(w => w.Partbarcode.ToUpper() == KPs.inputData).AnyAsync())
+ {
+ resultModel.Msg += "組件名稱【" + q_Kp.KpName + "】已有相同組件序號【" + KPs.inputData + "】安勤轉拋KeyParts紀錄 ";
+ }
+ #endregion
+
var checkDataRedundancy = await barcodeItemsController.GetBarcodeItemByDataRedundancy(q_Kp.KpNo, KPs.inputData);
if (checkDataRedundancy.Value.Count() != 0)
{
@@ -1991,6 +2002,17 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
#endregion
#region 組件代碼-組件序號是否重複
+ //WINDOWS驗證-取得安勤 + 昶亨的KP SN
+ #region 取消
+ #endregion
+ //改抓C_SFIS_KEYPARTS (安勤轉拋)
+ #region
+ if (await _context.CSfisKeyparts.Where(w => w.Partbarcode.ToUpper() == barcodeKPDtoItem.inputData).AnyAsync())
+ {
+ CheckMsg += "組件名稱【" + wipKpsItem.KpName + "】已有相同組件序號【" + barcodeKPDtoItem.inputData + "】安勤轉拋KeyParts紀錄 ";
+ }
+ #endregion
+
var checkDataRedundancy = await barcodeItemsController.GetBarcodeItemByDataRedundancy(wipKpsItem.KpNo, barcodeKPDtoItem.inputData);
if (checkDataRedundancy.Value.Count() != 0)
{
diff --git a/AMESCoreStudio.WebApi/Models/AMES/CSfisKeypart.cs b/AMESCoreStudio.WebApi/Models/AMES/CSfisKeypart.cs
new file mode 100644
index 00000000..b5ce22f5
--- /dev/null
+++ b/AMESCoreStudio.WebApi/Models/AMES/CSfisKeypart.cs
@@ -0,0 +1,41 @@
+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
+{
+ ///
+ /// 安勤轉拋 KeyParts
+ ///
+ [Table("C_SFIS_KEYPARTS", Schema = "JHAMES")]
+ public partial class CSfisKeypart
+ {
+ [Column("PRODUCTSN")]
+ [StringLength(20)]
+ public string Productsn { get; set; }
+
+ [Column("PARTBARCODE")]
+ [StringLength(20)]
+ public string Partbarcode { get; set; }
+
+ [Column("MOID")]
+ [StringLength(15)]
+ public string Moid { get; set; }
+
+ [Column("PARTTYPEID")]
+ [StringLength(15)]
+ public string Parttypeid { get; set; }
+
+ [Column("MATERIALID")]
+ [StringLength(20)]
+ public string Materialid { get; set; }
+
+ [Column("CREATE_DATE", TypeName = "DATE")]
+ public DateTime? CreateDate { get; set; }
+ }
+}
diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs
index 78a414e0..b5b048a0 100644
--- a/AMESCoreStudio.WebApi/Models/AMESContext.cs
+++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs
@@ -153,6 +153,7 @@ namespace AMESCoreStudio.WebApi
modelBuilder.Entity().HasKey(c => new { c.StockInNo, c.KPItem });
modelBuilder.Entity().HasKey(c => new { c.NGClassNo, c.NGReasonNo });
modelBuilder.Entity().HasKey(c => new { c.Yrer, c.Month, c.QcRateType, c.ProductType });
+ modelBuilder.Entity().HasNoKey();
}
///
@@ -950,6 +951,11 @@ namespace AMESCoreStudio.WebApi
/// QC RATE
///
public virtual DbSet QcRates { get; set; }
+
+ ///
+ /// 安勤轉拋
+ ///
+ public virtual DbSet CSfisKeyparts { get; set; }
}
}