Compare commits
15 Commits
6665b77e09
...
7532c89ae2
| Author | SHA1 | Date | |
|---|---|---|---|
| 7532c89ae2 | |||
| dd6895fac2 | |||
| 95c869d667 | |||
| 9325e58551 | |||
| 17b6c0ac66 | |||
| 3241cf810a | |||
| b5b57fe3bf | |||
| 08b052ea5a | |||
| 8ad64bb67a | |||
| e0eb26b544 | |||
| 2090f8ce71 | |||
| db1d5f1601 | |||
| c5d53e03d3 | |||
| fb0b3f06a4 | |||
| 6e2e17bdde |
@@ -1,4 +1,14 @@
|
|||||||
import {text, pgTable, numeric, index, timestamp, boolean, uuid, uniqueIndex, jsonb} from "drizzle-orm/pg-core";
|
import {
|
||||||
|
text,
|
||||||
|
pgTable,
|
||||||
|
numeric,
|
||||||
|
index,
|
||||||
|
timestamp,
|
||||||
|
boolean,
|
||||||
|
uuid,
|
||||||
|
uniqueIndex,
|
||||||
|
jsonb,
|
||||||
|
} from "drizzle-orm/pg-core";
|
||||||
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
@@ -12,6 +22,7 @@ export const rfidReaders = pgTable(
|
|||||||
lastTrigger: timestamp("lastTrigger").defaultNow(),
|
lastTrigger: timestamp("lastTrigger").defaultNow(),
|
||||||
lastTriggerGood: boolean("lastTiggerGood").default(true),
|
lastTriggerGood: boolean("lastTiggerGood").default(true),
|
||||||
active: boolean("active").default(true),
|
active: boolean("active").default(true),
|
||||||
|
lastTagScanned: text("lastTagScanned"),
|
||||||
},
|
},
|
||||||
(table) => [
|
(table) => [
|
||||||
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
||||||
|
|||||||
58
frontend/src/components/dashboard/AddCards.tsx
Normal file
58
frontend/src/components/dashboard/AddCards.tsx
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogDescription,
|
||||||
|
DialogFooter,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
DialogTrigger,
|
||||||
|
} from "@/components/ui/dialog";
|
||||||
|
|
||||||
|
import { useCardStore } from "@/lib/store/useCardStore";
|
||||||
|
import { toast } from "sonner";
|
||||||
|
|
||||||
|
export function AddCards() {
|
||||||
|
const { cards, addCard } = useCardStore();
|
||||||
|
|
||||||
|
const handleAddPPOO = () => {
|
||||||
|
const existingCard = cards.filter((c) => c.i === "PPOO");
|
||||||
|
//console.log(existingCard.length);
|
||||||
|
//console.log(data);
|
||||||
|
if (existingCard.length != 0) {
|
||||||
|
toast.error(`PPOO already exists no card will be added`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
addCard({
|
||||||
|
i: "PPOO",
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
w: 5,
|
||||||
|
h: 3,
|
||||||
|
isResizable: true,
|
||||||
|
isDraggable: true,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<Dialog>
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
<Button variant="outline">Add Cards</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent className="sm:max-w-[425px]">
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Cards</DialogTitle>
|
||||||
|
<DialogDescription>
|
||||||
|
Please add a card below.
|
||||||
|
</DialogDescription>
|
||||||
|
</DialogHeader>
|
||||||
|
<Button onClick={handleAddPPOO} className="w-48">
|
||||||
|
PPOO
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<DialogFooter>
|
||||||
|
<Button type="submit">Save changes</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
68
frontend/src/components/dashboard/DashBoard.tsx
Normal file
68
frontend/src/components/dashboard/DashBoard.tsx
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
export default function DashBoard() {
|
||||||
|
// const handleResizeStop = (newLayout: any, newItem: any) => {
|
||||||
|
// updateCard(
|
||||||
|
// newItem.i,
|
||||||
|
// newLayout.filter((n: any) => n.i === newItem.i)[0]
|
||||||
|
// ); // Store the new layout in state
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const handleDragStop = (newLayout: any, newItem: any) => {
|
||||||
|
// updateCard(
|
||||||
|
// newItem.i,
|
||||||
|
// newLayout.filter((n: any) => n.i === newItem.i)[0]
|
||||||
|
// ); // Persist the updated layout with custom name
|
||||||
|
// };
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="ml-5 w-11/12 h-9/10">
|
||||||
|
<p>Comming soon...</p>
|
||||||
|
{/* <ResizablePanelGroup
|
||||||
|
direction="horizontal"
|
||||||
|
//className="rounded-lg border"
|
||||||
|
autoSaveId="persistence"
|
||||||
|
>
|
||||||
|
<ResizablePanel>
|
||||||
|
<ResizablePanelGroup direction="vertical">
|
||||||
|
<ResizablePanel>
|
||||||
|
<div className="overflow: auto">
|
||||||
|
<Lots />
|
||||||
|
</div>
|
||||||
|
</ResizablePanel>
|
||||||
|
<ResizableHandle />
|
||||||
|
<ResizablePanel>
|
||||||
|
<ResizablePanelGroup direction="horizontal">
|
||||||
|
<ResizablePanel>
|
||||||
|
<LabelLog />
|
||||||
|
</ResizablePanel>
|
||||||
|
<ResizableHandle />
|
||||||
|
<ResizablePanel>
|
||||||
|
<OcpLogs />
|
||||||
|
</ResizablePanel>
|
||||||
|
</ResizablePanelGroup>
|
||||||
|
</ResizablePanel>
|
||||||
|
</ResizablePanelGroup>
|
||||||
|
</ResizablePanel>
|
||||||
|
<ResizableHandle />
|
||||||
|
<ResizablePanel defaultSize={25}>
|
||||||
|
<ResizablePanelGroup direction="vertical">
|
||||||
|
{server[0].value === "usday1vms006" && (
|
||||||
|
<ResizablePanel className="max-h-[300px]">
|
||||||
|
<WrapperManualTrigger />
|
||||||
|
</ResizablePanel>
|
||||||
|
)}
|
||||||
|
{server[0].value === "usday1vms006" && (
|
||||||
|
<ResizablePanel className="max-h-[300px]">
|
||||||
|
<WrapperManualTrigger />
|
||||||
|
</ResizablePanel>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<ResizableHandle />
|
||||||
|
<ResizablePanel>
|
||||||
|
<PrinterStatus />
|
||||||
|
</ResizablePanel>
|
||||||
|
</ResizablePanelGroup>
|
||||||
|
</ResizablePanel>
|
||||||
|
</ResizablePanelGroup> */}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -7,12 +7,17 @@ interface LstCardProps {
|
|||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LstCard({children, className = "", style = {}}: LstCardProps) {
|
export function LstCard({
|
||||||
|
children,
|
||||||
|
className = "",
|
||||||
|
style = {},
|
||||||
|
}: LstCardProps) {
|
||||||
return (
|
return (
|
||||||
<div className="m-auto">
|
<Card
|
||||||
<Card className={`border-solid border-1 border-[#00659c] ${className}`} style={style}>
|
className={`border-solid border-1 border-[#00659c] ${className}`}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getAdjustments } from "@/utils/querys/logistics/siloAdjustments/getAdjustments";
|
import { getAdjustments } from "@/utils/querys/logistics/siloAdjustments/getAdjustments";
|
||||||
import { columns } from "@/utils/tableData/siloAdjustmentHist/siloAdjHist";
|
import { columns } from "@/utils/tableData/siloAdjustmentHist/siloAdjHistColumns";
|
||||||
import { DataTable } from "@/utils/tableData/siloAdjustmentHist/siloDate";
|
import { SiloTable } from "@/utils/tableData/siloAdjustmentHist/siloData";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
export default function HistoricalData(props: any) {
|
export default function HistoricalData(props: any) {
|
||||||
@@ -18,11 +18,9 @@ export default function HistoricalData(props: any) {
|
|||||||
const adjustments: any = data.filter(
|
const adjustments: any = data.filter(
|
||||||
(l: any) => l.locationID === parseInt(props.laneId)
|
(l: any) => l.locationID === parseInt(props.laneId)
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(adjustments);
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto py-10">
|
<div className="container mx-auto py-10">
|
||||||
<DataTable columns={columns} data={adjustments} />
|
<SiloTable columns={columns} data={adjustments} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
50
frontend/src/components/logistics/warehouse/PPOOCard.tsx
Normal file
50
frontend/src/components/logistics/warehouse/PPOOCard.tsx
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { LstCard } from "@/components/extendedUI/LstCard";
|
||||||
|
import { useCardStore } from "@/lib/store/useCardStore";
|
||||||
|
import { getPPOO } from "@/utils/querys/logistics/getPPOO";
|
||||||
|
import { columns } from "@/utils/tableData/ppoo/ppooColumns";
|
||||||
|
import { PPOOTable } from "@/utils/tableData/ppoo/ppooData";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { CircleX } from "lucide-react";
|
||||||
|
import { Suspense } from "react";
|
||||||
|
import { toast } from "sonner";
|
||||||
|
|
||||||
|
export default function PPOO({ style = {} }) {
|
||||||
|
const { removeCard } = useCardStore();
|
||||||
|
const { data, isError, isLoading } = useQuery(getPPOO());
|
||||||
|
|
||||||
|
if (isLoading) return <div>Loading adjustmnet data...</div>;
|
||||||
|
if (isError) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<p>There was an error getting the adjustments.</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCloseCard = () => {
|
||||||
|
removeCard("PPOO");
|
||||||
|
|
||||||
|
toast.success("card removed");
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<div style={style}>
|
||||||
|
<LstCard style={style}>
|
||||||
|
<Suspense fallback={<p>Loading PPOO...</p>}>
|
||||||
|
<div className={`flex justify-center`}>
|
||||||
|
<p
|
||||||
|
className={`drag-handle w-fit`}
|
||||||
|
style={{ cursor: "move", padding: "5px" }}
|
||||||
|
>
|
||||||
|
PPOO
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<button onClick={handleCloseCard}>
|
||||||
|
<CircleX />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<PPOOTable columns={columns} data={data} style={style} />
|
||||||
|
</Suspense>
|
||||||
|
</LstCard>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -4,56 +4,117 @@ import Lots from "./Lots";
|
|||||||
import OcpLogs from "./OcpLogs";
|
import OcpLogs from "./OcpLogs";
|
||||||
import PrinterStatus from "./PrinterStatus";
|
import PrinterStatus from "./PrinterStatus";
|
||||||
import { useSettingStore } from "@/lib/store/useSettings";
|
import { useSettingStore } from "@/lib/store/useSettings";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
||||||
import LabelLog from "./LabelLog";
|
import LabelLog from "./LabelLog";
|
||||||
|
import {
|
||||||
|
ResizableHandle,
|
||||||
|
ResizablePanel,
|
||||||
|
ResizablePanelGroup,
|
||||||
|
} from "@/components/ui/resizable-panels";
|
||||||
|
|
||||||
export default function OCPPage() {
|
export default function OCPPage() {
|
||||||
const { settings } = useSettingStore();
|
const { settings } = useSettingStore();
|
||||||
|
|
||||||
let server = settings.filter((n) => n.name === "server");
|
let server = settings.filter((n) => n.name === "server");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-screen w-full ">
|
<div className="ml-5 w-11/12 h-9/10">
|
||||||
<div className="flex flex-row gap-2">
|
<ResizablePanelGroup
|
||||||
<div className="flex flex-col w-4/5 h-dvh">
|
direction="horizontal"
|
||||||
<div className="">
|
//className="rounded-lg border"
|
||||||
|
autoSaveId="ocpPage"
|
||||||
|
>
|
||||||
|
<ResizablePanel>
|
||||||
|
<ResizablePanelGroup direction="vertical">
|
||||||
|
<ResizablePanel>
|
||||||
|
<div style={{ overflow: "auto" }}>
|
||||||
<Lots />
|
<Lots />
|
||||||
</div>
|
</div>
|
||||||
|
</ResizablePanel>
|
||||||
<div className="w-5/6 h-1/2">
|
<ResizableHandle />
|
||||||
<Tabs defaultValue="ocplogs" className="w-full">
|
<ResizablePanel>
|
||||||
<TabsList className="grid w-full grid-cols-2">
|
<ResizablePanelGroup direction="horizontal">
|
||||||
<TabsTrigger value="ocplogs">
|
<ResizablePanel className="overflow: auto">
|
||||||
OcpLogs
|
<div style={{ overflow: "auto" }}>
|
||||||
</TabsTrigger>
|
<LabelLog />
|
||||||
<TabsTrigger value="labels">Labels</TabsTrigger>
|
</div>
|
||||||
</TabsList>
|
</ResizablePanel>
|
||||||
<TabsContent value="ocplogs">
|
<ResizableHandle />
|
||||||
<div className="w-full">
|
<ResizablePanel>
|
||||||
|
<div style={{ overflow: "auto" }}>
|
||||||
<OcpLogs />
|
<OcpLogs />
|
||||||
</div>
|
</div>
|
||||||
</TabsContent>
|
</ResizablePanel>
|
||||||
<TabsContent value="labels">
|
</ResizablePanelGroup>
|
||||||
<LabelLog />
|
</ResizablePanel>
|
||||||
</TabsContent>
|
</ResizablePanelGroup>
|
||||||
</Tabs>
|
</ResizablePanel>
|
||||||
</div>
|
<ResizableHandle />
|
||||||
</div>
|
<ResizablePanel defaultSize={25}>
|
||||||
<div className="flex flex-col">
|
<ResizablePanelGroup direction="vertical">
|
||||||
{server[0].value === "usday1vms006" && (
|
{server[0].value === "usday1vms006" && (
|
||||||
<div>
|
<ResizablePanel className="max-h-[300px]">
|
||||||
<WrapperManualTrigger />
|
<WrapperManualTrigger />
|
||||||
</div>
|
</ResizablePanel>
|
||||||
)}
|
)}
|
||||||
{server[0].value === "localhost" && (
|
{server[0].value === "usday1vms006" && (
|
||||||
<div>
|
<ResizablePanel className="max-h-[300px]">
|
||||||
<WrapperManualTrigger />
|
<WrapperManualTrigger />
|
||||||
</div>
|
</ResizablePanel>
|
||||||
)}
|
)}
|
||||||
<div>
|
|
||||||
|
<ResizableHandle />
|
||||||
|
<ResizablePanel>
|
||||||
<PrinterStatus />
|
<PrinterStatus />
|
||||||
</div>
|
</ResizablePanel>
|
||||||
</div>
|
</ResizablePanelGroup>
|
||||||
</div>
|
</ResizablePanel>
|
||||||
|
</ResizablePanelGroup>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
// return (
|
||||||
|
// <div className="h-screen w-full ">
|
||||||
|
// <div className="flex flex-row gap-2">
|
||||||
|
// <div className="flex flex-col w-4/5 h-dvh">
|
||||||
|
// <div className="">
|
||||||
|
// <Lots />
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// <div className="w-5/6 h-1/2">
|
||||||
|
// <Tabs defaultValue="ocplogs" className="w-full">
|
||||||
|
// <TabsList className="grid w-full grid-cols-2">
|
||||||
|
// <TabsTrigger value="ocplogs">
|
||||||
|
// OcpLogs
|
||||||
|
// </TabsTrigger>
|
||||||
|
// <TabsTrigger value="labels">Labels</TabsTrigger>
|
||||||
|
// </TabsList>
|
||||||
|
// <TabsContent value="ocplogs">
|
||||||
|
// <div className="w-full">
|
||||||
|
// <OcpLogs />
|
||||||
|
// </div>
|
||||||
|
// </TabsContent>
|
||||||
|
// <TabsContent value="labels">
|
||||||
|
// <LabelLog />
|
||||||
|
// </TabsContent>
|
||||||
|
// </Tabs>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// <div className="flex flex-col">
|
||||||
|
// {server[0].value === "usday1vms006" && (
|
||||||
|
// <div>
|
||||||
|
// <WrapperManualTrigger />
|
||||||
|
// </div>
|
||||||
|
// )}
|
||||||
|
// {server[0].value === "localhost" && (
|
||||||
|
// <div>
|
||||||
|
// <WrapperManualTrigger />
|
||||||
|
// </div>
|
||||||
|
// )}
|
||||||
|
// <div>
|
||||||
|
// <PrinterStatus />
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ const fetchSession = async () => {
|
|||||||
localStorage.removeItem("auth-storage");
|
localStorage.removeItem("auth-storage");
|
||||||
localStorage.removeItem("nextauth.message");
|
localStorage.removeItem("nextauth.message");
|
||||||
localStorage.removeItem("prod");
|
localStorage.removeItem("prod");
|
||||||
localStorage.removeItem("cards");
|
|
||||||
localStorage.removeItem("rememberMe");
|
|
||||||
localStorage.removeItem("username");
|
|
||||||
|
|
||||||
throw new Error("Session not found");
|
throw new Error("Session not found");
|
||||||
}
|
}
|
||||||
@@ -55,5 +52,9 @@ export const useSession = () => {
|
|||||||
}
|
}
|
||||||
}, [data, error]);
|
}, [data, error]);
|
||||||
|
|
||||||
return {session: data && token ? {user: data.user, token: data.token} : null, status, error};
|
return {
|
||||||
|
session: data && token ? { user: data.user, token: data.token } : null,
|
||||||
|
status,
|
||||||
|
error,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
55
frontend/src/lib/store/useCardStore.ts
Normal file
55
frontend/src/lib/store/useCardStore.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import { create } from "zustand";
|
||||||
|
import { devtools, persist } from "zustand/middleware";
|
||||||
|
|
||||||
|
interface CardSettings {
|
||||||
|
daysSinceLast?: number;
|
||||||
|
rowType?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Card {
|
||||||
|
i: string;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
w: number;
|
||||||
|
h: number;
|
||||||
|
minW?: number;
|
||||||
|
maxW?: number;
|
||||||
|
minH?: number;
|
||||||
|
maxH?: number;
|
||||||
|
isResizable: boolean;
|
||||||
|
isDraggable: boolean;
|
||||||
|
cardSettings?: CardSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CardStore {
|
||||||
|
cards: Card[]; // Array of card objects
|
||||||
|
addCard: (card: Card) => void;
|
||||||
|
updateCard: (id: string, updatedCard: Partial<Card>) => void;
|
||||||
|
removeCard: (id: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useCardStore = create<CardStore>()(
|
||||||
|
devtools(
|
||||||
|
persist<CardStore>(
|
||||||
|
(set) => ({
|
||||||
|
cards: [],
|
||||||
|
|
||||||
|
addCard: (card) =>
|
||||||
|
set((state) => ({ cards: [...state.cards, card] })),
|
||||||
|
|
||||||
|
updateCard: (id, updatedCard) =>
|
||||||
|
set((state) => ({
|
||||||
|
cards: state.cards.map((card) =>
|
||||||
|
card.i === id ? { ...card, ...updatedCard } : card
|
||||||
|
),
|
||||||
|
})),
|
||||||
|
|
||||||
|
removeCard: (id) =>
|
||||||
|
set((state) => ({
|
||||||
|
cards: state.cards.filter((card) => card.i !== id),
|
||||||
|
})),
|
||||||
|
}),
|
||||||
|
{ name: "card-storage" }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
@@ -21,6 +21,7 @@ import { Toaster } from "sonner";
|
|||||||
import { useSessionStore } from "../lib/store/sessionStore";
|
import { useSessionStore } from "../lib/store/sessionStore";
|
||||||
import { useSession } from "@/hooks/useSession";
|
import { useSession } from "@/hooks/useSession";
|
||||||
import { useLogout } from "@/hooks/useLogout";
|
import { useLogout } from "@/hooks/useLogout";
|
||||||
|
import { AddCards } from "@/components/dashboard/AddCards";
|
||||||
|
|
||||||
// same as the layout
|
// same as the layout
|
||||||
export const Route = createRootRoute({
|
export const Route = createRootRoute({
|
||||||
@@ -37,7 +38,7 @@ export const Route = createRootRoute({
|
|||||||
<nav className="flex justify-end">
|
<nav className="flex justify-end">
|
||||||
<div className="m-2 flex flex-row">
|
<div className="m-2 flex flex-row">
|
||||||
<div className="m-auto pr-2">
|
<div className="m-auto pr-2">
|
||||||
<p>Add Card</p>
|
<AddCards />
|
||||||
</div>
|
</div>
|
||||||
<div className="m-1">
|
<div className="m-1">
|
||||||
<ModeToggle />
|
<ModeToggle />
|
||||||
@@ -51,7 +52,9 @@ export const Route = createRootRoute({
|
|||||||
src="https://github.com/shadcn.png"
|
src="https://github.com/shadcn.png"
|
||||||
alt="@shadcn"
|
alt="@shadcn"
|
||||||
/>
|
/>
|
||||||
<AvatarFallback>CN</AvatarFallback>
|
<AvatarFallback>
|
||||||
|
CN
|
||||||
|
</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent>
|
<DropdownMenuContent>
|
||||||
@@ -66,7 +69,13 @@ export const Route = createRootRoute({
|
|||||||
<hr className="solid"></hr>
|
<hr className="solid"></hr>
|
||||||
<DropdownMenuItem>
|
<DropdownMenuItem>
|
||||||
<div className="m-auto">
|
<div className="m-auto">
|
||||||
<button onClick={() => logout()}>Logout</button>
|
<button
|
||||||
|
onClick={() =>
|
||||||
|
logout()
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Logout
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
|
|||||||
@@ -2,50 +2,16 @@ import {createFileRoute} from "@tanstack/react-router";
|
|||||||
//import GridLayout from "react-grid-layout";
|
//import GridLayout from "react-grid-layout";
|
||||||
import "../../node_modules/react-grid-layout/css/styles.css";
|
import "../../node_modules/react-grid-layout/css/styles.css";
|
||||||
import "../../node_modules/react-resizable/css/styles.css";
|
import "../../node_modules/react-resizable/css/styles.css";
|
||||||
|
import DashBoard from "@/components/dashboard/DashBoard";
|
||||||
|
|
||||||
export const Route = createFileRoute("/")({
|
export const Route = createFileRoute("/")({
|
||||||
component: Index,
|
component: Index,
|
||||||
});
|
});
|
||||||
|
|
||||||
function Index() {
|
function Index() {
|
||||||
// const [layout, setLayout] = useState([
|
|
||||||
// {
|
|
||||||
// i: "PPOO",
|
|
||||||
// x: 0,
|
|
||||||
// y: 0,
|
|
||||||
// w: 5,
|
|
||||||
// h: 3,
|
|
||||||
// minW: 2,
|
|
||||||
// maxW: 6,
|
|
||||||
// minH: 2,
|
|
||||||
// maxH: 4,
|
|
||||||
// isResizable: true,
|
|
||||||
// isDraggable: true,
|
|
||||||
// },
|
|
||||||
// {i: "OCPLogs", x: 2, y: 0, w: 5, h: 3, isResizable: true, isDraggable: true},
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// const [cardData, setCardData] = useState([
|
|
||||||
// {i: "card1", name: "PPOO"},
|
|
||||||
// {i: "card2", name: "OCPLogs"},
|
|
||||||
// ]);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="h-dvh w-dvw">
|
||||||
{/* <AddCards addCard={addCard} cards={cards} /> */}
|
<DashBoard />
|
||||||
{/* <GridLayout className="layout" cols={12} rowHeight={30} width={window.innerWidth}>
|
|
||||||
<div className="bg-blue-400" key="a" data-grid={{x: 0, y: 0, w: 1, h: 2, static: true}}>
|
|
||||||
a
|
|
||||||
</div>
|
</div>
|
||||||
<div className="bg-blue-400" key="b" data-grid={{x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4}}>
|
|
||||||
b
|
|
||||||
</div>
|
|
||||||
<div className="bg-blue-400" key="c" data-grid={{x: 4, y: 0, w: 1, h: 2}}>
|
|
||||||
c
|
|
||||||
</div>
|
|
||||||
</GridLayout> */}
|
|
||||||
<div className="m-auto">
|
|
||||||
<span>Empty Space why dont you add some cards?</span>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,9 @@ export const Route = createFileRoute("/ocp/")({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function RouteComponent() {
|
function RouteComponent() {
|
||||||
return <OCPPage />;
|
return (
|
||||||
|
<div className="h-dvh w-dvw">
|
||||||
|
<OCPPage />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
20
frontend/src/utils/querys/logistics/getPPOO.tsx
Normal file
20
frontend/src/utils/querys/logistics/getPPOO.tsx
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { queryOptions } from "@tanstack/react-query";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export function getPPOO() {
|
||||||
|
return queryOptions({
|
||||||
|
queryKey: ["getPPOO"],
|
||||||
|
queryFn: () => fetchStockSilo(),
|
||||||
|
//enabled:
|
||||||
|
staleTime: 1000,
|
||||||
|
refetchInterval: 2 * 2000,
|
||||||
|
refetchOnWindowFocus: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const fetchStockSilo = async () => {
|
||||||
|
const { data } = await axios.get(`/api/logistics/getppoo`);
|
||||||
|
// if we are not localhost ignore the devDir setting.
|
||||||
|
//const url: string = window.location.host.split(":")[0];
|
||||||
|
return data.data ?? [];
|
||||||
|
};
|
||||||
@@ -4,7 +4,7 @@ import axios from "axios";
|
|||||||
export function getStockSilo() {
|
export function getStockSilo() {
|
||||||
const token = localStorage.getItem("auth_token");
|
const token = localStorage.getItem("auth_token");
|
||||||
return queryOptions({
|
return queryOptions({
|
||||||
queryKey: ["getUsers"],
|
queryKey: ["getSiloData"],
|
||||||
queryFn: () => fetchStockSilo(token),
|
queryFn: () => fetchStockSilo(token),
|
||||||
enabled: !!token, // Prevents query if token is null
|
enabled: !!token, // Prevents query if token is null
|
||||||
staleTime: 1000,
|
staleTime: 1000,
|
||||||
|
|||||||
46
frontend/src/utils/tableData/ppoo/ppooColumns.tsx
Normal file
46
frontend/src/utils/tableData/ppoo/ppooColumns.tsx
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
|
import { format } from "date-fns";
|
||||||
|
|
||||||
|
// This type is used to define the shape of our data.
|
||||||
|
// You can use a Zod schema here if you want.
|
||||||
|
export type Adjustmnets = {
|
||||||
|
siloAdjust_id: string;
|
||||||
|
currentStockLevel: string;
|
||||||
|
newLevel: number;
|
||||||
|
dateAdjusted: string;
|
||||||
|
lastDateAdjusted: string;
|
||||||
|
comment: string;
|
||||||
|
commentAddedBy: string;
|
||||||
|
commentDate: string;
|
||||||
|
add_user: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const columns: ColumnDef<Adjustmnets>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "MachineLocation",
|
||||||
|
header: () => <div className="text-left">Line</div>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "ArticleHumanReadableId",
|
||||||
|
header: "AV",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "RunningNumber",
|
||||||
|
header: "Running Number",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "ProductionDate",
|
||||||
|
header: "Booked in",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
if (row.getValue("ProductionDate")) {
|
||||||
|
const correctDate = format(
|
||||||
|
row.getValue("ProductionDate"),
|
||||||
|
"M/d/yyyy hh:mm"
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<div className="text-left font-medium">{correctDate}</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
124
frontend/src/utils/tableData/ppoo/ppooData.tsx
Normal file
124
frontend/src/utils/tableData/ppoo/ppooData.tsx
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
useReactTable,
|
||||||
|
getPaginationRowModel,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
interface DataTableProps<TData, TValue> {
|
||||||
|
columns: ColumnDef<TData, TValue>[];
|
||||||
|
data: TData[];
|
||||||
|
style: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PPOOTable<TData, TValue>({
|
||||||
|
columns,
|
||||||
|
data,
|
||||||
|
style,
|
||||||
|
}: DataTableProps<TData, TValue>) {
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(parseInt(style.height.replace("px", "")) - 50);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: `${parseInt(style.width.replace("px", "")) - 50}px`,
|
||||||
|
height: `${parseInt(style.height.replace("px", "")) - 150}px`,
|
||||||
|
cursor: "move",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
style={{
|
||||||
|
width: `${parseInt(style.width.replace("px", "")) - 50}px`,
|
||||||
|
height: `${parseInt(style.height.replace("px", "")) - 200}px`,
|
||||||
|
cursor: "move",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id}>
|
||||||
|
{headerGroup.headers.map((header) => {
|
||||||
|
return (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef
|
||||||
|
.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={
|
||||||
|
row.getIsSelected() && "selected"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(
|
||||||
|
cell.column.columnDef.cell,
|
||||||
|
cell.getContext()
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell
|
||||||
|
colSpan={columns.length}
|
||||||
|
className="h-24 text-center"
|
||||||
|
>
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center justify-end space-x-2 py-4">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
>
|
||||||
|
Previous
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
>
|
||||||
|
Next
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ interface DataTableProps<TData, TValue> {
|
|||||||
data: TData[];
|
data: TData[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DataTable<TData, TValue>({
|
export function SiloTable<TData, TValue>({
|
||||||
columns,
|
columns,
|
||||||
data,
|
data,
|
||||||
}: DataTableProps<TData, TValue>) {
|
}: DataTableProps<TData, TValue>) {
|
||||||
11
package-lock.json
generated
11
package-lock.json
generated
@@ -36,6 +36,7 @@
|
|||||||
"pino-abstract-transport": "^2.0.0",
|
"pino-abstract-transport": "^2.0.0",
|
||||||
"pino-pretty": "^13.0.0",
|
"pino-pretty": "^13.0.0",
|
||||||
"postgres": "^3.4.5",
|
"postgres": "^3.4.5",
|
||||||
|
"react-resizable-panels": "^2.1.7",
|
||||||
"rimraf": "^6.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"st-ethernet-ip": "^2.7.3",
|
"st-ethernet-ip": "^2.7.3",
|
||||||
"ws": "^8.18.1",
|
"ws": "^8.18.1",
|
||||||
@@ -7173,6 +7174,16 @@
|
|||||||
"react": "^19.1.0"
|
"react": "^19.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-resizable-panels": {
|
||||||
|
"version": "2.1.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-resizable-panels/-/react-resizable-panels-2.1.7.tgz",
|
||||||
|
"integrity": "sha512-JtT6gI+nURzhMYQYsx8DKkx6bSoOGFp7A3CwMrOb8y5jFHFyqwo9m68UhmXRw57fRVJksFn1TSlm3ywEQ9vMgA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
||||||
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/read-pkg": {
|
"node_modules/read-pkg": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"admConfig": {
|
"admConfig": {
|
||||||
"build": 207,
|
"build": 215,
|
||||||
"oldBuild": "backend-0.1.3.zip"
|
"oldBuild": "backend-0.1.3.zip"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -84,6 +84,7 @@
|
|||||||
"pino-abstract-transport": "^2.0.0",
|
"pino-abstract-transport": "^2.0.0",
|
||||||
"pino-pretty": "^13.0.0",
|
"pino-pretty": "^13.0.0",
|
||||||
"postgres": "^3.4.5",
|
"postgres": "^3.4.5",
|
||||||
|
"react-resizable-panels": "^2.1.7",
|
||||||
"rimraf": "^6.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"st-ethernet-ip": "^2.7.3",
|
"st-ethernet-ip": "^2.7.3",
|
||||||
"ws": "^8.18.1",
|
"ws": "^8.18.1",
|
||||||
|
|||||||
@@ -14,13 +14,23 @@ export const lanes: any = [];
|
|||||||
export const getLanesToCycleCount = async () => {
|
export const getLanesToCycleCount = async () => {
|
||||||
const currentTime: any = timeZoneFix();
|
const currentTime: any = timeZoneFix();
|
||||||
// store the lanes in memeory
|
// store the lanes in memeory
|
||||||
createLog("info", "warehouse", "logistics", "Empty lane triggered update.");
|
createLog("info", "warehouse", "logistics", "Lane triggered update.");
|
||||||
lastCheck = currentTime;
|
lastCheck = currentTime;
|
||||||
const ageQuery = cycleCountCheck.replaceAll("[ageOfRow]", `1000`);
|
const ageQuery = cycleCountCheck.replaceAll("[ageOfRow]", `1000`);
|
||||||
const { data: prodLanes, error: pl } = await tryCatch(
|
const { data: prodLanes, error: pl } = await tryCatch(
|
||||||
query(ageQuery, "Get Stock lane date.")
|
query(ageQuery, "Get Stock lane date.")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (pl) {
|
||||||
|
createLog(
|
||||||
|
"error",
|
||||||
|
"warehouse",
|
||||||
|
"logistics",
|
||||||
|
`There was an error getting lanes: ${pl}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// run the update on the lanes
|
// run the update on the lanes
|
||||||
for (let i = 0; i < prodLanes.length; i++) {
|
for (let i = 0; i < prodLanes.length; i++) {
|
||||||
const createLane = {
|
const createLane = {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { tryCatch } from "../../../../../globalUtils/tryCatch.js";
|
||||||
|
import { query } from "../../../../sqlServer/prodSqlServer.js";
|
||||||
|
import { ppooQuery } from "../../../../sqlServer/querys/warehouse/ppooQuery.js";
|
||||||
|
|
||||||
|
export const getPPOO = async () => {
|
||||||
|
const { data, error } = await tryCatch(query(ppooQuery, "Get PPOO"));
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
return { success: false, message: "Error getting ppoo", data: error };
|
||||||
|
}
|
||||||
|
|
||||||
|
return { success: true, message: "Current pallets in PPOO.", data: data };
|
||||||
|
};
|
||||||
@@ -9,6 +9,7 @@ import { migrateAdjustments } from "./controller/siloAdjustments/migrateAdjustme
|
|||||||
import getSiloAdjustments from "./route/siloAdjustments/getSiloAdjustments.js";
|
import getSiloAdjustments from "./route/siloAdjustments/getSiloAdjustments.js";
|
||||||
import { getLanesToCycleCount } from "./controller/warehouse/cycleCountChecks/cyclecountCheck.js";
|
import { getLanesToCycleCount } from "./controller/warehouse/cycleCountChecks/cyclecountCheck.js";
|
||||||
import getCycleCountCheck from "./route/getCycleCountChecks.js";
|
import getCycleCountCheck from "./route/getCycleCountChecks.js";
|
||||||
|
import getPPOO from "./route/getPPOO.js";
|
||||||
|
|
||||||
const app = new OpenAPIHono();
|
const app = new OpenAPIHono();
|
||||||
|
|
||||||
@@ -23,6 +24,8 @@ const routes = [
|
|||||||
getSiloAdjustments,
|
getSiloAdjustments,
|
||||||
//lanes
|
//lanes
|
||||||
getCycleCountCheck,
|
getCycleCountCheck,
|
||||||
|
//warehouse
|
||||||
|
getPPOO,
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
// app.route("/server", modules);
|
// app.route("/server", modules);
|
||||||
|
|||||||
53
server/services/logistics/route/getPPOO.ts
Normal file
53
server/services/logistics/route/getPPOO.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||||
|
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||||
|
import { tryCatch } from "../../../globalUtils/tryCatch.js";
|
||||||
|
import { getCycleCountCheck } from "../controller/warehouse/cycleCountChecks/getCycleCountCheck.js";
|
||||||
|
import { getPPOO } from "../controller/warehouse/ppoo/getPPOO.js";
|
||||||
|
|
||||||
|
const app = new OpenAPIHono();
|
||||||
|
|
||||||
|
// const Body = z
|
||||||
|
// .object({
|
||||||
|
// age: z.number().optional().openapi({ example: 90 }),
|
||||||
|
// //email: z.string().optional().openapi({example: "s.smith@example.com"}),
|
||||||
|
// type: z.string().optional().openapi({ example: "fg" }),
|
||||||
|
// })
|
||||||
|
// .openapi("User");
|
||||||
|
app.openapi(
|
||||||
|
createRoute({
|
||||||
|
tags: ["logistics"],
|
||||||
|
summary: "Returns pallets currently in ppoo",
|
||||||
|
method: "get",
|
||||||
|
path: "/getppoo",
|
||||||
|
// request: {
|
||||||
|
// body: {
|
||||||
|
// content: {
|
||||||
|
// "application/json": { schema: Body },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// description:
|
||||||
|
// "Provided a running number and lot number you can consume material.",
|
||||||
|
responses: responses(),
|
||||||
|
}),
|
||||||
|
async (c) => {
|
||||||
|
//apiHit(c, { endpoint: "api/sqlProd/close" });
|
||||||
|
|
||||||
|
const { data: ppoo, error } = await tryCatch(getPPOO());
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
return c.json({
|
||||||
|
success: false,
|
||||||
|
message: "Error getting lane data.",
|
||||||
|
data: error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.json({
|
||||||
|
success: ppoo.success,
|
||||||
|
message: ppoo.message,
|
||||||
|
data: ppoo.data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
export default app;
|
||||||
@@ -15,6 +15,14 @@ export const getLots = async () => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (!lotInfo.data.success) {
|
||||||
|
// return {
|
||||||
|
// success: false,
|
||||||
|
// message: "There was an error getting the lots",
|
||||||
|
// data: lotInfo.data.message,
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
message: "Current active lots that are technically released.",
|
message: "Current active lots that are technically released.",
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export const printerCycle = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p.name === "Autolabeler") {
|
if (p.name === "Autolabeler") {
|
||||||
await autoLabelingStats(p);
|
//await autoLabelingStats(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ setTimeout(async () => {
|
|||||||
await updatePrinters();
|
await updatePrinters();
|
||||||
await assignedPrinters();
|
await assignedPrinters();
|
||||||
printerCycle();
|
printerCycle();
|
||||||
printerCycleAutoLabelers();
|
// printerCycleAutoLabelers();
|
||||||
}
|
}
|
||||||
}, 10 * 1000);
|
}, 10 * 1000);
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ export const assignedPrinters = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const printers: any = print.data ?? [];
|
const printers: any = print.data ?? [];
|
||||||
const lots: any = l.data ?? [];
|
const lots: any = l.data.length === 0 ? [] : l.data;
|
||||||
|
|
||||||
for (let i = 0; i < printers.length; i++) {
|
for (let i = 0; i < printers.length; i++) {
|
||||||
// is the printer assinged in alplalabel online?
|
// is the printer assinged in alplalabel online?
|
||||||
const assigned = lots.filter(
|
const assigned = lots?.filter(
|
||||||
(p: any) => p.printerID === parseInt(printers[i].humanReadableId)
|
(p: any) => p.printerID === parseInt(printers[i].humanReadableId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
13
server/services/sqlServer/querys/warehouse/ppooQuery.ts
Normal file
13
server/services/sqlServer/querys/warehouse/ppooQuery.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export const ppooQuery = `
|
||||||
|
select MachineLocation,
|
||||||
|
[RunningNumber],
|
||||||
|
ArticleHumanReadableId,
|
||||||
|
ArticleDescription,
|
||||||
|
convert(Date, ProductionDay) as productionDay,
|
||||||
|
ProductionDate
|
||||||
|
FROM [test1_AlplaPROD2.0_Reporting].[reporting_productionControlling].[ScannedUnit] (nolock)
|
||||||
|
|
||||||
|
where [RunningNumber] in (select Lfdnr from AlplaPROD_test1.dbo.V_LagerPositionenBarcodes (nolock) where IdLagerAbteilung = 00000)
|
||||||
|
|
||||||
|
order by ProductionDate
|
||||||
|
`;
|
||||||
Reference in New Issue
Block a user