浏览代码

Add modal to verdict

ailton 8 年之前
父节点
当前提交
1326b8d94b

+ 1 - 1
.classpath

@@ -22,7 +22,7 @@
22 22
 			<attribute name="maven.pomderived" value="true"/>
23 23
 		</attributes>
24 24
 	</classpathentry>
25
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
25
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
26 26
 		<attributes>
27 27
 			<attribute name="maven.pomderived" value="true"/>
28 28
 		</attributes>

+ 10 - 3
.settings/org.eclipse.jdt.core.prefs

@@ -1,5 +1,12 @@
1 1
 eclipse.preferences.version=1
2
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
3
-org.eclipse.jdt.core.compiler.compliance=1.5
2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5
+org.eclipse.jdt.core.compiler.compliance=1.8
6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
8
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
4 11
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5
-org.eclipse.jdt.core.compiler.source=1.5
12
+org.eclipse.jdt.core.compiler.source=1.8

+ 0 - 6
src/main/java/org/develop/officialjournal/controllers/LawyerController.java

@@ -3,16 +3,10 @@ package org.develop.officialjournal.controllers;
3 3
 import org.develop.officialjournal.services.Database;
4 4
 import org.springframework.web.bind.annotation.PathVariable;
5 5
 import org.springframework.web.bind.annotation.RequestMapping;
6
-import org.springframework.web.bind.annotation.RequestMethod;
7 6
 import org.springframework.web.bind.annotation.RequestParam;
8 7
 import org.springframework.web.bind.annotation.RestController;
9 8
 
10
-import dao.DAOEntity;
11
-import dao.DAOJudge;
12 9
 import dao.DAOLawyer;
13
-import dao.DAOSearch;
14
-import entity.Entity;
15
-import entity.Judge;
16 10
 import entity.Lawyer;
17 11
 
18 12
 @RestController

+ 24 - 5
src/main/java/org/develop/officialjournal/controllers/ProcessController.java

@@ -1,20 +1,18 @@
1 1
 package org.develop.officialjournal.controllers;
2 2
 
3
+import java.util.Comparator;
3 4
 import java.util.List;
4 5
 
5 6
 import org.develop.officialjournal.services.Database;
6 7
 import org.springframework.web.bind.annotation.PathVariable;
7 8
 import org.springframework.web.bind.annotation.RequestMapping;
8
-import org.springframework.web.bind.annotation.RequestMethod;
9 9
 import org.springframework.web.bind.annotation.RequestParam;
10 10
 import org.springframework.web.bind.annotation.RestController;
11 11
 
12
-import dao.DAOLawyer;
13 12
 import dao.DAOProcess;
14 13
 import dao.DAOSearch;
15 14
 import entity.DOProcess;
16 15
 import entity.Entity;
17
-import entity.Lawyer;
18 16
 
19 17
 @RestController
