private void addPlaga(XMLGregorianCalendar cal, visita v, GregorianCalendar c) { fertinsumos.dataservice.plaga.ObjectFactory factory = new fertinsumos.dataservice.plaga.ObjectFactory(); fertinsumos.dataservice.plaga.AgregaPlaga plaga = factory.createAgregaPlaga(); plaga.setFechaVisita(cal); plaga.setNombre(v.getPlaga()); plaga.setPoblacion(v.getPobPlaga()); plagaService.agregaPlaga(cal, v.getPlaga(), v.getPobPlaga()); maleza hierva = new maleza(c.getTime(), v.getPlaga(), v.getPobPlaga()); listaPlagas.add(hierva); }
@RequestMapping(value = "agregaPlaga", method = RequestMethod.POST) public String addPlaga(@ModelAttribute("visitaForm") visita t, Model modelo) throws Exception { GregorianCalendar cal = new GregorianCalendar(); cal.setTime(t.getFecha()); maleza m = new maleza(cal.getTime(), t.getPlaga(), t.getPobPlaga()); logger.info("llamando al servicio"); plagaService.agregaPlaga( DatatypeFactory.newInstance().newXMLGregorianCalendar(cal), t.getPlaga(), t.getPobPlaga()); listaPlagas.add(m); return "redirect:informesDone"; }