0% found this document useful (0 votes)
23 views

Employee Management System

The Employment Management System (EMS) is a comprehensive software solution developed using Java Spring Framework and Thymeleaf, designed to streamline employee management processes such as data handling, attendance tracking, performance evaluation, and payroll processing. The system features a user-friendly interface, automated workflows, and robust security measures, aiming to enhance organizational efficiency and decision-making. With a scalable architecture and integration capabilities, the EMS caters to the evolving needs of businesses across various industries.

Uploaded by

Rakesh Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Employee Management System

The Employment Management System (EMS) is a comprehensive software solution developed using Java Spring Framework and Thymeleaf, designed to streamline employee management processes such as data handling, attendance tracking, performance evaluation, and payroll processing. The system features a user-friendly interface, automated workflows, and robust security measures, aiming to enhance organizational efficiency and decision-making. With a scalable architecture and integration capabilities, the EMS caters to the evolving needs of businesses across various industries.

Uploaded by

Rakesh Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Abstract

The Employment Management System (EMS) is a robust software solution crafted

using the Java Spring Framework and Thyme leaf templating engine. Leveraging the

power of these technologies, the system offers an intuitive and feature-rich platform

for efficient management of various workforce-related processes within organizations.

From employee data management to recruitment, performance evaluation, and

scheduling, the EMS provides seamless functionalities accessible tAdminough a user-

friendly interface. The utilization of Java Spring ensures scalability, security, and

reliability, while Thyme leaf facilitates dynamic and responsive web content

rendering.

This combination enables administrators to oversee employee records, track

attendance, assign tasks, and monitor progress with ease. Moreover, the EMS

incorporates advanced features such as automated notifications, customizable

reporting, and analytics tools, empowering organizations to make informed decisions

and enhance operational efficiency. With its robust architecture and flexible design,

the Employment Management System developed with Java Spring Framework and

Thyme leaf caters to the evolving needs of businesses across industries, facilitating

effective human resource management and fostering organizational growth.

Page |1
Certificate

I, Mr./Ms._______________________, Roll no. _______________________certify


that the Project Report/Dissertation entitled “______________________________” is
done by me and it is an authentic work carried out by me at
___________________(Name of the organization or the institute). The matter
embodied in this project work has not been submitted earlier for the award of any
degree or diploma to the best of my knowledge and belief.

Signature of the Student: -___________


Date: - ___________

Certified that the Project/Dissertation entitled “____________________” Done by


Mr./Ms. _________________________, Roll no.____________________________
is completed under my guidance.

Signature of the Guide: - _________


Date: - _________
Name of the Guide: -_________
Countersigned Designation: - _________
Address: -_________
Uttam Institute of Technology &
Management, Agra

Director/HOD

Page |2
ACKNOWLEDGEMENT

I have taken efforts in this project. However, it would not have been possible

without the kind support and help of my faculty members My team-members and my

friends Samagra and Prasant. I would like to extend my sincere thanks to all of them.

I am highly indebted to Mr. Aman Tyagi for their guidance and constant

supervision as well as for providing necessary information regarding the project

& also, for their support in completing the project. I am extremely thankful to him

for providing such a nice support and guidance, although he had busy schedule

managing the corporate affairs.

I would like to express my gratitude towards my parents & member of Uttam

Institute of Technology and Management, Agra for their kind co-operation and

encouragement which helps me in completion of this project.

I am thankful to and fortunate enough to get constant encouragement, support and

guidance from all Teaching staffs of Department of Computer Science which

helped us in successfully completing our project work.

Date: - ____________ Aditya Kumar

Agra Roll No. 2103925011005

Page |3
PROJECT SYNOPSIS
TITLE: -EMPLOYEE MANAGEMENT SYSTEM

1. Introduction:
The Employee Management System (EMS) is a software solution designed to
streamline and automate various aspects of employee management within an
organization. This system aims to enhance efficiency, accuracy, and transparency in
managing employee information, attendance, performance, and payroll processing. By
leveraging Java programming language along with Hibernate, Spring framework, and
PostgreSQL database, the EMS offers a robust and scalable solution for modern
businesses.

2. Objectives:
- Develop a comprehensive employee database to securely store and manage
employee information.
- Automate the process of recording employee attendance and tracking their working
hours.
- Implement performance evaluation modules for assessing employee performance
based on predefined metrics.
- Facilitate payroll processing by accurately calculating salaries, deductions, and
related aspects.
- Provide a user-friendly interface for administrators and employees to interact with
the system efficiently.

3. Methodology:
The Employee Management System will be developed using Java programming
language for backend logic. Spring Hibernate ORM will be utilized for seamless
interaction with the PostgreSQL database, ensuring efficient data management. Spring
framework will be employed for dependency injection, transaction management, and
other enterprise-level features, facilitating rapid development and maintenance. The
system will follow a modular architecture, allowing for scalability and easy
integration of additional functionalities.

4. Technologies Used:
Java: For backend logic and application development.
Hibernate: For object-relational mapping (ORM) to interact with the PostgreSQL
database.
Spring Framework: For dependency injection, transaction management, and
enterprise-level features and also include Spring Security .
PostgreSQL: As the backend database management system for secure and efficient
data storage.
FrontEnd: Html, CSS and ThymeLeaf for Server Side Scripting

5. Key Features:
User Authentication and Authorization: Secure login and role-based access control
to ensure data privacy and security.

Employee Information Management: Add, update, and delete employee profiles

Page |4
with details such as personal information, contact details, and employment history.

Attendance Tracking: Record and monitor employee attendance, including leave


requests and approvals.

Performance Evaluation: Evaluate employee performance based on predefined


metrics and generate performance reports.
Payroll Processing: Calculate salaries, deductions, taxes, and other payroll-related
aspects accurately.
Reporting and Analytics: Generate insightful reports on various aspects of employee
data, facilitating data-driven decision-making.
Notifications and Reminders: Send automated notifications and reminders for pending
tasks, meetings, and announcements.
Search and Filtering: Easily search and filter employee records based on criteria such
as department, job title, or location.

6. Scope:
The Employee Management System encompasses modules for employee information
management, attendance tracking, performance evaluation, payroll processing,
reporting, and notification mechanisms. It provides a comprehensive solution for
managing various ADMIN tasks efficiently.

7. Internal Guide:
The internal guide for the
Employee Management System project is : - AMAN TYAGI SIR

8. Expected Outcomes:
-Efficient management of employee data and attendance records.
- Objective assessment of employee performance, facilitating performance reviews
and feedback.
- Accurate payroll processing, ensuring compliance with regulatory requirements.
- Enhanced transparency, communication, and productivity within the organization.

9. Timeline:
The development of the Employee Management System is expected to be completed
till 20th April 2024, including requirements gathering, design, development, testing,
and deployment phases.

10. Conclusion:
The Employee Management System using Java, Spring, Hibernate, and PostgreSQL
offers a comprehensive solution for organizations to effectively manage their
workforce. By leveraging modern technologies and best practices, the system aims to
enhance efficiency, accuracy, and transparency in employee management processes,
ultimately contributing to organizational success.

This project synopsis outlines the key aspects of the Employee Management System,
highlighting its objectives, methodology, expected outcomes, and scope. By following
this roadmap, the development team can proceed with the implementation of the
system effectively

Page |5
List of Figure

Figures Page No.

Fig I: ER Diagram 27
Fig II: Zero Level Diagram (DFD) 37
Fig III: First Level Diagram (DFD) 38
Fig IV: Second Level Diagram (DFD) 39
Fig V: Login Page 44
Fig VI: Employee Dashboard 45
Fig VII: Apply Leave 46
Fig VIII: Admin Attendance Management 46
Fig IX: Admin Main Dashboard 47
Fig X: Attendance Marking Panel 47
Fig XI: Notification Panel 48
Fig XII: Admin Leave Management 48
Fig XIII: Add New Employee Form 49
Fig XIV: Update Employee Form 49
Fig XV: Admin Table 58
Fig XVI: Leave Table 58
Fig XVII: Attendance Table 59
Fig XVIII: Employee Table 59
Fig XIX: Notification Table 60

Page |6
TABLE OF CONTENTS

Contents

Abstract
Certificate
Acknowledgement
List of Figure
Table of Contents

Chapter 1: Introduction
1.1 Introduction to Project
1.2 Project Category
1.3 Objectives
1.4 Problem Formulation
1.5 Identification/Reorganization of Need
1.6 Existing System
1.7 Proposed System
1.8 Unique Feature of the System
Chapter 2: Requirement Analysis and System Specification
2.1 Feasibility Study
2.1.1 Technical Feasibility
2.1.2 Economic Feasibility
2.1.3 Operational Feasibility
2.2 Software Requirement
2.2.1 Data Requirement
2.2.2 Functional Requirement
2.2.3 Performance Requirement
2.2.4 Dependability Requirement
2.2.5 Maintainability Requirement
2.2.6 Look and Feel Requirement
2.3 System Specification and Security Measures for Running the Project
2.4 Validation
2.5 Expected hurdles

Page |7
2.6 SDLC model to be used
2.6.1 Selection of SDLC Model
2.6.2 Agile Methodology
2.6.3 Agile in Attire Guru Development
2.6.4 Benefits of Agile in Attire Guru
3 Chapter 3: System Design and Security Consideration
3.1 Design Patterns
3.2 Security Consideration
3.3 Integration with Third Party Systems
3.4 Database Design
3.4.1 ER Diagrams
Chapter 4: Implementation, Testing and maintenance
4.1 Introduction to Languages, IDE’s, Tools and Technologies used for
Implementation
4.2 Coding standards of Language used
4.3 Project Scheduling
4.4 Testing Techniques and Test Plans
4.4.1 Unit Testing
4.4.2 Integration Testing
4.4.3 Functional Testing
4.4.4 Usability Testing
4.4.5 Cross-Browser Testing
4.4.6 Basic Test Plan
4.5 Data Flow Diagrams (DFDs)
4.5.1 Zero Level Diagram
4.5.2 First Level Diagram
4.5.3 Second Level Diagram
Chapter 5: Results and Discussions
5.1 User Interface Representation
5.2 Snapshots of System with brief detail of each
5.3 Back Ends Representation
Chapter 6: Conclusion
6.1 Conclusion
6.2 Future Scope

Page |8
CHAPTER – 1
INTRODUCTION

1.1 Introduction To Project


In the contemporary business landscape, effective management of employees is

crucial for organizational success. The Employee Management System developed

using Java Spring Framework, PostgreSQL, Thymeleaf, HTML, and CSS addresses

this need by providing a comprehensive platform for managing employee-related

tasks. From onboarding new hires to tracking performance, this system streamlines

various aspects of ADMIN management. By leveraging cutting-edge technologies and

intuitive design principles, our system aims to revolutionize how businesses manage

their workforce.

1.2 Project Category


The project falls under the category of Human Resource Management Systems

(ADMINMS) and Employee Management Software. It encompasses functionalities

such as employee data management, attendance tracking, leave management,

performance evaluation, and payroll processing. Within this category, our system

aims to offer a seamless integration of various ADMIN processes to enhance

efficiency and productivity in organizations of all sizes.

Page |9
1.3 Objectives

Efficiency: Develop a system that automates routine ADMIN tasks, reducing manual

effort and minimizing errors.

Scalability: Design a solution that can scale with the organization's growth,

accommodating an increasing number of employees and evolving requirements.

User-Friendly Interface: Create an intuitive interface that is easy to navigate for

both administrators and employees, ensuring widespread adoption and minimal

training requirements.

Data Security: Implement robust security measures to safeguard sensitive employee

information and comply with data protection regulations.

Integration: Integrate seamlessly with existing systems and tools used by the

organization to facilitate smooth data exchange and workflow continuity.

1.4 Problem Formulation

The core challenge addressed by the Employee Management System is the inefficient

handling of employee-related tasks using manual or disjointed systems. Issues such as

data redundancy, lack of real-time updates, and difficulty in tracking employee

performance hinder organizational productivity. Additionally, disparate systems for

different ADMIN functions lead to siloed data and inefficiencies in information

sharing. The aim is to overcome these challenges by providing a unified platform that

centralizes employee data and automates key ADMIN processes.

P a g e | 10
1.5 Identification/Reorganization of Need
TAdminough stakeholder consultations and analysis of existing ADMIN processes,

we identified several areas that require improvement:

Employee Data Management: Simplify the process of storing, updating, and

accessing employee information.

Attendance and Leave Management: Streamline attendance tracking and automate

leave request approval workflows.

Performance Evaluation: Implement a system for setting goals, conducting

performance reviews, and providing feedback.

Payroll Processing: Automate payroll calculations, tax deductions, and salary

disbursements to ensure accuracy and timeliness.

1.6 Existing System


Currently, many organizations rely on manual methods or legacy software for

employee management, leading to inefficiencies and errors. These systems often lack

integration, resulting in data inconsistencies and redundant efforts. Moreover, they

may not offer modern features such as self-service portals or mobile accessibility,

limiting employee engagement and satisfaction.

1.7 Proposed System


The proposed Employee Management System will leverage Java Spring Framework,

PostgreSQL, Thymeleaf, HTML, and CSS to develop a modern and robust solution.

Key features include:

Centralized Employee Database: Store all employee information in a centralized

database for easy access and management.

Automated Workflows: Automate routine ADMIN processes such as attendance

P a g e | 11
tracking, leave management, and performance evaluation to save time and reduce

errors.

Self-Service Portals: Empower employees to update personal information, submit

leave requests, and access ADMIN policies and resources tAdminough self-service

portals.

Real-Time Reporting: Generate customizable reports on employee attendance,

performance metrics, and payroll data in real-time for informed decision-making.

Mobile Accessibility: Ensure accessibility across devices, allowing employees and

administrators to access the system anytime, anywhere.

1.8 Unique Feature of the System

Role-Based Access Control: Implement role-based access control to ensure data

security and restrict access to sensitive information based on user roles and

permissions.

Customizable Templates: Provide customizable templates for documents such as

offer letters, performance appraisals, and ADMIN policies to align with the

organization's branding and requirements.

Integration Capabilities: Enable seamless integration with other software systems

such as accounting software, CRM systems, and time tracking tools to facilitate data

exchange and streamline workflows.

Scalability: Design the system to scale effortlessly as the organization grows,

accommodating an increasing number of employees and expanding functionalities

without compromising performance.

Responsive Design: Develop a responsive user interface that adapts to different

screen sizes and devices, ensuring optimal user experience across desktops, tablets,

and smartphones.

P a g e | 12
CHAPTER – 2
Requirement Analysis and System Specification

2.1 Feasibility Study

A feasibility study is a crucial evaluation process that helps determine the viability

and practicality of a proposed project or system. It assesses various aspects to ensure

that the project aligns with the organization's objectives, resources, and constraints.

The feasibility study covers several key areas, including technical, economical,

operational, software, data, functional, performance, dependability, maintainability,

look and feel, validation, expected hurdles, and the selection of an appropriate SDLC

(Software Development Life Cycle) model.

2.1.1 Technical Feasibility

Technical feasibility examines whether the organization possesses the necessary

technical resources and expertise to develop and implement the proposed system

successfully. It involves evaluating the availability of hardware, software, network

infrastructure, and skilled personnel capable of working with the chosen technologies,

such as Java, Spring Framework, PostgreSQL, and web technologies (HTML, CSS,

JavaScript). Additionally, it assesses the compatibility of third-party libraries or

frameworks with the selected technology stack and the availability of development

tools and IDEs.

2.1.2 Economical Feasibility

Economical feasibility determines the financial viability of the project by conducting

a cost-benefit analysis. It involves estimating the development costs, implementation

expenses, and ongoing operational costs, including licensing fees (if applicable),

P a g e | 13
hosting expenses, hardware and software acquisition costs, and training expenses.

These costs are then compared against the potential benefits and savings, such as

increased efficiency, reduced administrative overhead, improved employee

productivity, and cost savings from automating manual processes. The analysis helps

calculate the return on investment (ROI) and assess whether the project is

economically feasible.

2.1.3 Operational Feasibility

Operational feasibility evaluates the organization's readiness and ability to support

and operate the proposed Employee Management System effectively. It considers

factors such as the availability of skilled personnel, training requirements for existing

