Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created July 15, 2013 00:01
Show Gist options
  • Save marti1125/5996684 to your computer and use it in GitHub Desktop.
Save marti1125/5996684 to your computer and use it in GitHub Desktop.
job verificar cantidad de productos
package jobs;
import java.util.List;
import models.Producto;
import play.jobs.*;
@Every("1mn")
public class VerificarCantidadDeProductos extends Job {
public void doJob() {
List<Producto> productos = Producto.findAll();
for(Producto p : productos){
if(p.cantidadInicial == 0){
System.out.println("No tiene Stock");
} else {
System.out.println("Hay Stock");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment