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
uphrh-smf-form
Commits
eafda528
Unverified
Commit
eafda528
authored
2 years ago
by
sarojsingh2021
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #9 from UPHRH-platform/cvs_download
Cvs download
parents
fa875d79
8ef9b144
master
delete-form
No related merge requests found
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
pom.xml
+6
-1
pom.xml
src/main/java/com/tarento/formservice/controllers/FormsController.java
+16
-10
.../com/tarento/formservice/controllers/FormsController.java
src/main/java/com/tarento/formservice/model/CSVDataDto.java
+26
-0
src/main/java/com/tarento/formservice/model/CSVDataDto.java
src/main/java/com/tarento/formservice/model/InstituteCSVResponseDto.java
+11
-0
...om/tarento/formservice/model/InstituteCSVResponseDto.java
src/main/java/com/tarento/formservice/model/InstituteDownloadRequestDto.java
+15
-0
...arento/formservice/model/InstituteDownloadRequestDto.java
src/main/java/com/tarento/formservice/repository/ElasticSearchRepository.java
+13
-0
...rento/formservice/repository/ElasticSearchRepository.java
src/main/java/com/tarento/formservice/service/FormsService.java
+3
-9
...in/java/com/tarento/formservice/service/FormsService.java
src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java
+1115
-901
...om/tarento/formservice/service/impl/FormsServiceImpl.java
src/main/java/com/tarento/formservice/utils/PathRoutes.java
+1
-0
src/main/java/com/tarento/formservice/utils/PathRoutes.java
with
1206 additions
and
921 deletions
+1206
-921
pom.xml
+
6
−
1
View file @
eafda528
...
...
@@ -44,7 +44,12 @@
<artifactId>
javax.mail
</artifactId>
<version>
1.6.0
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.opencsv/opencsv -->
<dependency>
<groupId>
com.opencsv
</groupId>
<artifactId>
opencsv
</artifactId>
<version>
5.7.1
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>
org.apache.poi
</groupId>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/controllers/FormsController.java
+
16
−
10
View file @
eafda528
...
...
@@ -6,6 +6,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.tarento.formservice.model.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.tomcat.util.codec.binary.Base64
;
import
org.slf4j.Logger
;
...
...
@@ -28,16 +29,6 @@ import org.springframework.web.multipart.MultipartFile;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.google.gson.Gson
;
import
com.tarento.formservice.model.AssignApplication
;
import
com.tarento.formservice.model.Consent
;
import
com.tarento.formservice.model.FormData
;
import
com.tarento.formservice.model.IncomingData
;
import
com.tarento.formservice.model.KeyValue
;
import
com.tarento.formservice.model.KeyValueList
;
import
com.tarento.formservice.model.SearchObject
;
import
com.tarento.formservice.model.SearchRequestDto
;
import
com.tarento.formservice.model.Status
;
import
com.tarento.formservice.model.UserInfo
;
import
com.tarento.formservice.models.Form
;
import
com.tarento.formservice.models.FormDetail
;
import
com.tarento.formservice.service.FormsService
;
...
...
@@ -173,6 +164,21 @@ public class FormsController {
return
ResponseGenerator
.
failureResponse
(
Constants
.
ResponseMessages
.
ERROR_MESSAGE
);
}
@PostMapping
(
value
=
PathRoutes
.
FormServiceApi
.
GET_INSTITUTE_DATA
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
String
getInstituteData
(
@RequestHeader
(
value
=
Constants
.
Parameters
.
X_USER_INFO
,
required
=
false
)
String
xUserInfo
,
@RequestBody
InstituteDownloadRequestDto
instituteDownloadRequestDto
)
throws
JsonProcessingException
{
UserInfo
userInfo
=
null
;
if
(
StringUtils
.
isNotBlank
(
xUserInfo
))
{
userInfo
=
new
Gson
().
fromJson
(
xUserInfo
,
UserInfo
.
class
);
}
String
responseData
=
formsService
.
getInstitutesData
(
userInfo
,
instituteDownloadRequestDto
);
if
(
responseData
!=
null
)
{
return
ResponseGenerator
.
successResponse
(
responseData
);
}
return
ResponseGenerator
.
failureResponse
(
Constants
.
ResponseMessages
.
ERROR_MESSAGE
);
}
@GetMapping
(
value
=
PathRoutes
.
FormServiceApi
.
GET_APPLICATIONS_STATUS_COUNT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
String
getApplicationsStatusCount
(
@RequestHeader
(
value
=
Constants
.
Parameters
.
X_USER_INFO
,
required
=
false
)
String
xUserInfo
)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/model/CSVDataDto.java
0 → 100644
+
26
−
0
View file @
eafda528
package
com.tarento.formservice.model
;
import
lombok.*
;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public
class
CSVDataDto
{
private
String
applicationId
;
private
Long
formId
;
private
String
title
;
private
String
section
;
private
String
question
;
private
String
instituteAnswer
;
private
String
inspectionAnswer
;
private
String
updatedBy
;
private
String
updatedDate
;
private
String
createdDate
;
private
Integer
version
;
private
String
status
;
private
String
inspectionCompletionDate
;
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/model/InstituteCSVResponseDto.java
0 → 100644
+
11
−
0
View file @
eafda528
package
com.tarento.formservice.model
;
import
lombok.Getter
;
import
lombok.Setter
;
@Getter
@Setter
public
class
InstituteCSVResponseDto
{
private
String
data
;
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/model/InstituteDownloadRequestDto.java
0 → 100644
+
15
−
0
View file @
eafda528
package
com.tarento.formservice.model
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
@Getter
@Setter
public
class
InstituteDownloadRequestDto
{
private
Integer
page
;
private
Integer
size
;
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/repository/ElasticSearchRepository.java
+
13
−
0
View file @
eafda528
...
...
@@ -25,6 +25,8 @@ import org.elasticsearch.client.RequestOptions;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.core.CountRequest
;
import
org.elasticsearch.client.core.CountResponse
;
import
org.elasticsearch.common.xcontent.XContentType
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -268,4 +270,15 @@ public class ElasticSearchRepository {
}
return
response
;
}
public
CountResponse
executeCountRequest
(
CountRequest
countRequest
)
{
CountResponse
response
=
null
;
try
{
response
=
client
.
count
(
countRequest
,
RequestOptions
.
DEFAULT
);
}
catch
(
IOException
e
)
{
LOGGER
.
error
(
marker
,
"Encountered an error while connecting : "
,
e
);
LOGGER
.
error
(
marker
,
"Error Message to report : {}"
,
e
.
getMessage
());
}
return
response
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/service/FormsService.java
+
3
−
9
View file @
eafda528
...
...
@@ -6,17 +6,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentMap
;
import
com.tarento.formservice.model.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.tarento.formservice.model.AssignApplication
;
import
com.tarento.formservice.model.Consent
;
import
com.tarento.formservice.model.IncomingData
;
import
com.tarento.formservice.model.KeyValueList
;
import
com.tarento.formservice.model.ResponseData
;
import
com.tarento.formservice.model.SearchRequestDto
;
import
com.tarento.formservice.model.State
;
import
com.tarento.formservice.model.StateMatrix
;
import
com.tarento.formservice.model.UserInfo
;
import
com.tarento.formservice.models.Form
;
import
com.tarento.formservice.models.FormDetail
;
...
...
@@ -44,6 +36,8 @@ public interface FormsService {
List
<
Map
<
String
,
Object
>>
getAllPlainForms
();
String
getInstitutesData
(
UserInfo
userInfo
,
InstituteDownloadRequestDto
instituteDownloadRequestDto
);
KeyValueList
getApplicationsStatusCount
(
UserInfo
userInfo
);
public
Boolean
saveFormSubmitv1
(
IncomingData
incomingData
,
UserInfo
userInfo
,
String
action
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java
+
1115
−
901
View file @
eafda528
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/utils/PathRoutes.java
+
1
−
0
View file @
eafda528
...
...
@@ -11,6 +11,7 @@ public interface PathRoutes {
final
String
SAVE_FORM_SUBMIT_V1
=
"/v1/saveFormSubmit"
;
final
String
SAVE_FORM_SUBMIT_BULK
=
"/saveFormSubmitBulk"
;
final
String
GET_ALL_APPLICATIONS
=
"/getAllApplications"
;
final
String
GET_INSTITUTE_DATA
=
"/getInstituteData"
;
final
String
GET_APPLICATIONS_BY_ID
=
"/getApplicationsById"
;
final
String
GET_APPLICATIONS_STATUS_COUNT
=
"/getApplicationsStatusCount"
;
final
String
FILE_UPLOAD
=
"/fileUpload"
;
...
...
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