staff, integration with existing systems or databases, and the impact on current

processes and workflows. Additionally, it assesses the availability of IT support staff

for system maintenance, troubleshooting, and the need for change management efforts

to facilitate a smooth transition.

2.2 Software Requirement

Software requirement determines whether the required software components,

including Java, Spring Framework, PostgreSQL, and web technologies, can be

developed or acquired within the project constraints. It involves evaluating the

availability of suitable software tools, frameworks, programming languages, and

development environments that meet the project's requirements. Additionally, it

assesses the compatibility of third-party libraries or frameworks with the chosen

technology stack and the availability of compatible development tools and IDEs.

P a g e | 14
2.2.1 Data Requirement

Data requirement involves identifying the data sources, data types, and data volumes

required for the Employee Management System. It includes assessing the data quality,

availability, and accessibility of employee information from existing databases,

ADMIN systems, or manual records. Additionally, it determines the data types and

formats required for storing employee details, such as personal information,

employment history, and payroll data, as well as evaluating data migration or

integration requirements from existing systems.

2.2.2 Functional Requirement

Data requirement involves identifying the data sources, data types, and data volumes

required for the Employee Management System. It includes assessing the data quality,

availability, and accessibility of employee information from existing databases,

ADMIN systems, or manual records. Additionally, it determines the data types and

formats required for storing employee details, such as personal information,

employment history, and payroll data, as well as evaluating data migration or

integration requirements from existing systems.

2.2.3 Performance Requirement

Performance requirements specify the expected performance levels of the Employee

Management System, such as response times, tAdminoughput, and resource

utilization. This includes defining the expected response times for various operations

(e.g., data retrieval, report generation, user interface interactions), determining the

anticipated user load and the system's ability to handle the expected concurrency, and

P a g e | 15
evaluating the need for caching mechanisms or performance optimization techniques.

2.2.4 Dependability Requirement

Dependability requirements assess the system's reliability, availability, and fault

tolerance requirements, as well as the necessary measures for data integrity, security,

and disaster recovery. For the Employee Management System, this involves assessing

the system's reliability and availability requirements, considering the critical nature of

employee data, determining necessary measures for data backup, recovery, and

disaster management, and ensuring compliance with relevant data protection and

security regulations (e.g., GDPR, HIPAA).

2.2.5 Maintainability Requirement

Maintainability requirements evaluate the ease of maintaining and updating the

Employee Management System over its lifecycle. It considers factors such as modular

design, documentation, and coding standards. This includes evaluating the modular

design and coding standards for ease of maintenance and future enhancements,

ensuring proper documentation and code comments for better understanding and

knowledge transfer, and assessing the availability of support and resources for future

upgrades and bug fixes.

2.2.6 Look and Feel Requirement

Look and feel requirements define the desired user interface (UI) and user experience

(UX) requirements, ensuring that the Employee Management System is intuitive,

P a g e | 16
user-friendly, and visually appealing. This involves defining the desired UI design,

including layout, color schemes, and branding elements, ensuring adherence to web

accessibility standards (e.g., WCAG) for users with disabilities, and considering

responsive design principles for optimal viewing across different devices and screen

sizes.

2.3 System Specification and Security Measures for Running the Project
Hardware Requirements:
• CPU: A multi-core processor with sufficient processing power to
handle incoming requests.
• RAM: Adequate RAM to support the application's memory
requirements, including caching and concurrent user sessions.
• Storage: Sufficient disk space for storing application files, databases,
and any necessary backups.
Operating System:
• The choice of operating system depends on the technologies being
used. Common choices include Linux distributions, Windows (e.g.,
Ubuntu, CentOS, Windows 7 or later) and Windows Server.
Web Server:
• Depending on the web application Spring framework being used you
may need a web server such as Apache HTTP Server or Nginx to
handle incoming HTTP requests and serve static files.
Database:
• If your web application requires a database (as in the case of the
Employee Management System with PostgreSQL), you'll need to
ensure compatibility with the chosen database management system
(DBMS) and allocate sufficient resources for its operation.
Networking:
• Sufficient bandwidth to handle incoming and outgoing network traffic,
especially during peak usage periods.

P a g e | 17
• Proper firewall configurations to protect the web application from
unauthorized access and potential security tAdmineats.
Software Dependencies:
• Ensure that the necessary software dependencies and libraries required
by your web application are installed and properly configured on the
server.
Security Measures:
• Implement appropriate security measures such as SSL/TLS encryption
for secure communication, regular software updates to patch known
vulnerabilities, and proper access controls to protect sensitive data.
Monitoring and Logging:
• Set up monitoring tools to track system performance, detect errors or
anomalies, and troubleshoot issues promptly.
• Configure logging mechanisms to record important events and user
actions for auditing and debugging purposes.
Backup and Disaster Recovery:
• Establish backup and disaster recovery procedures to protect against
data loss and ensure the availability of the web application in the
event of system failures or disasters

2.4 Validation

Validation outlines the methods and techniques for validating the Employee

Management System's functionality and performance, including defining the

acceptance criteria and testing strategies. This may involve outlining testing strategies

such as unit testing, integration testing, and user acceptance testing, defining test data

and test cases to validate the system's functionality and performance, and considering

involving end-users and stakeholders in the validation process.

P a g e | 18
2.5 Expected Hurdles

Expected hurdles identify potential risks, obstacles, and challenges that may arise

during the development and implementation of the Employee Management System.

This includes identifying potential hurdles such as data migration challenges,

integration issues with existing systems, user resistance to change, regulatory changes

or updates to the chosen technologies, and the need for data privacy and security

measures to protect sensitive employee information. Additionally, it involves

assessing the impact of these hurdles and developing mitigation strategies.

2.6 SDLC Model to Be Used

The SDLC (Software Development Life Cycle) model to be used refers to the

software development approach or methodology that will be followed for the

Employee Management System project. This may involve evaluating the suitability of

an Agile software development approach, such as Scrum or Kanban, for iterative

development and frequent feedback loops, or considering a hybrid approach

combining Agile and Waterfall methodologies for different project phases. The

chosen SDLC model should align with the organization's preferred development

practices and culture.

2.6.1 Selection of SDLC Model

The selection of the SDLC model is a crucial decision that impacts the entire

development process of the Employee Management System. One popular choice is

the Agile methodology, which emphasizes iterative and incremental development,

frequent feedback loops, and continuous collaboration with stakeholders

P a g e | 19
2.6.2 Agile Methodology

The Agile methodology is a flexible and adaptive approach to software development

that promotes rapid delivery of working software, frequent collaboration, and the

ability to respond to changing requirements. It emphasizes self-organizing teams,

iterative planning, and continuous improvement tAdminough regular retrospectives

and adjustments.

2.6.3 Agile in Attire Guru Development

Adopting the Agile methodology for the development of the Employee Management

System can bring several benefits. It allows for iterative and incremental

development, where features are delivered in sprints or iterations, enabling early and

continuous feedback from stakeholders. This approach fosters collaboration and

communication among the development team, stakeholders, and end-users, ensuring

that the system meets their evolving needs.

2.6.4 Benefits of Agile in Attire Guru

By embracing Agile principles, the development of the Employee Management

System can benefit from increased flexibility, faster time-to-market, improved quality

tAdminough continuous testing and integration, and the ability to adapt to changing

requirements or market conditions. Additionally, Agile promotes transparency and

stakeholder involvement tAdminoughout the development process, fostering a shared

understanding and ownership of the project.

P a g e | 20
CHAPTER – 3
System Design and Security Consideration

3.1 Design Patterns


Design patterns are reusable solutions to commonly occurring problems in software

design. Incorporating appropriate design patterns can enhance the maintainability,

scalability, and flexibility of the Employee Management System. Some relevant

design patterns that could be applied include:

1. Model-View-Controller (MVC): Separating the application logic into tAdminee

interconnected components: the model (data management), the view (user interface),

and the controller (handling user input and updates).

2. Repository Pattern: Abstracting the data access layer and providing a clean

interface for interacting with the database, promoting code reusability and testability.

3. Singleton Pattern: Ensuring that a class has only one instance and providing a

global point of access to it, useful for managing shared resources or configuration

settings.

