Skip to content

Commit

Permalink
Major Commit: Updated all the images, updated the name of the applica…
Browse files Browse the repository at this point in the history
…tion.

 - Added all required entity classes and added all required fields.
 - Added all corresponding repository classes.
 - Added controller for the Employee Details.
 - Added validators for all the employees.
 - Updated all the jsps with the new fields and details as per the requirements.
  • Loading branch information
mahi-mullapudi committed May 15, 2018
1 parent 2148718 commit 3f3c132
Show file tree
Hide file tree
Showing 43 changed files with 1,709 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import java.util.Map;

@Component
public class TimesheetConstants implements Serializable {
public class ApplicationConstants implements Serializable {

public static final String SALT = "technumen"; //Key used for Encryption.
public static final String SALT = "employeeManagement"; //Key used for Encryption.

public static final String REGISTRATION_STATUS_ACTIVE = "ACTIVE";

Expand Down Expand Up @@ -42,6 +42,8 @@ public class TimesheetConstants implements Serializable {

public static final String TIMESHEET_TYPE_BIWEEKLY = "BIWEEKLY";

public static final String TIMESHEET_TYPE_MONTHLY = "MONTHLY";

public static final String REST_RESPONSE_CODE_SUCCESS = "SUCCESS";

public static final String REST_RESPONSE_CODE_ERROR = "ERROR";
Expand All @@ -66,4 +68,27 @@ public class TimesheetConstants implements Serializable {

public static final String fromAddress = "[email protected]";

public static final Map<String, String> skillMap = ImmutableMap.<String, String>builder()
.put("java", "Java")
.put("mule", "Mule Soft")
.put("net", ".Net")
.put("servicenow", "Service Now")
.put("qa", "Quality Assurance")
.put("ba", "Business Analyst")
.build();
public static final Map<String, String> companyNamesMap = ImmutableMap.<String, String>builder()
.put("geeksoft", "Geeksoft LLC.,")
.put("datasols", "DataSols LLC.,")
.put("anjs", "ANJS Tech")
.put("eish", "EISH Technologies")
.build();

public static final Map<String, String> empTypeMap = ImmutableMap.<String, String>builder()
.put("client", "Client Project")
.put("inhouse", "Inhouse Project")
.put("marketing", "Marketing")
.put("bench", "Bench")
.put("training", "Training")
.build();

}
60 changes: 60 additions & 0 deletions src/main/java/com/tutorialq/entities/ClientDetails.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.tutorialq.entities;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;

@Data
@Entity
@EqualsAndHashCode(exclude = {"employee", "clientDetailsId"})
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ClientDetails implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "CLIENT_DETAILS_ID", unique = true, nullable = false)
private long clientDetailsId;
private String clientName; //Name of the Client.
private String clientAddress;//Address of the Client.
private String clientCity;
private String clientState;
private String clientZip;
private String contractCompany;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate contractStartDate;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate contractEndDate;
//Vendor Contact Details
private String vendorCompany;
private String vendorContactName;
private String vendorPhone;
private String vendorEmail;
private String paymentTerms;
//Invoice Details
private String invoiceContactName;
private String invoiceContactPhone;
private String invoiceContactEmail;
private String invoiceFrequency;
private String comments;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "EMPLOYEE_ID", nullable = false)
@JsonIgnore
private Employee employee;
//Audit Information
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateCreated;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateLastModified;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateApproved;
private String nameCreated;
private String nameLastModified;
private String nameApproved;

}
44 changes: 44 additions & 0 deletions src/main/java/com/tutorialq/entities/DocumentRefData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.tutorialq.entities;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.HashSet;
import java.util.Set;

@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class DocumentRefData implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "DOCUMENT_REF_ID", unique = true, nullable = false)
private long documentRefDataId;
private String cdeSection;
private String sectionDisplayName;
private String DscExplanation;

@OneToMany(fetch = FetchType.LAZY, mappedBy = "employee")
private Set<DocumentUpload> documentUploads = new HashSet<>(0);

//Audit Information
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateCreated;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateLastModified;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateApproved;
private String nameCreated;
private String nameLastModified;
private String nameApproved;


}
54 changes: 54 additions & 0 deletions src/main/java/com/tutorialq/entities/DocumentUpload.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.tutorialq.entities;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;

@Data
@Entity
@EqualsAndHashCode(exclude = {"employee", "clientDetailsId"})
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class DocumentUpload implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "DOCUMENT_UPLOAD_ID", unique = true, nullable = false)
private long documentUploadId;
private long documentRefDataId;
private java.sql.Blob blobMessage;
private String dscFileName;
private String rowId;
private long fileSize;
private String dscSectionName; //To get the section name of the uploaded file
private String dscComments;
//Extra fields to be populated from other tables.
private String uploadedUserName;
private String shortDescription; //This stores the display name of the uploaded section name.
private int numOrder;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "EMPLOYEE_ID", nullable = false)
@JsonIgnore
private Employee employee;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "DOCUMENT_REF_ID", nullable = false)
@JsonIgnore
private DocumentRefData documentRefData;
//Audit Information
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateCreated;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateLastModified;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateApproved;
private String nameCreated;
private String nameLastModified;
private String nameApproved;

}
58 changes: 37 additions & 21 deletions src/main/java/com/tutorialq/entities/Employee.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tutorialq.entities;

