Compare commits
5 Commits
f481197d6e
...
63e005b790
| Author | SHA1 | Date | |
|---|---|---|---|
| 63e005b790 | |||
| 814861e59c | |||
| dd62ceb133 | |||
| e335225807 | |||
| 3e54685a7e |
@@ -35,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"admConfig": {
|
"admConfig": {
|
||||||
"build": 135,
|
"build": 136,
|
||||||
"oldBuild": "backend-0.1.3.zip"
|
"oldBuild": "backend-0.1.3.zip"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -9,6 +9,18 @@ param (
|
|||||||
# Example string to run with the parameters in it.
|
# Example string to run with the parameters in it.
|
||||||
# .\services.ps1 -serviceName "LSTV2" -option "install" -appPath "E:\LST\lstV2" -description "Logistics Support Tool V2" -command "run start"
|
# .\services.ps1 -serviceName "LSTV2" -option "install" -appPath "E:\LST\lstV2" -description "Logistics Support Tool V2" -command "run start"
|
||||||
|
|
||||||
|
|
||||||
|
### the fix
|
||||||
|
# .\services.ps1 -serviceName "LST-App" -option "delete" -appPath "E:\LST\lstV2" -description "Logistics Support Tool V2" -command "run start"
|
||||||
|
# .\services.ps1 -serviceName "LST-frontend" -option "delete" -appPath "E:\LST\lstV2" -description "Logistics Support Tool V2" -command "run start"
|
||||||
|
# .\services.ps1 -serviceName "LST-System" -option "delete" -appPath "E:\LST\lstV2" -description "Logistics Support Tool V2" -command "run start"
|
||||||
|
# .\services.ps1 -serviceName "LST-Gateway" -option "delete" -appPath "E:\LST\lstV2" -description "Logistics Support Tool V2" -command "run start"
|
||||||
|
|
||||||
|
# .\services.ps1 -serviceName "LST-App" -option "install" -appPath "E:\LST\lst_backend" -description "Logistics Support Tool V2" -command "run startapp"
|
||||||
|
# .\services.ps1 -serviceName "LST-frontend" -option "install" -appPath "E:\LST\lst_backend" -description "Logistics Support Tool V2" -command "run startfront"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$nssmPath = $AppPath + "\nssm.exe"
|
$nssmPath = $AppPath + "\nssm.exe"
|
||||||
$npmPath = "C:\Program Files\nodejs\npm.cmd" # Path to npm.cmd
|
$npmPath = "C:\Program Files\nodejs\npm.cmd" # Path to npm.cmd
|
||||||
|
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ try {
|
|||||||
$gatewayport = "4401"
|
$gatewayport = "4401"
|
||||||
$systemport = "4201"
|
$systemport = "4201"
|
||||||
$ocmeport = "4301"
|
$ocmeport = "4301"
|
||||||
$appport = "4901"
|
$appport = "4401"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($token -in @("test1", "test2", "test3")) {
|
if ($token -in @("test1", "test2", "test3")) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { prolinkCheck } from "../lots/prolinkCheck.js";
|
|||||||
import { createLabel } from "./createLabel.js";
|
import { createLabel } from "./createLabel.js";
|
||||||
import { bookInLabel } from "./bookIn.js";
|
import { bookInLabel } from "./bookIn.js";
|
||||||
import { delieryInhouse } from "../specialProcesses/inhouse/inhouseDelivery.js";
|
import { delieryInhouse } from "../specialProcesses/inhouse/inhouseDelivery.js";
|
||||||
|
import { dualPrintingProcess } from "../specialProcesses/dualPrinting/dualPrinting.js";
|
||||||
|
|
||||||
interface Printer {
|
interface Printer {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -120,7 +121,7 @@ export const labelingProcess = async ({
|
|||||||
`${printer?.name}, being sent over for dual printing processing.`
|
`${printer?.name}, being sent over for dual printing processing.`
|
||||||
);
|
);
|
||||||
// process what line to print the label for and return the lot info and change filteredLot to returned one.
|
// process what line to print the label for and return the lot info and change filteredLot to returned one.
|
||||||
//filteredLot = await dualPrintingProcess(filteredLot);
|
filteredLot = await dualPrintingProcess(filteredLot);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there are more than 2 lots it might be an auto labeler, autolabeler will be defined by its id for now only dayton
|
// if there are more than 2 lots it might be an auto labeler, autolabeler will be defined by its id for now only dayton
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
import { createLog } from "../../../../logger/logger.js";
|
||||||
|
import { query } from "../../../../sqlServer/prodSqlServer.js";
|
||||||
|
|
||||||
|
export const dualPrintingProcess = async (lotInfo: any) => {
|
||||||
|
// currently we will only allow for 2 printers to be linked only crazy people want more than 2
|
||||||
|
createLog(
|
||||||
|
"info",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
"Dual printing running logic here to see what to print"
|
||||||
|
);
|
||||||
|
// each check
|
||||||
|
let lastPrinted;
|
||||||
|
let firstLine;
|
||||||
|
let secondLine;
|
||||||
|
|
||||||
|
// this query checks the last line to print a label
|
||||||
|
const printedQuery = `SELECT TOP(1) IdProdPlanung,
|
||||||
|
IdArtikelvarianten,
|
||||||
|
IdMaschine,
|
||||||
|
LfdNr,
|
||||||
|
ArtikelVariantenBez,
|
||||||
|
Add_User,
|
||||||
|
Add_Date,
|
||||||
|
Upd_User,
|
||||||
|
Upd_Date,
|
||||||
|
IdProdBereich
|
||||||
|
FROM AlplaPROD_test1.dbo.T_EtikettenGedruckt (nolock)
|
||||||
|
where IdMaschine in (${lotInfo[0].machineID},${lotInfo[1].machineID}) order by Add_Date desc`;
|
||||||
|
|
||||||
|
const fisrtLineDT = `SELECT top(1) IdMaschine,
|
||||||
|
case when Endzeit ='1900-01-01 00:00:00.000' and DATEDIFF(MINUTE, Startzeit, GETDATE()) >= 3 Then 1 else 0 end as 'LineCheck'
|
||||||
|
FROM AlplaPROD_test1.dbo.T_HistoryStillstandsereignis (nolock) where IdMaschine = ${lotInfo[0].machineID} order by Add_Date desc`;
|
||||||
|
|
||||||
|
const secondLineDT = `SELECT top(1) IdMaschine,
|
||||||
|
case when Endzeit ='1900-01-01 00:00:00.000' and DATEDIFF(MINUTE, Startzeit, GETDATE()) >= 3 Then 1 else 0 end as 'LineCheck'
|
||||||
|
FROM AlplaPROD_test1.dbo.T_HistoryStillstandsereignis (nolock) where IdMaschine = ${lotInfo[1].machineID} order by Add_Date desc`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// get what was last printed
|
||||||
|
const result = await query(printedQuery, "Last Printed Query");
|
||||||
|
lastPrinted = result[0].IdMaschine;
|
||||||
|
} catch (err) {
|
||||||
|
createLog(
|
||||||
|
"error",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
`Error: getting last printed querty: ${err}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// get if if running or down
|
||||||
|
const first = await query(fisrtLineDT, "First line DT Check");
|
||||||
|
firstLine = first[0].LineCheck;
|
||||||
|
} catch (err) {
|
||||||
|
createLog(
|
||||||
|
"error",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
`Error: with getting ${lotInfo[0].machineID} data query: ${err}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const second = await query(secondLineDT, "Second line DT Check");
|
||||||
|
secondLine = second[0].LineCheck;
|
||||||
|
} catch (err) {
|
||||||
|
createLog(
|
||||||
|
"error",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
`Error: with getting ${lotInfo[1].machineID} data query: ${err}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// first check if both are up and running
|
||||||
|
if (firstLine === 0 && secondLine === 0) {
|
||||||
|
createLog("info", "ocp", "ocp", "Both lines are up");
|
||||||
|
// what line last printed
|
||||||
|
if (lastPrinted === lotInfo[0].machineID) {
|
||||||
|
// IE 7 then print 8, usslc was the main example for all of this
|
||||||
|
let whatToPrint = lotInfo.filter(
|
||||||
|
(m: any) => m.machineID === lotInfo[1].machineID
|
||||||
|
);
|
||||||
|
// send to label
|
||||||
|
createLog(
|
||||||
|
"info",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
`Printing label for ${whatToPrint.MachineDescription}`
|
||||||
|
);
|
||||||
|
return whatToPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastPrinted === lotInfo[1].machineID) {
|
||||||
|
// IE 8 then print 7, usslc was the main example for all of this
|
||||||
|
let whatToPrint = lotInfo.filter(
|
||||||
|
(m: any) => m.machineID === lotInfo[0].machineID
|
||||||
|
);
|
||||||
|
// send to label
|
||||||
|
createLog(
|
||||||
|
"info",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
`Printing label for ${whatToPrint.MachineDescription}`
|
||||||
|
);
|
||||||
|
return whatToPrint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// as we are only allowing 2 lines if one is down the other must be up... still going to conditional it to be sure
|
||||||
|
createLog(
|
||||||
|
"info",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
"Looking at what line is down and printing the other one!"
|
||||||
|
);
|
||||||
|
if (firstLine === 1 && secondLine === 0) {
|
||||||
|
// print the other line
|
||||||
|
let whatToPrint = lotInfo.filter(
|
||||||
|
(m: any) => m.machineID === lotInfo[1].machineID
|
||||||
|
);
|
||||||
|
|
||||||
|
// send to label
|
||||||
|
createLog(
|
||||||
|
"info",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
`Printing label for ${whatToPrint.MachineDescription}`
|
||||||
|
);
|
||||||
|
return whatToPrint;
|
||||||
|
} else if (firstLine === 0 && secondLine === 1) {
|
||||||
|
// print the other line
|
||||||
|
let whatToPrint = lotInfo.filter(
|
||||||
|
(m: any) => m.machineID === lotInfo[0].machineID
|
||||||
|
);
|
||||||
|
// send to label
|
||||||
|
createLog(
|
||||||
|
"info",
|
||||||
|
"ocp",
|
||||||
|
"ocp",
|
||||||
|
`Printing label for ${whatToPrint.MachineDescription}`
|
||||||
|
);
|
||||||
|
return whatToPrint;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
@@ -213,7 +213,7 @@
|
|||||||
"contactPhone": "6366970253",
|
"contactPhone": "6366970253",
|
||||||
"customerTiAcc": "ALPL01LIMAINT",
|
"customerTiAcc": "ALPL01LIMAINT",
|
||||||
"lstServerPort": "4000",
|
"lstServerPort": "4000",
|
||||||
"active": false,
|
"active": true,
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
"contactPhone": "6366970253",
|
"contactPhone": "6366970253",
|
||||||
"customerTiAcc": "ALPL01JCINT",
|
"customerTiAcc": "ALPL01JCINT",
|
||||||
"lstServerPort": "4000",
|
"lstServerPort": "4000",
|
||||||
"active": false,
|
"active": true,
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
"contactPhone": "6366970253",
|
"contactPhone": "6366970253",
|
||||||
"customerTiAcc": "ALPL01SHERMANINT",
|
"customerTiAcc": "ALPL01SHERMANINT",
|
||||||
"lstServerPort": "4000",
|
"lstServerPort": "4000",
|
||||||
"active": false,
|
"active": true,
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
|
|||||||
Reference in New Issue
Block a user