4. Observer Pattern: Implementing a publish-subscribe model, where objects

(observers) are notified when the state of another object (subject) changes, facilitating

event-driven programming.

5. Decorator Pattern: Allowing the dynamic addition of responsibilities or behaviors

to objects at runtime, promoting code extensibility and flexibility.

3.2 Security Consideration

Ensuring the security of the Employee Management System is crucial, as it handles

P a g e | 21
sensitive employee data. Security considerations should include:

1. Authentication and Authorization: Implementing robust mechanisms for user

authentication (e.g., username/password, multi-factor authentication) and role-based

access control to restrict unauthorized access.

2. Data Encryption: Encrypting sensitive data, such as personal information and

financial details, both at rest (in the database) and in transit (during communication),

using industry-standard encryption algorithms.

3. Input Validation: Validating and sanitizing user input to prevent injection attacks,

such as SQL injection and cross-site scripting (XSS).

4. Secure Communication: Enabling secure communication channels (e.g., HTTPS)

for data transmission and leveraging SSL/TLS protocols for encrypted data exchange.

5. Audit Logging: Maintaining detailed audit logs to track user activities, data

modifications, and system events for accountability and forensic analysis.

6. Regular Security Updates and Patching: Keeping the application, frameworks,

libraries, and underlying systems up-to-date with the latest security patches and

updates to mitigate known vulnerabilities.

3.3 Integration with Third Party System

The Employee Management System may need to integrate with other existing systems

within the organization, such as payroll systems, ADMIN information systems, or

identity management systems. Integration considerations include:

1. API Development: Exposing application programming interfaces (APIs) to

P a g e | 22
facilitate secure and controlled data exchange between the Employee Management

System and other systems.

2. Data Mapping and Transformation: Defining data mapping rules and

implementing data transformation logic to ensure compatibility between different data

formats and structures.

3. Authentication and Authorization: Implementing appropriate authentication and

authorization mechanisms for third-party system integration, such as API keys,

OAuth, or token-based authentication.

4. Error Handling and Logging: Implementing robust error handling and logging

mechanisms to track and troubleshoot integration issues effectively.

5. Monitoring and Alerting: Setting up monitoring and alerting systems to detect

and notify administrators of any integration failures or performance issues.

3.4 Database Design

The database design for the Employee Management System (EMS) is fundamental to

ensuring efficient data storage, retrieval, and management. The EMS database is

designed using PostgreSQL, a powerful open-source relational database management

system known for its robustness, scalability, and compliance with SQL standards. The

following sections detail the core concepts and tables involved in this database design.

Key Concepts:

Normalization: To minimize redundancy and dependency, the database is

normalized, typically up to the third normal form (3NF). This involves dividing larger

tables into smaller, related tables and defining relationships between them.

P a g e | 23
Relationships: The EMS database includes various relationships between entities,

such as one-to-one, one-to-many, and many-to-many. These relationships are

established using foreign keys and junction tables.

Indexes: Indexes are used to speed up the retrieval of data. Primary keys are

automatically indexed, and additional indexes can be created on frequently queried

columns to enhance performance.

Constraints: Constraints ensure data integrity and consistency. Primary keys, foreign

keys, unique constraints, and check constraints are used to enforce rules at the

database level.

Employee Table
create table employee
(
emp_id varchar(255) not null
primary key,
contact varchar(255),
department varchar(255),
designation varchar(255),
email varchar(255),
emp_pic oid,
first_name varchar(255),
last_name varchar(255),
password varchar(255),
dob varchar(255),
user_role varchar(255),
emp_detail_qr oid,
reporting_role varchar(255),
reporting_manager varchar(255),
salt_value varchar(255),
reporting_team_leader varchar(255)
);

alter table employee


owner to postgres;

Primary Key: emp_id uniquely identifies each employee.

P a g e | 24
Admin Table
create table admin
(
emp_id varchar(255) not null
primary key,
contact varchar(255),
dob varchar(255),
email varchar(255),
emp_detail_qr oid,
emp_pic oid,
first_name varchar(255),
last_name varchar(255),
password varchar(255),
salt_value varchar(255),
user_role varchar(255)
);

Primary Key: emp_id uniquely identifies each Admin.

Attendance Record Table


create table attendance
(
id bigint not null
primary key,
attendance_time varchar(255),
emp_id varchar(255),
month varchar(255),
status varchar(255),
week_day varchar(255),
user_role varchar(255)
);

Primary Key: id uniquely identifies each employee attendance record.

Leave Table
create table leave
(
leave_id bigint not null
primary key,
emp_id varchar(255),
end_date varchar(255),
leave_type varchar(255),
reason varchar(255),
start_date varchar(255),
status varchar(255),
leave_days bigint
);

Primary Key: leave_id uniquely identifies each employee leave record.

P a g e | 25
3.4.1 ER Diagram

Figure 1 ER Diagram

P a g e | 26
CHAPTER – 4
Implementation, Testing and maintenance

4.1 Introduction to Languages, IDEs, Tools, and Technologies used for


Implementation

Language & Technology: The development of an Employee Management System is

facilitated tAdminough several advanced programming languages, tools, and

technologies. Java is the primary language used due to its object-oriented features,

which facilitate modular, reusable code and make it suitable for the scalable and

reliable backend structure of the system. Spring Framework is leveraged to extend

Java abilities, providing tools to support database interactions, and application

lifecycle management, thereby simplifying many complex issues like transaction

management and security in applications

Database: PostgreSQL is chosen as the database system because of its open-source nature

and robust performance capabilities, including high volume transaction processing and

extensive indexing which are essential for managing large sets of employee data. On the front

end, Thymeleaf is used for rendering HTML in web applications, and it integrates well with

Spring, offering a server-side template engine that helps in building robust and flexible web

applications [citation:9]. HTML and CSS are foundational technologies used for creating and

styling the user interfaces, ensuring accessibility and responsiveness across different devices

IDE (Integrated Development Environment): IntelliJ IDEA serves as the integrated

development environment (IDE) which supports these technologies. It enhances developer

productivity tAdminough intelligent code completion, on-the-fly code analysis, and

refactoring tools

P a g e | 27
4.2 Coding standards of Language used
For Java development, adhering to coding standards is crucial to ensure that the code

remains clean, maintainable, and relatively free from bugs. This adherence helps in

fostering a collaborative development environment where multiple developers can

work on the same codebase efficiently. Here are some of the best practices and tools

used to maintain high coding standards in the development of the Employee

Management System (EMS):

Naming Conventions

Classes and Interfaces:

• Classes and interfaces should be named using PascalCase (e.g.,

EmployeeService, EmployeRepository). This helps in quickly identifying

types and their roles within the application.

Methods and Variables:

• Methods and variables should be named using camelCase (e.g.,

saveEmployee, getEmployee). Method names should typically be verbs or

verb pAdminases to indicate actions (e.g., saveEmployeeData,

getEmployeeDetails).

Constants:

• Constants should be named using uppercase letters with words separated by

underscores (e.g., MAX_SALARY, MIN_AGE_REQUIREMENT).

Error Handling

Proper error handling is critical to building a robust Java application. Following are

the best practices:

Use Checked Exceptions for Recoverable Conditions:

• Use checked exceptions for conditions from which the application might

recover (e.g., IOException, SQLException).

P a g e | 28
Use Unchecked Exceptions for Programming Errors:

• Use unchecked exceptions (subclasses of RuntimeException) for programming

errors such as NullPointerException or IllegalArgumentException.

Always Log Exceptions:

• Ensure that all exceptions are logged. This can be done using a logging

framework like SLF4J with Logback or Log4j.

Provide Meaningful Messages:

• Include meaningful messages when tAdminowing exceptions to help with