import com.tutorialq.constants.TimesheetConstants;
import com.tutorialq.constants.ApplicationConstants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand All @@ -10,7 +10,7 @@

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDate;
import java.util.HashSet;
import java.util.Set;

Expand Down Expand Up @@ -39,48 +39,64 @@ public class Employee implements Serializable {
private String employeeFullName;
private String employeeMiddleName;
private String employeeTitle; //Description of the Employee Title.
private int employeeRoleId; //Foreign Reference for Employee_Roles table.
private Integer employeeRoleId; //Foreign Reference for Employee_Roles table.
private String employeeRoleDesc;
private String employeePhone;
private String employeePhoneExt;
private String clientName; //Name of the Client.
private String clientAddress;//Address of the Client.
private String clientCity;
private String clientState;
private String clientZip;
private long departmentId;//Primary key of Department table.
private String departmentName;
private String skillSet;
private String companyName;
private String employmentType;
private String referredBy;
private Integer currentSalaryPerc;
private Integer salaryDiscount;

@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate employmentStartDate;
@DateTimeFormat(pattern = "MM/dd/yyyy")
@Temporal(TemporalType.DATE)
private Date employeeStartDate; //Account Created Date.
private LocalDate employeeStartDate; //Account Created Date.
private String accountStatusFlag; //Flag to check if the account is ACTIVE or INACTIVE.
@DateTimeFormat(pattern = "MM/dd/yyyy")
@Temporal(TemporalType.TIMESTAMP)
private Date dateInactivated;
private LocalDate dateInactivated;
private String nameUserInactivated; // Who inactivated this user
@DateTimeFormat(pattern = "MM/dd/yyyy")
@Temporal(TemporalType.TIMESTAMP)
private Date dateCreated;
private String nameUserCreated;

@OneToMany(fetch = FetchType.LAZY, mappedBy = "employee")
private Set<Timesheet> timesheetRecords = new HashSet<>(0);

@OneToMany(fetch = FetchType.LAZY, mappedBy = "employee")
private Set<ClientDetails> clientDetails = new HashSet<>(0);

@OneToMany(fetch = FetchType.LAZY, mappedBy = "employee")
private Set<DocumentUpload> documentUploads = new HashSet<>(0);

@OneToMany(fetch = FetchType.LAZY, mappedBy = "employee")
private Set<ImmigrationDetails> immigrationDetails = new HashSet<>(0);

public String getEmployeeFullName() {
return (StringUtils.isNotBlank(this.employeeFirstName) ? this.employeeFirstName : "") +
" " + (StringUtils.isNotBlank(this.employeeLastName) ? this.employeeLastName : "");
}

//Audit Information
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateCreated;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateLastModified;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateApproved;
private String nameCreated;
private String nameLastModified;
private String nameApproved;

public boolean isEmployeeRole() {
return this.employeeRoleId == TimesheetConstants.USER_ROLE_EMPLOYEE_ID;
return this.employeeRoleId == ApplicationConstants.USER_ROLE_EMPLOYEE_ID;
}

public boolean isSupervisorRole() {
return this.employeeRoleId == TimesheetConstants.USER_ROLE_SUPERVISOR_ID;
return this.employeeRoleId == ApplicationConstants.USER_ROLE_SUPERVISOR_ID;
}

public boolean isAdminRole() {
return this.employeeRoleId == TimesheetConstants.USER_ROLE_ADMIN_ID;
return this.employeeRoleId == ApplicationConstants.USER_ROLE_ADMIN_ID;
}

}
52 changes: 52 additions & 0 deletions src/main/java/com/tutorialq/entities/ImmigrationDetails.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.tutorialq.entities;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;

@Data
@Entity
@EqualsAndHashCode(exclude = {"employee", "immiDetailsId"})
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ImmigrationDetails implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "DOCUMENT_UPLOAD_ID", unique = true, nullable = false)
private long immiDetailsId;
private String currentStatus;
private String receiptNumber;
private String lcaNumber;
private BigDecimal currentWage;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate startDate;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate endDate;
private String dscComments;

private String greenCardStatus;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate gcStartDate;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "EMPLOYEE_ID", nullable = false)
@JsonIgnore
private Employee employee;

//Audit Information
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateCreated;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateLastModified;
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate dateApproved;
private String nameCreated;
private String nameLastModified;
private String nameApproved;
}
Loading

0 comments on commit 3f3c132

Please sign in to comment.