Updated Document entity to work with sourceId instead of callId
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.*;
|
import net.gepafin.tendermanagement.model.response.*;
|
||||||
import net.gepafin.tendermanagement.service.FaqService;
|
import net.gepafin.tendermanagement.service.FaqService;
|
||||||
import net.gepafin.tendermanagement.service.LookUpDataService;
|
import net.gepafin.tendermanagement.service.LookUpDataService;
|
||||||
@@ -167,14 +168,14 @@ public class CallDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<DocumentEntity> convertToDocumentEntities(List<DocumentReq> documentReqList, CallEntity callEntity,
|
public List<DocumentEntity> convertToDocumentEntities(List<DocumentReq> documentReqList, Long sourceId,
|
||||||
DocumentTypeEnum documentType) {
|
DocumentTypeEnum documentType) {
|
||||||
if (documentReqList == null) {
|
if (documentReqList == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<DocumentEntity> existingDocuments = documentRepository
|
List<DocumentEntity> existingDocuments = documentRepository
|
||||||
.findByCallIdAndTypeAndIsDeletedFalse(callEntity.getId(), documentType.getValue());
|
.findBySourceIdAndTypeAndIsDeletedFalse(sourceId, documentType.getValue());
|
||||||
|
|
||||||
List<Long> incomingIds = documentReqList.stream().map(DocumentReq::getId).filter(id -> id != null && id > 0)
|
List<Long> incomingIds = documentReqList.stream().map(DocumentReq::getId).filter(id -> id != null && id > 0)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -182,7 +183,7 @@ public class CallDao {
|
|||||||
existingDocuments.stream().filter(document -> !incomingIds.contains(document.getId()))
|
existingDocuments.stream().filter(document -> !incomingIds.contains(document.getId()))
|
||||||
.forEach(this::softDeleteDocument);
|
.forEach(this::softDeleteDocument);
|
||||||
List<DocumentEntity> documentEntities = documentReqList.stream()
|
List<DocumentEntity> documentEntities = documentReqList.stream()
|
||||||
.map(req -> convertToDocumentEntity(req, callEntity)).collect(Collectors.toList());
|
.map(req -> convertToDocumentEntity(req, sourceId)).collect(Collectors.toList());
|
||||||
documentRepository.saveAll(documentEntities);
|
documentRepository.saveAll(documentEntities);
|
||||||
return documentEntities;
|
return documentEntities;
|
||||||
}
|
}
|
||||||
@@ -192,9 +193,9 @@ public class CallDao {
|
|||||||
documentRepository.save(documentEntity);
|
documentRepository.save(documentEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DocumentEntity convertToDocumentEntity(DocumentReq documentReq, CallEntity callEntity) {
|
private DocumentEntity convertToDocumentEntity(DocumentReq documentReq,Long sourceId) {
|
||||||
validateDocumentEntity(documentReq.getId());
|
validateDocumentEntity(documentReq.getId());
|
||||||
DocumentEntity documentEntity = documentRepository.findByIdAndCallIdAndIsDeletedFalse(documentReq.getId(), callEntity.getId())
|
DocumentEntity documentEntity = documentRepository.findByIdAndSourceIdAndIsDeletedFalse(documentReq.getId(),sourceId)
|
||||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
||||||
Translator.toLocale(GepafinConstant.DOCUMENT_NOT_FOUND)));
|
Translator.toLocale(GepafinConstant.DOCUMENT_NOT_FOUND)));
|
||||||
return documentEntity;
|
return documentEntity;
|
||||||
@@ -275,7 +276,9 @@ public class CallDao {
|
|||||||
DocumentResponseBean responseBean = new DocumentResponseBean();
|
DocumentResponseBean responseBean = new DocumentResponseBean();
|
||||||
responseBean.setId(entity.getId());
|
responseBean.setId(entity.getId());
|
||||||
responseBean.setName(entity.getFileName());
|
responseBean.setName(entity.getFileName());
|
||||||
responseBean.setDescription(entity.getDescription());
|
responseBean.setType(DocumentTypeEnum.valueOf(entity.getType()));
|
||||||
|
responseBean.setSource(DocumentSourceTypeEnum.valueOf(entity.getSource()));
|
||||||
|
responseBean.setSourceId(entity.getSourceId());
|
||||||
responseBean.setFilePath(entity.getFilePath());
|
responseBean.setFilePath(entity.getFilePath());
|
||||||
responseBean.setCreatedDate(entity.getCreatedDate());
|
responseBean.setCreatedDate(entity.getCreatedDate());
|
||||||
responseBean.setUpdatedDate(entity.getUpdatedDate());
|
responseBean.setUpdatedDate(entity.getUpdatedDate());
|
||||||
@@ -362,9 +365,9 @@ public class CallDao {
|
|||||||
callRepository.save(callEntity);
|
callRepository.save(callEntity);
|
||||||
convertToEvaluationCriteriaEntities(createCallRequest.getCriteria(), callEntity, LookUpDataTypeEnum.EVALUATION_CRITERIA);
|
convertToEvaluationCriteriaEntities(createCallRequest.getCriteria(), callEntity, LookUpDataTypeEnum.EVALUATION_CRITERIA);
|
||||||
|
|
||||||
convertToDocumentEntities(createCallRequest.getDocs(), callEntity, DocumentTypeEnum.DOCUMENT);
|
convertToDocumentEntities(createCallRequest.getDocs(), callEntity.getId(), DocumentTypeEnum.DOCUMENT);
|
||||||
|
|
||||||
convertToDocumentEntities(createCallRequest.getImages(), callEntity, DocumentTypeEnum.IMAGES);
|
convertToDocumentEntities(createCallRequest.getImages(), callEntity.getId(), DocumentTypeEnum.IMAGES);
|
||||||
|
|
||||||
updateLookUpData(callEntity, createCallRequest.getCheckList(), LookUpDataTypeEnum.CHECKLIST);
|
updateLookUpData(callEntity, createCallRequest.getCheckList(), LookUpDataTypeEnum.CHECKLIST);
|
||||||
|
|
||||||
@@ -523,9 +526,9 @@ public class CallDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private CallResponse getCallResponseBean(CallEntity callEntity) {
|
private CallResponse getCallResponseBean(CallEntity callEntity) {
|
||||||
List<DocumentEntity> documentEntities = documentRepository.findByCallIdAndTypeAndIsDeletedFalse(callEntity.getId(),
|
List<DocumentEntity> documentEntities = documentRepository.findBySourceIdAndTypeAndIsDeletedFalse(callEntity.getId(),
|
||||||
DocumentTypeEnum.DOCUMENT.getValue());
|
DocumentTypeEnum.DOCUMENT.getValue());
|
||||||
List<DocumentEntity> imageEntities = documentRepository.findByCallIdAndTypeAndIsDeletedFalse(callEntity.getId(),
|
List<DocumentEntity> imageEntities = documentRepository.findBySourceIdAndTypeAndIsDeletedFalse(callEntity.getId(),
|
||||||
DocumentTypeEnum.IMAGES.getValue());
|
DocumentTypeEnum.IMAGES.getValue());
|
||||||
List<LookUpDataResponse> amiedTo = callTargetAudienceChecklistRepository
|
List<LookUpDataResponse> amiedTo = callTargetAudienceChecklistRepository
|
||||||
.findByCallIdAndLookupDataTypeAndIsDeletedFalse(callEntity.getId(), LookUpDataTypeEnum.AIMED_TO.getValue()).stream()
|
.findByCallIdAndLookupDataTypeAndIsDeletedFalse(callEntity.getId(), LookUpDataTypeEnum.AIMED_TO.getValue()).stream()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.dao;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -40,16 +41,17 @@ public class DocumentDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CallService callService;
|
private CallService callService;
|
||||||
|
|
||||||
public List<DocumentResponseBean> uploadFiles(List<MultipartFile> files, Long callId, DocumentTypeEnum fileType) {
|
public List<DocumentResponseBean> uploadFiles(List<MultipartFile> files, Long sourceId, DocumentSourceTypeEnum sourceType, DocumentTypeEnum fileType) {
|
||||||
List<DocumentEntity> documentEntities = new ArrayList<>();
|
List<DocumentEntity> documentEntities = new ArrayList<>();
|
||||||
CallEntity callEntity = callService.validateCall(callId);
|
Long source = resolveSourceId(sourceId, sourceType);
|
||||||
for (MultipartFile file : files) {
|
for (MultipartFile file : files) {
|
||||||
try {
|
try {
|
||||||
uploadFileOnAmazonS3 result = uploadFileOnAmazonS3(file);
|
uploadFileOnAmazonS3 result = uploadFileOnAmazonS3(file);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
DocumentEntity documentEntity = new DocumentEntity();
|
DocumentEntity documentEntity = new DocumentEntity();
|
||||||
documentEntity.setFileName(result.fileName());
|
documentEntity.setFileName(result.fileName());
|
||||||
documentEntity.setCall(callEntity);
|
documentEntity.setSource(sourceType.getValue());
|
||||||
|
documentEntity.setSourceId(source);
|
||||||
documentEntity.setType(fileType.getValue());
|
documentEntity.setType(fileType.getValue());
|
||||||
documentEntity.setFilePath(result.filepath());
|
documentEntity.setFilePath(result.filepath());
|
||||||
documentEntity.setIsDeleted(false);
|
documentEntity.setIsDeleted(false);
|
||||||
@@ -61,6 +63,18 @@ public class DocumentDao {
|
|||||||
documentRepository.saveAll(documentEntities);
|
documentRepository.saveAll(documentEntities);
|
||||||
return documentEntities.stream().map(callDao::convertToDocumentResponseBean).collect(Collectors.toList());
|
return documentEntities.stream().map(callDao::convertToDocumentResponseBean).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
private Long resolveSourceId(Long sourceId, DocumentSourceTypeEnum sourceType) {
|
||||||
|
if (sourceType == DocumentSourceTypeEnum.CALL) {
|
||||||
|
CallEntity callEntity = callService.validateCall(sourceId);
|
||||||
|
return callEntity.getId();
|
||||||
|
}
|
||||||
|
// else if (sourceType == SourceTypeEnum.APPLICATION) {
|
||||||
|
// ApplicationEntity applicationEntity = applicationService.validateApplication(sourceId);
|
||||||
|
// return applicationEntity.getId(); // Assuming ApplicationEntity has getId()
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
return sourceId;
|
||||||
|
}
|
||||||
|
|
||||||
private uploadFileOnAmazonS3 uploadFileOnAmazonS3(MultipartFile file) throws IOException {
|
private uploadFileOnAmazonS3 uploadFileOnAmazonS3(MultipartFile file) throws IOException {
|
||||||
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
||||||
@@ -109,6 +123,8 @@ public class DocumentDao {
|
|||||||
documentEntity.setFilePath(result.filepath);
|
documentEntity.setFilePath(result.filepath);
|
||||||
documentEntity.setFileName(result.fileName);
|
documentEntity.setFileName(result.fileName);
|
||||||
documentEntity.setType(documentTypeEnum.getValue());
|
documentEntity.setType(documentTypeEnum.getValue());
|
||||||
|
documentEntity.setSource(documentEntity.getSource());
|
||||||
|
documentEntity.setSourceId(documentEntity.getSourceId());
|
||||||
documentRepository.save(documentEntity);
|
documentRepository.save(documentEntity);
|
||||||
}
|
}
|
||||||
return callDao.convertToDocumentResponseBean(documentEntity);
|
return callDao.convertToDocumentResponseBean(documentEntity);
|
||||||
|
|||||||
@@ -20,12 +20,11 @@ public class DocumentEntity extends BaseEntity{
|
|||||||
@Column(name="TYPE")
|
@Column(name="TYPE")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@ManyToOne
|
@Column(name="SOURCE")
|
||||||
@JoinColumn(name = "CALL_ID")
|
private String source;
|
||||||
private CallEntity call;
|
|
||||||
|
|
||||||
@Column(name = "DESCRIPTION", columnDefinition = "TEXT")
|
@Column(name="SOURCE_ID")
|
||||||
private String description;
|
private Long sourceId;
|
||||||
|
|
||||||
@Column(name ="IS_DELETED", nullable = false)
|
@Column(name ="IS_DELETED", nullable = false)
|
||||||
private Boolean isDeleted = false;
|
private Boolean isDeleted = false;
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package net.gepafin.tendermanagement.enums;
|
||||||
|
|
||||||
|
public enum DocumentSourceTypeEnum {
|
||||||
|
CALL("CALL"),
|
||||||
|
|
||||||
|
APPLICATION("APPLICATION");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
DocumentSourceTypeEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package net.gepafin.tendermanagement.model.response;
|
package net.gepafin.tendermanagement.model.response;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
||||||
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@@ -13,7 +16,11 @@ public class DocumentResponseBean {
|
|||||||
|
|
||||||
private String filePath;
|
private String filePath;
|
||||||
|
|
||||||
private String description;
|
private DocumentTypeEnum type;
|
||||||
|
|
||||||
|
private DocumentSourceTypeEnum source;
|
||||||
|
|
||||||
|
private Long sourceId;
|
||||||
|
|
||||||
private LocalDateTime createdDate;
|
private LocalDateTime createdDate;
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ public interface DocumentRepository extends JpaRepository<DocumentEntity, Long>
|
|||||||
@Query("SELECT d FROM DocumentEntity d WHERE d.id = :id AND d.isDeleted = false")
|
@Query("SELECT d FROM DocumentEntity d WHERE d.id = :id AND d.isDeleted = false")
|
||||||
Optional<DocumentEntity> findById(@Param("id") Long id);
|
Optional<DocumentEntity> findById(@Param("id") Long id);
|
||||||
|
|
||||||
List<DocumentEntity> findByCallIdAndTypeAndIsDeletedFalse(Long callId, String type);
|
List<DocumentEntity> findBySourceIdAndTypeAndIsDeletedFalse(Long sourceId, String type);
|
||||||
|
|
||||||
Optional<DocumentEntity> findByIdAndCallIdAndIsDeletedFalse(Long id, Long callId);
|
Optional<DocumentEntity> findByIdAndSourceIdAndIsDeletedFalse(Long id, Long sourceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package net.gepafin.tendermanagement.service;
|
package net.gepafin.tendermanagement.service;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@@ -9,7 +10,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface DocumentService {
|
public interface DocumentService {
|
||||||
|
|
||||||
public List<DocumentResponseBean> uploadFile(List<MultipartFile> files,Long callId, DocumentTypeEnum fileType);
|
public List<DocumentResponseBean> uploadFile(List<MultipartFile> files, Long sourceId, DocumentSourceTypeEnum sourceType, DocumentTypeEnum fileType);
|
||||||
|
|
||||||
public void deleteFile(Long documentId);
|
public void deleteFile(Long documentId);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import net.gepafin.tendermanagement.dao.DocumentDao;
|
import net.gepafin.tendermanagement.dao.DocumentDao;
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
||||||
import net.gepafin.tendermanagement.service.DocumentService;
|
import net.gepafin.tendermanagement.service.DocumentService;
|
||||||
@@ -21,8 +22,8 @@ public class DocumentServiceImpl implements DocumentService {
|
|||||||
private DocumentDao documentDao;
|
private DocumentDao documentDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DocumentResponseBean> uploadFile(List<MultipartFile> files,Long callId,DocumentTypeEnum fileType) {
|
public List<DocumentResponseBean> uploadFile(List<MultipartFile> files, Long sourceId, DocumentSourceTypeEnum sourceType, DocumentTypeEnum fileType) {
|
||||||
return documentDao.uploadFiles(files,callId,fileType);
|
return documentDao.uploadFiles(files,sourceId,sourceType,fileType);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void deleteFile(Long documentId){
|
public void deleteFile(Long documentId){
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Content;
|
|||||||
import io.swagger.v3.oas.annotations.media.ExampleObject;
|
import io.swagger.v3.oas.annotations.media.ExampleObject;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
||||||
import net.gepafin.tendermanagement.model.util.Response;
|
import net.gepafin.tendermanagement.model.util.Response;
|
||||||
@@ -29,8 +30,8 @@ public interface DocumentApi {
|
|||||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||||
@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) }))})
|
||||||
@PostMapping(value = "/uploadFile/call/{callId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/uploadFile/source/{sourceId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
default ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, @Parameter(description = "call id", required = true) @PathVariable("callId") Long callId, @RequestParam("file") List<MultipartFile> files, @RequestParam("documentType") DocumentTypeEnum documentTypeEnum) {
|
default ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, @Parameter(description = "Source Id", required = true) @PathVariable("sourceId") Long sourceId, @RequestParam DocumentSourceTypeEnum sourceType, @RequestParam("file") List<MultipartFile> files, @RequestParam("documentType") DocumentTypeEnum documentTypeEnum) {
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
|
|||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import net.gepafin.tendermanagement.config.Translator;
|
import net.gepafin.tendermanagement.config.Translator;
|
||||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||||
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
|
||||||
import net.gepafin.tendermanagement.model.util.Response;
|
import net.gepafin.tendermanagement.model.util.Response;
|
||||||
@@ -27,10 +28,10 @@ DocumentApiController implements DocumentApi {
|
|||||||
private DocumentService documentService;
|
private DocumentService documentService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, Long callId,
|
public ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, Long sourceId, DocumentSourceTypeEnum sourceType,
|
||||||
List<MultipartFile> files, DocumentTypeEnum fileType) {
|
List<MultipartFile> files, DocumentTypeEnum fileType) {
|
||||||
try {
|
try {
|
||||||
List<DocumentResponseBean> responseBeans = documentService.uploadFile(files, callId, fileType);
|
List<DocumentResponseBean> responseBeans = documentService.uploadFile(files, sourceId,sourceType, fileType);
|
||||||
return ResponseEntity.status(HttpStatus.CREATED)
|
return ResponseEntity.status(HttpStatus.CREATED)
|
||||||
.body(new Response<List<DocumentResponseBean>>(responseBeans, Status.SUCCESS, Translator.toLocale(GepafinConstant.FILES_UPLOADED_MSG)));
|
.body(new Response<List<DocumentResponseBean>>(responseBeans, Status.SUCCESS, Translator.toLocale(GepafinConstant.FILES_UPLOADED_MSG)));
|
||||||
} catch (CustomValidationException ex) {
|
} catch (CustomValidationException ex) {
|
||||||
|
|||||||
@@ -540,15 +540,15 @@
|
|||||||
columnName="order_no" />
|
columnName="order_no" />
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
<changeSet id="03-09-2024_1" author="Rajesh Khore">
|
<changeSet id="03-09-2024_1" author="Rajesh Khore">
|
||||||
<sql>
|
<sql>
|
||||||
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
|
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
|
||||||
</sql>
|
</sql>
|
||||||
<sqlFile dbms="postgresql"
|
<sqlFile dbms="postgresql"
|
||||||
path="db/dump/update_form_field_data_04_09_2024.sql" />
|
path="db/dump/update_form_field_data_04_09_2024.sql" />
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
<changeSet id="04-09-2024_1" author="Rajesh Khore">
|
<changeSet id="04-09-2024_1" author="Rajesh Khore">
|
||||||
<dropColumn tableName="FAQ" columnName="question_short" />
|
<dropColumn tableName="FAQ" columnName="question_short" />
|
||||||
<dropColumn tableName="FAQ" columnName="question" />
|
<dropColumn tableName="FAQ" columnName="question" />
|
||||||
<dropColumn tableName="FAQ" columnName="response_short" />
|
<dropColumn tableName="FAQ" columnName="response_short" />
|
||||||
@@ -564,5 +564,13 @@
|
|||||||
<modifyDataType tableName="LOOKUP_DATA" columnName="title" newDataType="TEXT"/>
|
<modifyDataType tableName="LOOKUP_DATA" columnName="title" newDataType="TEXT"/>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="09-09-2024_1" author="Harish Bagora">
|
||||||
|
<renameColumn tableName="document" oldColumnName="call_id" newColumnName="source_id" columnDataType="BIGINT"/>
|
||||||
|
<addColumn tableName="document">
|
||||||
|
<column name="source" type="VARCHAR(255)"/>
|
||||||
|
</addColumn>
|
||||||
|
<dropColumn tableName="document" columnName="description"/>
|
||||||
|
<dropForeignKeyConstraint baseTableName="document" constraintName="fk_call_document"/>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
Reference in New Issue
Block a user