Unverified Commit e3054442 authored by mmudrakola-nisum-com's avatar mmudrakola-nisum-com Committed by GitHub

Merge pull request #175 from nisum-inc/FEATURE/MT-175-Service-skelton-creation

Did service skeleton side changes
parents b527dc27 f6a242a8
......@@ -46,12 +46,14 @@ public class AttendanceController {
return new ResponseEntity<>(message, HttpStatus.OK);
}
@RequestMapping(value = "generatePdfReport/{id}/{fromDate}/{toDate}",
@RequestMapping(value = "generatePdfReport/{id}/{fromDate}/{toDate}/{fromTime}/{toTime}",
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 {
String result = userService.generatePdfReport(id, fromDate, toDate);
@PathVariable("toDate") String toDate,
@RequestParam("fromTime") String fromTime,
@RequestParam("toTime") String toTime) throws MyTimeException {
String result = attendanceService.generatePdfReport(id, fromDate, toDate, fromTime, toTime);
return new ResponseEntity<>(result, HttpStatus.OK);
}
......
......@@ -10,4 +10,6 @@ public interface AttendanceService {
List<AttendenceData> getAttendanciesReport(String reportDate,String shift) throws MyTimeException, SQLException;
String generatePdfReport(long id, String fromDate, String toDate, String fromTime, String toTime) throws MyTimeException;
}
......@@ -18,6 +18,7 @@ import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.repository.ProjectTeamMatesRepo;
import com.nisum.mytime.utils.MyTimeLogger;
import com.nisum.mytime.utils.MyTimeUtils;
import com.nisum.mytime.utils.PdfReportGenerator;
@Service
public class AttendanceServiceImpl implements AttendanceService {
......@@ -28,6 +29,9 @@ public class AttendanceServiceImpl implements AttendanceService {
@Autowired
ProjectTeamMatesRepo projectTeamMatesRepo;
@Autowired
private PdfReportGenerator pdfReportGenerator;
@Override
public List<AttendenceData> getAttendanciesReport(String reportDate, String shift) throws MyTimeException {
long start_ms = System.currentTimeMillis();
......@@ -37,6 +41,12 @@ public class AttendanceServiceImpl implements AttendanceService {
return listOfEmployees;
}
@Override
public String generatePdfReport(long id, String fromDate, String toDate, String fromTime, String toTime)
throws MyTimeException {
return pdfReportGenerator.generateEmployeeReport(id, fromDate, toDate);
}
private List<AttendenceData> getEmpsAttendenceByShiftWise(String reportDate, String shift) throws MyTimeException {
List<AttendenceData> listOfEmployees = new ArrayList<AttendenceData>();
Optional<List<ProjectTeamMate>> list = findEmpIdsByShiftWise(shift);
......
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