From d2aa49ae7a7ff40b1bec360aadbcafc7cb05a6e4 Mon Sep 17 00:00:00 2001 From: Marvin Date: Mon, 21 Aug 2023 19:21:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95KeyParts?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=87=8D=E5=B7=A5=E5=B7=A5=E5=8D=95=E7=9A=84=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B8=85=E5=8D=95=EF=BC=88=E8=AF=BB=E5=8F=96=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E7=AC=94=E6=9D=A1=E7=A0=81=E7=9A=84=E7=BB=84=E4=BB=B6=E6=B8=85?= =?UTF-8?q?=E5=8D=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AMES/WipInfosController.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs index 3c2946b5..a86b75ee 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs @@ -677,10 +677,38 @@ and b.item_no = '{0}' and a.barcode_no = '{1}'", kp_no, barcode_no); await conn.OpenAsync(); } + string wip_sql = "select b.barcode_id,a.wip_type from jhames.wip_info a,jhames.barcode_info b where a.wip_id = b.wip_id and a.wip_no = '" + wipNO + "'"; + DataTable dtWip = new DataTable(); + using (var cmd = conn.CreateCommand()) + { + cmd.CommandText = wip_sql; + + using (var reader = await cmd.ExecuteReaderAsync()) + { + if (reader.HasRows) + { + dtWip = DataReaderToDataTable(reader); + } + } + } + + string wipType = ""; + int barcode_id = -1; + if (dtWip.Rows.Count > 0) + { + wipType = dtWip.Rows[0]["WIP_TYPE"].ToString(); + barcode_id = int.Parse(dtWip.Rows[0]["BARCODE_ID"].ToString()); + } + string kp_sql = "select kp_no, count(kp_seq) as kp_qty from jhames.wip_kp where wip_no = '" + wipNO + "' group by kp_no"; DataTable dtKp = new DataTable(); + if (wipType == "R") + { + kp_sql = "select item_no as kp_no,count(item_no) kp_qty from jhames.barcode_item where barcode_id = " + barcode_id + " group by item_no"; + } + using (var cmd = conn.CreateCommand()) { cmd.CommandText = kp_sql;