REQ-3300: 调整提示信息
This commit is contained in:
parent
1894d36779
commit
5228193d5a
@ -22,7 +22,9 @@ import cn.axzo.nanopart.ess.api.request.RevokeContractRequest;
|
||||
import cn.axzo.nanopart.ess.api.response.CreateContractByFileResponse;
|
||||
import cn.axzo.nanopart.ess.server.dao.EssContractDao;
|
||||
import cn.axzo.nanopart.ess.server.dao.EssLogDao;
|
||||
import cn.axzo.nanopart.ess.server.dao.EssOrgDao;
|
||||
import cn.axzo.nanopart.ess.server.entity.EssContract;
|
||||
import cn.axzo.nanopart.ess.server.entity.EssOrg;
|
||||
import cn.axzo.nanopart.ess.server.entity.EssPerson;
|
||||
import cn.axzo.nanopart.ess.server.ess.domain.JsonObjectAsString;
|
||||
import cn.axzo.nanopart.ess.server.ess.mq.EssBroadcaster;
|
||||
@ -42,6 +44,7 @@ public class ContractManager {
|
||||
|
||||
public static final String CONTRACT_ID = "contractId";
|
||||
|
||||
private final EssOrgDao essOrgDao;
|
||||
private final OrgManager orgManager;
|
||||
private final EssClient essClient;
|
||||
private final EssContractDao essContractDao;
|
||||
@ -62,6 +65,8 @@ public class ContractManager {
|
||||
return contractSupport.createDuplicateContractByFileResponse(request);
|
||||
}
|
||||
try {
|
||||
EssOrg org = essOrgDao.findOrNull(contract.getCreatorOuId());
|
||||
BizAssertions.assertTrue(org != null && org.isAuthorized(), "合同创建单位还未认证电子签");
|
||||
EssPerson superAdmin = orgManager.getSuperAdminOrThrow(request.getCreator().getOuId());
|
||||
List<String> essFileIds = essClient.uploadDocument(superAdmin, request.getByFile().getBase64Files());
|
||||
ChannelCreateFlowByFilesResponse essResponse = essClient.createContractByFile(superAdmin, essFileIds,
|
||||
@ -81,8 +86,6 @@ public class ContractManager {
|
||||
}
|
||||
catch (TencentCloudSDKException | ServiceException e) {
|
||||
log.warn("创建合同失败", e);
|
||||
if (contract != null)
|
||||
essContractDao.removeById(contract.getId());
|
||||
throw fail("创建合同失败: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
|
||||
package cn.axzo.nanopart.ess.server.ess;
|
||||
|
||||
import static cn.axzo.nanopart.ess.server.utils.IdBuilder.idbuilder;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import cn.axzo.nanopart.ess.api.enums.EssPersonState;
|
||||
import cn.axzo.nanopart.ess.api.enums.EssSealState;
|
||||
@ -23,12 +30,6 @@ import cn.axzo.nanopart.ess.server.utils.BizAssertions;
|
||||
import cn.axzo.nanopart.ess.server.utils.BizTransactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static cn.axzo.nanopart.ess.server.utils.IdBuilder.idbuilder;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
@ -92,13 +93,13 @@ public class OrgManager {
|
||||
|
||||
public EssPerson getSuperAdminOrThrow(Long ouId) {
|
||||
EssPerson superAdmin = findSuperAdmin(ouId).orElse(null);
|
||||
BizAssertions.assertNotNull(superAdmin, "单位还未认证");
|
||||
BizAssertions.assertNotNull(superAdmin, "单位还未认证, 单位id={}", ouId);
|
||||
return superAdmin;
|
||||
}
|
||||
|
||||
Optional<EssPerson> findSuperAdmin(Long ouId) {
|
||||
EssOrg org = essOrgDao.findOrNull(ouId);
|
||||
BizAssertions.assertNotNull(org, "单位不存在");
|
||||
BizAssertions.assertNotNull(org, "单位不存在, 单位id={}", ouId);
|
||||
if (org.getSuperAdminPersonId() <= 0L)
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(essPersonDao.findOrNull(ouId, org.getSuperAdminPersonId()));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user