|
|
@ -3133,10 +3133,22 @@ exports.motorAction = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
const motorData = await MotorData.findOne({
|
|
|
|
|
|
|
|
customerId,
|
|
|
|
|
|
|
|
motor_id: motorId,
|
|
|
|
|
|
|
|
start_instance_id: dynamicInstanceId
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let totalWaterPumped = 0; // Default value in case data is missing
|
|
|
|
|
|
|
|
if (motorData && motorData.quantity_delivered) {
|
|
|
|
|
|
|
|
totalWaterPumped = motorData.quantity_delivered;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("quantity_delivered:", totalWaterPumped);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const totalWaterPumped = await motorData.quantity_delivered
|
|
|
|
//const totalWaterPumped = await motorData.quantity_delivered
|
|
|
|
console.log("quantity_delivered",totalWaterPumped)
|
|
|
|
// console.log("quantity_delivered",totalWaterPumped)
|
|
|
|
eventEmitter.emit("motorStop", customerId, fcmToken, tankName, blockName, stopTime, "Mobile APP", totalWaterPumped, typeOfWater, motorId,
|
|
|
|
eventEmitter.emit("motorStop", customerId, fcmToken, tankName, blockName, stopTime, "Mobile APP", totalWaterPumped, typeOfWater, motorId,
|
|
|
|
loggedInUser.phone,);
|
|
|
|
loggedInUser.phone,);
|
|
|
|
|
|
|
|
|
|
|
|