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
72dddea7
Commit
72dddea7
authored
Jul 10, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add api template to download interaction excel
parent
808ce7dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
1 deletion
+74
-1
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
...aMartin/admission/controller/AdmissionFormController.java
+43
-0
lamartinDashboard/dashboard.html
lamartinDashboard/dashboard.html
+2
-1
lamartinDashboard/js/dashboard.js
lamartinDashboard/js/dashboard.js
+29
-0
No files found.
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
View file @
72dddea7
...
@@ -317,6 +317,49 @@ public class AdmissionFormController {
...
@@ -317,6 +317,49 @@ public class AdmissionFormController {
IOUtils
.
copy
(
pdfStream
,
response
.
getOutputStream
());
IOUtils
.
copy
(
pdfStream
,
response
.
getOutputStream
());
}
}
@GetMapping
(
value
=
"/admission-form/download-master-interaction-excel"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"SUCCESS"
),
@ApiResponse
(
code
=
400
,
message
=
"FAILED"
),
@ApiResponse
(
code
=
500
,
message
=
"Exception Occurred"
)
})
@ApiOperation
(
value
=
""
)
public
void
downloadMasterInteractionExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestParam
(
"apikey"
)
String
apiKey
,
@RequestParam
String
schoolName
,
@RequestParam
String
interactionDate
)
throws
Exception
{
List
<
AdmissionFormData
>
admissionFormDataList
=
this
.
admissionFormDAOController
.
getAdmissionFormDataList
(
schoolName
,
null
,
interactionDate
,
null
,
null
);
if
(
admissionFormDataList
.
isEmpty
())
{
throw
new
Exception
(
"No Admission Data Found"
);
}
//TODO: write logic to download excel
// 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
(
@GetMapping
(
value
=
"/admission-form/count"
,
value
=
"/admission-form/count"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
produces
=
MediaType
.
APPLICATION_JSON_VALUE
...
...
lamartinDashboard/dashboard.html
View file @
72dddea7
...
@@ -154,8 +154,9 @@
...
@@ -154,8 +154,9 @@
</div>
</div>
<div
class=
"book-appointment-box2"
>
<div
class=
"book-appointment-box2"
>
<button
id=
"interactionScoring"
class=
"btn btn-primary btn-sm"
>
Interaction Scoring Sheet
</button>
<button
id=
"interactionScoring"
class=
"btn btn-primary btn-sm"
>
Interaction Scoring Sheet
</button>
<button
id=
"counsellorScoring"
class=
"btn btn-secondary btn-sm"
>
Counsellor Scoring Sheet
</button>
<button
id=
"download-interaction-sheet-btn"
class=
"btn btn-success btn-sm"
>
Download Interaction Sheet
</button>
<button
id=
"download-interaction-sheet-btn"
class=
"btn btn-success btn-sm"
>
Download Interaction Sheet
</button>
<button
id=
"download-interaction-excel-btn"
class=
"btn btn-success btn-sm"
>
Download Interaction Excel
</button>
<button
id=
"counsellorScoring"
class=
"btn btn-secondary btn-sm"
>
Counsellor Scoring Sheet
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
lamartinDashboard/js/dashboard.js
View file @
72dddea7
...
@@ -341,4 +341,33 @@ $(document).ready(function () {
...
@@ -341,4 +341,33 @@ $(document).ready(function () {
)
)
.
focus
();
.
focus
();
});
});
$
(
'
#download-interaction-excel-btn
'
).
click
(
function
()
{
let
schoolName
=
$
(
'
#schoolFilterReport
'
).
val
();
let
interactionDate
=
$
(
'
#dateFilterReport
'
).
val
();
if
(
!
schoolName
||
!
interactionDate
)
{
$
(
'
#reportModal
'
).
modal
(
'
hide
'
);
$
(
'
#messageModal .modal-title
'
).
text
(
'
Error
'
);
$
(
'
#messageModal .modal-body
'
).
text
(
'
Please select school and date to download counsellor scoring sheet.
'
);
$
(
'
#messageModal
'
).
modal
(
'
show
'
);
return
;
}
window
.
open
(
BASE_URL_LAMARTIN
+
`/admission-form/download-master-interaction-excel?apikey=
${
loginData
.
apiKey
}
&schoolName=
${
schoolName
}
&interactionDate=
${
interactionDate
}
`
,
'
_blank
'
)
.
focus
();
});
});
});
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