fixed s3 call document download issue
This commit is contained in:
@@ -8,10 +8,10 @@ import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.gepafin.tendermanagement.enums.DocOtherSourceTypeEnum;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -58,8 +58,8 @@ public class DelegationDao {
|
||||
@Autowired
|
||||
private S3PathConfig s3ConfigBean;
|
||||
|
||||
@Value("${aws.s3.url.folder.delegation}")
|
||||
private String s3Folder;
|
||||
// @Value("${aws.s3.url.folder.delegation}")
|
||||
// private String s3Folder;
|
||||
|
||||
@Autowired
|
||||
private UserCompanyDelegationRepository userCompanyDelegationRepository;
|
||||
@@ -67,9 +67,9 @@ public class DelegationDao {
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
|
||||
|
||||
public ByteArrayOutputStream generateDocument(Map<String, String> placeholders, String templateName) {
|
||||
try {
|
||||
String s3Folder = s3ConfigBean.generateDocumentPathForOther(DocOtherSourceTypeEnum.USER_DELEGATION, 0L, 0L);
|
||||
InputStream templateStream = amazonS3Service.getFile(s3Folder ,templateName);
|
||||
XWPFDocument doc = loadTemplate(templateStream);
|
||||
replacePlaceholders(doc, placeholders);
|
||||
|
||||
Reference in New Issue
Block a user