|
@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -79,6 +80,7 @@ import es.uv.saic.service.UsuariService;
|
|
|
import es.uv.saic.service.UsuarisRolService;
|
|
import es.uv.saic.service.UsuarisRolService;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
|
|
+@RequestMapping("/dashboard")
|
|
|
public class DashboardController {
|
|
public class DashboardController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -116,7 +118,7 @@ public class DashboardController {
|
|
|
private String fileNotFound;
|
|
private String fileNotFound;
|
|
|
|
|
|
|
|
// POST para cargar el dashboard con toda su información
|
|
// POST para cargar el dashboard con toda su información
|
|
|
- @PostMapping("/dashboard")
|
|
|
|
|
|
|
+ @PostMapping
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public HashMap<String, Object> getOrganList(@RequestBody String usuari) {
|
|
public HashMap<String, Object> getOrganList(@RequestBody String usuari) {
|
|
|
HashMap<String, Object> model = new HashMap<>();
|
|
HashMap<String, Object> model = new HashMap<>();
|
|
@@ -171,7 +173,7 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//POST para mostrar el dashboard a partir de un numero ruct
|
|
//POST para mostrar el dashboard a partir de un numero ruct
|
|
|
- @PostMapping("/dashboard/{ruct}")
|
|
|
|
|
|
|
+ @PostMapping("/{ruct}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public HashMap<String, Object> getDashboardOrgan(@PathVariable Integer ruct, @RequestBody String usuari) {
|
|
public HashMap<String, Object> getDashboardOrgan(@PathVariable Integer ruct, @RequestBody String usuari) {
|
|
|
HashMap<String, Object> model = new HashMap<>();
|
|
HashMap<String, Object> model = new HashMap<>();
|
|
@@ -219,7 +221,7 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// GET para conseguir todos los procedimiento a partir del idTitulacio
|
|
// GET para conseguir todos los procedimiento a partir del idTitulacio
|
|
|
- @PostMapping("/dashboard/procedures/{idTitulacio}")
|
|
|
|
|
|
|
+ @PostMapping("/procedures/{idTitulacio}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<?> loadReports(@PathVariable Integer idTitulacio) {
|
|
public List<?> loadReports(@PathVariable Integer idTitulacio) {
|
|
|
String locale = LocaleContextHolder.getLocale().getLanguage();
|
|
String locale = LocaleContextHolder.getLocale().getLanguage();
|
|
@@ -360,7 +362,7 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// GET para conseguir la documentación ya a aportada a partir del id de la tituación
|
|
// GET para conseguir la documentación ya a aportada a partir del id de la tituación
|
|
|
- @GetMapping("/dashboard/documents/{idTitulacio}")
|
|
|
|
|
|
|
+ @GetMapping("/documents/{idTitulacio}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<CategoriaDocumentDTO> loadDocuments(@PathVariable Integer idTitulacio) {
|
|
public List<CategoriaDocumentDTO> loadDocuments(@PathVariable Integer idTitulacio) {
|
|
|
String locale = LocaleContextHolder.getLocale().getLanguage();
|
|
String locale = LocaleContextHolder.getLocale().getLanguage();
|
|
@@ -398,7 +400,7 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// GET para conseguir el diagrama de gantt a partir del ruct
|
|
// GET para conseguir el diagrama de gantt a partir del ruct
|
|
|
- @GetMapping("/dashboard/gantt/{ruct}")
|
|
|
|
|
|
|
+ @GetMapping("/gantt/{ruct}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<InstanciaGanttDTOImp> loadGantt(@PathVariable Integer ruct) {
|
|
public List<InstanciaGanttDTOImp> loadGantt(@PathVariable Integer ruct) {
|
|
|
Organ o = os.findByRuct(ruct);
|
|
Organ o = os.findByRuct(ruct);
|
|
@@ -449,7 +451,7 @@ public class DashboardController {
|
|
|
return data.stream().map(InstanciaGanttDTOImp::new).toList();
|
|
return data.stream().map(InstanciaGanttDTOImp::new).toList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/dashboard/documents/cats/{idCategoria}/{tambit}")
|
|
|
|
|
|
|
+ @GetMapping("/documents/cats/{idCategoria}/{tambit}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<Categoria> getDocumentChildCats(@PathVariable Integer idCategoria, @PathVariable String tambit) {
|
|
public List<Categoria> getDocumentChildCats(@PathVariable Integer idCategoria, @PathVariable String tambit) {
|
|
|
return cs.findByPareTambit(idCategoria, tambit);
|
|
return cs.findByPareTambit(idCategoria, tambit);
|
|
@@ -462,7 +464,7 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// POST para guardar un documento en el sistema
|
|
// POST para guardar un documento en el sistema
|
|
|
- @PostMapping("/dashboard/documents")
|
|
|
|
|
|
|
+ @PostMapping("/documents")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public void uploadDocument(@RequestParam MultipartFile file, @RequestParam Integer idCategoria,
|
|
public void uploadDocument(@RequestParam MultipartFile file, @RequestParam Integer idCategoria,
|
|
|
@RequestParam Integer lugar, @RequestParam String tlugar) throws IllegalStateException, IOException {
|
|
@RequestParam Integer lugar, @RequestParam String tlugar) throws IllegalStateException, IOException {
|
|
@@ -486,7 +488,7 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// POST para añadir un documento a un centro cocncreto
|
|
// POST para añadir un documento a un centro cocncreto
|
|
|
- @PostMapping("/dashboard/documents/archive")
|
|
|
|
|
|
|
+ @PostMapping("/documents/archive")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public void archiveDocuments(Model model, @RequestParam Integer lugar, @RequestParam String tlugar) {
|
|
public void archiveDocuments(Model model, @RequestParam Integer lugar, @RequestParam String tlugar) {
|
|
|
ArchiveOrganDTO organ = new ArchiveOrganDTO(lugar, tlugar);
|
|
ArchiveOrganDTO organ = new ArchiveOrganDTO(lugar, tlugar);
|
|
@@ -494,7 +496,7 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// GET para conseguir todos los graficos a partir de un RUCT
|
|
// GET para conseguir todos los graficos a partir de un RUCT
|
|
|
- @GetMapping("/dashboard/graphs/list/{ruct}")
|
|
|
|
|
|
|
+ @GetMapping("/graphs/list/{ruct}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<Grafica> getGraphDataList(@PathVariable Integer ruct) throws ParserConfigurationException {
|
|
public List<Grafica> getGraphDataList(@PathVariable Integer ruct) throws ParserConfigurationException {
|
|
|
Organ o = os.findByRuct(ruct);
|
|
Organ o = os.findByRuct(ruct);
|
|
@@ -507,14 +509,14 @@ public class DashboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//GET para conseguir todos los datos concretos de tasas para las tablas
|
|
//GET para conseguir todos los datos concretos de tasas para las tablas
|
|
|
- @GetMapping("/dashboard/graphs/rates/{lugar}")
|
|
|
|
|
|
|
+ @GetMapping("/graphs/rates/{lugar}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<Indicador> getGraphDataTaxes(@PathVariable Integer lugar) throws ParserConfigurationException {
|
|
public List<Indicador> getGraphDataTaxes(@PathVariable Integer lugar) throws ParserConfigurationException {
|
|
|
return this.ids.getGraphData(lugar);
|
|
return this.ids.getGraphData(lugar);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//GET para conseguir todos los datos concretos de cada gráfico
|
|
//GET para conseguir todos los datos concretos de cada gráfico
|
|
|
- @GetMapping("/dashboard/graphs/inds/{ruct}/{tambit}")
|
|
|
|
|
|
|
+ @GetMapping("/graphs/inds/{ruct}/{tambit}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<Indicador> getGraphDataByRuctTambit(@PathVariable Integer ruct, @PathVariable String tambit) throws ParserConfigurationException {
|
|
public List<Indicador> getGraphDataByRuctTambit(@PathVariable Integer ruct, @PathVariable String tambit) throws ParserConfigurationException {
|
|
|
Organ o = os.findByRuct(ruct);
|
|
Organ o = os.findByRuct(ruct);
|
|
@@ -564,13 +566,13 @@ public class DashboardController {
|
|
|
return inds;
|
|
return inds;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/dashboard/graphs/inds/{ruct}")
|
|
|
|
|
|
|
+ @GetMapping("/graphs/inds/{ruct}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<Indicador> getGraphDataByRuct(@PathVariable Integer ruct) throws ParserConfigurationException {
|
|
public List<Indicador> getGraphDataByRuct(@PathVariable Integer ruct) throws ParserConfigurationException {
|
|
|
return getGraphDataByRuctTambit(ruct, null);
|
|
return getGraphDataByRuctTambit(ruct, null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/dashboard/links/{ruct}")
|
|
|
|
|
|
|
+ @GetMapping("/links/{ruct}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public List<Link> getLinks(@PathVariable Integer ruct) {
|
|
public List<Link> getLinks(@PathVariable Integer ruct) {
|
|
|
List<Link> links = this.ls.findByRuct(ruct);
|
|
List<Link> links = this.ls.findByRuct(ruct);
|
|
@@ -580,7 +582,7 @@ public class DashboardController {
|
|
|
return this.ls.findByRuct(ruct);
|
|
return this.ls.findByRuct(ruct);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PostMapping("/dashboard/links/{ruct}")
|
|
|
|
|
|
|
+ @PostMapping("/links/{ruct}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Link createLink(@PathVariable Integer ruct, @RequestParam String dataExp) throws ParseException {
|
|
public Link createLink(@PathVariable Integer ruct, @RequestParam String dataExp) throws ParseException {
|
|
|
|
|
|
|
@@ -600,7 +602,7 @@ public class DashboardController {
|
|
|
return l;
|
|
return l;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @DeleteMapping("/dashboard/links/{id}")
|
|
|
|
|
|
|
+ @DeleteMapping("/links/{id}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Integer deleteLink(@PathVariable Integer id) {
|
|
public Integer deleteLink(@PathVariable Integer id) {
|
|
|
Link l = this.ls.findById(id);
|
|
Link l = this.ls.findById(id);
|