Produced by Araxis Merge on 11/28/2017 4:44:48 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | admin_portal_reeng_2018.1.0.0.zip\admin portal reeng\mhv_source\mhv_admin\mhv-admin-portlet\src\main\java\gov\va\med\mhv\admin\web\util | SortUtil.java | Fri Sep 8 21:00:22 2017 UTC |
2 | admin_portal_reeng_2018.1.0.0.zip\admin portal reeng\mhv_source\mhv_admin\mhv-admin-portlet\src\main\java\gov\va\med\mhv\admin\web\util | SortUtil.java | Tue Nov 28 20:50:38 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 376 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | package go v.va.med.m hv.admin.w eb.util; | |
2 | ||
3 | import jav a.util.Com parator; | |
4 | import jav a.util.Lis t; | |
5 | ||
6 | import gov .va.med.mh v.admin.dt o.Employee OrgRoleDTO ; | |
7 | import gov .va.med.mh v.admin.dt o.Employee OrgRoleHis toryDTO; | |
8 | import gov .va.med.mh v.admin.dt o.Employee SearchResu lt; | |
9 | ||
10 | /** | |
11 | * This cl ass contai ns the var ious sort implementa tions requ ried by th e manage | |
12 | * va staf f applicat ion | |
13 | * | |
14 | * @author PI I
|
|
15 | * | |
16 | */ | |
17 | public cla ss SortUti l { | |
18 | ||
19 | pu blic void imposeDefa ultSortOrd erViewAll( List<Emplo yeeOrgRole DTO> exist ingRoleAss ignments) { | |
20 | ||
21 | if ( existingRo leAssignme nts != nul l) { | |
22 | ||
23 | existi ngRoleAssi gnments.so rt(new Com parator<Em ployeeOrgR oleDTO>() { | |
24 | ||
25 | @Overrid e | |
26 | public i nt compare (EmployeeO rgRoleDTO o1, Employ eeOrgRoleD TO o2) { | |
27 | int result = 0; | |
28 | ||
29 | if (o1 != null && o2 != null) { | |
30 | ||
31 | // order by active fla g | |
32 | if (o1.getAc tive() != null && o2 .getActive () != null ) { | |
33 | ||
34 | resu lt = o2.ge tActive(). compareTo( o1.getActi ve()); | |
35 | ||
36 | } | |
37 | ||
38 | // then by r ole (role name) | |
39 | if (result = = 0 && o1. getRole() != null && o2.getRol e() != nul l | |
40 | && o1. getRole(). getName() != null && o2.getRol e().getNam e() != nul l) { | |
41 | ||
42 | resu lt = o1.ge tRole().ge tName().co mpareTo(o2 .getRole() .getName() ); | |
43 | ||
44 | } | |
45 | ||
46 | // then by f ull name | |
47 | if (result = = 0 && o1. getEmploye e() != nul l && o2.ge tEmployee( ) != null | |
48 | && o1. getEmploye e().getFul lName() != null && o 2.getEmplo yee().getF ullName() != null) { | |
49 | ||
50 | resu lt = o1.ge tEmployee( ).getFullN ame().toLo werCase() | |
51 | .compare To(o2.getE mployee(). getFullNam e().toLowe rCase()); | |
52 | ||
53 | } | |
54 | ||
55 | } | |
56 | return res ult; | |
57 | } | |
58 | }); | |
59 | } | |
60 | } | |
61 | ||
62 | pu blic void imposeDefa ultSortOrd erSearch(L ist<Employ eeSearchRe sult> empl oyees) { | |
63 | ||
64 | if ( employees != null) { | |
65 | ||
66 | employ ees.sort(n ew Compara tor<Employ eeSearchRe sult>() { | |
67 | ||
68 | @Overrid e | |
69 | public i nt compare (EmployeeS earchResul t e1, Empl oyeeSearch Result e2) { | |
70 | int result = 0; | |
71 | ||
72 | if (e1 != null && e2 != null) { | |
73 | ||
74 | // order by last name | |
75 | if (e1.getLa stName() ! = null && e2.getLast Name() != null) { | |
76 | ||
77 | resu lt = e1.ge tLastName( ).toLowerC ase().comp areTo(e2.g etLastName ().toLower Case()); | |
78 | ||
79 | } | |
80 | ||
81 | // then by f irst name | |
82 | if (result = = 0 && e1. getFirstNa me() != nu ll && e2.g etFirstNam e() != nul l) { | |
83 | ||
84 | resu lt = e1.ge tFirstName ().toLower Case().com pareTo(e2. getFirstNa me().toLow erCase()); | |
85 | ||
86 | } | |
87 | ||
88 | // then by V ANetworkID (username ) | |
89 | if (result = = 0 && e1. getUserNam e() != nul l && e2.ge tUserName( ) != null) { | |
90 | ||
91 | resu lt = e1.ge tUserName( ).toLowerC ase().comp areTo(e2.g etUserName ().toLower Case()); | |
92 | ||
93 | } | |
94 | ||
95 | } | |
96 | return res ult; | |
97 | } | |
98 | }); | |
99 | } | |
100 | } | |
101 | ||
102 | pu blic void imposeDefa ultSortOrd erManageSt affMember( List<Emplo yeeOrgRole DTO> emplo yeesCurren tRoles) { | |
103 | ||
104 | if ( employeesC urrentRole s != null) { | |
105 | ||
106 | employ eesCurrent Roles.sort (new Compa rator<Empl oyeeOrgRol eDTO>() { | |
107 | ||
108 | @Overrid e | |
109 | public i nt compare (EmployeeO rgRoleDTO o1, Employ eeOrgRoleD TO o2) { | |
110 | int result = 0; | |
111 | ||
112 | if (o1 != null && o2 != null) { | |
113 | ||
114 | // order by active fla g | |
115 | if (o1.getAc tive() != null && o2 .getActive () != null ) { | |
116 | ||
117 | resu lt = o2.ge tActive(). compareTo( o1.getActi ve()); | |
118 | ||
119 | } | |
120 | ||
121 | // then by r ole | |
122 | if (result = = 0 && o1. getRole() != null && o2.getRol e() != nul l | |
123 | && o1. getRole(). getName() != null && o2.getRol e().getNam e() != nul l) { | |
124 | ||
125 | resu lt = o1.ge tRole().ge tName().co mpareTo(o2 .getRole() .getName() ); | |
126 | ||
127 | } | |
128 | ||
129 | } | |
130 | return res ult; | |
131 | } | |
132 | }); | |
133 | } | |
134 | ||
135 | } | |
136 | ||
137 | pu blic void imposeDefa ultSortOrd erRoleHist ory(List<E mployeeOrg RoleHistor yDTO> empl oyeesHisto ricalRoles ) { | |
138 | ||
139 | if ( employeesH istoricalR oles != nu ll) { | |
140 | employ eesHistori calRoles.s ort(new Co mparator<E mployeeOrg RoleHistor yDTO>() { | |
141 | ||
142 | @Overrid e | |
143 | public i nt compare (EmployeeO rgRoleHist oryDTO o1, EmployeeO rgRoleHist oryDTO o2) { | |
144 | int result = 0; | |
145 | ||
146 | if (o1 != null && o2 != null) { | |
147 | ||
148 | // order by date | |
149 | if (o1.getMo dification Date() != null && o2 .getModifi cationDate () != null ) { | |
150 | ||
151 | resu lt = o2.ge tModificat ionDate(). compareTo( o1.getModi ficationDa te()); | |
152 | ||
153 | } | |
154 | ||
155 | // then by L evel (tyep of organi zation) | |
156 | if (result = = 0 && o1. getEmploye eOrgRoleDT O() != nul l && o2.ge tEmployeeO rgRoleDTO( ) != null | |
157 | && o1. getEmploye eOrgRoleDT O().getOrg anization( ) != null | |
158 | && o2. getEmploye eOrgRoleDT O().getOrg anization( ) != null | |
159 | && o1. getEmploye eOrgRoleDT O().getOrg anization( ).getTypeO fOrganizat ion() != n ull | |
160 | && o2. getEmploye eOrgRoleDT O().getOrg anization( ).getTypeO fOrganizat ion() != n ull) { | |
161 | ||
162 | Stri ng type1 = o1.getEmp loyeeOrgRo leDTO().ge tOrganizat ion().getT ypeOfOrgan ization(); | |
163 | Stri ng type2 = o2.getEmp loyeeOrgRo leDTO().ge tOrganizat ion().getT ypeOfOrgan ization(); | |
164 | resu lt = type1 .compareTo (type2); | |
165 | ||
166 | } | |
167 | ||
168 | // then by R ole (role name) | |
169 | if (result = = 0 && o1. getEmploye eOrgRoleDT O() != nul l && o2.ge tEmployeeO rgRoleDTO( ) != null | |
170 | && o1. getEmploye eOrgRoleDT O().getRol e() != nul l | |
171 | && o2. getEmploye eOrgRoleDT O().getRol e() != nul l | |
172 | && o1. getEmploye eOrgRoleDT O().getRol e().getNam e() != nul l | |
173 | && o2. getEmploye eOrgRoleDT O().getRol e().getNam e() != nul l) { | |
174 | ||
175 | Stri ng name1 = o1.getEmp loyeeOrgRo leDTO().ge tRole().ge tName(); | |
176 | Stri ng name2 = o2.getEmp loyeeOrgRo leDTO().ge tRole().ge tName(); | |
177 | resu lt = name1 .compareTo (name2); | |
178 | ||
179 | } | |
180 | ||
181 | } | |
182 | return res ult; | |
183 | } | |
184 | }); | |
185 | } | |
186 | ||
187 | } | |
188 | ||
189 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.