This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@RequestMapping("/movimentacao") | |
public class ItemController { | |
@PostMapping("/novo") | |
public @ResponseBody ModelAndView listar(@RequestBody String items) throws JsonParseException, JsonMappingException, IOException{ | |
ObjectMapper mapper = new ObjectMapper(); | |
List<ItemsMovimentacao> listItens = mapper.readValue(items, TypeFactory.defaultInstance() | |
.constructCollectionType(List.class, ItemsMovimentacao.class)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim Url As String, | |
Dim dataJSON As String, | |
Dim returnResponse As String, | |
dataJSON = "[{ ""idGrupoNotificacao"":5," _ | |
& " ""tipoNotificacao"":1, " _ | |
& " ""idCentralNotificacaoOrigemConfiguracao"":1, " _ | |
& " ""prioridade"":2, " _ | |
& " ""idTipoPessoa"":2, " _ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE produto( | |
IDPRODUTO INT AUTO_INCREMENT, | |
COD_TIPO INT, | |
COD_FORNECEDOR INT, | |
DESCRICAO VARCHAR(100) NOT NULL, | |
MEDIDA VARCHAR(20) NOT NULL, | |
VL_COMPRA REAL NOT NULL, | |
VL_VENDA REAL, | |
CONSTRAINT CK_VLVENDA CHECK(VL_VENDA > VL_COMPRA), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select m.COD_PRODUTO, | |
p.DESCRICAO, | |
sum(m.QTD_ITENS) as Qtd , | |
(sum(m.QTD_ITENS) * 100 / (select sum(m2.QTD_ITENS) from movimentacoes as m2)) as Percentual | |
from movimentacoes as m | |
join produto as p | |
on p.idproduto = m.cod_produto | |
where m.cod_tipomovimento = 1 | |
group by m.COD_PRODUTO, p.descricao | |
order by Percentual desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pairwise = (arr, arg) => | |
/* | |
Primeiro laço (reduce) com os numeros recebidos no array | |
Inicio o reduce com um array contendo 2 posições, um número inteiro que vai armazenar as somas dos indices e um | |
objeto que vai armazenar os indices já usados no processo | |
*/ | |
arr.reduce((acc, cur, indexR, arr) => { | |
/* | |
Segundo laço (forEach) para testar o valor recebido do reduce com cada valor do array com a finalizade de | |
satisfazer a condição do desafio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chartFaturamento = { | |
create : function(element){ | |
$.ajax({ | |
type : "GET", | |
contentType : "application/json", | |
url : "/ajax/chartFaturamento", | |
success : function(data, statusText, xhr) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@RequestMapping("/fornecedor") | |
public class FornecedorController { | |
@Autowired | |
Fornecedores fornecedores; | |
@GetMapping("/novo") | |
public ModelAndView novo(Fornecedor fornecedor){ | |
// to do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Array de 4 elementos | |
var Json = [ | |
//Primeiro elemento | |
[{ | |
"name":"Distri Equipamente Cirurgicos", | |
"data":18 | |
}, | |
{ | |
"name":"DNAPet", | |
"data":70 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const groupBy = (xs, key) => xs.reduce((rv, x) => { | |
(rv[x[key]] = rv[x[key]] || []).push(x); | |
return rv; | |
}, {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "tipoMovimentacao": "SAIDA", | |
"setor" : "clinica", | |
"idsetor" : 2, | |
"produto" : "Agulha 3ml" | |
"idproduto" : 12, | |
"qtd_produto" : 7 | |
}, | |
{ "tipoMovimentacao": "ENTRADA", | |
"setor" : "Limpeza", |
OlderNewer