Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.List;
- public class MatchScanCard {
- public static void main(String[] args) {
- try {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- List<OvertimeHour> overtimeHours = List.of(
- new OvertimeHour(
- 1L, 1L,
- sdf.parse("2025-01-01 07:00:00"),
- sdf.parse("2025-01-01 15:00:00"),
- 1, "SCHEDULED"
- ),
- new OvertimeHour(
- 1L, 2L,
- sdf.parse("2025-01-01 11:00:00"),
- sdf.parse("2025-01-01 12:00:00"),
- 2, "SCHEDULED"
- ),
- new OvertimeHour(
- 1L, 3L,
- sdf.parse("2025-01-01 13:30:00"),
- sdf.parse("2025-01-01 13:40:00"),
- 3, "SCHEDULED"
- )
- );
- Overtime ot = new Overtime(1L, 12136L, overtimeHours);
- List<AttRec> attRecs = List.of(
- new AttRec(1L, 12136L, sdf.parse("2025-01-01 06:55:53")),
- new AttRec(2L, 12136L, sdf.parse("2025-01-01 10:54:53")),
- new AttRec(3L, 12136L, sdf.parse("2025-01-01 11:01:05")),
- new AttRec(4L, 12136L, sdf.parse("2025-01-01 11:58:32")),
- new AttRec(5L, 12136L, sdf.parse("2025-01-01 12:06:32")),
- new AttRec(6L, 12136L, sdf.parse("2025-01-01 13:24:45")),
- new AttRec(7L, 12136L, sdf.parse("2025-01-01 15:03:11"))
- );
- } catch (ParseException e) {
- System.err.println(e.getMessage());
- e.printStackTrace();
- }
- }
- }
- class Overtime {
- private final Long otRid;
- private final Long staffRid;
- private final List<OvertimeHour> overtimeHours;
- public Overtime(Long otRid, Long staffRid, List<OvertimeHour> overtimeHours) {
- this.otRid = otRid;
- this.staffRid = staffRid;
- this.overtimeHours = overtimeHours;
- }
- public Long getOtRid() { return otRid; }
- public Long getStaffRid() { return staffRid; }
- public List<OvertimeHour> getOvertimeHours() { return overtimeHours; }
- }
- class OvertimeHour {
- private final Long otRid;
- private final Long otHourRid;
- private final Date startTime;
- private final Date endTime;
- private final Integer timeslotRid;
- private final String source;
- public OvertimeHour(Long otRid, Long otHourRid, Date startTime,
- Date endTime, Integer timeslotRid, String source) {
- this.otRid = otRid;
- this.otHourRid = otHourRid;
- this.startTime = startTime;
- this.endTime = endTime;
- this.timeslotRid = timeslotRid;
- this.source = source;
- }
- public Long getOtRid() { return otRid; }
- public Long getOtHourRid() { return otHourRid; }
- public Date getStartTime() { return startTime; }
- public Date getEndTime() { return endTime; }
- public Integer getTimeslotRid() { return timeslotRid; }
- public String getSource() { return source; }
- }
- class AttRec {
- private final Long recRid;
- private final Long staffRid;
- private final Date scanDateTime;
- public AttRec(Long recRid, Long staffRid, Date scanDateTime) {
- this.recRid = recRid;
- this.staffRid = staffRid;
- this.scanDateTime = scanDateTime;
- }
- public Long getRecRid() { return recRid; }
- public Long getStaffRid() { return staffRid; }
- public Date getScanDateTime() { return scanDateTime; }
- }
Advertisement
Add Comment
Please, Sign In to add comment