Updated code

This commit is contained in:
nisha
2024-12-13 13:48:46 +05:30
parent eb5075488e
commit 0bdc5f6fce
5 changed files with 17 additions and 4 deletions

View File

@@ -272,7 +272,7 @@ public class ApplicationAmendmentRequestDao {
String formFieldsJson = Utils.convertObjectToJson(formFieldRequestBean); String formFieldsJson = Utils.convertObjectToJson(formFieldRequestBean);
applicationAmendmentRequestEntity.setFormFields(formFieldsJson); applicationAmendmentRequestEntity.setFormFields(formFieldsJson);
} }
if(Boolean.FALSE.equals(applicationAmendmentRequest.getAmendmentDocument().isEmpty())) { if(applicationAmendmentRequest.getAmendmentDocument()!=null || Boolean.FALSE.equals(applicationAmendmentRequest.getAmendmentDocument().isEmpty())) {
setAmendmentDocuments(applicationAmendmentRequest.getAmendmentDocument(), applicationAmendmentRequestEntity); setAmendmentDocuments(applicationAmendmentRequest.getAmendmentDocument(), applicationAmendmentRequestEntity);
} }
List<ApplicationAmendmentRequestEntity> amendmentRequest = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(applicationEvaluationEntity.getId()); List<ApplicationAmendmentRequestEntity> amendmentRequest = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(applicationEvaluationEntity.getId());

View File

@@ -582,10 +582,11 @@ public class ApplicationEvaluationDao {
applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(entity.getId()); applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(entity.getId());
// Fetch amendment details from the request // Fetch amendment details from the request
if(req.getAmendmentDetails()!=null) {
List<AmendmentDetailsRequest> amendmentDetailsRequests = req.getAmendmentDetails(); List<AmendmentDetailsRequest> amendmentDetailsRequests = req.getAmendmentDetails();
updateAmendmentDocumentsAndFormFields(applicationAmendmentRequestEntities, amendmentDetailsRequests); updateAmendmentDocumentsAndFormFields(applicationAmendmentRequestEntities, amendmentDetailsRequests);
}
ApplicationEvaluationEntity savedEntity = applicationEvaluationRepository.save(entity); ApplicationEvaluationEntity savedEntity = applicationEvaluationRepository.save(entity);

View File

@@ -121,6 +121,14 @@ public class DocumentDao {
userActionContext = UserActionContextEnum.UPLOAD_APPLICATION_DOCUMENT; userActionContext = UserActionContextEnum.UPLOAD_APPLICATION_DOCUMENT;
} else if (fileType.equals(DocumentTypeEnum.IMAGES) && sourceType.equals(DocumentSourceTypeEnum.APPLICATION)) { } else if (fileType.equals(DocumentTypeEnum.IMAGES) && sourceType.equals(DocumentSourceTypeEnum.APPLICATION)) {
userActionContext = UserActionContextEnum.UPLOAD_APPLICATION_IMAGES; userActionContext = UserActionContextEnum.UPLOAD_APPLICATION_IMAGES;
}else if (fileType.equals(DocumentTypeEnum.DOCUMENT) && sourceType.equals(DocumentSourceTypeEnum.AMENDMENT)) {
userActionContext = UserActionContextEnum.UPLOAD_AMENDMENT_DOCUMENT;
} else if (fileType.equals(DocumentTypeEnum.IMAGES) && sourceType.equals(DocumentSourceTypeEnum.AMENDMENT)) {
userActionContext = UserActionContextEnum.UPLOAD_AMENDMENT_IMAGES;
}else if (fileType.equals(DocumentTypeEnum.DOCUMENT) && sourceType.equals(DocumentSourceTypeEnum.EVALUATION)) {
userActionContext = UserActionContextEnum.UPLOAD_EVALUATION_DOCUMENT;
} else if (fileType.equals(DocumentTypeEnum.IMAGES) && sourceType.equals(DocumentSourceTypeEnum.EVALUATION)) {
userActionContext = UserActionContextEnum.UPLOAD_EVALUATION_IMAGES;
} }
return userActionContext; return userActionContext;

View File

@@ -118,6 +118,10 @@ public enum UserActionContextEnum {
UPDATE_DOCUMENT("UPDATE_DOCUEMENT"), UPDATE_DOCUMENT("UPDATE_DOCUEMENT"),
UPDATE_IMAGES("UPDATE_IMAGES"), UPDATE_IMAGES("UPDATE_IMAGES"),
GET_DOCUMENT("GET_DOCUMENT"), GET_DOCUMENT("GET_DOCUMENT"),
UPLOAD_AMENDMENT_DOCUMENT("UPLOAD_AMENDMENT_DOCUMENT"),
UPLOAD_AMENDMENT_IMAGES("UPLOAD_AMENDMENT_IMAGES"),
UPLOAD_EVALUATION_DOCUMENT("UPLOAD_EVALUATION_DOCUMENT"),
UPLOAD_EVALUATION_IMAGES("UPLOAD_EVALUATION_IMAGES"),
/** Assigned flow context **/ /** Assigned flow context **/
CREATE_UPDATE_FLOW("CREATE_UPDATE_FLOW"), CREATE_UPDATE_FLOW("CREATE_UPDATE_FLOW"),

View File

@@ -65,9 +65,9 @@ public interface ApplicationEvaluationApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) @ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) }))
}) })
@PutMapping(value = "/assignedApplicationId/{id}", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) @PutMapping(value = "/assignedApplication/{assignedApplicationId}", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<Response<ApplicationEvaluationResponse>> updateApplicationEvaluation(HttpServletRequest request, ResponseEntity<Response<ApplicationEvaluationResponse>> updateApplicationEvaluation(HttpServletRequest request,
@Parameter(description = "The AssignedApplication id", required = true) @PathVariable("id") Long id, @Parameter(description = "The AssignedApplication id", required = true) @PathVariable("assignedApplicationId") Long assignedApplicationId,
@Parameter(description = "Application Evaluation request object", required = true) @Valid @RequestBody List<EvaluationDocumentRequest> applicationEvaluationDocRequest); @Parameter(description = "Application Evaluation request object", required = true) @Valid @RequestBody List<EvaluationDocumentRequest> applicationEvaluationDocRequest);