20 18
 public class ProcessController {
@@ -42,15 +40,36 @@ public class ProcessController {
42 40
 	}
43 41
 
44 42
 	@RequestMapping("/process/entity")
45
-	public List<DOProcess> getProcessByEntity(@RequestParam (required = true) Integer entityId,@RequestParam (required = true) String type ) 
43
+	public List<DOProcess> getProcessByEntity(@RequestParam (required = true)  Integer entityId,
44
+											  @RequestParam (required = true)  String type ,
45
+											  @RequestParam (required = false, defaultValue= "0") Integer processId   ) 
46 46
 	{
47 47
 		Entity entity = new Entity();
48 48
 		entity.setId(entityId);
49 49
 		entity.setType(type);
50
-		return daoSearch.search(entity, true);
50
+		return daoSearch.search(entity, true, processId);
51 51
 
52 52
 	}
53 53
 
54
+	
55
+	@RequestMapping("/process/number")
56
+	public List<DOProcess> getProcessByEntity(  @RequestParam (required = true)  String processNumber ,
57
+											  	@RequestParam (required = false, defaultValue= "0") Integer processId   ) 
58
+	{
59
+		
60
+		List<DOProcess> searchResults =  daoSearch.search(processNumber, true, processId);
61
+
62
+		searchResults.sort(new Comparator<DOProcess>() {
63
+
64
+			public int compare(DOProcess o1, DOProcess o2) {
65
+				// TODO Auto-generated method stub
66
+				return (int) (o1.getProcessDate().getTime() - o2.getProcessDate().getTime());
67
+				
68
+			}
69
+		});
70
+		return searchResults;
71
+		
72
+	}
54 73
 
55 74
 
56 75
 

+ 35 - 34
src/main/resources/static/index.html

@@ -2,8 +2,24 @@
2 2
 
3 3
 <head>
4 4
 <title>Angular JS Modules</title>
5
-<script
6
-	src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
5
+
6
+  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.css">
7
+     
8
+ 
9
+  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
10
+  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.min.js"></script>
11
+  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-aria.min.js"></script>
12
+  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-messages.min.js"></script>
13
+
14
+  <!-- Angular Material Library -->
15
+  <script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.js"></script>
16
+  
17
+  
18
+
19
+
20
+
21
+      
22
+
7 23
 <script src="script/module/app.js"></script>
8 24
 <!-- <script src="script/module/lawyer.js"></script> -->
9 25
 <script src="script/module/search.js"></script>
@@ -31,7 +47,7 @@ table tr:nth-child(even) {
31 47
 		<div ng-controller="searchController">
32 48
 
33 49
 			<input type="text" ng-model="entity.text" size="50">
34
-			<button ng-click="search()">Search</button>
50
+			<button ng-click="search()">Busca</button>
35 51
 
36 52
 
37 53
 			<table border="0">
@@ -50,7 +66,8 @@ table tr:nth-child(even) {
50 66
 				</tr>
51 67
 
52 68
 			</table>
53
-
69
+			<button ng-click="getProcessEntity()"> Processos</button>
70
+			
54 71
 
55 72
 			<br>
56 73
 			<br>
@@ -60,47 +77,31 @@ table tr:nth-child(even) {
60 77
 				<tr>
61 78
 					<td>Identificador</td>
62 79
 					<td>Numero</td>
80
+					<td>Data</td>
63 81
 					<td>Tipo</td>
64
-					<td>NumeroOAB</td>
65 82
 
66 83
 				</tr>
67 84
 
68
-				<tr>
85
+				<tr ng-repeat="process in processList">
69 86
 					<td><input type="text" ng-model="process.id" /></td>
70
-					<td><input type="text" ng-model="process.numberProcess" size="40" /></td>
71
-					<td><input type="text" ng-model="process.typeVerdict"></td>
72
-					<td><input type="text" ng-model="process.oabnumber"></td>
87
+					<td><input type="text" ng-model="process.processNumber" ng-click="getProcessNumber(process.processNumber)" size="40" /></td>
88
+					<td><input type="text" ng-model="process.processDate"></td>
89
+					<td><input type="text" ng-model="process.typeVerdict.name"></td>
90
+					<td >
91
+						<div ng-click="showVerdict(this)">Setença</div>
92
+						<div ng-model="process.verdict"  class="ng-hide" data-id="process.id"> </div>
93
+					</td>
73 94
 				</tr>
74
-
75
-
95
+				
96
+				
76 97
 			</table>
98
+			
99
+			
100
+			
77 101
 
78 102
 
79 103
 		</div>
80
-		<!-- 		<div ng-controller="processController"> -->
81
-
82
-		<!-- 			<table border="0"> -->
83
-
84
-		<!-- 				<tr> -->
85
-		<!-- 					<td>Id</td> -->
86
-		<!-- 					<td><input type="text" ng-model="student.id"></td> -->
87
-		<!-- 				</tr> -->
88
-
89
-		<!-- 				<tr> -->
90
-		<!-- 					<td>Name:</td> -->
91
-		<!-- 					<td><input type="text" ng-model="student.name"></td> -->
92
-		<!-- 				</tr> -->
93
-
94
-		<!-- 				<tr> -->
95
-		<!-- 					<td>OABNumber:</td> -->
96
-		<!-- 					<td><input type="text" ng-model="student.oabnumber"></td> -->
97
-		<!-- 				</tr> -->
98
-
99
-		<!-- 			</table> -->
100
-
101
-		<!-- 			<button ng-click="update()">Click Me!</button> -->
102 104
 
103
-		<!-- 		</div> -->
104 105
 
105 106
 
106 107
 	</div>

+ 1 - 1
src/main/resources/static/script/module/app.js

@@ -1,4 +1,4 @@
1
-var mainApp = angular.module("mainApp", []);
1
+var mainApp = angular.module("mainApp", ['ngMaterial']);
2 2
 
3 3
 
4 4
 

+ 102 - 10
src/main/resources/static/script/module/search.js

@@ -1,23 +1,115 @@
1
-mainApp.controller("searchController", function($scope, $http) {
1
+mainApp.controller("searchController", function($scope, $http, $mdDialog ) {
2 2
 
3 3
 	var urlBase = "http://localhost:8080"
4 4
 
5 5
 
6
+		
7
+		/**Search the entity*/
6 8
 		$scope.search = function(){
7
-			var url ="/search"+urlBase+"?text="+$scope.entity.text;
8
-			$http.get(url) .then(function(response) {
9
+			var url =urlBase+"/search"+"?text="+$scope.entity.text;
10
+			$http.get(url).then(function(response) {
9 11
 				$scope.entity =  response.data;
10
-		});
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
+			
30
+			
31
+			$http.get(url) .then(function(response) {$scope.processList =  response.data;});
32
+		};
33
+		
34
+		/**Return all process from entity*/
35
+		$scope.getProcessNumber = function(processNumber ){
36
+			
37
+		
38
+			var url =urlBase+"/process/number?processNumber="+processNumber;
39
+			
11 40
 			
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
+//			}
12 48
 			
13
-		$scope.getProcess = function(){
14
-			var url ="/search"+urlBase+"?text="+$scope.entity.text;
15
-			$http.get(url) .then(function(response) {
16
-			$scope.entity =  response.data;
17
-		});
49
+			
50
+			$http.get(url) .then(function(response) {$scope.processList =  response.data;});
51
+		};
52
+		
53
+		$scope.processList=[];
54
+		
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
+		
82
+		
83
+		
84
+		
85
+		$scope.showVerdict = function(process) {
86
+		    
87
+			
88
+
89
+//			var url =urlBase+"/judge/"+process.process.judge.id;
90
+//			$http.get(url).then(function(response) {process.process.judge =  response.data;});
91
+//			
92
+			
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
+		
107
+
108
+
109
+		
18 110
 		
19 111
 
20
-	}
112
+	
21 113
 
22 114
 });
23 115