Added name field in company document
This commit is contained in:
@@ -86,7 +86,7 @@ public class CompanyDocumentDao {
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
|
||||
public List<CompanyDocumentResponseBean> uploadFileForCompany(HttpServletRequest request, Long userId, List<MultipartFile> files, Long companyId, Long documentCategoryId, CompanyDocumentTypeEnum companyDocumentSourceTypeEnum, LocalDateTime expirationDate){
|
||||
public List<CompanyDocumentResponseBean> uploadFileForCompany(HttpServletRequest request, Long userId, List<MultipartFile> files, Long companyId, Long documentCategoryId, CompanyDocumentTypeEnum companyDocumentSourceTypeEnum, LocalDateTime expirationDate,String name){
|
||||
DocumentCategoryEntity categoryEntity = categoryDao.validateCategory(documentCategoryId);
|
||||
validator.validateUserWithCompany(request,companyId);
|
||||
UserWithCompanyEntity userWithCompanyEntity=companyService.getUserWithCompany(userId,companyId);
|
||||
@@ -106,6 +106,7 @@ public class CompanyDocumentDao {
|
||||
companyDocumentEntity.setFilePath(uploadFileOnAmazonS3Response.getFilePath());
|
||||
companyDocumentEntity.setIsDeleted(false);
|
||||
companyDocumentEntity.setUploadedBy(userId);
|
||||
companyDocumentEntity.setName(name);
|
||||
if (expirationDate.isBefore(currentDate.plusDays(7))) {
|
||||
companyDocumentEntity.setStatus(CompanyDocumentStatusEnum.DUE.getValue());
|
||||
} else {
|
||||
@@ -159,7 +160,7 @@ public class CompanyDocumentDao {
|
||||
DocumentCategoryEntity categoryEntity = entity.getCategoryEntity();
|
||||
DocumentCategoryResponse responseCategory = categoryDao.convertToResponseBean(categoryEntity);
|
||||
responseBean.setId(entity.getId());
|
||||
responseBean.setName(entity.getFileName());
|
||||
responseBean.setFileName(entity.getFileName());
|
||||
responseBean.setType(CompanyDocumentTypeEnum.valueOf(entity.getType()));
|
||||
responseBean.setFilePath(entity.getFilePath());
|
||||
responseBean.setCompanyId(entity.getCompanyId());
|
||||
@@ -167,9 +168,11 @@ public class CompanyDocumentDao {
|
||||
responseBean.setStatus(entity.getStatus());
|
||||
responseBean.setUploadedBy(entity.getUploadedBy());
|
||||
responseBean.setCategory(responseCategory);
|
||||
responseBean.setName(entity.getName());
|
||||
responseBean.setUserWithCompanyId(entity.getUserWithCompany().getId());
|
||||
responseBean.setCreatedDate(entity.getCreatedDate());
|
||||
responseBean.setUpdatedDate(entity.getUpdatedDate());
|
||||
|
||||
return responseBean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user