Commit 0fb91dc6 authored by Sumith's avatar Sumith

[$umith] MT-65, MT-66 completed

parent 7a39c235
...@@ -216,4 +216,14 @@ public class UserController { ...@@ -216,4 +216,14 @@ public class UserController {
return new ResponseEntity<>(masterDataMap, HttpStatus.OK); return new ResponseEntity<>(masterDataMap, HttpStatus.OK);
} }
@RequestMapping(value = "/getEmployeeByStatus", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeRoles>> getEmployeeByStatus(
@RequestParam("status") String status) {
List<EmployeeRoles> employeesRoles = userService
.getEmployeesByStatus(status);
return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
}
} }
\ No newline at end of file
...@@ -17,4 +17,6 @@ public interface EmployeeRolesRepo ...@@ -17,4 +17,6 @@ public interface EmployeeRolesRepo
List<EmployeeRoles> findByEmpStatusAndFunctionalGroup(String empStatus, List<EmployeeRoles> findByEmpStatusAndFunctionalGroup(String empStatus,
String functionalGroup); String functionalGroup);
List<EmployeeRoles> findByEmpStatusOrderByEmployeeNameAsc(String empStatus);
} }
...@@ -65,4 +65,6 @@ public interface UserService { ...@@ -65,4 +65,6 @@ public interface UserService {
List<MasterData> getMasterData() throws MyTimeException; List<MasterData> getMasterData() throws MyTimeException;
List<EmployeeRoles> getEmployeesByFunctionalGrp(String functionalGrp); List<EmployeeRoles> getEmployeesByFunctionalGrp(String functionalGrp);
List<EmployeeRoles> getEmployeesByStatus(String status);
} }
...@@ -7,6 +7,7 @@ import java.util.List; ...@@ -7,6 +7,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.FindAndModifyOptions; import org.springframework.data.mongodb.core.FindAndModifyOptions;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
...@@ -123,8 +124,7 @@ public class UserServiceImpl implements UserService { ...@@ -123,8 +124,7 @@ public class UserServiceImpl implements UserService {
newBenchAllocation.setEmployeeName(employeeRoles.getEmployeeName()); newBenchAllocation.setEmployeeName(employeeRoles.getEmployeeName());
newBenchAllocation.setProjectId("Nisum0000"); newBenchAllocation.setProjectId("Nisum0000");
newBenchAllocation.setStartDate(employeeRoles.getDateOfJoining() != null newBenchAllocation.setStartDate(employeeRoles.getDateOfJoining() != null
? employeeRoles.getDateOfJoining() ? employeeRoles.getDateOfJoining() : new Date());
: new Date());
Project p = projectRepo.findByProjectId("Nisum0000"); Project p = projectRepo.findByProjectId("Nisum0000");
newBenchAllocation.setProjectName(p.getProjectName()); newBenchAllocation.setProjectName(p.getProjectName());
newBenchAllocation.setManagerId(p.getManagerId()); newBenchAllocation.setManagerId(p.getManagerId());
...@@ -423,4 +423,16 @@ public class UserServiceImpl implements UserService { ...@@ -423,4 +423,16 @@ public class UserServiceImpl implements UserService {
functionalGrp); functionalGrp);
} }
@Override
public List<EmployeeRoles> getEmployeesByStatus(String status) {
if (status.equals("both")) {
return employeeRolesRepo
.findAll(new Sort(Sort.Direction.ASC, "employeeName"));
} else {
return employeeRolesRepo
.findByEmpStatusOrderByEmployeeNameAsc(status);
}
}
} }
<style>
.grid-align {
text-align: left;
}
</style>
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;" <div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer" ng-controller="assignRoleController" id="popupContainer" ng-controller="assignRoleController"
ng-init="getUserRoles()"> ng-init="getUserRoles()">
...@@ -17,10 +22,26 @@ ...@@ -17,10 +22,26 @@
</div> </div>
</div> </div>
<br/> <br/>
<div class="form-group col-lg-7 col-md-7 col-sm-7 col-xs-12"></div>
<div class="row col-lg-12" style="margin-left: 0px;">
<input type="radio" ng-model="status" value="Active" ng-click="getUserRoles()"> Active
<input type="radio" ng-model="status" value="In Active" ng-click="getUserRoles()"> Inactive
<input type="radio" ng-model="status" value="both" ng-click="getUserRoles()"> Both
</div>
<div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group"> <div class="form-group">
<div class="form-inline col-lg-12" style="margin-left: 10px;"> <div class="form-inline col-lg-12" style="margin-left: 10px;">
<div class="form-group col-lg-3 col-md-4 col-sm-6 col-xs-12"> <!-- <div class="form-group col-lg-3 col-md-4 col-sm-6 col-xs-12">
<div class="input-group" <div class="input-group"
style=""> style="">
<input type="text" ng-model="empSearchId" id="empSearchId" <input type="text" ng-model="empSearchId" id="empSearchId"
...@@ -36,9 +57,9 @@ ...@@ -36,9 +57,9 @@
</button> </button>
</span> </span>
</div> </div>
</div> </div> -->
<div class="form-group col-lg-7 col-md-7 col-sm-7 col-xs-12"></div> <!-- <div class="form-group col-lg-7 col-md-7 col-sm-7 col-xs-12"></div> -->
<div class="form-group col-lg-2" style="margin-left:0px;"> <div class="form-group col-lg-2" style="margin-top: 30px;margin-left: 355px;">
<label class="" for="submitBtn"><md-button <label class="" for="submitBtn"><md-button
class="md-raised md-primary" class="md-raised md-primary"
style="width:142px;background: cadetblue;margin:0px;" style="width:142px;background: cadetblue;margin:0px;"
...@@ -53,13 +74,4 @@ ...@@ -53,13 +74,4 @@
</div> </div>
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
</div> </div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment