Commit 7802a1b6 authored by mmudrakola-nisum-com's avatar mmudrakola-nisum-com Committed by rbonthala-nisum-com

MT-74:integrating_biometric_data_to_the_application (#30)

parent 39abe4d2
......@@ -56,5 +56,5 @@ dependencies {
compile('jcifs:jcifs:1.3.17')
compile('javax.servlet:servlet-api')
compile('com.github.ozlerhakan:poiji:1.11')
testCompile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '6.1.0.jre8'
}
......@@ -15,10 +15,16 @@ public class DbConnection {
public static Connection getDBConnection(String dbURL) throws SQLException {
try {
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
connection = DriverManager.getConnection(dbURL);
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
connection = DriverManager.getConnection("jdbc:sqlserver://10.3.45.105:1433;databaseName=smartiSCC", "sa", "nisum@123");
} catch (ClassNotFoundException cnfex) {
log.error("Problem in loading or " + "registering MS Access JDBC driver", cnfex);
log.error("Problem in loading or " + "registering mssql JDBC driver", cnfex);
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return connection;
}
......
......@@ -57,11 +57,11 @@ public class AttendanceController {
return new ResponseEntity<>(result, HttpStatus.OK);
}
@RequestMapping(value = "copyRemoteMdbFileToLocal", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
/* @RequestMapping(value = "copyRemoteMdbFileToLocal", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Boolean> copyRemoteMdbFileToLocal() throws MyTimeException {
Boolean result = attendanceService.copyRemoteMdbFileToLocal();
return new ResponseEntity<>(result, HttpStatus.OK);
}
}*/
@RequestMapping(value = "resyncMonthData/{fromDate}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Boolean> resyncMonthData(@PathVariable("fromDate") String fromDate) throws MyTimeException {
......
......@@ -19,12 +19,12 @@ public class MyTimeCronSchedularJob implements Job {
@Override
public void execute(JobExecutionContext jobExecutionContext) {
try {
/*try {
if (employeeDataService.fetchEmployeesDataOnDayBasis()) {
MyTimeLogger.getInstance().info("Shedular Executed Successfully Records Saved in DB");
}
} catch (MyTimeException | SQLException e) {
MyTimeLogger.getInstance().error("Shedular failed to Executed ::: " , e);
}
}*/
}
}
......@@ -10,8 +10,4 @@ public interface AttendanceService {
List<AttendenceData> getAttendanciesReport(String reportDate) throws MyTimeException, SQLException;
Boolean copyRemoteMdbFileToLocal() throws MyTimeException;
void triggerMailToAbsentees() throws MyTimeException;
}
......@@ -85,8 +85,9 @@ public class UserServiceImpl implements UserService {
@Override
public Boolean fetchEmployeesData(String perticularDate,
boolean resynchFlag) throws MyTimeException {
return employeeDataBaseService.fetchEmployeesData(perticularDate,
resynchFlag);
/* return employeeDataBaseService.fetchEmployeesData(perticularDate,
resynchFlag);*/
return true;
}
@Override
......
......@@ -62,6 +62,7 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
$scope.gridOptions.data = [];
$scope.getEmployeePresent = function(type){
$scope.attendenceType="both";
$mdDialog.hide();
if(type == "onload"){
showProgressDialog("Fetching data please wait...");
......@@ -80,10 +81,24 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
if(response.data.length == 0){
$timeout(function(){showAlert('No data available');},600);
$scope.refreshPage();
$scope.attendenceType="both";
}else{
$scope.attendenceType="both";
$scope.totalAttendanceArray=response.data;
$scope.gridOptions.data = response.data;
$scope.totalPresent = response.data[0].totalPresent;
$scope.totalAbsent = response.data[0].totalAbsent;
$scope.presentArray=[];
$scope.absentArray=[];
angular.forEach(response.data, function(attendance) {
if(attendance.ifPresent =='P'){
$scope.presentArray.push(attendance);
}else if(attendance.ifPresent =='A'){
$scope.absentArray.push(attendance);
}
});
$scope.totalPresent = $scope.presentArray.length;
$scope.totalAbsent = $scope.absentArray.length;
}
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
......@@ -134,4 +149,20 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
function ProgressController($scope, dataToPass) {
$scope.progressText = dataToPass;
}
$scope.getAttendanceReport = function(value){
if(value == 'both'){
$scope.attendenceType=value;
$scope.gridOptions.data=$scope.totalAttendanceArray;
}else if (value == 'present'){
$scope.present=value;
$scope.gridOptions.data=$scope.presentArray;
}else if (value == 'absent'){
$scope.absent=value;
$scope.gridOptions.data=$scope.absentArray;
}
}
});
......@@ -34,18 +34,29 @@
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12">
<div class="col-lg-3"></div>
<div class="col-lg-8">
<div class="col-lg-2 col-xs-12">
</div>
<div class=" col-lg-offset-2 col-lg-3 col-xs-12">
<p>
<b>Total Present:</b> {{totalPresent}}
</p>
</div>
<div class="col-lg-2 col-xs-12">
<div class="col-lg-3 col-xs-12">
<p>
<b>Total Absent:</b> {{totalAbsent}}
</p>
</div>
<div class="col-lg-5"></div>
</div>
<div class=" cocol-lg-4 ">
<p><input type="radio" name="attend" ng-model="attendenceType" value="both" ng-click="getAttendanceReport(attendenceType)"> All
<input type="radio" name="attend" ng-model="attendenceType" value="present" ng-click="getAttendanceReport(attendenceType)"> Present
<input type="radio" name="attend" ng-model="attendenceType" value="absent" ng-click="getAttendanceReport(attendenceType)"> Absence
</p>
</div>
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
</div>
......
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