refactor(ocp): lots of work for rfid and dyco contorl

This commit is contained in:
2025-03-27 21:12:22 -05:00
parent 27d6b6e884
commit ba3d721940
19 changed files with 360 additions and 162 deletions

View File

@@ -50,9 +50,10 @@ export const labelingProcess = async ({
// if we got a line passed over we need to get the machine id from this.
if (line) {
const macId = await getMac(line);
// filter out the lot for the line
filteredLot = lots.data.filter((l: any) => l.machineId === macId);
filteredLot = lots.data.filter(
(l: any) => l.MachineID === macId[0].HumanReadableId
);
if (filteredLot.length === 0) {
createLog(
@@ -160,7 +161,10 @@ export const labelingProcess = async ({
`Main material is not prepaired for lot ${filteredLot[0].lot}`
);
return;
return {
success: false,
message: `Main material is not prepaired for lot ${filteredLot[0].lot}`,
};
}
// comment only but will check for color
@@ -198,16 +202,19 @@ export const labelingProcess = async ({
"ocp",
`Prolink does not match for ${filteredLot[0].MachineDescription}`
);
return;
return {
success: false,
message: `Prolink does not match for ${filteredLot[0].MachineDescription}`,
};
}
createLog("info", "labeling", "ocp", `Is prolink good? ${prolink}`);
// create the label
const label = await createLabel(filteredLot[0], userPrinted);
if (!label.success) {
return { sucess: false, message: label.message, data: label.data };
}
// if (!label.success) {
// return { sucess: false, message: label.message, data: label.data };
// }
// send over to be booked in if we can do it.
const bookin = settingData.filter((s) => s.name === "bookin");