use of org.springframework.web.bind.annotation.GetMapping in project sic by belluccifranco.
the class GastoController method getGastosPorCajaYFormaDePago.
@GetMapping("/gastos/busqueda")
@ResponseStatus(HttpStatus.OK)
public List<Gasto> getGastosPorCajaYFormaDePago(@RequestParam long idEmpresa, @RequestParam long idFormaDePago, @RequestParam long desde, @RequestParam long hasta) {
Date fechaDesde = new Date(desde);
Date fechaHasta = new Date(hasta);
return gastoService.getGastosEntreFechasYFormaDePago(idEmpresa, idFormaDePago, fechaDesde, fechaHasta);
}
use of org.springframework.web.bind.annotation.GetMapping in project dhis2-core by dhis2.
the class DataElementOperandController method getObjectList.
@GetMapping
@SuppressWarnings("unchecked")
@ResponseBody
public RootNode getObjectList(@RequestParam Map<String, String> rpParameters, OrderParams orderParams) throws QueryParserException {
Schema schema = schemaService.getDynamicSchema(DataElementOperand.class);
List<String> fields = Lists.newArrayList(contextService.getParameterValues("fields"));
List<String> filters = Lists.newArrayList(contextService.getParameterValues("filter"));
List<Order> orders = orderParams.getOrders(schema);
if (fields.isEmpty()) {
fields.addAll(Preset.ALL.getFields());
}
WebOptions options = new WebOptions(rpParameters);
WebMetadata metadata = new WebMetadata();
List<DataElementOperand> dataElementOperands;
if (options.isTrue("persisted")) {
dataElementOperands = Lists.newArrayList(manager.getAll(DataElementOperand.class));
} else {
boolean totals = options.isTrue("totals");
String deg = CollectionUtils.popStartsWith(filters, "dataElement.dataElementGroups.id:eq:");
deg = deg != null ? deg.substring("dataElement.dataElementGroups.id:eq:".length()) : null;
String ds = options.get("dataSet");
if (deg != null) {
DataElementGroup dataElementGroup = manager.get(DataElementGroup.class, deg);
dataElementOperands = dataElementCategoryService.getOperands(dataElementGroup.getMembers(), totals);
} else if (ds != null) {
DataSet dataSet = manager.get(DataSet.class, ds);
dataElementOperands = dataElementCategoryService.getOperands(dataSet, totals);
} else {
List<DataElement> dataElements = new ArrayList<>(manager.getAllSorted(DataElement.class));
dataElementOperands = dataElementCategoryService.getOperands(dataElements, totals);
}
}
Query query = queryService.getQueryFromUrl(DataElementOperand.class, filters, orders, options.getRootJunction());
query.setDefaultOrder();
query.setObjects(dataElementOperands);
dataElementOperands = (List<DataElementOperand>) queryService.query(query);
Pager pager = metadata.getPager();
if (options.hasPaging() && pager == null) {
pager = new Pager(options.getPage(), dataElementOperands.size(), options.getPageSize());
linkService.generatePagerLinks(pager, DataElementOperand.class);
dataElementOperands = PagerUtils.pageCollection(dataElementOperands, pager);
}
RootNode rootNode = NodeUtils.createMetadata();
if (pager != null) {
rootNode.addChild(NodeUtils.createPager(pager));
}
rootNode.addChild(fieldFilterService.filter(DataElementOperand.class, dataElementOperands, fields));
return rootNode;
}
use of org.springframework.web.bind.annotation.GetMapping in project vft-capture by videofirst.
the class InfoController method info.
@GetMapping
public Info info() {
Info info = infoService.getInfo();
info.setCaptureStatus(captureService.status());
info.setUploads(uploadService.status());
return info;
}
use of org.springframework.web.bind.annotation.GetMapping in project tesla by linking12.
the class FilterRuleController method edit.
@RequiresPermissions("filter:rule:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, Model model) {
FilterRuleDO ruleDo = ruleService.get(id);
model.addAttribute("rule", ruleDo);
return prefix + "/edit";
}
use of org.springframework.web.bind.annotation.GetMapping in project tesla by linking12.
the class LoginController method logout.
@GetMapping("/logout")
String logout() {
Subject subject = SecurityUtils.getSubject();
subject.logout();
return "redirect:/login";
}
Aggregations