From 3acaba2cf5fba2d8f6bab4f4d69bb5ad71737d25 Mon Sep 17 00:00:00 2001 From: Marvin Date: Thu, 16 Mar 2023 11:23:44 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=89=8D=E5=88=A4=E7=BB=B4?= =?UTF-8?q?=E4=BF=AE=E8=BE=93=E5=85=A5=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=9C=BA?= =?UTF-8?q?=E7=A7=8D=E6=98=BE=E7=A4=BA=202.=E4=BF=AE=E6=94=B9=E5=B7=A5?= =?UTF-8?q?=E5=8D=95KeyParts=E6=9F=A5=E8=AF=A22=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?MAC=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=9D=A5=E6=BA=90=EF=BC=8C?= =?UTF-8?q?=E5=AE=89=E5=8B=A4=E5=8E=82=E5=86=85=E7=9A=84SFIS=E7=9A=84ZPDKe?= =?UTF-8?q?yPart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.Web/Views/REP/REP001.cshtml | 6 ++++++ .../Controllers/AMES/NgInfoController.cs | 3 +++ .../Controllers/AMES/WipInfosController.cs | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/AMESCoreStudio.Web/Views/REP/REP001.cshtml b/AMESCoreStudio.Web/Views/REP/REP001.cshtml index ca6bd3d9..83588ba6 100644 --- a/AMESCoreStudio.Web/Views/REP/REP001.cshtml +++ b/AMESCoreStudio.Web/Views/REP/REP001.cshtml @@ -151,6 +151,12 @@ width: 200, sort: true }, + { + field: 'modelNO', + title: '機種', + width: 160, + sort: true + }, { field: 'stationName', title: '站別名稱', diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs index 3575cdb1..2b83305a 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs @@ -102,11 +102,14 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES join q2 in _context.BarcodeInfoes on q1.BarcodeID equals q2.BarcodeID join q3 in _context.WipInfos on q1.WipId equals q3.WipID join q4 in _context.Stationses on q1.StationId equals q4.StationID + join q5 in _context.WipAtts on q3.WipNO equals q5.WipNO select new { q1.NgID, q2.BarcodeNo, q3.WipNO, + q5.ItemNO, + q5.ModelNO, q4.StationName, q1.TestStatus, q1.Status, diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs index 826c4977..c76d2594 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs @@ -295,6 +295,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES await esun_conn.OpenAsync(); } + /* string mac_sql = string.Format(@"select distinct a.工單編號 as mo_id,e.客戶工單編號 as customer_moid,a.工單序號 as product_sn, case substring(f.avalue_kp_typeid, 1, 3) when 'MAC' then isnull(z.item_prefix,'')+b.SUB_ITEM_SN else b.SUB_ITEM_SN end as part_barcode, f.avalue_kp_typeid as class,c.material_id,d.r_stn as routeid,'' as workerid,rtrim(g.sn_date) + ' ' + rtrim(g.sn_time) as create_date @@ -309,6 +310,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES where g.sn_result = 'OK' AND a.工單序號 = '{0}' AND c.material_id LIKE 'MAC%'", barcodeNo); + */ + + string mac_sql = string.Format(@"SELECT B.[ProductSN], B.[PartBarcode], B.[MFID], B.[MOID], B.[PartTypeID], B.[MaterialID], B.[IsActive] +FROM [SFIS].[dbo].[ZPDKeyPart] B WHERE B.[IsActive] = 1 AND B.[ProductSN] = (SELECT A.[PartBarcode] FROM [SFIS].[dbo].[ZPDKeyPart] A WHERE A.[IsActive] = 1 AND A.[PartTypeID] = 'MAC' AND A.[PartBarcode] = '{0}')", barcodeNo); try { @@ -774,6 +779,7 @@ and b.item_no = '{0}' and a.barcode_no = '{1}'", kp_no, barcode_no); //part_no = "91000237320038"; + /* string mac_sql = string.Format(@"select distinct a.工單編號 as mo_id,e.客戶工單編號 as customer_moid,a.工單序號 as product_sn, case substring(f.avalue_kp_typeid, 1, 3) when 'MAC' then isnull(z.item_prefix,'')+b.SUB_ITEM_SN else b.SUB_ITEM_SN end as part_barcode, f.avalue_kp_typeid as class,c.material_id,d.r_stn as routeid,'' as workerid,rtrim(g.sn_date) + ' ' + rtrim(g.sn_time) as create_date @@ -788,6 +794,10 @@ and b.item_no = '{0}' and a.barcode_no = '{1}'", kp_no, barcode_no); where g.sn_result = 'OK' AND a.工單序號 = '{0}' AND c.material_id LIKE 'MAC%'", part_no); + */ + string mac_sql = string.Format(@"SELECT B.[ProductSN], B.[PartBarcode], B.[MFID], B.[MOID], B.[PartTypeID], B.[MaterialID], B.[IsActive] +FROM [SFIS].[dbo].[ZPDKeyPart] B WHERE B.[IsActive] = 1 AND B.[ProductSN] = (SELECT A.[PartBarcode] FROM [SFIS].[dbo].[ZPDKeyPart] A WHERE A.[IsActive] = 1 AND A.[PartTypeID] = 'MAC' AND A.[PartBarcode] = '{0}')", part_no); + using (var esun_cmd = esun_conn.CreateCommand()) {