Commit 2a10b786 authored by Manuel De la Penna's avatar Manuel De la Penna

se borra cod comentado

parent 9d10b65c
......@@ -109,64 +109,6 @@ class AppPointCollector extends backendPlus.AppBackend{
res.send(result);
});
});
/*mainApp.post(baseUrl+'/save/positions',function(req,res){
var result = {};
var lines = [];
var client = null;
Promise.resolve().then(function(){
JSON.parse(req.body.position_collection).forEach(function(pos){
pos.observaciones = (pos.observaciones)?"'"+pos.observaciones+"'":null;
pos.puerta = (pos.puerta)?"'"+pos.puerta+"'":null;
lines.push("'" + (req.body.token.token) + "'"
+ ",'" + pos.fecha_relevamiento + "'"
+ ",'" + pos.sector + "'"
+ ",'" + pos.manzana + "'"
+ ",'" + pos.lado + "'"
+ ',' + pos.secuencia
+ "," + pos.puerta
+ ',' + pos.nivel
+ ",'" + JSON.stringify(pos.puntos) + "'"
+ "," + pos.observaciones
);
});
if(lines.length){
return be.getDbClient(req).then(function(cli){
client = cli;
var today = date.today();
return cli.query("select * " +
"from tareas " +
"where tarea = $1 and vencimiento >= $2"
,[req.body.token.tarea, today.toYmd()]).fetchOneRowIfExists();
}).then(function(result){
if(result.rowCount){
return client.query("INSERT INTO lecturas " +
"(token, fecha_relevamiento, sector, manzana, lado, secuencia, puerta, nivel, puntos, observaciones) " +
"VALUES ("+lines.join("),(")+") "
,[]).execute();
}else{
throw new Error('La tarea no existe o se encuentra vencida. No se guardaron los puntos');
}
}).then(function(){
client.done();
result = { code: 200, message: 'Posiciones guardadas correctamente'};
});
}else{
result = { code: 204, message: 'No se recibieron posiciones nuevas.'};
}
}).then(function(){
res.send(result);
}).catch(function(err){
if(client && typeof client.done === "function"){
client.done();
}
console.log('ERROR: ',err.message);
result = { code: 500, message: "Error. " + err.message};
res.send(result);
});
});*/
}
getProcedures(){
var be = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment