From 995311c5631a5538ab791b118e1b5b975da3f205 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 10 Mar 2025 16:59:17 -0500 Subject: [PATCH] feat(querys): plant query for gln and label data for sscc and other info --- package.json | 2 ++ .../sqlServer/querys/dataMart/plantInfo.ts | 12 ++++++++++++ .../querys/materialHelpers/labelInfo.ts | 19 ++++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 server/services/sqlServer/querys/dataMart/plantInfo.ts diff --git a/package.json b/package.json index f167c94..c9191a4 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "dev": "concurrently -n \"server,frontend\" -c \"#007755,#2f6da3\" \"npm run dev:server\" \"cd frontend && npm run dev\"", "dev:server": "dotenvx run -f .env -- tsx watch server/index.ts", "dev:frontend": "cd frontend && npm run dev", + "dev:dbgen": " drizzle-kit generate --config=drizzle-dev.config.ts", + "dev:dbmigrate": " drizzle-kit migrate --config=drizzle-dev.config.ts", "build": "npm run build:server && npm run build:frontend", "build:server": "rimraf dist && tsc --build && xcopy server\\scripts dist\\server\\scripts /E /I /Y", "build:frontend": "cd frontend && npm run build", diff --git a/server/services/sqlServer/querys/dataMart/plantInfo.ts b/server/services/sqlServer/querys/dataMart/plantInfo.ts new file mode 100644 index 0000000..f9da908 --- /dev/null +++ b/server/services/sqlServer/querys/dataMart/plantInfo.ts @@ -0,0 +1,12 @@ +export const plantInfo = ` +select werkkurzbez as plantToken, +gln, +IdAdressen as addressId, +Bezeichnung as addressDecriptuion, +Strasse as streetAddress, +plz as zipcode, +ort as cityState +--,* +from alplaprod_test1.dbo.T_Adressen where werkkurzbez = '[token]' + +`; diff --git a/server/services/sqlServer/querys/materialHelpers/labelInfo.ts b/server/services/sqlServer/querys/materialHelpers/labelInfo.ts index 1eb1a2b..4892cf6 100644 --- a/server/services/sqlServer/querys/materialHelpers/labelInfo.ts +++ b/server/services/sqlServer/querys/materialHelpers/labelInfo.ts @@ -1,3 +1,20 @@ export const labelData = ` -select Barcode as barcode from alplaprod_test1.dbo.V_LagerPositionenBarcodes (NOLOCK) where lfdnr = [rn] +select x.Barcode as barcode, +Produktionslos as lot, +x.IdArtikelVarianten as article, +x.ArtikelVariantenBez as description, +m.Standort as machineLocation, +m.Bezeichnung as machineDescription, +e.IdEtikettenDrucker as printer, +x.LfdNr as runningNr +from alplaprod_test1.dbo.V_LagerPositionenBarcodes x (NOLOCK) +left join +alplaprod_test1.dbo.T_EtikettenGedruckt as e +on x.Lfdnr = e.LfdNr + +left join +alplaprod_test1.dbo.T_Maschine as m on +e.IdMaschine = m.IdMaschine + +where x.lfdnr = [rn] and x.IdWarenlager not in(6) `;