ajustes no app para a api_homol
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 75 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 74 KiB |
BIN
assets/images/desenvolvimento.png
Normal file
BIN
assets/images/desenvolvimento.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
BIN
assets/images/homologacao.png
Normal file
BIN
assets/images/homologacao.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
@@ -43,7 +43,7 @@ class MainControllers{
|
|||||||
return senhaCriptogradafa;
|
return senhaCriptogradafa;
|
||||||
}
|
}
|
||||||
salvarLog(EstudanteModelo estudanteModelo,String TELA)async{
|
salvarLog(EstudanteModelo estudanteModelo,String TELA)async{
|
||||||
final url = 'http://192.168.18.2:8000/log';
|
final url = '${estudanteModelo.URL}/log';
|
||||||
|
|
||||||
// print('dados');
|
// print('dados');
|
||||||
// print(widget.estudanteModelo.dados);
|
// print(widget.estudanteModelo.dados);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class EstudanteModelo{
|
|||||||
String cidade;
|
String cidade;
|
||||||
String NO_USUARIO;
|
String NO_USUARIO;
|
||||||
String CD_USUARIO;
|
String CD_USUARIO;
|
||||||
|
String URL;
|
||||||
|
|
||||||
EstudanteModelo({
|
EstudanteModelo({
|
||||||
required this.NO_ALUNO,
|
required this.NO_ALUNO,
|
||||||
@@ -22,6 +23,7 @@ class EstudanteModelo{
|
|||||||
required this.nroAluno,
|
required this.nroAluno,
|
||||||
required this.cidade,
|
required this.cidade,
|
||||||
required this.NO_USUARIO,
|
required this.NO_USUARIO,
|
||||||
required this.CD_USUARIO
|
required this.CD_USUARIO,
|
||||||
|
required this.URL
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ class _TelaAgendaState extends State<TelaAgenda> {
|
|||||||
carregandoEventos = true;
|
carregandoEventos = true;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
||||||
final url = 'http://192.168.18.2:8000/calendario?'
|
final url = '${widget.estudanteModelo.URL}/calendario?'
|
||||||
'MES=${dataAtual.year}-${dataAtual.month}-01&'
|
'MES=${dataAtual.year}-${dataAtual.month}-01&'
|
||||||
'COD_ESCOLA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_CAD_DIVERSO']}&'
|
'COD_ESCOLA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_CAD_DIVERSO']}&'
|
||||||
'QUANTIDADE=31&'
|
'QUANTIDADE=31&'
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ class _TelaBoletimState extends State<TelaBoletim> {
|
|||||||
|
|
||||||
buscarNotas()async{
|
buscarNotas()async{
|
||||||
|
|
||||||
final url = 'http://192.168.18.2:8000/boletim_notas?MATRICULA=${widget.matricula}&CIDADE=${widget.estudanteModelo.cidade}';
|
final url = '${widget.estudanteModelo.URL}/boletim_notas?MATRICULA=${widget.matricula}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
// print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
// print(map);
|
// print(map);
|
||||||
@@ -54,10 +54,10 @@ class _TelaBoletimState extends State<TelaBoletim> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
}else{
|
}else{
|
||||||
for(int i=0;list.length>i;i++){
|
for(int i=0;list.length>i;i++){
|
||||||
listDisciplinas1.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: int.parse(list[i]['NOTA_1']??0), falta: 0));
|
listDisciplinas1.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: int.parse(list[i]['NOTA_1']??'0'), falta: 0));
|
||||||
listDisciplinas2.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: list[i]['NOTA_2']==null?0:int.parse(list[i]['NOTA_2']??0), falta: 0));
|
listDisciplinas2.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: list[i]['NOTA_2']==null?0:int.parse(list[i]['NOTA_2']??'0'), falta: 0));
|
||||||
listDisciplinas3.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: list[i]['NOTA_3']==null?0:int.parse(list[i]['NOTA_3']??0), falta: 0));
|
listDisciplinas3.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: list[i]['NOTA_3']==null?0:int.parse(list[i]['NOTA_3']??'0'), falta: 0));
|
||||||
listDisciplinas4.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: list[i]['NOTA_4']==null?0:int.parse(list[i]['NOTA_4']??0), falta: 0));
|
listDisciplinas4.add(ItemDisciplina(disciplina: list[i]['NO_DISCIPLINA'], nota: list[i]['NOTA_4']==null?0:int.parse(list[i]['NOTA_4']??'0'), falta: 0));
|
||||||
}
|
}
|
||||||
buscarFaltas();
|
buscarFaltas();
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ class _TelaBoletimState extends State<TelaBoletim> {
|
|||||||
|
|
||||||
buscarFaltas()async{
|
buscarFaltas()async{
|
||||||
|
|
||||||
final url = 'http://192.168.18.2:8000/boletim_faltas?MATRICULA=${widget.matricula}&CIDADE=${widget.estudanteModelo.cidade}';
|
final url = '${widget.estudanteModelo.URL}/boletim_faltas?MATRICULA=${widget.matricula}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
// print(url);
|
// print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class _TelaHistoricoState extends State<TelaHistorico> {
|
|||||||
|
|
||||||
getMatriculas()async{
|
getMatriculas()async{
|
||||||
String cd = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
String cd = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
||||||
final url = 'http://192.168.18.2:8000/matriculas_aluno?CD_ALUNO=$cd&CIDADE=${widget.estudanteModelo.cidade}';
|
final url = '${widget.estudanteModelo.URL}/matriculas_aluno?CD_ALUNO=$cd&CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import '../componentes/input_text.dart';
|
|||||||
import '../componentes/snackBars.dart';
|
import '../componentes/snackBars.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import '../componentes/text_custom.dart';
|
import '../componentes/text_custom.dart';
|
||||||
|
import '../utils/fixos.dart';
|
||||||
|
|
||||||
class TelaLogin extends StatefulWidget {
|
class TelaLogin extends StatefulWidget {
|
||||||
const TelaLogin({Key? key}) : super(key: key);
|
const TelaLogin({Key? key}) : super(key: key);
|
||||||
@@ -33,6 +34,8 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
EstudanteModelo? estudanteModelo;
|
EstudanteModelo? estudanteModelo;
|
||||||
String status = 'VALIDANDO ACESSO...';
|
String status = 'VALIDANDO ACESSO...';
|
||||||
var map;
|
var map;
|
||||||
|
int contLogo = 0;
|
||||||
|
String urlAPI = 'https://homol-controle-educa-api.rkmsistemas.com.br';
|
||||||
|
|
||||||
verificacao(){
|
verificacao(){
|
||||||
if(inputLogin.text.isNotEmpty){
|
if(inputLogin.text.isNotEmpty){
|
||||||
@@ -59,7 +62,7 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
alterarSenha = false;
|
alterarSenha = false;
|
||||||
status = 'ALTERANDO SENHA ...';
|
status = 'ALTERANDO SENHA ...';
|
||||||
setState(() {});
|
setState(() {});
|
||||||
final url = 'http://192.168.18.2:8000/inserirpais';
|
final url = '$urlAPI/inserirpais';
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
@@ -99,7 +102,7 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
|
|
||||||
conectAPI(String cpf, String senha)async{
|
conectAPI(String cpf, String senha)async{
|
||||||
final PrefService _prefService = PrefService();
|
final PrefService _prefService = PrefService();
|
||||||
final url = 'http://192.168.18.2:8000/loginpais?CPF=$cpf';
|
final url = '$urlAPI/loginpais?CPF=$cpf';
|
||||||
print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
map = json.decode(response.body);
|
map = json.decode(response.body);
|
||||||
@@ -146,7 +149,7 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
|
|
||||||
buscaFilhos(String nome,String parentesco,String cidade, String CPF)async{
|
buscaFilhos(String nome,String parentesco,String cidade, String CPF)async{
|
||||||
String q = nome.replaceAll(' ', '%20').toUpperCase();
|
String q = nome.replaceAll(' ', '%20').toUpperCase();
|
||||||
final url = 'http://192.168.18.2:8000/buscafilhos?NOME=$q&PARENTESCO=${parentesco.replaceAll("Ã", 'A').replaceAll('ã', 'a')}&CIDADE=$cidade';
|
final url = '$urlAPI/buscafilhos?NOME=$q&PARENTESCO=${parentesco.replaceAll("Ã", 'A').replaceAll('ã', 'a')}&CIDADE=$cidade';
|
||||||
print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
@@ -186,12 +189,13 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
nroAluno: 0,
|
nroAluno: 0,
|
||||||
cidade: cidade,
|
cidade: cidade,
|
||||||
NO_USUARIO: nome,
|
NO_USUARIO: nome,
|
||||||
CD_USUARIO: CPF
|
CD_USUARIO: CPF,
|
||||||
|
URL: urlAPI
|
||||||
);
|
);
|
||||||
Navigator.pushReplacement(context,MaterialPageRoute(builder: (context) => TelaSituacaoEscolar(estudanteModelo: estudanteModelo!)));
|
Navigator.pushReplacement(context,MaterialPageRoute(builder: (context) => TelaSituacaoEscolar(estudanteModelo: estudanteModelo!)));
|
||||||
}else{
|
}else{
|
||||||
Navigator.pushReplacement(context,MaterialPageRoute(builder: (context) =>
|
Navigator.pushReplacement(context,MaterialPageRoute(builder: (context) =>
|
||||||
TelaSelecionaFilho(listAlunos: listAlunos,cidade: cidade,CD_USUARIO: CPF,NO_USUARIO: nome,)));
|
TelaSelecionaFilho(listAlunos: listAlunos,cidade: cidade,CD_USUARIO: CPF,NO_USUARIO: nome,URL: urlAPI,)));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
showSnackBar(context, 'Estudante não encontrado', Colors.red);
|
showSnackBar(context, 'Estudante não encontrado', Colors.red);
|
||||||
@@ -221,9 +225,38 @@ class _TelaLoginState extends State<TelaLogin> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
GestureDetector(
|
||||||
child: Image.asset("assets/images/logoEduca.png",width:Dimensoes.width * 0.4,height: Dimensoes.height * 0.12)
|
onTap: carregando?null:()=>setState((){
|
||||||
|
contLogo++;
|
||||||
|
if(contLogo<5){
|
||||||
|
urlAPI = Fixos.LINK_API_HOMOL;
|
||||||
|
}else{
|
||||||
|
contLogo=0;
|
||||||
|
urlAPI = Fixos.LINK_API_LOCAL;
|
||||||
|
}
|
||||||
|
// if(contLogo>=5 && contLogo<=10){
|
||||||
|
// urlAPI = Fixos.AMB_HOMO;
|
||||||
|
// }
|
||||||
|
// if(contLogo>10){
|
||||||
|
// urlAPI = Fixos.AMB_DEV;
|
||||||
|
// if(contLogo==15){
|
||||||
|
// contLogo=0;
|
||||||
|
// urlAPI = Fixos.AMB_PROD;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// print(contLogo);
|
||||||
|
// print(urlAPI);
|
||||||
|
}),
|
||||||
|
child: Container(
|
||||||
|
child: Image.asset("assets/images/logoEduca.png",width:Dimensoes.width * 0.4,height: Dimensoes.height * 0.12)
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
urlAPI==Fixos.LINK_API_LOCAL?Container(
|
||||||
|
child: Image.asset("assets/images/desenvolvimento.png",width:Dimensoes.width * 0.5,height: Dimensoes.height * 0.12)
|
||||||
|
):Container(),
|
||||||
|
urlAPI==Fixos.LINK_API_HOMOL?Container(
|
||||||
|
child: Image.asset("assets/images/homologacao.png",width:Dimensoes.width * 0.5,height: Dimensoes.height * 0.12)
|
||||||
|
):Container(),
|
||||||
carregando?Container():Container(
|
carregando?Container():Container(
|
||||||
width: Dimensoes.width>900? Dimensoes.width * 0.18:Dimensoes.width*0.7,
|
width: Dimensoes.width>900? Dimensoes.width * 0.18:Dimensoes.width*0.7,
|
||||||
child: InputText(
|
child: InputText(
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
|||||||
getPasse()async{
|
getPasse()async{
|
||||||
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
||||||
String passe = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
String passe = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
||||||
final url = 'http://192.168.18.2:8000/passe?CD_ALUNO=${teste_passe}&CIDADE=${widget.estudanteModelo.cidade}';
|
final url = '${widget.estudanteModelo.URL}/passe?CD_ALUNO=${teste_passe}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
@@ -61,7 +61,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
|||||||
}
|
}
|
||||||
getFrequencia(String CD_ALUNO)async{
|
getFrequencia(String CD_ALUNO)async{
|
||||||
dadosFrequncia.clear();
|
dadosFrequncia.clear();
|
||||||
final url = 'http://192.168.18.2:8000/frequencia?CD_ALUNO=${CD_ALUNO}&CIDADE=${widget.estudanteModelo.cidade}';
|
final url = '${widget.estudanteModelo.URL}/frequencia?CD_ALUNO=${CD_ALUNO}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
@@ -115,7 +115,7 @@ class _TelaPasseState extends State<TelaPasse> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
String teste_passe = '4E275A169EA2432E949FF90DF8D2CF10';
|
||||||
String CD_ALUNO = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
String CD_ALUNO = widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_ALUNO'];
|
||||||
final url = 'http://192.168.18.2:8000/carteira?CD_ALUNO=${teste_passe}&CIDADE=${widget.estudanteModelo.cidade}';
|
final url = '${widget.estudanteModelo.URL}/carteira?CD_ALUNO=${teste_passe}&CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
|
|||||||
@@ -13,11 +13,14 @@ class TelaSelecionaFilho extends StatefulWidget {
|
|||||||
String cidade;
|
String cidade;
|
||||||
String NO_USUARIO;
|
String NO_USUARIO;
|
||||||
String CD_USUARIO;
|
String CD_USUARIO;
|
||||||
|
String URL;
|
||||||
|
|
||||||
TelaSelecionaFilho({
|
TelaSelecionaFilho({
|
||||||
required this.listAlunos,
|
required this.listAlunos,
|
||||||
required this.cidade,
|
required this.cidade,
|
||||||
required this.NO_USUARIO,
|
required this.NO_USUARIO,
|
||||||
required this.CD_USUARIO
|
required this.CD_USUARIO,
|
||||||
|
required this.URL
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -62,7 +65,8 @@ class _TelaSelecionaFilhoState extends State<TelaSelecionaFilho> {
|
|||||||
nroAluno: i,
|
nroAluno: i,
|
||||||
cidade: widget.cidade,
|
cidade: widget.cidade,
|
||||||
CD_USUARIO: widget.CD_USUARIO,
|
CD_USUARIO: widget.CD_USUARIO,
|
||||||
NO_USUARIO: widget.NO_USUARIO
|
NO_USUARIO: widget.NO_USUARIO,
|
||||||
|
URL: widget.URL
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:rkm_educa_app/componentes/item_evento_home.dart';
|
import 'package:rkm_educa_app/componentes/item_evento_home.dart';
|
||||||
import 'package:rkm_educa_app/controllers/main_controllers.dart';
|
import 'package:rkm_educa_app/controllers/main_controllers.dart';
|
||||||
import 'package:rkm_educa_app/modelos/estudante_modelo.dart';
|
import 'package:rkm_educa_app/modelos/estudante_modelo.dart';
|
||||||
@@ -34,7 +33,7 @@ class _TelaSituacaoEscolarState extends State<TelaSituacaoEscolar> {
|
|||||||
bool carregandoOcorrencias = true;
|
bool carregandoOcorrencias = true;
|
||||||
|
|
||||||
buscarEventos()async{
|
buscarEventos()async{
|
||||||
final url = 'http://192.168.18.2:8000/calendario_home?'
|
final url = '${widget.estudanteModelo.URL}/calendario_home?'
|
||||||
'HOJE=${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}&'
|
'HOJE=${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}&'
|
||||||
'COD_ESCOLA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_CAD_DIVERSO']}&'
|
'COD_ESCOLA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_CAD_DIVERSO']}&'
|
||||||
'CIDADE=${widget.estudanteModelo.cidade}';
|
'CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
@@ -52,7 +51,7 @@ class _TelaSituacaoEscolarState extends State<TelaSituacaoEscolar> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buscarOcorrencia()async{
|
buscarOcorrencia()async{
|
||||||
final url = 'http://192.168.18.2:8000/ocorrencia?'
|
final url = '${widget.estudanteModelo.URL}/ocorrencia?'
|
||||||
'MATRICULA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_MATRICULA']}&'
|
'MATRICULA=${widget.estudanteModelo.dados[widget.estudanteModelo.nroAluno]['CD_MATRICULA']}&'
|
||||||
'CIDADE=${widget.estudanteModelo.cidade}';
|
'CIDADE=${widget.estudanteModelo.cidade}';
|
||||||
print(url);
|
print(url);
|
||||||
|
|||||||
5
lib/utils/fixos.dart
Normal file
5
lib/utils/fixos.dart
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class Fixos{
|
||||||
|
static const String LINK_API_LOCAL = 'http://192.168.18.2:8000';
|
||||||
|
static const String LINK_API_CONTAINER = 'http://192.168.0.42:8013';
|
||||||
|
static const String LINK_API_HOMOL = 'https://homol-controle-educa-api.rkmsistemas.com.br';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user