Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Deep Dey
LaMartin-Webomagic
Commits
dbd9d124
Commit
dbd9d124
authored
Jul 16, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Initialize form interview See merge request
deepdey/lamartin-webomagic!2
parents
cb00966a
7cc22160
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
407 additions
and
24 deletions
+407
-24
lamartinBackend/pom.xml
lamartinBackend/pom.xml
+5
-0
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
...aMartin/admission/controller/AdmissionFormController.java
+89
-20
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/repository/AdmissionFormDataRepository.java
...admission/dao/repository/AdmissionFormDataRepository.java
+2
-1
lamartinBackend/src/main/java/com/example/LaMartin/admission/mapper/AdmissionFormPreviewMapper.java
...LaMartin/admission/mapper/AdmissionFormPreviewMapper.java
+30
-0
lamartinBackend/src/main/java/com/example/LaMartin/common/service/TemplateService.java
.../com/example/LaMartin/common/service/TemplateService.java
+17
-0
lamartinBackend/src/main/resources/templates/AdmissionConfimationFormListTemplate.html
...urces/templates/AdmissionConfimationFormListTemplate.html
+233
-0
lamartinDashboard/dashboard.html
lamartinDashboard/dashboard.html
+4
-1
lamartinFrontend/style.css
lamartinFrontend/style.css
+27
-2
No files found.
lamartinBackend/pom.xml
View file @
dbd9d124
...
...
@@ -153,6 +153,11 @@
<groupId>
javax.mail
</groupId>
<artifactId>
javax.mail-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
<version>
4.1.1
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
View file @
dbd9d124
...
...
@@ -17,11 +17,14 @@ import org.springframework.http.MediaType;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
...
...
@@ -197,6 +200,46 @@ public class AdmissionFormController {
IOUtils
.
copy
(
pdfStream
,
response
.
getOutputStream
());
}
@GetMapping
(
value
=
"/admission-confirmation-form/download-form"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"SUCCESS"
),
@ApiResponse
(
code
=
400
,
message
=
"FAILED"
),
@ApiResponse
(
code
=
500
,
message
=
"Exception Occurred"
)
})
@ApiOperation
(
value
=
""
)
public
void
downloadAdmissionConfirmationForm
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestParam
(
"apikey"
)
String
apiKey
,
@RequestParam
(
"formIds"
)
String
formIds
)
throws
Exception
{
// TODO: validation of api key using redis
List
<
Long
>
formIdList
=
Stream
.
of
(
formIds
.
split
(
","
))
.
map
(
Long:
:
valueOf
)
.
collect
(
Collectors
.
toList
());
if
(
formIdList
.
isEmpty
())
{
throw
new
Exception
(
"Provide formIds to download"
);
}
List
<
AdmissionFormData
>
admissionFormDataList
=
this
.
admissionFormDAOController
.
getAdmissionFormDataListByIds
(
formIdList
);
if
(
admissionFormDataList
.
isEmpty
())
{
throw
new
Exception
(
"No Admission Data Found"
);
}
String
output
=
templateService
.
generateAdmissionConfirmationFormListTemplate
(
admissionFormDataList
);
ByteArrayInputStream
pdfStream
=
pdfService
.
convertHtmlToPdf
(
output
);
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=admission-confirmation-form-list.pdf"
);
IOUtils
.
copy
(
pdfStream
,
response
.
getOutputStream
());
}
@GetMapping
(
value
=
"/admission-form/download-counsellor-scoring-template"
)
...
...
@@ -316,6 +359,38 @@ public class AdmissionFormController {
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=master-interaction-template.pdf"
);
IOUtils
.
copy
(
pdfStream
,
response
.
getOutputStream
());
}
public
byte
[]
convertAdmissionFormToExcel
(
List
<
AdmissionFormData
>
admissionFormDataList
)
throws
Exception
{
Workbook
workbook
=
new
HSSFWorkbook
();
Sheet
sheet
=
workbook
.
createSheet
(
"Admission Form Data"
);
Row
headerRow
=
sheet
.
createRow
(
0
);
headerRow
.
createCell
(
0
).
setCellValue
(
"SL. NO."
);
headerRow
.
createCell
(
1
).
setCellValue
(
"Reference Id"
);
headerRow
.
createCell
(
2
).
setCellValue
(
"Name"
);
headerRow
.
createCell
(
3
).
setCellValue
(
"Father's Name"
);
headerRow
.
createCell
(
4
).
setCellValue
(
"Interaction Time"
);
// Start data rows from second row
int
rowIndex
=
1
;
for
(
AdmissionFormData
admissionFormData
:
admissionFormDataList
)
{
Row
dataRow
=
sheet
.
createRow
(
rowIndex
++);
// Set data for each column based on AdmissionFormData fields
dataRow
.
createCell
(
0
).
setCellValue
(
admissionFormData
.
getId
());
dataRow
.
createCell
(
1
).
setCellValue
(
admissionFormData
.
getFatherEmail
());
dataRow
.
createCell
(
2
).
setCellValue
(
admissionFormData
.
getFullName
());
dataRow
.
createCell
(
3
).
setCellValue
(
admissionFormData
.
getFatherName
());
dataRow
.
createCell
(
4
).
setCellValue
(
admissionFormData
.
getInteractionTime
());
}
// Write the workbook to a byte array
ByteArrayOutputStream
out
=
new
ByteArrayOutputStream
();
workbook
.
write
(
out
);
return
out
.
toByteArray
();
}
@GetMapping
(
...
...
@@ -327,7 +402,7 @@ public class AdmissionFormController {
@ApiResponse
(
code
=
500
,
message
=
"Exception Occurred"
)
})
@ApiOperation
(
value
=
""
)
public
Object
downloadMasterInteractionExcel
(
public
void
downloadMasterInteractionExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestParam
(
"apikey"
)
String
apiKey
,
...
...
@@ -348,24 +423,18 @@ public class AdmissionFormController {
throw
new
Exception
(
"No Admission Data Found"
);
}
//TODO: write logic to download excel
return
new
ResponseEntity
<>(
new
GeneralResponse
(
true
,
AppConstants
.
RESPONSE_SUCCESS_STATUS_CODE
,
"Excel should be downloaded"
,
null
),
HttpStatus
.
OK
);
// Call the convertAdmissionFormToExcel method to get the Excel data as byte array
byte
[]
excelData
=
convertAdmissionFormToExcel
(
admissionFormDataList
);
// Set response content type as application/vnd.ms-excel
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
+
"; charset=UTF-8"
);
// Set a downloadable filename
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\"master-interaction-excel.xls\""
);
// Write the Excel data to the response output stream
response
.
getOutputStream
().
write
(
excelData
);
// String output = templateService
// .generateMasterInteractionTemplate(admissionFormDataList);
//
// ByteArrayInputStream pdfStream = pdfService.convertHtmlToPdf(output);
//
// response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
// response.setHeader("Content-Disposition", "attachment; filename=master-interaction-template.pdf");
// IOUtils.copy(pdfStream, response.getOutputStream());
}
@GetMapping
(
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/repository/AdmissionFormDataRepository.java
View file @
dbd9d124
...
...
@@ -2,6 +2,7 @@ package com.example.LaMartin.admission.dao.repository;
import
com.example.LaMartin.admission.mapper.AdmissionFormCountMapper
;
import
com.example.LaMartin.admission.mapper.AdmissionFormMapper
;
import
com.example.LaMartin.admission.mapper.AdmissionFormPreviewMapper
;
import
com.example.LaMartin.admission.model.AdmissionFormData
;
import
com.example.LaMartin.admission.pojo.AdmissionFormCount
;
import
lombok.AllArgsConstructor
;
...
...
@@ -199,7 +200,7 @@ public class AdmissionFormDataRepository {
parameters
.
addValue
(
"correspondenceEmail"
,
correspondenceEmail
);
}
return
namedParameterJdbcTemplate
.
query
(
sql
.
toString
(),
parameters
,
new
AdmissionFormMapper
());
.
query
(
sql
.
toString
(),
parameters
,
new
AdmissionForm
Preview
Mapper
());
}
public
List
<
AdmissionFormData
>
getAdmissionFormDataListByIds
(
List
<
Long
>
ids
)
{
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/mapper/AdmissionFormPreviewMapper.java
0 → 100644
View file @
dbd9d124
package
com
.
example
.
LaMartin
.
admission
.
mapper
;
import
com.example.LaMartin.admission.model.AdmissionFormData
;
import
com.example.LaMartin.common.utils.RowMapperUtil
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.jdbc.core.RowMapper
;
import
org.springframework.stereotype.Component
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
@Component
public
class
AdmissionFormPreviewMapper
implements
RowMapper
<
AdmissionFormData
>
{
@Override
public
AdmissionFormData
mapRow
(
@NotNull
ResultSet
rs
,
int
rowNum
)
throws
SQLException
{
AdmissionFormData
formData
=
new
AdmissionFormData
();
formData
.
setFullName
(
RowMapperUtil
.
getString
(
rs
,
"full_name"
));
formData
.
setFatherName
(
RowMapperUtil
.
getString
(
rs
,
"father_name"
));
formData
.
setFatherEmail
(
RowMapperUtil
.
getString
(
rs
,
"father_email"
));
formData
.
setMotherName
(
RowMapperUtil
.
getString
(
rs
,
"mother_name"
));
formData
.
setInteractionDate
(
RowMapperUtil
.
getString
(
rs
,
"interaction_date"
));
formData
.
setInteractionTime
(
RowMapperUtil
.
getString
(
rs
,
"interaction_time"
));
return
formData
;
}
}
lamartinBackend/src/main/java/com/example/LaMartin/common/service/TemplateService.java
View file @
dbd9d124
...
...
@@ -28,6 +28,23 @@ public class TemplateService {
return
templateEngine
.
process
(
"AdmissionFormListTemplate"
,
context
);
}
public
String
generateAdmissionConfirmationFormListTemplate
(
List
<
AdmissionFormData
>
admissionFormDataList
)
{
// for (AdmissionFormData admissionFormData: admissionFormDataList)
// {
// String originalDate = "2024-07-04";
// LocalDate date = LocalDate.parse(admissionFormData.getInteractionDate());
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
// admissionFormData.setInteractionDate(date.format(formatter));
// }
Context
context
=
new
Context
();
context
.
setVariable
(
"admissionFormList"
,
admissionFormDataList
);
context
.
setVariable
(
"serverPath"
,
settings
.
getStaticServerPath
());
return
templateEngine
.
process
(
"AdmissionConfimationFormListTemplate"
,
context
);
}
public
String
generateAdmissionInterviewTemplate
(
@NotNull
AdmissionFormData
admissionFormData
)
{
String
originalDate
=
"2024-07-04"
;
// Example date string
LocalDate
date
=
LocalDate
.
parse
(
admissionFormData
.
getInteractionDate
());
...
...
lamartinBackend/src/main/resources/templates/AdmissionConfimationFormListTemplate.html
0 → 100644
View file @
dbd9d124
<!DOCTYPE html>
<html
xmlns:th=
"http://www.thymeleaf.org"
lang=
"en"
>
<head>
<title>
Intimation for Admission
</title>
<style>
*
{
font-family
:
Arial
,
sans-serif
;
margin
:
0
;
padding
:
0
;
font-size
:
12px
;
}
body
{
margin
:
0px
20px
;
}
.header
,
.content
,
.footer
{
text-align
:
center
;
position
:
relative
;
width
:
100%
;
}
.content
{
text-align
:
justify
;
}
.left
,
.center
,
.right
{
display
:
inline-block
;
}
.left
{
position
:
absolute
;
left
:
0
;
}
.right
{
position
:
absolute
;
right
:
0
;
}
.middle
{
margin
:
0
auto
;
text-align
:
center
;
}
.header
img
{
height
:
80px
;
}
.content
{
margin-top
:
10px
;
}
.content
p
{
margin
:
5px
0
;
}
.content
b
{
font-weight
:
bold
;
}
.account-details
,
.fee-details
{
width
:
100%
;
margin-top
:
20px
;
border-collapse
:
collapse
;
}
.account-details
td
,
.fee-details
td
,
.fee-details
th
{
border
:
1px
solid
black
;
padding
:
5px
;
text-align
:
left
;
}
.fee-details
th
{
text-align
:
center
;
}
.signature
{
margin-top
:
40px
;
text-align
:
left
;
}
.signature
img
{
width
:
18%
;
height
:
18%
;
}
</style>
</head>
<body>
<div
class=
"container"
th:each=
"admissionForm : ${admissionFormList}"
>
<div
class=
"header"
>
<div
class=
"left"
>
<h4>
Supriyo Dhar, HRM, MBA, LLB
<br
/>
Secretary
</h4>
</div>
<div
class=
"center"
>
<img
th:src=
"@{${serverPath + 'static/la-martin-logo.png'}}"
alt=
"Logo"
height=
"80px"
/>
<!-- <img src="la-martin-logo copy.png" alt="Logo" height="80px" /> -->
</div>
<div
class=
"right"
>
<h2>
La Martiniere
</h2>
</div>
</div>
<div
class=
"content"
>
<div
class=
"left"
>
<p><b>
To,
</b><br
/>
<b
th:text=
"${admissionForm.fatherName}"
>
Pratik Shrivastava
</b>
</p>
</div>
<div
class=
"right"
>
<p><b
th:text=
"${admissionForm.interactionDate}"
>
17/07/2024
</b></p>
</div>
<br/>
<br/>
<br/>
<div
class=
"middle"
>
<strong>
Sub:
<u>
Intimation for Admission
</u></strong>
</div>
<p>
Dear Parent/s,
</p>
<br
/>
<p>
We are pleased to inform you that your son
<b
th:text=
"${admissionForm.fullName}"
></b>
has been
granted admission to
<b
th:text=
"${admissionForm.admissionClass}"
></b>
for the year
2024-2025.
</p>
<p>
Please contact the
<b>
Principal's office of La Martiniere for Boys, 11 Dr. U.N. Brahmachari Street,
Kolkata 700 017
</b>
, in person, along with a printout of this letter on
<b>
05/04/2024 at 10:00am
</b>
for necessary formalities.
</p>
<p>
Parents willing to pay the full year fee may do so, or pay quarterly by way of Pay Order favouring
<b>
“La
Martiniere Calcutta”
</b>
or bank transfer, at the time of admission.
</p>
<p>
For the
<b>
1
<sup>
st
</sup>
Quarter (April to June 2024)
</b>
, parents are to pay
<b>
Rs. 1,69,500/- (Rupees
One Lacs Sixty Nine Thousand Five Hundred only)
</b>
towards Tuition Fees, Session Fees,
Infrastructure Development Fees, Admission Fees, Building Development Fees and Security Deposit
(refundable). The amount may be transferred directly to the following account.
</p>
<br
/>
<p><b><u>
Penalty of Rs.5000/- will be levied if fees not paid on the due date.
</u></b></p>
<table
class=
"account-details"
>
<tr>
<td>
Account Name
</td>
<td>
: La Martiniere, Calcutta
</td>
</tr>
<tr>
<td>
Account Number
</td>
<td>
: 031201001229
</td>
</tr>
<tr>
<td>
Bank Name
</td>
<td>
: ICICI Bank, Gorky Terrace
</td>
</tr>
<tr>
<td>
Account Type
</td>
<td>
: Savings
</td>
</tr>
<tr>
<td>
RTGS/NEFT/IFS Code
</td>
<td>
: ICIC0000312
</td>
</tr>
</table>
<br
/>
<p>
Please email the enclosed format to
<b>
lmcao@rediffmail.com
</b>
for confirmation of your payment and also
bring a hard copy while visiting Principal’s Office.
</p>
<table
class=
"fee-details"
>
<tr>
<th>
Quarters
</th>
<th>
Amount
</th>
<th>
Date of Payment
</th>
</tr>
<tr>
<td>
1
<sup>
st
</sup>
Quarter (April to June 2024)
</td>
<td>
Rs. 1,69,500.00
</td>
<td>
On the date of admission
</td>
</tr>
<tr>
<td>
2
<sup>
nd
</sup>
Quarter (July to Sept. 2024)
</td>
<td>
Rs. 1,24,500.00
</td>
<td>
1
<sup>
st
</sup>
to 5
<sup>
th
</sup>
July, 2024
</td>
</tr>
<tr>
<td>
3
<sup>
rd
</sup>
Quarter (Oct to Dec. 2024)
</td>
<td>
Rs. 1,24,500.00
</td>
<td>
1
<sup>
st
</sup>
to 5
<sup>
th
</sup>
Oct. 2024
</td>
</tr>
<tr>
<td>
4
<sup>
th
</sup>
Quarter (Jan to March 2025)
</td>
<td>
Rs. 1,24,500.00
</td>
<td>
6
<sup>
th
</sup>
to 11
<sup>
th
</sup>
Jan 2025
</td>
</tr>
<tr>
<td><b>
Total
</b></td>
<td
colspan=
"2"
><b>
Rs 5,43,000.00
</b></td>
</tr>
</table>
<div
class=
"signature"
>
<p>
Yours faithfully,
</p>
<!-- <img th:src="@{${serverPath + 'static/signature.png'}}" alt="Logo" height="80px" /> -->
<img
src=
"signature.png"
alt=
"Logo"
height=
"80px"
/>
<p><b>
SUPRIYO DHAR
</b><br
/>
Secretary
<br
/>
La Martiniere, Kolkata
</p>
</div>
<div
class=
"footer"
>
<div
class=
"left"
>
<p>
11 Dr. U.N. Brahmachari Street
<br
/>
Kolkata - 700 017 (INDIA)
</p>
</div>
<div
class=
"center"
>
<p>
+91-33-4040-6600/01
<br
/>
22890112(D)
</p>
</div>
<div
class=
"right"
>
<p>
secretary@lamartiniere.co
<br
/>
lamartiniere.co
</p>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
lamartinDashboard/dashboard.html
View file @
dbd9d124
...
...
@@ -55,8 +55,11 @@
<button
id=
"summary-popup-btn"
class=
"btn btn-success btn-sm"
>
Download Score Sheets
</button>
<button
id=
"download-admission-data-btn"
class=
"btn btn-success btn-sm"
>
Download Admission Data
</button>
</div>
<div>
<button
id=
"bookAppointmentBtn"
class=
"btn btn-primary btn-sm"
>
Schedule Admission
</button>
<button
id=
"bookAppointmentBtn"
class=
"btn btn-primary btn-sm"
>
Schedule Appointment
</button>
</div>
</div>
</div>
<div
class=
"record-data"
>
...
...
lamartinFrontend/style.css
View file @
dbd9d124
...
...
@@ -25,6 +25,7 @@ body {
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
text-align
:
center
;
}
.la-header-title
{
...
...
@@ -157,7 +158,7 @@ body {
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
width
:
30%
;
/* width: 30%; */
padding
:
0px
10px
;
}
...
...
@@ -192,3 +193,27 @@ input[type="file"] {
transform
:
rotate
(
360deg
);
}
}
@media
only
screen
and
(
max-width
:
768px
)
{
#application-form
{
width
:
100%
;
}
.form-image-group
{
display
:
flex
;
flex-wrap
:
wrap
;
/* flex-direction: column; */
}
.la-form-group
{
width
:
100%
;
}
/* input[type="file"] {
width: 80%;
} */
.la-body-container
{
padding
:
0px
60px
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment