|
|
@ -317,9 +317,6 @@ exports.getTanklevels = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
|
|
const updated_data = await Tank.find({ customerId: customerId });
|
|
|
|
const updated_data = await Tank.find({ customerId: customerId });
|
|
|
|
console.log("updated_data", updated_data);
|
|
|
|
console.log("updated_data", updated_data);
|
|
|
|
const user = await User.findOne({ customerId: customerId });
|
|
|
|
|
|
|
|
const buildingName = user ? user.buildingName : null;
|
|
|
|
|
|
|
|
const address1 = user ? user.profile.address1 : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updated_data.forEach((tank) => {
|
|
|
|
updated_data.forEach((tank) => {
|
|
|
|
const waterlevel = parseInt(tank.waterlevel.replace(/,/g, ''), 10);
|
|
|
|
const waterlevel = parseInt(tank.waterlevel.replace(/,/g, ''), 10);
|
|
|
@ -353,8 +350,6 @@ exports.getTanklevels = async (req, reply) => {
|
|
|
|
totalDrinkingWaterInOverheadCapacity: sumOverheadDrinkingWaterCapacity,
|
|
|
|
totalDrinkingWaterInOverheadCapacity: sumOverheadDrinkingWaterCapacity,
|
|
|
|
totalBoreWaterInSumpCapacity: sumSumpBoreWaterCapacity,
|
|
|
|
totalBoreWaterInSumpCapacity: sumSumpBoreWaterCapacity,
|
|
|
|
totalBoreWaterInOverheadCapacity: sumOverheadBoreWaterCapacity,
|
|
|
|
totalBoreWaterInOverheadCapacity: sumOverheadBoreWaterCapacity,
|
|
|
|
buildingName: buildingName,
|
|
|
|
|
|
|
|
address1: address1,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (!reply.sent) {
|
|
|
|
if (!reply.sent) {
|
|
|
@ -370,6 +365,7 @@ exports.getTanklevels = async (req, reply) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const intervals = {};
|
|
|
|
const intervals = {};
|
|
|
|
let sump_water_levels=[];
|
|
|
|
let sump_water_levels=[];
|
|
|
|
let supplier_tanks = [];
|
|
|
|
let supplier_tanks = [];
|
|
|
|