Commit 393c6ba3 authored by Rajeshekar's avatar Rajeshekar

Fixed the jar issue and manage projects not working in prod server

parent aafbaa63
...@@ -56,7 +56,7 @@ dependencies { ...@@ -56,7 +56,7 @@ dependencies {
compile('jcifs:jcifs:1.3.17') compile('jcifs:jcifs:1.3.17')
compile('javax.servlet:servlet-api') compile('javax.servlet:servlet-api')
compile('com.github.ozlerhakan:poiji:1.11') compile('com.github.ozlerhakan:poiji:1.11')
testCompile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '6.1.0.jre8' compile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '6.1.0.jre8'
compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-web')
compile('io.springfox:springfox-swagger2:2.7.0') compile('io.springfox:springfox-swagger2:2.7.0')
compile('io.springfox:springfox-swagger-ui:2.7.0') compile('io.springfox:springfox-swagger-ui:2.7.0')
......
...@@ -26,29 +26,36 @@ public class EmployeeDataService { ...@@ -26,29 +26,36 @@ public class EmployeeDataService {
@Autowired @Autowired
DbConnection dbConnection; DbConnection dbConnection;
public List<EmpLoginData> fetchEmployeeLoginsBasedOnDates(long employeeId, String fromDate, String toDate) public List<EmpLoginData> fetchEmployeeLoginsBasedOnDates(long employeeId,
throws MyTimeException { String fromDate, String toDate) throws MyTimeException {
long start_ms = System.currentTimeMillis(); long start_ms = System.currentTimeMillis();
String querys = null; String querys = null;
if (employeeId == 0) if (employeeId == 0)
querys = MyTimeUtils.ABESENT_STATUS_QUERY + "'" + fromDate + "'" + MyTimeUtils.ABESENT_STATUS_QUERY1 + "'" querys = MyTimeUtils.ABESENT_STATUS_QUERY + "'" + fromDate + "'"
+ toDate + "'" + MyTimeUtils.ABESENT_STATUS_QUERY3; + MyTimeUtils.ABESENT_STATUS_QUERY1 + "'" + toDate + "'"
+ MyTimeUtils.ABESENT_STATUS_QUERY3;
else else
querys = MyTimeUtils.ABESENT_STATUS_QUERY + "'" + fromDate + "'" + MyTimeUtils.ABESENT_STATUS_QUERY1 + "'" querys = MyTimeUtils.ABESENT_STATUS_QUERY + "'" + fromDate + "'"
+ toDate + "'" + MyTimeUtils.ABESENT_STATUS_QUERY2 + employeeId + MyTimeUtils.ABESENT_STATUS_QUERY3; + MyTimeUtils.ABESENT_STATUS_QUERY1 + "'" + toDate + "'"
+ MyTimeUtils.ABESENT_STATUS_QUERY2 + employeeId
+ MyTimeUtils.ABESENT_STATUS_QUERY3;
int countHours = 0; int countHours = 0;
List<EmpLoginData> listOfEmpLoginData = new ArrayList<>(); List<EmpLoginData> listOfEmpLoginData = new ArrayList<>();
try (Connection connection = dbConnection.getDBConnection(); try (Connection connection = dbConnection.getDBConnection();
Statement statement = connection.createStatement(); Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(querys.toString())) { ResultSet resultSet = statement
.executeQuery(querys.toString())) {
while (resultSet.next()) { while (resultSet.next()) {
EmpLoginData empLoginData = new EmpLoginData(); EmpLoginData empLoginData = new EmpLoginData();
empLoginData.setEmployeeId(resultSet.getString("EmployeeCode")); empLoginData.setEmployeeId(resultSet.getString("EmployeeCode"));
empLoginData.setEmployeeName(resultSet.getString("FirstName")); empLoginData.setEmployeeName(resultSet.getString("FirstName"));
empLoginData.setDateOfLogin(resultSet.getDate("FirstLogin").toString()); empLoginData.setDateOfLogin(
empLoginData.setFirstLogin(resultSet.getTime("FirstLogin").toString()); resultSet.getDate("FirstLogin").toString());
empLoginData.setLastLogout(resultSet.getTime("LastLogin").toString()); empLoginData.setFirstLogin(
resultSet.getTime("FirstLogin").toString());
empLoginData.setLastLogout(
resultSet.getTime("LastLogin").toString());
Time from = resultSet.getTime("FirstLogin"); Time from = resultSet.getTime("FirstLogin");
Time to = resultSet.getTime("LastLogin"); Time to = resultSet.getTime("LastLogin");
long milliseconds = to.getTime() - from.getTime(); long milliseconds = to.getTime() - from.getTime();
...@@ -57,22 +64,28 @@ public class EmployeeDataService { ...@@ -57,22 +64,28 @@ public class EmployeeDataService {
int minutes = (seconds % 3600) / 60; int minutes = (seconds % 3600) / 60;
seconds = (seconds % 3600) % 60; seconds = (seconds % 3600) % 60;
empLoginData.setTotalLoginTime(hours + ":" + minutes + ":" + seconds); empLoginData.setTotalLoginTime(
empLoginData.setTotalLoginTime(hours + ":" + minutes + ":" + seconds); hours + ":" + minutes + ":" + seconds);
Date d = MyTimeUtils.tdf.parse(empLoginData.getTotalLoginTime()); empLoginData.setTotalLoginTime(
hours + ":" + minutes + ":" + seconds);
Date d = MyTimeUtils.tdf
.parse(empLoginData.getTotalLoginTime());
countHours += d.getTime(); countHours += d.getTime();
listOfEmpLoginData.add(empLoginData); listOfEmpLoginData.add(empLoginData);
} }
if (!listOfEmpLoginData.isEmpty()) { if (!listOfEmpLoginData.isEmpty()) {
listOfEmpLoginData.get(0) listOfEmpLoginData.get(0).setTotalAvgTime(MyTimeUtils.tdf
.setTotalAvgTime(MyTimeUtils.tdf.format(countHours / listOfEmpLoginData.size())); .format(countHours / listOfEmpLoginData.size()));
} }
MyTimeLogger.getInstance().info( MyTimeLogger.getInstance()
" Time Taken fecth Employee data based on Dates ::: " + (System.currentTimeMillis() - start_ms)); .info(" Time Taken fecth Employee data based on Dates ::: "
+ (System.currentTimeMillis() - start_ms));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
MyTimeLogger.getInstance().error(e.getMessage()); MyTimeLogger.getInstance().error(e.getMessage());
throw new MyTimeException(e.getMessage()); throw new MyTimeException(e.getMessage());
} }
......
...@@ -928,11 +928,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -928,11 +928,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
document.getElementById('domain').focus(); document.getElementById('domain').focus();
} }
else if(deliveryLeadsSelectedList.employeeName == undefined || deliveryLeadsSelectedList.employeeName == ""){ else if(deliveryLeadsSelectedList.employeeName == undefined || deliveryLeadsSelectedList.employeeName == ""){
 $scope.alertMsg = "Please select a Delivery Lead"; $scope.alertMsg = "Please select a Delivery Lead";
document.getElementById('deliveryLead').focus(); document.getElementById('deliveryLead').focus();
} }
else if(projectStatus == undefined){ else if(projectStatus == undefined){
 $scope.alertMsg = "Please select a Project Status"; $scope.alertMsg = "Please select a Project Status";
document.getElementById('projectStatus').focus(); document.getElementById('projectStatus').focus();
} }
else { else {
......
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