Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
fcfa5577
Commit
fcfa5577
authored
Aug 01, 2018
by
Rajeshekar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Rajeshekar]: If mysql connection not there,the UI screens popups
closing as the exception is thown back to UI
parent
874acacd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
38 deletions
+63
-38
AttendanceController.java
...ava/com/nisum/mytime/controller/AttendanceController.java
+63
-38
No files found.
src/main/java/com/nisum/mytime/controller/AttendanceController.java
View file @
fcfa5577
package
com
.
nisum
.
mytime
.
controller
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -29,43 +30,67 @@ public class AttendanceController {
@Autowired
private
AttendanceService
attendanceService
;
@RequestMapping
(
value
=
"employeeLoginsBasedOnDate"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
EmpLoginData
>>
employeeLoginsBasedOnDate
(
@RequestParam
(
"empId"
)
long
id
,
@RequestParam
(
"fromDate"
)
String
fromDate
,
@RequestParam
(
"toDate"
)
String
toDate
)
throws
MyTimeException
{
List
<
EmpLoginData
>
message
=
userService
.
employeeLoginsBasedOnDate
(
id
,
fromDate
,
toDate
);
@RequestMapping
(
value
=
"employeeLoginsBasedOnDate"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
EmpLoginData
>>
employeeLoginsBasedOnDate
(
@RequestParam
(
"empId"
)
long
id
,
@RequestParam
(
"fromDate"
)
String
fromDate
,
@RequestParam
(
"toDate"
)
String
toDate
)
throws
MyTimeException
{
List
<
EmpLoginData
>
message
=
new
ArrayList
<>();
try
{
message
=
userService
.
employeeLoginsBasedOnDate
(
id
,
fromDate
,
toDate
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
new
ResponseEntity
<>(
message
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"generatePdfReport/{id}/{fromDate}/{toDate}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
TEXT_PLAIN_VALUE
)
@RequestMapping
(
value
=
"generatePdfReport/{id}/{fromDate}/{toDate}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
TEXT_PLAIN_VALUE
)
public
ResponseEntity
<
String
>
generatePdfReport
(
@PathVariable
(
"id"
)
long
id
,
@PathVariable
(
"fromDate"
)
String
fromDate
,
@PathVariable
(
"toDate"
)
String
toDate
)
throws
MyTimeException
{
@PathVariable
(
"fromDate"
)
String
fromDate
,
@PathVariable
(
"toDate"
)
String
toDate
)
throws
MyTimeException
{
String
result
=
userService
.
generatePdfReport
(
id
,
fromDate
,
toDate
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"attendanciesReport/{reportDate}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
AttendenceData
>>
attendanciesReport
(
@PathVariable
(
"reportDate"
)
String
reportDate
)
@RequestMapping
(
value
=
"attendanciesReport/{reportDate}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
AttendenceData
>>
attendanciesReport
(
@PathVariable
(
"reportDate"
)
String
reportDate
)
throws
MyTimeException
,
SQLException
{
List
<
AttendenceData
>
lisOfAttendenceData
=
attendanceService
.
getAttendanciesReport
(
reportDate
);
List
<
AttendenceData
>
lisOfAttendenceData
=
attendanceService
.
getAttendanciesReport
(
reportDate
);
return
new
ResponseEntity
<>(
lisOfAttendenceData
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"employeesDataSave/{searchDate}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Boolean
>
employeesDataSave
(
@PathVariable
(
"searchDate"
)
String
searchDate
)
@RequestMapping
(
value
=
"employeesDataSave/{searchDate}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Boolean
>
employeesDataSave
(
@PathVariable
(
"searchDate"
)
String
searchDate
)
throws
MyTimeException
{
Boolean
result
=
userService
.
fetchEmployeesData
(
searchDate
,
false
);
Boolean
result
=
userService
.
fetchEmployeesData
(
searchDate
,
false
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
/* @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 = "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
{
Boolean
result
=
userService
.
fetchEmployeesData
(
fromDate
,
true
);
@RequestMapping
(
value
=
"resyncMonthData/{fromDate}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Boolean
>
resyncMonthData
(
@PathVariable
(
"fromDate"
)
String
fromDate
)
throws
MyTimeException
{
Boolean
result
=
userService
.
fetchEmployeesData
(
fromDate
,
true
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment