|
@@ -3,128 +3,153 @@ mainApp.controller("searchController", function($scope, $http, $mdDialog ) {
|
3
|
3
|
var urlBase = "http://localhost:8080"
|
4
|
4
|
|
5
|
5
|
|
6
|
|
-
|
|
6
|
+
|
7
|
7
|
/**Search the entity*/
|
8
|
8
|
$scope.search = function(){
|
9
|
|
- var url =urlBase+"/search"+"?text="+$scope.entity.text;
|
10
|
|
- $http.get(url).then(function(response) {
|
11
|
|
- $scope.entity = response.data;
|
12
|
|
- $scope.processList=[];
|
13
|
|
-
|
14
|
|
- });
|
15
|
|
- };
|
16
|
|
-
|
17
|
|
-
|
18
|
|
- /**Return all process from entity*/
|
19
|
|
- $scope.getProcessEntity = function(){
|
20
|
|
- var url =urlBase+"/process/entity?type="+$scope.entity.type +"&entityId="+$scope.entity.id;
|
21
|
|
-
|
22
|
|
- var size = $scope.processList.length;
|
23
|
|
-
|
24
|
|
- if($scope.processList != undefined && size > 0 )
|
25
|
|
- {
|
26
|
|
- url = url +"&processId="+$scope.processList[size -1].id;
|
27
|
|
-
|
|
9
|
+ var url =urlBase+"/search"+"?text="+$scope.entity.text;
|
|
10
|
+ $http.get(url).then(function(response) {
|
|
11
|
+ $scope.entity = response.data;
|
|
12
|
+ $scope.processList=[];
|
|
13
|
+
|
|
14
|
+ });
|
|
15
|
+ };
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+ /**Return all process from entity*/
|
|
19
|
+ $scope.getProcessEntity = function(){
|
|
20
|
+ var url =urlBase+"/process/entity?type="+$scope.entity.type +"&entityId="+$scope.entity.id;
|
|
21
|
+
|
|
22
|
+ var size = $scope.processList.length;
|
|
23
|
+
|
|
24
|
+ if($scope.processList != undefined && size > 0 )
|
|
25
|
+ {
|
|
26
|
+ url = url +"&processId="+$scope.processList[size -1].id;
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ $http.get(url) .then(function(response) {$scope.processList = response.data;});
|
|
30
|
+ };
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+ /**Return all process from process Number*/
|
|
35
|
+ $scope.getProcessNumber = function(processNumber ){
|
|
36
|
+
|
|
37
|
+ var url =urlBase+"/process/number?processNumber="+processNumber;
|
|
38
|
+ var size = $scope.processList.length;
|
|
39
|
+ $http.get(url) .then(function(response) {$scope.processList = response.data;});
|
|
40
|
+ };
|
|
41
|
+
|
|
42
|
+ $scope.processList=[];
|
|
43
|
+ $scope.showVerdict = function(process) {
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+ $mdDialog.show({
|
|
47
|
+ clickOutsideToClose: true,
|
|
48
|
+ scope: $scope, // use parent scope in template
|
|
49
|
+ preserveScope: true, // do not forget this if use parent scope
|
|
50
|
+
|
|
51
|
+ template: "<div id=\"verditctText\" > " +
|
|
52
|
+ " <div id=\"verdictTitle\">"+process.process.judge.name+"</div>"
|
|
53
|
+ +process.process.verdict.replace(/\n\r?/g, '<br />') +
|
|
54
|
+ "</div>",
|
|
55
|
+ controller: function DialogController($scope, $mdDialog) {
|
|
56
|
+ $scope.closeDialog = function() {
|
|
57
|
+ $mdDialog.hide();
|
|
58
|
+ }
|
28
|
59
|
}
|
29
|
|
-
|
30
|
|
-
|
31
|
|
- $http.get(url) .then(function(response) {$scope.processList = response.data;});
|
32
|
|
- };
|
|
60
|
+ });
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+ };
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+ $scope.getInfo = function(process) {
|
|
67
|
+
|
33
|
68
|
|
34
|
|
- /**Return all process from entity*/
|
35
|
|
- $scope.getProcessNumber = function(processNumber ){
|
36
|
|
-
|
|
69
|
+ var judge = " <p> JUIZ: "+process.process.judge.name +" </p> ";
|
|
70
|
+ var lawyer = "";// <p> ADVOGADO: "+process.process.judge.name +" </p>";
|
37
|
71
|
|
38
|
|
- var url =urlBase+"/process/number?processNumber="+processNumber;
|
|
72
|
+ for(var i in process.process.lawyers)
|
|
73
|
+ {
|
|
74
|
+ var lawyerObj = process.process.lawyers[i];
|
39
|
75
|
|
|
76
|
+ lawyer = lawyer + "<p> ADVOGADO: "+lawyerObj.name +" </p>";
|
40
|
77
|
|
41
|
|
- var size = $scope.processList.length;
|
42
|
|
-//
|
43
|
|
-// if($scope.processList != undefined && size > 0 )
|
44
|
|
-// {
|
45
|
|
-// //url = url +"&processId="+$scope.processList[size -1].id;
|
46
|
|
-//
|
47
|
|
-// }
|
|
78
|
+ }
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+ var entities = "";
|
|
83
|
+ for(var i in process.process.otherEntities)
|
|
84
|
+ {
|
|
85
|
+ var entityObject = process.process.otherEntities[i];
|
48
|
86
|
|
|
87
|
+ entities = entities + "<p> "+entityObject.type+" : "+entityObject.name +" </p>";
|
49
|
88
|
|
50
|
|
- $http.get(url) .then(function(response) {$scope.processList = response.data;});
|
51
|
|
- };
|
|
89
|
+ }
|
52
|
90
|
|
53
|
|
- $scope.processList=[];
|
|
91
|
+ var modalText = "<div id=\"verditctText\" > " + juiz + advogado + entities +"</div>"
|
54
|
92
|
|
55
|
|
-// $scope.shwoVerdict = function(process){
|
56
|
|
-//
|
57
|
|
-//
|
58
|
|
-//
|
59
|
|
-//
|
60
|
|
-//
|
61
|
|
-//// var idProcess = process.id;
|
62
|
|
-////
|
63
|
|
-//// for(var i in $scope.processList)
|
64
|
|
-//// {
|
65
|
|
-//// var item = $scope.processList[i];
|
66
|
|
-////
|
67
|
|
-//// if(item.id = idProcess)
|
68
|
|
-//// {
|
69
|
|
-//// console.log(id);
|
70
|
|
-////
|
71
|
|
-//// }
|
72
|
|
-////
|
73
|
|
-//// }
|
74
|
|
-//
|
75
|
|
-// console.log(process.process.verdict);
|
76
|
|
-//
|
77
|
|
-//
|
78
|
|
-//
|
79
|
|
-//
|
80
|
|
-// }
|
81
|
93
|
|
82
|
94
|
|
83
|
95
|
|
84
|
96
|
|
85
|
|
- $scope.showVerdict = function(process) {
|
86
|
|
-
|
87
|
|
-
|
|
97
|
+ $mdDialog.show({
|
|
98
|
+ clickOutsideToClose: true,
|
|
99
|
+ scope: $scope, // use parent scope in template
|
|
100
|
+ preserveScope: true, // do not forget this if use parent scope
|
|
101
|
+
|
|
102
|
+ template: modalText ,
|
|
103
|
+ controller: function DialogController($scope, $mdDialog) {
|
|
104
|
+ $scope.closeDialog = function() {
|
|
105
|
+ $mdDialog.hide();
|
|
106
|
+ }
|
|
107
|
+ }
|
|
108
|
+ });
|
88
|
109
|
|
89
|
|
-// var url =urlBase+"/judge/"+process.process.judge.id;
|
90
|
|
-// $http.get(url).then(function(response) {process.process.judge = response.data;});
|
91
|
|
-//
|
|
110
|
+
|
|
111
|
+ };
|
|
112
|
+
|
|
113
|
+ $scope.getInfoEntity = function(){
|
|
114
|
+
|
|
115
|
+ var url =urlBase+"/search/info?type="+$scope.entity.type +"&entityId="+$scope.entity.id;
|
|
116
|
+ var size = $scope.processList.length;
|
|
117
|
+
|
|
118
|
+ $http.get(url) .then(function(response) {
|
|
119
|
+
|
|
120
|
+ $scope.myChartObject = {};
|
|
121
|
+ $scope.myChartObject.type = "ColumnChart";
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+ $scope.myChartObject.data =
|
|
125
|
+ {
|
|
126
|
+ "cols": [ {id: "t", label: "Topping", type: "string"},
|
|
127
|
+ {id: "s", label: "Diarios", type: "number" } ,
|
|
128
|
+ {role: "style", type: "string"}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+ ],
|
|
132
|
+ "rows": [
|
|
133
|
+ {c: [{v: "Deferidos"}, {v: response.data.deferredProcess } , {v: "green"} ]},
|
|
134
|
+ {c: [{v: "Indeferidos"}, {v: response.data.rejectedProcess } , {v: "red"} ]},
|
|
135
|
+ {c: [{v: "Transito"}, {v: response.data.transtitProcess } , {v: "beige"} ]}
|
|
136
|
+ ]
|
|
137
|
+ };
|
|
138
|
+
|
|
139
|
+ $scope.myChartObject.options = {'title': 'Informaçoes sobre a entidade' };
|
|
140
|
+
|
92
|
141
|
|
93
|
|
- $mdDialog.show(
|
94
|
|
- $mdDialog.alert()
|
95
|
|
- .clickOutsideToClose(true)
|
96
|
|
- .title(process.process.judge.name)
|
97
|
|
- .textContent(process.process.verdict)
|
98
|
|
- .ok('Fechar!')
|
99
|
|
- // You can specify either sting with query selector
|
100
|
|
- .openFrom('#left')
|
101
|
|
- // or an element
|
102
|
|
- .closeTo(angular.element(document.querySelector('#right')))
|
103
|
|
- );
|
104
|
|
- };
|
105
|
|
-
|
106
|
|
-
|
|
142
|
+
|
|
143
|
+ });
|
|
144
|
+
|
|
145
|
+ };
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
107
|
149
|
|
108
|
150
|
|
109
|
|
-
|
110
|
|
-
|
111
|
151
|
|
112
|
|
-
|
113
|
152
|
|
114
|
153
|
});
|
115
|
154
|
|
116
|
|
-//mainApp.controller("processController", function($scope, $http) {
|
117
|
|
-//
|
118
|
|
-// var urlBase = "http://localhost:8080/search"
|
119
|
|
-//
|
120
|
|
-//
|
121
|
|
-// $scope.search = function(){
|
122
|
|
-//
|
123
|
|
-// var url =urlBase+"?text="+$scope.entity.text;
|
124
|
|
-// $http.get(url) .then(function(response) {
|
125
|
|
-// $scope.entity = response.data;
|
126
|
|
-// });
|
127
|
|
-//
|
128
|
|
-// }
|
129
|
|
-//
|
130
|
|
-//});
|
|
155
|
+
|