refactor(ocme): corrections to endpoints to work with ocnme as intneeded
This commit is contained in:
@@ -1,16 +1,19 @@
|
|||||||
import {spawn} from "child_process";
|
import { spawn } from "child_process";
|
||||||
import {getAppInfo} from "../globalUtils/appInfo.js";
|
import { getAppInfo } from "../globalUtils/appInfo.js";
|
||||||
import {db} from "../../database/dbclient.js";
|
import { db } from "../../database/dbclient.js";
|
||||||
import {serverData} from "../../database/schema/serverData.js";
|
import { serverData } from "../../database/schema/serverData.js";
|
||||||
import {eq, sql} from "drizzle-orm";
|
import { eq, sql } from "drizzle-orm";
|
||||||
import {createLog} from "../services/logger/logger.js";
|
import { createLog } from "../services/logger/logger.js";
|
||||||
|
|
||||||
type UpdateServerResponse = {
|
type UpdateServerResponse = {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateServer = async (devApp: string, server: string | null): Promise<UpdateServerResponse> => {
|
export const updateServer = async (
|
||||||
|
devApp: string,
|
||||||
|
server: string | null
|
||||||
|
): Promise<UpdateServerResponse> => {
|
||||||
const app = await getAppInfo(devApp);
|
const app = await getAppInfo(devApp);
|
||||||
const serverInfo = await db
|
const serverInfo = await db
|
||||||
.select()
|
.select()
|
||||||
@@ -26,7 +29,8 @@ export const updateServer = async (devApp: string, server: string | null): Promi
|
|||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: "Looks like you are missing the plant token or have entered an incorrect one please try again.",
|
message:
|
||||||
|
"Looks like you are missing the plant token or have entered an incorrect one please try again.",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +82,7 @@ export const updateServer = async (devApp: string, server: string | null): Promi
|
|||||||
// change the server to upgradeing
|
// change the server to upgradeing
|
||||||
await db
|
await db
|
||||||
.update(serverData)
|
.update(serverData)
|
||||||
.set({isUpgrading: true})
|
.set({ isUpgrading: true })
|
||||||
.where(eq(serverData.plantToken, server?.toLowerCase() ?? ""));
|
.where(eq(serverData.plantToken, server?.toLowerCase() ?? ""));
|
||||||
//let stdout = "";
|
//let stdout = "";
|
||||||
//let stderr = "";
|
//let stderr = "";
|
||||||
@@ -109,7 +113,7 @@ export const updateServer = async (devApp: string, server: string | null): Promi
|
|||||||
try {
|
try {
|
||||||
await db
|
await db
|
||||||
.update(serverData)
|
.update(serverData)
|
||||||
.set({lastUpdated: sql`NOW()`, isUpgrading: false})
|
.set({ lastUpdated: sql`NOW()`, isUpgrading: false })
|
||||||
.where(eq(serverData.plantToken, server?.toLowerCase() ?? ""));
|
.where(eq(serverData.plantToken, server?.toLowerCase() ?? ""));
|
||||||
createLog(
|
createLog(
|
||||||
"info",
|
"info",
|
||||||
@@ -156,7 +160,12 @@ export const updateServer = async (devApp: string, server: string | null): Promi
|
|||||||
export async function processAllServers(devApp: string) {
|
export async function processAllServers(devApp: string) {
|
||||||
const servers = await db.select().from(serverData);
|
const servers = await db.select().from(serverData);
|
||||||
|
|
||||||
createLog("info", "lst", "serverUpdater", `Running the update on all servers`);
|
createLog(
|
||||||
|
"info",
|
||||||
|
"lst",
|
||||||
|
"serverUpdater",
|
||||||
|
`Running the update on all servers`
|
||||||
|
);
|
||||||
let count = 1;
|
let count = 1;
|
||||||
for (const server of servers) {
|
for (const server of servers) {
|
||||||
try {
|
try {
|
||||||
@@ -166,7 +175,12 @@ export async function processAllServers(devApp: string) {
|
|||||||
|
|
||||||
//return {success: true, message: `${server.sName} was updated.`, data: updateToServer};
|
//return {success: true, message: `${server.sName} was updated.`, data: updateToServer};
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
createLog("info", "lst", "serverUpdater", `Error updating ${server.sName}: ${error.message}`);
|
createLog(
|
||||||
|
"info",
|
||||||
|
"lst",
|
||||||
|
"serverUpdater",
|
||||||
|
`Error updating ${server.sName}: ${error.message}`
|
||||||
|
);
|
||||||
//return {success: false, message: `Error updating ${server.sName}: ${error.message}`};
|
//return {success: false, message: `Error updating ${server.sName}: ${error.message}`};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ const updateBuildNumber = (appLock: string) => {
|
|||||||
// Auto-commit changes
|
// Auto-commit changes
|
||||||
execSync("git add package.json");
|
execSync("git add package.json");
|
||||||
execSync(
|
execSync(
|
||||||
`git commit -m "build: bump build number to ${pkgJson.admConfig.build}"`
|
`git commit -m "chore(release): bump build number to ${pkgJson.admConfig.build}"`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
createLog(
|
createLog(
|
||||||
|
|||||||
@@ -3,9 +3,14 @@ import axios from "axios";
|
|||||||
export const ocmeInv = async (data: any) => {
|
export const ocmeInv = async (data: any) => {
|
||||||
try {
|
try {
|
||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
"http://usday1vms010:3250/api/v1/getLaneData",
|
"http://usday1vms010:3250/api/v1/getlanedata",
|
||||||
{lane: data.lane, laneType: data.laneType},
|
{ lane: data.lane, laneType: data.laneType },
|
||||||
{headers: {"Content-Type": "application/json", Connection: "keep-alive"}}
|
{
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Connection: "keep-alive",
|
||||||
|
},
|
||||||
|
}
|
||||||
);
|
);
|
||||||
// console.log(res.data.data);
|
// console.log(res.data.data);
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,37 @@
|
|||||||
import {db} from "../../../../database/dbclient.js";
|
import { db } from "../../../../database/dbclient.js";
|
||||||
import {ocmeData} from "../../../../database/schema/ocme.js";
|
import { ocmeData } from "../../../../database/schema/ocme.js";
|
||||||
import {differenceInMinutes} from "date-fns";
|
import { differenceInMinutes } from "date-fns";
|
||||||
import {createLog} from "../../logger/logger.js";
|
import { createLog } from "../../logger/logger.js";
|
||||||
import {eq} from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
|
|
||||||
export const getInfo = async () => {
|
export const getInfo = async () => {
|
||||||
let ocmeInfo: any = [];
|
let ocmeInfo: any = [];
|
||||||
try {
|
try {
|
||||||
ocmeInfo = await db.select().from(ocmeData).where(eq(ocmeData.pickedUp, false));
|
ocmeInfo = await db
|
||||||
|
.select()
|
||||||
|
.from(ocmeData)
|
||||||
|
.where(eq(ocmeData.pickedUp, false));
|
||||||
|
|
||||||
// add in the time difference
|
// add in the time difference
|
||||||
ocmeInfo = ocmeInfo.map((o: any) => {
|
ocmeInfo = ocmeInfo.map((o: any) => {
|
||||||
const now = new Date(Date.now());
|
const now = new Date(Date.now());
|
||||||
const diff = differenceInMinutes(now, o.add_Date!);
|
//const strippedDate = o.add_Date.replace("Z", "");
|
||||||
return {...o, waitingFor: diff};
|
const diff = differenceInMinutes(now, o.add_Date);
|
||||||
|
return { ...o, waitingFor: diff };
|
||||||
});
|
});
|
||||||
createLog("info", "ocme", "ocme", `There are ${ocmeInfo.length} pallet(s) to be picked up.`);
|
createLog(
|
||||||
|
"info",
|
||||||
|
"ocme",
|
||||||
|
"ocme",
|
||||||
|
`There are ${ocmeInfo.length} pallet(s) to be picked up.`
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
createLog("error", "ocme", "ocme", "There was an error trying to retrive the ocmeInfo.");
|
createLog(
|
||||||
|
"error",
|
||||||
|
"ocme",
|
||||||
|
"ocme",
|
||||||
|
"There was an error trying to retrive the ocmeInfo."
|
||||||
|
);
|
||||||
throw Error("There was an error trying to retrive the.");
|
throw Error("There was an error trying to retrive the.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {OpenAPIHono} from "@hono/zod-openapi";
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
||||||
|
|
||||||
// routes
|
// routes
|
||||||
import getInfo from "./route/getInfo.js";
|
import getInfo from "./route/getInfo.js";
|
||||||
@@ -7,14 +7,23 @@ import pickedup from "./route/pickedUp.js";
|
|||||||
import postsscc from "./route/postSSCC.js";
|
import postsscc from "./route/postSSCC.js";
|
||||||
import getShipments from "./route/getShipmentPallets.js";
|
import getShipments from "./route/getShipmentPallets.js";
|
||||||
import cycleCount from "./route/cycleCount.js";
|
import cycleCount from "./route/cycleCount.js";
|
||||||
import {serve} from "@hono/node-server";
|
import { serve } from "@hono/node-server";
|
||||||
import {createLog} from "../logger/logger.js";
|
import { createLog } from "../logger/logger.js";
|
||||||
import {db} from "../../../database/dbclient.js";
|
import { db } from "../../../database/dbclient.js";
|
||||||
import {settings} from "../../../database/schema/settings.js";
|
import { settings } from "../../../database/schema/settings.js";
|
||||||
|
import manualTrigger from "./route/triggerCamera.js";
|
||||||
|
|
||||||
const app = new OpenAPIHono();
|
const app = new OpenAPIHono();
|
||||||
const port = process.env.OCME_PORT;
|
const port = process.env.OCME_PORT;
|
||||||
const routes = [getInfo, postRunningNr, postsscc, pickedup, getShipments, cycleCount] as const;
|
const routes = [
|
||||||
|
getInfo,
|
||||||
|
postRunningNr,
|
||||||
|
postsscc,
|
||||||
|
pickedup,
|
||||||
|
getShipments,
|
||||||
|
cycleCount,
|
||||||
|
manualTrigger,
|
||||||
|
] as const;
|
||||||
const setting = await db.select().from(settings);
|
const setting = await db.select().from(settings);
|
||||||
|
|
||||||
const isActive = setting.filter((n) => n.name === "ocmeService");
|
const isActive = setting.filter((n) => n.name === "ocmeService");
|
||||||
@@ -23,7 +32,10 @@ const appRoutes = routes.forEach((route) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.all("/api/v1/*", (c) => {
|
app.all("/api/v1/*", (c) => {
|
||||||
return c.json({success: false, message: "you have encounted an ocme route that dose not exist."});
|
return c.json({
|
||||||
|
success: false,
|
||||||
|
message: "you have encounted an ocme route that dose not exist.",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
if (port && isActive[0]?.value === "1") {
|
if (port && isActive[0]?.value === "1") {
|
||||||
serve(
|
serve(
|
||||||
@@ -33,7 +45,12 @@ if (port && isActive[0]?.value === "1") {
|
|||||||
hostname: "0.0.0.0",
|
hostname: "0.0.0.0",
|
||||||
},
|
},
|
||||||
(info) => {
|
(info) => {
|
||||||
createLog("info", "LST", "server", `Ocme section is listening on http://${info.address}:${info.port}`);
|
createLog(
|
||||||
|
"info",
|
||||||
|
"LST",
|
||||||
|
"server",
|
||||||
|
`Ocme section is listening on http://${info.address}:${info.port}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import {createRoute, OpenAPIHono, z} from "@hono/zod-openapi";
|
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||||
|
|
||||||
import {apiHit} from "../../../globalUtils/apiHits.js";
|
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||||
import {responses} from "../../../globalUtils/routeDefs/responses.js";
|
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||||
import {authMiddleware} from "../../auth/middleware/authMiddleware.js";
|
import { authMiddleware } from "../../auth/middleware/authMiddleware.js";
|
||||||
import {cycleCount} from "../controller/cycleCount.js";
|
import { cycleCount } from "../controller/cycleCount.js";
|
||||||
import type {User} from "../../../types/users.js";
|
import type { User } from "../../../types/users.js";
|
||||||
import {verify} from "hono/jwt";
|
import { verify } from "hono/jwt";
|
||||||
|
|
||||||
const app = new OpenAPIHono({strict: false});
|
const app = new OpenAPIHono({ strict: false });
|
||||||
|
|
||||||
const AddSetting = z.object({
|
const AddSetting = z.object({
|
||||||
lane: z.string().openapi({example: "L064"}),
|
lane: z.string().openapi({ example: "L064" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
app.openapi(
|
app.openapi(
|
||||||
@@ -18,19 +18,19 @@ app.openapi(
|
|||||||
tags: ["ocme"],
|
tags: ["ocme"],
|
||||||
summary: "Cycle counts a lane based on the lane Alias",
|
summary: "Cycle counts a lane based on the lane Alias",
|
||||||
method: "post",
|
method: "post",
|
||||||
path: "/cyclecount",
|
path: "/cycleCount",
|
||||||
middleware: authMiddleware,
|
middleware: authMiddleware,
|
||||||
request: {
|
request: {
|
||||||
body: {
|
body: {
|
||||||
content: {
|
content: {
|
||||||
"application/json": {schema: AddSetting},
|
"application/json": { schema: AddSetting },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
responses: responses(),
|
responses: responses(),
|
||||||
}),
|
}),
|
||||||
async (c) => {
|
async (c) => {
|
||||||
apiHit(c, {endpoint: "api/auth/register"});
|
apiHit(c, { endpoint: "api/auth/register" });
|
||||||
// make sure we have a vaid user being accessed thats really logged in
|
// make sure we have a vaid user being accessed thats really logged in
|
||||||
const body = await c.req.json();
|
const body = await c.req.json();
|
||||||
|
|
||||||
@@ -43,15 +43,26 @@ app.openapi(
|
|||||||
const payload = await verify(token, process.env.JWT_SECRET!);
|
const payload = await verify(token, process.env.JWT_SECRET!);
|
||||||
user = payload.user as User;
|
user = payload.user as User;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return c.json({message: "Unauthorized"}, 401);
|
return c.json({ message: "Unauthorized" }, 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const cycleData = await cycleCount(body, user);
|
const cycleData = await cycleCount(body, user);
|
||||||
return c.json({success: true, message: `${body.lane} was just cycle counted.`, data: cycleData}, 200);
|
return c.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: `${body.lane} was just cycle counted.`,
|
||||||
|
data: cycleData,
|
||||||
|
},
|
||||||
|
200
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return c.json(
|
return c.json(
|
||||||
{success: false, message: `There was an error cycle counting ${body.lane}`, data: error},
|
{
|
||||||
|
success: false,
|
||||||
|
message: `There was an error cycle counting ${body.lane}`,
|
||||||
|
data: error,
|
||||||
|
},
|
||||||
400
|
400
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {createRoute, OpenAPIHono, z} from "@hono/zod-openapi";
|
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||||
import {apiHit} from "../../../globalUtils/apiHits.js";
|
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||||
import {getShipmentPallets} from "../controller/getShipmentPallets.js";
|
import { getShipmentPallets } from "../controller/getShipmentPallets.js";
|
||||||
|
|
||||||
const app = new OpenAPIHono();
|
const app = new OpenAPIHono();
|
||||||
|
|
||||||
const ShipmentID = z.object({
|
const ShipmentID = z.object({
|
||||||
shipmentID: z.string().optional().openapi({example: "14558"}),
|
shipmentID: z.string().optional().openapi({ example: "14558" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
app.openapi(
|
app.openapi(
|
||||||
@@ -13,11 +13,11 @@ app.openapi(
|
|||||||
tags: ["ocme"],
|
tags: ["ocme"],
|
||||||
summary: "Post New running number to be picked up.",
|
summary: "Post New running number to be picked up.",
|
||||||
method: "post",
|
method: "post",
|
||||||
path: "/getshipmentpallets",
|
path: "/GetShipmentPallets",
|
||||||
request: {
|
request: {
|
||||||
body: {
|
body: {
|
||||||
content: {
|
content: {
|
||||||
"application/json": {schema: ShipmentID},
|
"application/json": { schema: ShipmentID },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -26,8 +26,8 @@ app.openapi(
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
success: z.boolean().openapi({example: true}),
|
success: z.boolean().openapi({ example: true }),
|
||||||
message: z.string().openapi({example: "Starter"}),
|
message: z.string().openapi({ example: "Starter" }),
|
||||||
// data: z
|
// data: z
|
||||||
// .array(z.object({sscc: z.string().optional()}))
|
// .array(z.object({sscc: z.string().optional()}))
|
||||||
// .optional()
|
// .optional()
|
||||||
@@ -41,9 +41,12 @@ app.openapi(
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
success: z.boolean().openapi({example: false}),
|
success: z.boolean().openapi({ example: false }),
|
||||||
message: z.string().optional().openapi({example: "Internal Server error"}),
|
message: z
|
||||||
data: z.array(z.object({})).optional().openapi({example: []}),
|
.string()
|
||||||
|
.optional()
|
||||||
|
.openapi({ example: "Internal Server error" }),
|
||||||
|
data: z.array(z.object({})).optional().openapi({ example: [] }),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -71,11 +74,17 @@ app.openapi(
|
|||||||
// make sure we have a vaid user being accessed thats really logged in
|
// make sure we have a vaid user being accessed thats really logged in
|
||||||
try {
|
try {
|
||||||
const data = await c.req.json();
|
const data = await c.req.json();
|
||||||
apiHit(c, {endpoint: "api/ocme/getshipmentpallets", lastBody: data});
|
apiHit(c, { endpoint: "api/ocme/getshipmentpallets", lastBody: data });
|
||||||
|
|
||||||
|
console.log;
|
||||||
|
|
||||||
if (!data.shipmentID) {
|
if (!data.shipmentID) {
|
||||||
return c.json(
|
return c.json(
|
||||||
{success: false, message: "You are missing the shipment id please try again.", data: []},
|
{
|
||||||
|
success: false,
|
||||||
|
message: "You are missing the shipment id please try again.",
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
400
|
400
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -83,11 +92,22 @@ app.openapi(
|
|||||||
const shiptmentData = await getShipmentPallets(data.shipmentID);
|
const shiptmentData = await getShipmentPallets(data.shipmentID);
|
||||||
|
|
||||||
return c.json(
|
return c.json(
|
||||||
{success: shiptmentData.success, message: shiptmentData.message, data: shiptmentData.data ?? []},
|
{
|
||||||
|
success: shiptmentData.success,
|
||||||
|
message: shiptmentData.message,
|
||||||
|
data: shiptmentData.data ?? [],
|
||||||
|
},
|
||||||
200
|
200
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return c.json({success: false, message: "There was an error getting the shipment data.", data: error}, 400);
|
return c.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "There was an error getting the shipment data.",
|
||||||
|
data: error,
|
||||||
|
},
|
||||||
|
400
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
* Phase 2 we will just reprint the tag that was generated at the line
|
* Phase 2 we will just reprint the tag that was generated at the line
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {createLog} from "../../../logger/logger.js";
|
import { createLog } from "../../../logger/logger.js";
|
||||||
import type {TagData} from "../tagData.js";
|
import type { TagData } from "../tagData.js";
|
||||||
import {tagStuff} from "../tags/crudTag.js";
|
import { tagStuff } from "../tags/crudTag.js";
|
||||||
|
|
||||||
export const wrapperStuff = async (tagData: TagData[]) => {
|
export const wrapperStuff = async (tagData: TagData[]) => {
|
||||||
if (tagData.length != 1) {
|
if (tagData.length != 1) {
|
||||||
@@ -18,18 +18,28 @@ export const wrapperStuff = async (tagData: TagData[]) => {
|
|||||||
tagStuff(tagData);
|
tagStuff(tagData);
|
||||||
} else {
|
} else {
|
||||||
const tagdata = await tagStuff(tagData);
|
const tagdata = await tagStuff(tagData);
|
||||||
|
if (!tagData) {
|
||||||
|
createLog("error", "rfid", "rfid", `No tagData was grabbed.`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* we want to make sure this pallet came from a line as its last spot if not we need to have a manual check.
|
* we want to make sure this pallet came from a line as its last spot if not we need to have a manual check.
|
||||||
*/
|
*/
|
||||||
const station3 = tagdata.some((n: any) => n.lastareaIn.includes("line3"));
|
if (
|
||||||
|
!Array.isArray(tagdata) &&
|
||||||
|
tagdata?.some((n: any) => n.lastareaIn.includes("line3"))
|
||||||
|
) {
|
||||||
|
createLog("error", "rfid", "rfid", `Data passed over is not an array.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const station3 = tagdata; //?.some((n: any) => n.lastareaIn.includes("line3"));
|
||||||
|
|
||||||
if (!station3) {
|
if (!station3) {
|
||||||
createLog(
|
createLog(
|
||||||
"error",
|
"error",
|
||||||
"rfid",
|
"rfid",
|
||||||
"rfid",
|
"rfid",
|
||||||
`${tagdata.tag}, Did not come from a line please check the pallet and manually print the label.`
|
`${tagdata[0].tag}, Did not come from a line please check the pallet and manually print the label.`
|
||||||
);
|
);
|
||||||
|
|
||||||
// when we manually run again we want to make sure we read from the 3rd antenna this way we do not get the wrong info.
|
// when we manually run again we want to make sure we read from the 3rd antenna this way we do not get the wrong info.
|
||||||
@@ -38,9 +48,19 @@ export const wrapperStuff = async (tagData: TagData[]) => {
|
|||||||
|
|
||||||
// check if a running number exists
|
// check if a running number exists
|
||||||
if (station3.runningNumber) {
|
if (station3.runningNumber) {
|
||||||
createLog("info", "rfid", "rfid", `Reprint label ${station3.runningNumber}`);
|
createLog(
|
||||||
|
"info",
|
||||||
|
"rfid",
|
||||||
|
"rfid",
|
||||||
|
`Reprint label ${station3.runningNumber}`
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
createLog("info", "rfid", "rfid", `A new labels will be created and linked to this ${tagdata.tag} tag`);
|
createLog(
|
||||||
|
"info",
|
||||||
|
"rfid",
|
||||||
|
"rfid",
|
||||||
|
`A new labels will be created and linked to this ${tagdata.tag} tag`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user