From 3c46d8d79593e74fe5ec090334cf6d085eefb545 Mon Sep 17 00:00:00 2001 From: Sai Date: Thu, 10 Aug 2023 14:30:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=81=8E=E7=AB=99KeyParts=E5=88=A4?= =?UTF-8?q?=E6=96=B7=E4=BF=AE=E6=AD=A3=E6=8A=93=E5=AE=89=E5=8B=A4=E8=BD=89?= =?UTF-8?q?=E6=8B=8BTable=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/BLL/BarCodeCheckController.cs | 22 ++++++++++ .../Models/AMES/CSfisKeypart.cs | 41 +++++++++++++++++++ AMESCoreStudio.WebApi/Models/AMESContext.cs | 6 +++ 3 files changed, 69 insertions(+) create mode 100644 AMESCoreStudio.WebApi/Models/AMES/CSfisKeypart.cs 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; } } }