Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
examsAndAdmissions
Commits
3795d61b
Unverified
Commit
3795d61b
authored
1 year ago
by
Shishir Suman
Committed by
GitHub
1 year ago
Browse files
Options
Download
Plain Diff
Merge pull request #143 from Radheshhathwar/development
Development
parents
0a4b1fb9
b0e48f55
github/fork/ruksana2808/filter_bug_examCycle
bug_fix_question_paper_upload
development
fee_changes
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/ExamCycleController.java
+10
-1
...mf/examsAndAdmissions/controller/ExamCycleController.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/FeeController.java
+0
-1
...to/upsmf/examsAndAdmissions/controller/FeeController.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/repository/CourseRepository.java
+3
-0
...upsmf/examsAndAdmissions/repository/CourseRepository.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/repository/ExamCycleRepository.java
+2
-0
...mf/examsAndAdmissions/repository/ExamCycleRepository.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/ExamCycleService.java
+7
-2
...to/upsmf/examsAndAdmissions/service/ExamCycleService.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/impl/FeeServiceImpl.java
+4
-0
...upsmf/examsAndAdmissions/service/impl/FeeServiceImpl.java
with
26 additions
and
4 deletions
+26
-4
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/ExamCycleController.java
+
10
−
1
View file @
3795d61b
...
...
@@ -6,7 +6,6 @@ import com.tarento.upsmf.examsAndAdmissions.model.ResponseDto;
import
com.tarento.upsmf.examsAndAdmissions.model.dto.ExamCycleWithExamsDTO
;
import
com.tarento.upsmf.examsAndAdmissions.model.dto.SearchExamCycleDTO
;
import
com.tarento.upsmf.examsAndAdmissions.repository.CourseRepository
;
import
com.tarento.upsmf.examsAndAdmissions.repository.ExamEntityRepository
;
import
com.tarento.upsmf.examsAndAdmissions.service.ExamCycleService
;
import
com.tarento.upsmf.examsAndAdmissions.util.Constants
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -106,5 +105,15 @@ public class ExamCycleController {
return
new
ResponseEntity
<>(
response
,
response
.
getResponseCode
());
}
@GetMapping
(
"/examCyclesByCouses"
)
public
ResponseEntity
<
ResponseDto
>
getExamCycleDetailsByInstitute
(
@RequestParam
Long
instituteId
){
try
{
List
<
ExamCycle
>
examDetails
=
service
.
getExamCyclesByExamCycleAndCourse
(
instituteId
);
return
FeeController
.
handleSuccessResponse
(
examDetails
);
}
catch
(
Exception
e
){
return
FeeController
.
handleErrorResponse
(
e
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/FeeController.java
+
0
−
1
View file @
3795d61b
...
...
@@ -71,7 +71,6 @@ public class FeeController {
return
handleErrorResponse
(
e
);
}
}
public
static
ResponseEntity
<
ResponseDto
>
handleSuccessResponse
(
Object
response
)
{
ResponseParams
params
=
new
ResponseParams
();
params
.
setStatus
(
HttpStatus
.
OK
.
getReasonPhrase
());
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/repository/CourseRepository.java
+
3
−
0
View file @
3795d61b
...
...
@@ -5,6 +5,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
java.util.List
;
import
java.util.Optional
;
public
interface
CourseRepository
extends
JpaRepository
<
Course
,
Long
>
{
...
...
@@ -14,4 +15,6 @@ public interface CourseRepository extends JpaRepository<Course, Long> {
Optional
<
Course
>
findByCourseNameIgnoreCase
(
@Param
(
"courseName"
)
String
courseName
);
Course
findByInstituteId
(
Long
id
);
List
<
Course
>
findAllByInstituteId
(
Long
instituteId
);
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/repository/ExamCycleRepository.java
+
2
−
0
View file @
3795d61b
...
...
@@ -26,4 +26,6 @@ public interface ExamCycleRepository extends JpaRepository<ExamCycle, Long> {
@Query
(
value
=
"select * from exam_cycle ec where ec.course_id =:courseId and date_part('year', ec.start_date) = :startYear and date_part('year', ec.end_date) <= :endYear"
,
nativeQuery
=
true
)
List
<
ExamCycle
>
searchExamCycleByCourseIdAndStartYearAndEndYear
(
@Param
(
"courseId"
)
String
courseId
,
@Param
(
"startYear"
)
Integer
startYear
,
@Param
(
"endYear"
)
Integer
endYear
);
List
<
ExamCycle
>
findByCourseInAndEndDateAfter
(
List
<
Course
>
courses
,
LocalDate
currentDate
);
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/ExamCycleService.java
+
7
−
2
View file @
3795d61b
...
...
@@ -23,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
import
javax.validation.ConstraintViolationException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.format.DateTimeFormatter
;
...
...
@@ -444,5 +445,9 @@ public class ExamCycleService {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
response
);
}
}
}
\ No newline at end of file
public
List
<
ExamCycle
>
getExamCyclesByExamCycleAndCourse
(
Long
instituteId
)
{
List
<
Course
>
courses
=
courseRepository
.
findAllByInstituteId
(
instituteId
);
LocalDate
currentDate
=
LocalDate
.
now
();
return
repository
.
findByCourseInAndEndDateAfter
(
courses
,
currentDate
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/impl/FeeServiceImpl.java
+
4
−
0
View file @
3795d61b
...
...
@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -87,6 +88,9 @@ public class FeeServiceImpl implements FeeService {
@Autowired
private
StudentExamRegistrationRepository
studentExamRegistrationRepository
;
@Autowired
private
CourseRepository
courseRepository
;
/**
* API to save and return payment redirect URL
*
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets