|
@@ -18,15 +18,43 @@ mainApp.controller("searchController", function($scope, $http, $mdDialog ) {
|
18
|
18
|
/**Return all process from entity*/
|
19
|
19
|
$scope.getProcessEntity = function(){
|
20
|
20
|
var url =urlBase+"/process/entity?type="+$scope.entity.type +"&entityId="+$scope.entity.id;
|
21
|
|
-
|
22
|
21
|
var size = $scope.processList.length;
|
23
|
|
-
|
24
|
22
|
if($scope.processList != undefined && size > 0 )
|
25
|
23
|
{
|
26
|
24
|
url = url +"&processId="+$scope.processList[size -1].id;
|
27
|
25
|
}
|
28
|
26
|
|
29
|
|
- $http.get(url) .then(function(response) {$scope.processList = response.data;});
|
|
27
|
+
|
|
28
|
+ $http.get(url) .then(function(response) {
|
|
29
|
+
|
|
30
|
+ $scope.processList = response.data;
|
|
31
|
+ var k=0;
|
|
32
|
+
|
|
33
|
+ for( var i in $scope.processList)
|
|
34
|
+ {
|
|
35
|
+ var process = $scope.processList[i];
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+ var urlProcess =urlBase+"/process/"+process.id+"/all";
|
|
39
|
+
|
|
40
|
+ if(process.lawyers.length == 0)
|
|
41
|
+ {
|
|
42
|
+ $http.get(urlProcess).then(function(response) {
|
|
43
|
+ $scope.processList[k] = response.data;
|
|
44
|
+ k++;
|
|
45
|
+
|
|
46
|
+ });
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ }
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+ });
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
30
|
58
|
};
|
31
|
59
|
|
32
|
60
|
|
|
@@ -61,44 +89,37 @@ mainApp.controller("searchController", function($scope, $http, $mdDialog ) {
|
61
|
89
|
|
62
|
90
|
|
63
|
91
|
};
|
|
92
|
+
|
|
93
|
+ /**Show a popUp with a process**/
|
64
|
94
|
|
65
|
|
-
|
66
|
|
- $scope.getInfo = function(process) {
|
67
|
|
-
|
68
|
|
-
|
|
95
|
+ $scope.showPopUp = function(process)
|
|
96
|
+ {
|
69
|
97
|
var judge = " <p> JUIZ: "+process.process.judge.name +" </p> ";
|
70
|
|
- var lawyer = "";// <p> ADVOGADO: "+process.process.judge.name +" </p>";
|
71
|
|
-
|
|
98
|
+ var lawyer = "";
|
|
99
|
+
|
72
|
100
|
for(var i in process.process.lawyers)
|
73
|
101
|
{
|
74
|
102
|
var lawyerObj = process.process.lawyers[i];
|
75
|
|
-
|
76
|
|
- lawyer = lawyer + "<p> ADVOGADO: "+lawyerObj.name +" </p>";
|
77
|
|
-
|
|
103
|
+ if(lawyerObj.id != 22)
|
|
104
|
+ {
|
|
105
|
+ lawyer = lawyer + "<p> ADVOGADO: "+lawyerObj.name +" </p>";
|
|
106
|
+ }
|
78
|
107
|
}
|
79
|
|
-
|
80
|
|
-
|
81
|
|
-
|
82
|
108
|
var entities = "";
|
83
|
109
|
for(var i in process.process.otherEntities)
|
84
|
110
|
{
|
85
|
111
|
var entityObject = process.process.otherEntities[i];
|
86
|
|
-
|
|
112
|
+
|
87
|
113
|
entities = entities + "<p> "+entityObject.type+" : "+entityObject.name +" </p>";
|
88
|
|
-
|
|
114
|
+
|
89
|
115
|
}
|
90
|
|
-
|
91
|
|
- var modalText = "<div id=\"verditctText\" > " + juiz + advogado + entities +"</div>"
|
92
|
|
-
|
93
|
|
-
|
94
|
|
-
|
95
|
|
-
|
96
|
|
-
|
|
116
|
+
|
|
117
|
+ var modalText = "<div id=\"verditctText\" > " + judge + lawyer + entities +"</div>"
|
|
118
|
+
|
97
|
119
|
$mdDialog.show({
|
98
|
120
|
clickOutsideToClose: true,
|
99
|
121
|
scope: $scope, // use parent scope in template
|
100
|
122
|
preserveScope: true, // do not forget this if use parent scope
|
101
|
|
-
|
102
|
123
|
template: modalText ,
|
103
|
124
|
controller: function DialogController($scope, $mdDialog) {
|
104
|
125
|
$scope.closeDialog = function() {
|
|
@@ -106,10 +127,32 @@ mainApp.controller("searchController", function($scope, $http, $mdDialog ) {
|
106
|
127
|
}
|
107
|
128
|
}
|
108
|
129
|
});
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+ };
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+ /**Get All Info about the user*/
|
|
136
|
+
|
|
137
|
+ $scope.getInfo = function(process) {
|
109
|
138
|
|
|
139
|
+ var url =urlBase+"/process/"+process.process.id+"/all";
|
110
|
140
|
|
|
141
|
+ if(process.process.lawyers.length == 0)
|
|
142
|
+ {
|
|
143
|
+ $http.get(url) .then(function(response) {
|
|
144
|
+ process.process = response.data;
|
|
145
|
+ $scope.showPopUp(process);
|
|
146
|
+ });
|
|
147
|
+ }
|
|
148
|
+ else{
|
|
149
|
+ $scope.showPopUp(process);
|
|
150
|
+ }
|
111
|
151
|
};
|
112
|
152
|
|
|
153
|
+
|
|
154
|
+ /**Info of entity and build the graphic**/
|
|
155
|
+
|
113
|
156
|
$scope.getInfoEntity = function(){
|
114
|
157
|
|
115
|
158
|
var url =urlBase+"/search/info?type="+$scope.entity.type +"&entityId="+$scope.entity.id;
|
|
@@ -119,26 +162,26 @@ mainApp.controller("searchController", function($scope, $http, $mdDialog ) {
|
119
|
162
|
|
120
|
163
|
$scope.myChartObject = {};
|
121
|
164
|
$scope.myChartObject.type = "ColumnChart";
|
122
|
|
-
|
123
|
|
-
|
|
165
|
+
|
|
166
|
+
|
124
|
167
|
$scope.myChartObject.data =
|
125
|
168
|
{
|
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
|
|
- ]
|
|
169
|
+ "cols": [ {id: "t", label: "Topping", type: "string"},
|
|
170
|
+ {id: "s", label: "Diarios", type: "number" } ,
|
|
171
|
+ {role: "style", type: "string"}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+ ],
|
|
175
|
+ "rows": [
|
|
176
|
+ {c: [{v: "Deferidos"}, {v: response.data.deferredProcess } , {v: "green"} ]},
|
|
177
|
+ {c: [{v: "Indeferidos"}, {v: response.data.rejectedProcess } , {v: "red"} ]},
|
|
178
|
+ {c: [{v: "Transito"}, {v: response.data.transtitProcess } , {v: "beige"} ]}
|
|
179
|
+ ]
|
137
|
180
|
};
|
138
|
|
-
|
|
181
|
+
|
139
|
182
|
$scope.myChartObject.options = {'title': 'Informaçoes sobre a entidade' };
|
140
|
|
-
|
141
|
|
-
|
|
183
|
+
|
|
184
|
+
|
142
|
185
|
|
143
|
186
|
});
|
144
|
187
|
|