master^2
Varun 9 months ago
parent 45a03f5aac
commit 1b60e2eab0

@ -2889,9 +2889,10 @@ exports.motorAction = async (req, reply) => {
// Perform stop operations in the background
(async () => {
console.log(start_instance_id,"start_instance_id",customerId,"customerId",motorId,"motorId")
const motorData = await MotorData.findOne({ customerId, motor_id: motorId, start_instance_id: start_instance_id });
if (motorData) {
console.log("entered if in stop")
const receiverTank = await Tank.findOne({ customerId, tankName: motorData.receiverTank, tankLocation: motorData.receiver_type.toLowerCase() });
const receiverFinalWaterLevel = parseInt(receiverTank.waterlevel, 10);
const quantityDelivered = receiverFinalWaterLevel - parseInt(motorData.receiverInitialwaterlevel, 10);

Loading…
Cancel
Save