master
Varun 10 months ago
parent 756138fa97
commit 8524927cc6

@ -2130,7 +2130,7 @@ else if (currentWaterLevel >= highWaterThreshold) {
const currentWaterLevel = parseInt(supplierTank.waterlevel, 10); const currentWaterLevel = parseInt(supplierTank.waterlevel, 10);
const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100; const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100;
const receiverTank1 = await Tank.findOne({ customerId, tankName: req.body.to, tankLocation: req.body.to_type.toLowerCase() }); const receiverTank1 = await Tank.findOne({ customerId, tankName: req.body.to, tankLocation: req.body.to_type.toLowerCase() });
const stop_threshold_time = receiverTank1.connections.inputConnections[inputConnectionIndex].stop_threshold_time const stop_threshold_time = receiverTank1.connections.inputConnections[stop_threshold_time]
if (moment().isSameOrAfter(stop_threshold_time) || currentWaterPercentage <= lowWaterThreshold) { if (moment().isSameOrAfter(stop_threshold_time) || currentWaterPercentage <= lowWaterThreshold) {
console.log(thresholdTime,"thresholdtime") console.log(thresholdTime,"thresholdtime")
console.log(new Date(),"new time") console.log(new Date(),"new time")

Loading…
Cancel
Save