debugging (e.g., tAdminow new IllegalArgumentException("Employee ID

cannot be null")).

Avoidance of Complex Constructions

Complex constructions can impede readability and maintainability. The following

practices help in keeping the code simple and understandable:

Keep Methods Small and Focused:

• Each method should perform a single task or logical unit of work. If a method

exceeds 20-30 lines, consider refactoring it into smaller methods.

Limit Nested Loops and Conditionals:

• Deeply nested loops and conditionals should be avoided as they make the code

difficult to read and understand. Use early returns and guard clauses to reduce

nesting.

Prefer Composition over Inheritance:

• Composition is often more flexible than inheritance. Use composition to

delegate tasks to other classes rather than creating complex inheritance

hierarchies.

P a g e | 29
Tool Support in IntelliJ IDEA

IntelliJ IDEA provides excellent support for maintaining high coding standards

tAdminough various integrated tools:

Code Style Settings:

• IntelliJ IDEA allows configuring code style settings that automatically format

the code according to predefined standards. This includes indentation, braces

placement, and spaces around operators.

Inspections and Analysis:

• The IDE includes built-in inspections that analyse the code for potential issues

such as code smells, performance bottlenecks, and incorrect usage patterns.

These inspections provide real-time feedback and suggestions for

improvement.

Code Coverage:

• IntelliJ IDEA supports code coverage tools that help in identifying untested

parts of the codebase. This is essential for ensuring that the unit tests cover all

critical paths.

Refactoring Tools:

• The refactoring tools in IntelliJ IDEA simplify the process of renaming

classes, methods, and variables, extracting methods, and restructuring code.

This helps in maintaining a clean and organized codebase.

Integration with Version Control:

• IntelliJ IDEA integrates seamlessly with version control systems like Git,

providing tools for code reviews, merge conflict resolution, and branch

management. This ensures that the codebase remains consistent and changes

are tracked properly.

P a g e | 30
4.3 Project Scheduling

Effective project scheduling is crucial for the timely and successful delivery of any

software development project, including the Employee Management System (EMS).

Proper scheduling helps in managing resources efficiently, tracking progress,

mitigating risks, and ensuring that the project meets its deadlines and objectives. In

the context of modern software development, Agile methodologies are widely adopted

to facilitate flexibility and responsiveness to changing requirements.

Agile Methodologies

Agile methodologies, such as Scrum or Kanban, emphasize iterative development,

continuous feedback, and collaboration. These methodologies break down the project

into smaller, manageable units called sprints, typically lasting two to four weeks. Each

sprint focuses on delivering a potentially shippable increment of the product, ensuring

continuous progress and adaptation to user feedback.

Key Components of Agile Methodologies:

1. Sprints: Short, time-boxed periods during which specific work has to be completed

and made ready for review. Each sprint begins with a planning meeting to define the

sprint goals and ends with a review meeting to assess the work done and gather

feedback.

2. Daily Stand-ups: Brief daily meetings where team members discuss what they did

yesterday, what they plan to do today, and any blockers they are facing. This keeps

everyone informed and aligned.

3. Sprint Reviews and Retrospectives: At the end of each sprint, a review meeting is

held to demonstrate the work completed and gather feedback from stakeholders. A

retrospective meeting follows to reflect on the sprint and discuss what went well, what

didn’t, and how processes can be improved.

P a g e | 31
Tools and Integration

To support Agile project management, various tools are used for tracking and

collaboration. One of the most popular tools in the Agile community is JIRA.

JIRA:

• Task and Issue Tracking: JIRA allows teams to create, assign, and track tasks and

issues tAdminoughout the project lifecycle. This ensures that all work items are

accounted for and progress is visible to all stakeholders.

• Sprint Planning and Management: JIRA’s Agile boards (Scrum or Kanban) help in

planning sprints, organizing tasks, and managing the workflow. Teams can easily drag

and drop tasks to reflect their status.

• Burndown Charts: These charts provide a visual representation of the work

remaining in a sprint, helping teams to monitor progress and predict whether they will

complete their work on time.

Integration with IntelliJ IDEA:

• Seamless Workflow: IntelliJ IDEA integrates with JIRA, providing developers with

direct access to JIRA tasks from within the IDE. This integration allows developers to

link commits to JIRA issues, update task statuses, and view task details without

leaving the development environment.

• Time Tracking: Developers can log their work hours directly from IntelliJ IDEA,

ensuring accurate time tracking and reporting in JIRA.

• Notifications and Alerts: The integration ensures that developers receive

notifications about changes in JIRA tasks, such as new assignments, comments, or

status updates, keeping them informed and responsive.

Project Scheduling Process

1. Define Project Scope and Objectives: Clearly outline the goals, deliverables, and

P a g e | 32
constraints of the project. This involves collaborating with stakeholders to understand

their requirements and expectations.

2. Break Down the Work: Decompose the project into smaller tasks and subtasks. Each

task should be specific, measurable, and achievable within a sprint.

3. Establish Timelines: Determine the duration of each sprint and create a project

timeline that maps out all sprints and key milestones.

4. Assign Responsibilities: Allocate tasks to team members based on their skills and

availability. Ensure a balanced workload to avoid burnout and maximize productivity.

5. Monitor and Adjust: Continuously monitor the progress of the project using JIRA

and Agile boards. Adjust the plan as necessary based on feedback, changes in

requirements, or unforeseen challenges.

Benefits of Effective Project Scheduling

• Improved Resource Management: By planning and allocating resources effectively,

teams can ensure that they are utilized efficiently tAdminoughout the project.

• Enhanced Communication and Collaboration: Regular meetings and transparent

tracking tools foster better communication and collaboration among team members

and stakeholders.

• Flexibility and Adaptability: Agile methodologies allow teams to respond quickly to

changes in requirements or priorities, ensuring that the final product aligns with user

needs.

• Increased Visibility: Tools like JIRA provide real-time visibility into the project’s

progress, helping stakeholders stay informed and engaged.

P a g e | 33
4.4 Testing Techniques and Test Plans

4.4.1 Unit Testing

Definition and Purpose: Unit testing focuses on testing individual components or

units of code to ensure they function correctly in isolation. Tools: JUnit, integrated

with IntelliJ IDEA. Process:

1. Write Test Cases: Create specific test methods for the unit.

2. Run Tests: Execute tests within the IDE.

3. Analyse Results: Identify and fix any issues based on test outcomes.

4.4.2 Integration Testing

Definition and Purpose: Integration testing evaluates the interactions between

different modules or services to ensure they work together as expected. Tools:

Mockito, Spring Boot testing facilities. Process:

1. Set Up Environment: Mimic the production setup.

2. Create Test Scenarios: Develop test cases for component interactions.

3. Execute Tests: Run the integration tests.

4. Validate Results: Ensure components interact correctly.

4.4.3 Functional Testing

Definition and Purpose: Functional testing ensures that the system operates according

to specified requirements by testing the application's features and functionalities from

the user's perspective. Tools: Selenium. Process:

1. Identify Test Cases: Outline scenarios based on requirements.

2. Automate Test Cases: Use Selenium to automate these scenarios.

3. Run Tests: Execute automated tests.

4. Review Outcomes: Verify the application meets functional requirements.

4.4.4 Usability Testing

P a g e | 34
Definition and Purpose: Usability testing assesses how user-friendly and intuitive the

application is by gathering feedback from real users. Process:

1. Define Objectives: Determine usability aspects to test.

2. Select Participants: Choose a diverse user group.

3. Conduct Testing Sessions: Observe user interactions.

4. Gather Feedback: Collect qualitative feedback.

5. Analyse and Improve: Refine the user interface based on insights.

4.4.5 Cross-Browser Testing

Definition and Purpose: Cross-browser testing ensures the application functions

correctly across different web browsers and platforms. Tools: Browser Stack. Process:

1. Define Test Cases: Identify critical functionalities to test.

2. Set Up BrowserStack: Configure tests for various browsers.

3. Execute Tests: Run tests across different browsers.

4. Analyse Results: Identify and fix browser-specific issues.

4.4.6 Basic Test Plan

The basic test plan outlines how testing should be approached, documenting the

scope, resources, responsibilities, and schedule of testing activities. It describes the

specifics of each testing stage, requirements for passing each stage, and detailed steps

for executing tests. This structured approach helps in thorough verification of the

software and ensures a high-quality end product.

This detailed description highlights the comprehensive strategy in managing the

development and testing of an Employee Management System by leveraging

appropriate tools and technologies, ensuring a well-rounded and robust application.

P a g e | 35
4.5 Data Flow Diagrams (DFDs)

4.5.1 Zero Level Diagram

Figure 2 0 Level Diagram(DFD)

P a g e | 36
4.5.2 First Level Diagram

Figure 3 First Level Diagram(DFD)

P a g e | 37
4.5.3 Second Level Diagram

Figure 4 Second Level Diagram (DFD)

P a g e | 38
CHAPTER – 5

Results And Discussions

5.1 User Interface Representation

Designing the user interface (UI) for the Employee Management System (EMS)

involves creating an intuitive and user-friendly experience for all users, including

ADMIN managers, employees, and administrators. The UI should facilitate easy

navigation, efficient data entry, and quick access to essential features. Below is a

detailed description of the key UI components for the EMS:

1. Login Page

The login page is the entry point for all users. It should have fields for username and

password, and options for different user roles (Employee, Team Leader Manager,

Admin).

• Elements:

• Username and Password fields

• Login button

• Forgot Password link

• Role selection dropdown (if needed)

2. Dashboard

After logging in, users are directed to the dashboard. The dashboard displays relevant

information and quick links based on the user's role.

• Admin Dashboard:

• Quick links to Employee Management, Department Management,

Attendance, and Payroll sections

• Notifications about pending tasks, approvals, and alerts

P a g e | 39
• Summary statistics (e.g., number of employees, department

distribution, attendance summary)

• Employee Dashboard:

• Quick access to personal information, attendance records, and payroll

details

• Notifications about upcoming events, deadlines, and announcements

• Manager Dashboard:

• Quick links to system settings, user role management, and audit logs

• Summary of system usage and performance metrics

3. Employee Management Page

Admin managers can add, update, delete, and view employee information here.

• Elements:

• Search bar to find employees

• List of employees with options to view, edit, or delete

• Add Employee button

• Employee details form (Name, Address, Contact, Department, Role,

etc.)

• Save and Cancel buttons

4. Department Management Page

This page allows managing departments and roles.

• Elements:

• List of departments with options to add, edit, or delete

• Department details form (Department Name, Description)

• List of roles within each department with options to add, edit, or delete

• Save and Cancel buttons

P a g e | 40
5. Attendance Management Page

This page helps in tracking and managing employee attendance.

• Elements:

• Calendar view showing attendance records

• Filter options (by date, employee, department)

• Mark Attendance button

• Attendance reports generation

7. Settings Page

Administrators manage system settings, user roles, and configurations.

• Elements:

• User role management (Add, edit, delete roles)

• System configuration settings (Email settings, notification settings,

etc.)

• Audit logs for tracking system changes

8. Profile Page

Employees can view and update their personal information.

• Elements:

• Personal details form (Name, Address, Contact, Emergency Contact,

etc.)

• Change Password option

• Save and Cancel buttons

9. Notifications and Alerts

A unified section where users can view system notifications and alerts.

• Elements:

P a g e | 41
• List of notifications with timestamps

• Clear All or Mark as Read options

• Notification settings

User Interface Design Principles

To ensure the UI is effective and user-friendly, the following design principles should

be adhered to:

1. Simplicity: Keep the interface simple and uncluttered. Each page should focus

on a primary task or set of related tasks.

2. Consistency: Use consistent layouts, colors, and fonts tAdminoughout the

application. This helps users learn the system faster and reduces confusion.

3. Feedback: Provide immediate feedback for user actions, such as form

submissions or data updates, to confirm successful operations or highlight

errors.

4. Accessibility: Ensure the application is accessible to all users, including those

with disabilities. This involves using appropriate HTML tags, ensuring

sufficient colour contrast, and providing keyboard navigation.

5. Responsiveness: Design the UI to be responsive, ensuring it works well on

various devices, including desktops, tablets, and smartphones.

6. Usability Testing: Regularly conduct usability testing with real users to

gather feedback and make necessary adjustments to improve the user

experience.

P a g e | 42
5.2 Snapshots of System with brief detail of each

Figure 5 Login Page

Login Page: This is the entry page or homepage the Employee Management
System. By this page Employe, Team Leader, Manager and Admin can login.

The Entity required their Employee/Admin Code and Password for the login
After that an OTP is sent to the Entities registered mail. After the successful
authentication entities is Login.

P a g e | 43
Figure 6 Employee Dashboard

Employee Dashboard: This is the Employee Dashboard in this Employee can check

their personal information and their stats.

By this dashboard Employee check their attendance and apply Leave and also update

their password.

Left Sidebar

• Main Dashboard: Link to the main dashboard.

• Apply Leave: Option to apply for leave.

• Check Attendance: Option to check attendance records.

• Calendar: Access to a calendar.

Additional Elements

• Notifications: A button in the bottom right corner labeled "Open Notifications" for
viewing notifications.

P a g e | 44
Figure 7 Apply Leave

Apply Leave: This is the Employee Apply Leave Panel by this employee can apply

leave and also check their previous leave history.

Figure 8 Admin Attendance Management

Employee Attendance: This is the Admin Panel in which Admin and other access

granted entities check and modify the attendance of the Employees.

P a g e | 45
Figure 9 Admin Main Dashboard

LAdmin Main Dashboard: This is the main dashboard of Admin by this Admin can

check the all Employees and Add new employee delete and also modify the details of

employee.

Figure 10 Attendance Marking Panel

Attendance Marking Panel: This is the attendance marking panel by this employee

mark their attendance by showing their id card to the camera.

P a g e | 46
Figure 11 Notification Panel

Employee Notification Panel: This is the Notification panel of Employee Where all

the notification is shown

Figure 12 Admin Leave Management

Admin Leave Management: In this dashboard all the incoming leave request of all

the employees, team leader and manager shown.

P a g e | 47
Figure 13 Add New Employee Form

Add New Employee Form: Admin used this form to register new Employees to the

Panel.

Figure 14 Update Employee Form

Update Employee Form: This form used by admin to update the employee details.

5.3 Backend Representation

P a g e | 48
Login Controller

package com.project.ems.controller;

import com.project.ems.model.Admin;
import com.project.ems.model.Employee;
import com.project.ems.service.EmployeeService;
import com.project.ems.service.LoginService;

import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.actuate.autoconfigure.observation.Obs
ervationProperties;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Enumeration;
import java.util.Objects;

@Controller
public class LoginController {
@Autowired
private HttpSession session;

private LoginService loginService;


private EmployeeService employeeService;
@Autowired
public LoginController(LoginService
loginService,EmployeeService employeeService) {
this.loginService = loginService;
this.employeeService=employeeService;
}

@GetMapping("/ems/login")
public String getLoginPage(){
return "login1";
}
@PostMapping("/ems/loginPage")
public String loginPage(@RequestParam("empId")String
empId, @RequestParam("password")String password, Model model){
String userRole=
loginService.validateUser(empId,password);
if(userRole==null){
return "redirect:/ems/login?fail";
}

P a g e | 49
return
"redirect:/ems/login/validate/"+empId+"/"+userRole;
//return
"redirect:/ems/employee/dashboard/"+userRole+"/"+empId;

@GetMapping("/ems/login/validate/{empId}/{userRole}")
public String validateOtp(@PathVariable("empId")String
empId,@PathVariable("userRole")String userRole, Model model)
{
if(Objects.equals(userRole, "admin")) {
Admin admin = employeeService.findAdmin(empId);
String genV =
loginService.sendMail(admin.getEmail());
model.addAttribute("empId", empId);
model.addAttribute("userRole", userRole);
model.addAttribute("genV",genV);
return "enterOTp";
}
else {
Employee employee =
employeeService.findEmployee(empId);

String genV =
loginService.sendMail(employee.getEmail());
model.addAttribute("empId", empId);
model.addAttribute("userRole", userRole);
model.addAttribute("genV", genV);
return "enterOTp";
}
}

@PostMapping("/ems/login/validate/{userRole}/{empId}")
public String validateOtp(@RequestParam("genV")String
genV,@RequestParam("otp")String
otp,@PathVariable("empId")String
empId,@PathVariable("userRole")String userRole){
if(genV.equals(otp))
{
if(userRole.equals("employee")){
session.setAttribute("user",userRole);

return"redirect:/ems/dashboard/employee/"+empId;
}
if(userRole.equals("admin")){
session.setAttribute("user",userRole);
return "redirect:/ems/dashboard/admin/"+empId;
}
if(userRole.equals("teamLeader")){
session.setAttribute("user",userRole);
return
"redirect:/ems/dashboard/teamLeader/"+empId;
}
if(userRole.equals("manager")){

P a g e | 50
System.out.println(userRole);
session.setAttribute("user",userRole);
return
"redirect:/ems/dashboard/manager/"+empId;
}
}
return
"redirect:/ems/login/validate/"+empId+"/"+userRole+"?fail";
}
@GetMapping("/ems/error")
public String errorPage(){
return "errorPage";
}
@GetMapping("/ems/logout")
public String logout(){
session.invalidate();
return "redirect:/ems/login";
}

@GetMapping("/ems/login/admin")
public String adminLogin(){
return "login";
}
@PostMapping("/ems/login/admin")
public String adminLogin(@RequestParam("empId")String
empId, @RequestParam("password")String password, Model model){
String userRole=
loginService.validateAdmin(empId,password);
if(userRole==null){
return "redirect:/ems/login/admin?fail";
}
return
"redirect:/ems/login/validate/"+empId+"/"+userRole;
//return
"redirect:/ems/employee/dashboard/"+userRole+"/"+empId;

}
}

Employee Controller:

package com.project.ems.controller;

import com.project.ems.extras.News;
import com.project.ems.model.Admin;
import com.project.ems.model.Employee;
import com.project.ems.model.Leave;
import com.project.ems.model.Notification;
import com.project.ems.repository.AttendanceRepository;
import com.project.ems.service.*;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

P a g e | 51
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.text.DecimalFormat;
import java.util.List;
import java.util.Objects;

@Controller
public class EmployeeController {

private EmployeeService employeeService;


private NotificationService notificationService;
private LeaveService leaveService;
private AttendanceService attendanceService;
@Autowired
HttpSession session;
private static final DecimalFormat df = new
DecimalFormat("0.00");
@Autowired
public EmployeeController(EmployeeService
employeeService,LeaveService leaveService,NotificationService
notificationService, AttendanceService attendanceService) {
this.employeeService = employeeService;
this.leaveService= leaveService;
this.notificationService=notificationService;
this.attendanceService=attendanceService;
}
@GetMapping("/ems/addEmployee/employeeForm/{roleId}")
public String showAddEmployeeForm(@PathVariable("roleId")String
roleId, Model model){
Employee employee = new Employee();
model.addAttribute("employee",employee);
model.addAttribute("empId",roleId);
return "add-employeeForm";
}
@PostMapping("/ems/addEmployee/save/{roleId}")
public String saveEmployee(@ModelAttribute("employee")Employee
employee, @PathVariable("roleId")String roleId, Model model){
String empId=employeeService.saveEmployee(employee);
model.addAttribute("empId",empId);
model.addAttribute("roleId",roleId);
model.addAttribute("userRole",employee.getUserRole());
return "upload-employeePic";
}
@PostMapping("/ems/employee/uploadImage/{roleId}")
public String saveEmployeeImage(@RequestParam("imageFile")
MultipartFile imageFile,@PathVariable("roleId")String roleId,
@RequestParam("empId")String empId, @RequestParam("userRole")String
userRole){
try {

employeeService.saveEmployeeImage(imageFile,empId,userRole);
} catch (Exception e) {
throw new RuntimeException(e);
}

return"redirect:/ems/dashboard/admin/allEmployees/"+roleId;
}
@GetMapping("/ems/editImage/{empId}/{roleId}")
public String updateImageForm(@PathVariable("empId")String
empId,@PathVariable("roleId")String roleId, Model model){

P a g e | 52
model.addAttribute("empId",empId);
model.addAttribute("roleId",roleId);
return "upload-employeePic";
}
@GetMapping("/ems/updateEmployee/employeeForm/{empId}/{roleId}")
public String showUpdateEmployeeForm(@PathVariable("empId")String
empId,@PathVariable("roleId")String roleId ,Model model){
Employee employee = employeeService.getEmployee(empId);
model.addAttribute("employee",employee);
model.addAttribute("roleId",roleId);
return "update-employeeForm";
}
@PostMapping("/ems/updateEmployee/update/{empId}/{roleId}")
public String UpdateEmployee(@ModelAttribute("employee")Employee
employee,@PathVariable("roleId")String
roleId,@PathVariable("empId")String empId,Model model){
String
userRole=employeeService.updateEmployee(employee,empId);
return "redirect:/ems/dashboard/admin/allEmployees/"+roleId;
}
@GetMapping("/ems/deleteEmployee/{empId}/{roleId}")
public String deleteEmployee(@PathVariable("empId")String
empId,@PathVariable("roleId")String roleId, Model model){
employeeService.deleteEmployee(empId);
return"redirect:/ems/dashboard/admin/allEmployees/"+roleId;
}
@GetMapping("/ems/searchEmployees")
public String searchEmployee(@RequestParam(value="query")String
query, Model model){
List <Employee> employee =
employeeService.searchEmployee(query);
model.addAttribute("employee",employee);
return "allEmployees";
}
@GetMapping("/ems/dashboard/admin/{empId}")
public String showAdminDashboard(@PathVariable("empId")String
empId, Model model){
Double attendance=attendanceService.getAttendance(empId);
Long totalEmployees=employeeService.getTotalEmployee();
String userRole = (String) session.getAttribute("user");
if(userRole=="null") {
return "redirect:/ems/error";
}
else if(Objects.equals(userRole, "admin")){
System.out.println(userRole);
Admin admin = employeeService.findAdmin(empId);
model.addAttribute("roleId", empId);
model.addAttribute("attendance",df.format(attendance));
model.addAttribute("employee", admin);
model.addAttribute("totalEmployees",totalEmployees);
return "AdminDashboard";
}
else
return "redirect:/ems/error";

}
@GetMapping("/ems/dashboard/employee/{empId}")
public String showEmployeeDashboard(@PathVariable("empId")String
empId, Model model){
Double attendance=attendanceService.getAttendance(empId);

P a g e | 53
List<Notification>notifications=notificationService.getNotification(e
mpId);
String userRole = (String) session.getAttribute("user");
if(userRole=="null") {
return "redirect:/ems/error";
}
else if(Objects.equals(userRole, "employee")){
System.out.println(userRole);
Employee employee = employeeService.getEmployee(empId);
model.addAttribute("empId", empId);
model.addAttribute("employee", employee);
model.addAttribute("notification",notifications);
model.addAttribute("attendance",df.format(attendance));
return "EmployeeDashboard";
}
else
return "redirect:/ems/error";

}
@GetMapping("/ems/dashboard/manager/{empId}")
public String showManagerDashboard(@PathVariable("empId")String
empId, Model model){
Double attendance=attendanceService.getAttendance(empId);

List<Notification>notifications=notificationService.getNotification(e
mpId);
String userRole = (String) session.getAttribute("user");
System.out.println(userRole);
if(userRole=="null") {

return "redirect:/ems/error";
}
else if(Objects.equals(userRole, "manager")){
System.out.println(userRole);
Employee employee = employeeService.getEmployee(empId);
model.addAttribute("empId", empId);
model.addAttribute("notification",notifications);
model.addAttribute("attendance",df.format(attendance));
model.addAttribute("employee", employee);
return "ManagerDashboard";
}
else
return "redirect:/ems/error";

}
@GetMapping("/ems/dashboard/teamLeader/{empId}")
public String
showTeamLeaderDashboard(@PathVariable("empId")String empId, Model
model){
Double attendance=attendanceService.getAttendance(empId);

List<Notification>notifications=notificationService.getNotification(e
mpId);
String userRole = (String) session.getAttribute("user");
System.out.println(userRole);
if(userRole=="null") {

return "redirect:/ems/error";
}
else if(Objects.equals(userRole, "teamLeader")){
System.out.println(userRole);

P a g e | 54
Employee employee = employeeService.getEmployee(empId);
model.addAttribute("empId", empId);
model.addAttribute("notification",notifications);
model.addAttribute("attendance",df.format(attendance));
model.addAttribute("employee", employee);
return "TeamLeaderDashboard";
}
else
return "redirect:/ems/error";

}
@PostMapping("/ems/employee/updatePassword/{empId}")
public String UpdatePassWord(@PathVariable("empId")String
empId,@RequestParam("pass")String
pass,@RequestParam("confirmPass")String confirmPass, Model model){
String
status=employeeService.updateEmployeePass(empId,pass,confirmPass);
return
"redirect:/ems/employee/dashboard/user/"+empId+"?"+status;
}
@PostMapping("/ems/admin/updatePassword/{empId}")
public String UpdateAdminPassWord(@PathVariable("empId")String
empId,@RequestParam("pass")String
pass,@RequestParam("confirmPass")String confirmPass, Model model){
String
status=employeeService.updateAdminPass(empId,pass,confirmPass);
return "redirect:/ems/dashboard/admin/"+empId+"?"+status;
}

@GetMapping("/ems/employee/applyLeave/{empId}")
public String applyLeaveFormEmployee(@PathVariable("empId")String
empId, Model model){
List<Leave> leave = leaveService.findHistory(empId);

List<Notification>notifications=notificationService.getNotification(e
mpId);
Leave leave1= new Leave();
leave1.setEmpId(empId);
model.addAttribute("leave",leave);
model.addAttribute("empId",empId);
model.addAttribute("notification",notifications);
model.addAttribute("leave1",leave1);
return "employLeaveForm";
}
@GetMapping("/ems/manager/applyLeave/{empId}")
public String applyLeaveFormManager(@PathVariable("empId")String
empId, Model model){
List<Leave> leave = leaveService.findHistory(empId);

List<Notification>notifications=notificationService.getNotification(e
mpId);
Leave leave1= new Leave();
leave1.setEmpId(empId);
model.addAttribute("leave",leave);
model.addAttribute("notification",notifications);
model.addAttribute("empId",empId);
model.addAttribute("leave1",leave1);
return "managerLeaveForm";
}
@GetMapping("/ems/teamLeader/applyLeave/{empId}")
public String

P a g e | 55
applyLeaveFormTeamLeader(@PathVariable("empId")String empId, Model
model){
List<Leave> leave = leaveService.findHistory(empId);

List<Notification>notifications=notificationService.getNotification(e
mpId);
Leave leave1= new Leave();
leave1.setEmpId(empId);
model.addAttribute("leave",leave);
model.addAttribute("empId",empId);
model.addAttribute("notification",notifications);
model.addAttribute("leave1",leave1);
return "teamLeaderLeaveForm";
}
@PostMapping("/ems/employee/applyLeave/{empId}")
public String applyLeave(@PathVariable("empId")String empId,
@ModelAttribute("leave1")Leave leave1, Model model,
@RequestParam("leaveType")String
leaveType,@RequestParam("startDate")String
startDate,@RequestParam("endDate")String endDate,
@RequestParam("reason")String reason){
leave1.setReason(reason);
leave1.setEndDate(endDate);
leave1.setStatus("pending");
leave1.setEmpId(empId);
leave1.setStartDate(startDate);
leaveService.saveLeave(leave1);

return "redirect:/ems/employee/applyLeave/"+empId;
}
@PostMapping("/ems/manager/applyLeave/{empId}")
public String applyLeaveManager(@PathVariable("empId")String
empId, @ModelAttribute("leave1")Leave leave1, Model model,
@RequestParam("leaveType")String
leaveType,@RequestParam("startDate")String
startDate,@RequestParam("endDate")String endDate,
@RequestParam("reason")String reason){
leave1.setReason(reason);
leave1.setEndDate(endDate);
leave1.setStatus("pending");
leave1.setEmpId(empId);
leave1.setStartDate(startDate);
leaveService.saveLeave(leave1);

return "redirect:/ems/manager/applyLeave/"+empId;
}
@PostMapping("/ems/teamLeader/applyLeave/{empId}")
public String applyLeaveTeamLeader(@PathVariable("empId")String
empId, @ModelAttribute("leave1")Leave leave1, Model model,
@RequestParam("leaveType")String
leaveType,@RequestParam("startDate")String
startDate,@RequestParam("endDate")String endDate,
@RequestParam("reason")String reason){
leave1.setReason(reason);
leave1.setEndDate(endDate);
leave1.setStatus("pending");
leave1.setEmpId(empId);
leave1.setStartDate(startDate);
leaveService.saveLeave(leave1);
return "redirect:/ems/teamLeader/applyLeave/"+empId;

P a g e | 56
}
@GetMapping("/ems/employee/getNews")
public String getAllNews(Model model){
News news = new News();
List getNews = news.getNews();
model.addAttribute("news",getNews);
return "news";
}
}
Employee Model:

package com.project.ems.model;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Entity
public class Employee {

@Id
private String empId;
private String firstName;
private String lastName;
private String contact;
private String dob;
private String email;
private String userRole;
private String department;
private String designation;
private String password;
private String reportingRole;
private String reportingTeamLeader;
private String reportingManager;
private String saltValue;
@Lob
private String empPic;
@Lob
private String empDetailQr;
}

P a g e | 57
Snapshots of Database

Figure 15 Admin Table

Figure 16 Leave Table

P a g e | 58
Figure 17 Attendance Table

Figure 18 Employee Table

P a g e | 59
Figure 19 Notification Table

P a g e | 60
CHAPTER – 6

Conclusion and Future Scope

6.1 Conclusion

Developing an Employee Management System (EMS) using Java, the Spring

Framework, PostgreSQL, Thymeleaf, HTML, and CSS in IntelliJ IDEA provides a

robust foundation for managing employee data and enhancing organizational

efficiency. The system can streamline various HR processes, from employee

onboarding and performance tracking to leave management and reporting.

As businesses grow and evolve, the EMS can be expanded with advanced features and

integrations, including sophisticated analytics, mobile applications, enhanced security

measures, and seamless integration with other enterprise systems. Future

enhancements such as AI-driven insights, comprehensive compliance modules, and

tools for global workforce management can further increase the system's value.

Ultimately, a well-designed EMS not only improves the efficiency of HR operations

but also contributes to higher employee satisfaction and engagement. By continually

adapting and incorporating new technologies and user feedback, the EMS can remain

a vital tool in supporting the dynamic needs of modern organizations.

6.2 Future Scope

Expanding the scope of the Employee Management System (EMS) can enhance its

functionality and adaptability to future needs. Here are several potential areas for

future development:

P a g e | 61
1. Advanced Analytics and Reporting

• Custom Reports: Develop functionality to generate custom reports based on

various parameters such as department, role, performance metrics, etc.

• Dashboard Enhancements: Implement more advanced data visualization

techniques and interactive dashboards to provide deeper insights into

employee performance and organizational metrics.

2. Mobile Application

• Responsive Design: Enhance the responsiveness of the web application for

better usability on mobile devices.

• Native Mobile Apps: Develop native mobile applications for iOS and

Android platforms to provide employees with on-the-go access to the system.

3. Enhanced Security Features

• Two-Factor Authentication (2FA): Implement two-factor authentication to

increase security for user logins.

• Audit Logging: Add detailed audit logging to track changes and access to

sensitive data, which can help in monitoring and securing the system.

4. Performance Management

• Goal Setting and Tracking: Implement features for setting, tracking, and

evaluating employee goals and objectives.

• 360-Degree Feedback: Develop a comprehensive performance evaluation

system that includes feedback from peers, subordinates, and supervisors.

P a g e | 62
5. Artificial Intelligence and Machine Learning

• Predictive Analytics: Use machine learning to predict employee turnover,

identify potential high performers, and assist in workforce planning.

• Chatbots: Implement AI-powered chatbots to assist employees with common

queries and provide instant support.

6. Compliance and Legal Modules

• Regulatory Compliance: Add features to ensure compliance with local,

national, and international labor laws and regulations.

• Document Management: Develop a module for managing and storing

compliance-related documents and employee records securely.

7. Globalization and Localization

• Multi-Language Support: Provide support for multiple languages to cater to

a global workforce.

• Timezone Management: Implement features to handle different time zones

for employees working in various regions.

8. Employee Engagement and Collaboration

• Social Features: Introduce social features like forums, groups, and activity

feeds to enhance employee engagement.

• Communication Tools: Integrate with communication tools like Slack,

Microsoft Teams, or internal messaging systems to streamline communication.

P a g e | 63

You might also like