fix(preprint): added the correct to string for the preprint stuff

This commit is contained in:
2025-11-04 20:16:59 -06:00
parent bd7bea8db6
commit 360c0163f1
3 changed files with 43 additions and 41 deletions

View File

@@ -1,33 +1,33 @@
--- ---
name: Bug Report name: Bug Report
about: Report a bug to help us improve. about: Report a bug to help us improve.
title: "[BUG] " title: "[BUG] "
labels: ["bug", "needs-triage"] labels: ["bug", "needs-triage"]
--- ---
### Describe the bug ### Describe the bug
A clear and concise description of what the bug is. A clear and concise description of what the bug is.
### Steps to reproduce ### Steps to reproduce
1. Go to '...' 1. Go to '...'
2. Click on '....' 2. Click on '....'
3. Scroll down to '....' 3. Scroll down to '....'
4. See error 4. See error
### Expected behavior ### Expected behavior
A clear and concise description of what you expected to happen. A clear and concise description of what you expected to happen.
### Screenshots ### Screenshots
If applicable, add screenshots to help explain your problem. If applicable, add screenshots to help explain your problem.
### Gitea Version ### Gitea Version
e.g., 1.25.0 e.g., 1.25.0
### Additional context ### Additional context
Add any other context about the problem here. Add any other context about the problem here.

View File

@@ -13,12 +13,12 @@ post {
body:json { body:json {
{ {
"scannerId": 999, "scannerId": 999,
"lotNr": 3314, "lotNr": 26656,
"machineId": 22, // 457=22, 458=23 "machineId": 5, // 457=22, 458=23
"printerId": 22, // 457=22, 458=23 "printerId": 7, // 457=22, 458=23
"layoutId": 7, "layoutId": 22,
"numberOfCopies": 0, "numberOfCopies": 1,
"qtyToPrint": 1 "qtyToPrint":0
} }
} }

View File

@@ -69,6 +69,8 @@ const addProdLabel = async (
if (prodLabelError) { if (prodLabelError) {
log.error({ error: error }, "Error adding the label"); log.error({ error: error }, "Error adding the label");
} }
return;
}; };
export const preprintLabels = async (preprint: Preprint, username?: string) => { export const preprintLabels = async (preprint: Preprint, username?: string) => {
@@ -85,12 +87,12 @@ export const preprintLabels = async (preprint: Preprint, username?: string) => {
"POST", "POST",
"/public/v1.0/Warehousing/GenerateAndPrintLabel", "/public/v1.0/Warehousing/GenerateAndPrintLabel",
{ {
scannerId: preprint.scannerId, scannerId: preprint.scannerId.toString(),
lotNr: preprint.lotNr, lotNr: preprint.lotNr.toString(),
machineId: preprint.machineId, // 457=22, 458=23 machineId: preprint.machineId.toString(),
printerId: preprint.printerId, // 457=22, 458=23 printerId: preprint.printerId.toString(),
layoutId: preprint.layoutId, layoutId: preprint.layoutId.toString(),
numberOfCopies: preprint.numberOfCopies, numberOfCopies: preprint.numberOfCopies.toString(),
}, },
); );
if (labels?.data.Result === 1) { if (labels?.data.Result === 1) {
@@ -116,7 +118,7 @@ export const preprintLabels = async (preprint: Preprint, username?: string) => {
} }
labelsPrinted.push(parseInt(labels?.data.SSCC.slice(10, -1))); labelsPrinted.push(parseInt(labels?.data.SSCC.slice(10, -1)));
// add the label to our label db for tracking purposes // add the label to our label db for tracking purposes
addProdLabel( await addProdLabel(
preprint, preprint,
parseInt(labels?.data.SSCC.slice(10, -1)), parseInt(labels?.data.SSCC.slice(10, -1)),
username || "lst", username || "lst",
@@ -141,12 +143,12 @@ export const preprintLabels = async (preprint: Preprint, username?: string) => {
"POST", "POST",
"/public/v1.0/Warehousing/GenerateAndPrintLabel", "/public/v1.0/Warehousing/GenerateAndPrintLabel",
{ {
scannerId: preprint.scannerId, scannerId: preprint.scannerId.toString(),
lotNr: preprint.lotNr, lotNr: preprint.lotNr.toString(),
machineId: preprint.machineId, // 457=22, 458=23 machineId: preprint.machineId.toString(),
printerId: preprint.printerId, // 457=22, 458=23 printerId: preprint.printerId.toString(),
layoutId: preprint.layoutId, layoutId: preprint.layoutId.toString(),
numberOfCopies: preprint.numberOfCopies, numberOfCopies: preprint.numberOfCopies.toString(),
}, },
); );
@@ -173,7 +175,7 @@ export const preprintLabels = async (preprint: Preprint, username?: string) => {
} }
labelsPrinted.push(parseInt(labels.data.SSCC.slice(10, -1))); labelsPrinted.push(parseInt(labels.data.SSCC.slice(10, -1)));
addProdLabel( await addProdLabel(
preprint, preprint,
parseInt(labels?.data.SSCC.slice(10, -1)), parseInt(labels?.data.SSCC.slice(10, -1)),
username || "lst", username || "lst",