REQ-3581: 下载合同
This commit is contained in:
parent
9130acd9b8
commit
bb1b0d92ea
@ -148,8 +148,8 @@ public class EssContract extends BaseEntity<EssContract> {
|
||||
return approvers.stream().allMatch(Approver::isSignPersonPresent);
|
||||
}
|
||||
|
||||
public boolean downloadContract() {
|
||||
return isFinalState() || getOrCreateExt().isDownloadContract();
|
||||
public boolean shouldDownloadContract() {
|
||||
return isFinalState() || getOrCreateExt().isShouldDownloadContract();
|
||||
}
|
||||
|
||||
public boolean isFinalState() {
|
||||
@ -168,7 +168,7 @@ public class EssContract extends BaseEntity<EssContract> {
|
||||
@Setter
|
||||
@Getter
|
||||
public static class RecordExt {
|
||||
private boolean downloadContract;
|
||||
private boolean shouldDownloadContract;
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
|
||||
@ -161,7 +161,7 @@ public class EssService {
|
||||
public void saveContractSnapshot(String essContractId) {
|
||||
EssContract c = transactionTemplate.execute(unused -> {
|
||||
EssContract contract = essContractDao.getOrThrow(essContractId);
|
||||
contract.getRecordExt().setDownloadContract(true);
|
||||
contract.getRecordExt().setShouldDownloadContract(true);
|
||||
essContractDao.updateExt(contract);
|
||||
return contract;
|
||||
});
|
||||
@ -177,7 +177,7 @@ public class EssService {
|
||||
essSupport.asyncExec(() -> {
|
||||
try {
|
||||
EssContract c = essContractDao.findOrNull(contract.getEssContractId());
|
||||
if (c == null || c.downloadContract() || StringUtils.isNotBlank(c.getOssFileKey()))
|
||||
if (c == null || c.shouldDownloadContract() || StringUtils.isNotBlank(c.getOssFileKey()))
|
||||
return;
|
||||
String pdfUrl = getContractPDFUrlFromEss(c);
|
||||
String fileName = String.format("%s.pdf", c.getContractName());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user