|
@@ -295,7 +295,7 @@ public class ESignContractServiceImpl implements SignPlatformService, SignAccoun
|
|
|
* @param signFieldList 签署文档列表
|
|
|
* @param signInfo 签章信息
|
|
|
* @param eSignFileId e签宝文件id
|
|
|
- * @param accountMap
|
|
|
+ * @param accountMap 账号信息
|
|
|
*/
|
|
|
private void addSignField(List<ESignDoc> signFieldList, String flowId, ContractSignInfo signInfo,
|
|
|
String eSignFileId, List<String> willTypes, Map<String, String> accountMap) {
|
|
@@ -306,39 +306,41 @@ public class ESignContractServiceImpl implements SignPlatformService, SignAccoun
|
|
|
for (ContractSeal sealInfo : sealInfoList) {
|
|
|
// 签章里的签署人信息未传,则使用签署信息中的签署人信息
|
|
|
ContractSigner signer = null == sealInfo.getSigner() ? signInfo.getSingleSigner() : sealInfo.getSigner();
|
|
|
- ESignDocPosition posBean = ESignRequest.searchWordsPosition(flowId, eSignFileId, sealInfo.getKeyword());
|
|
|
- if (Boolean.TRUE.equals(sealInfo.getWithTime())) {
|
|
|
- posBean.setAddSignTime(true);
|
|
|
- posBean.setSignTimeFormat(ESignConstant.SIGN_DATE_FORMAT);
|
|
|
- }
|
|
|
- ESignDoc signField = null;
|
|
|
- // 企业
|
|
|
- if (ESignConstant.isOrgSealType(sealInfo.getSealIdType())) {
|
|
|
- // 机构签约类别,当签约主体为机构时必传
|
|
|
- String actorIdentityType = Boolean.TRUE.equals(sealInfo.getSignLegal()) ? "3" : "2";// 2企业 3法人
|
|
|
- if (Boolean.TRUE.equals(sealInfo.getAutoSign())) {
|
|
|
- signField = new ESignDoc(eSignFileId, accountMap.get(sealInfo.getSealIdNo()), null, posBean, null,
|
|
|
- null);
|
|
|
- handleAutoSign(flowId, sealInfo, signField);
|
|
|
- continue;
|
|
|
- } else {
|
|
|
- signField = new ESignDoc(eSignFileId, accountMap.get(signer.getSignerIdNo()), actorIdentityType,
|
|
|
- accountMap.get(sealInfo.getSealIdNo()), null, 1, posBean, null, null, null);
|
|
|
+ for (String keyword : sealInfo.getKeywords()) {
|
|
|
+ ESignDocPosition posBean = ESignRequest.searchWordsPosition(flowId, eSignFileId, keyword);
|
|
|
+ if (Boolean.TRUE.equals(sealInfo.getWithTime())) {
|
|
|
+ posBean.setAddSignTime(true);
|
|
|
+ posBean.setSignTimeFormat(ESignConstant.SIGN_DATE_FORMAT);
|
|
|
}
|
|
|
- } else if (ESignConstant.isIndividualSealType(signer.getSignerIdType())) {
|
|
|
- if (Boolean.TRUE.equals(sealInfo.getAutoSign())) {
|
|
|
- throw new ServiceException("签署任务-个人签章暂不支持自动签章", HttpStatus.BAD_REQUEST);
|
|
|
+ ESignDoc signField = null;
|
|
|
+ // 企业
|
|
|
+ if (ESignConstant.isOrgSealType(sealInfo.getSealIdType())) {
|
|
|
+ // 机构签约类别,当签约主体为机构时必传
|
|
|
+ String actorIdentityType = Boolean.TRUE.equals(sealInfo.getSignLegal()) ? "3" : "2";// 2企业 3法人
|
|
|
+ if (Boolean.TRUE.equals(sealInfo.getAutoSign())) {
|
|
|
+ signField = new ESignDoc(eSignFileId, accountMap.get(sealInfo.getSealIdNo()), null, posBean,
|
|
|
+ null, null);
|
|
|
+ handleAutoSign(flowId, sealInfo, signField);
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ signField = new ESignDoc(eSignFileId, accountMap.get(signer.getSignerIdNo()), actorIdentityType,
|
|
|
+ accountMap.get(sealInfo.getSealIdNo()), null, 1, posBean, null, null, null);
|
|
|
+ }
|
|
|
+ } else if (ESignConstant.isIndividualSealType(signer.getSignerIdType())) {
|
|
|
+ if (Boolean.TRUE.equals(sealInfo.getAutoSign())) {
|
|
|
+ throw new ServiceException("签署任务-个人签章暂不支持自动签章", HttpStatus.BAD_REQUEST);
|
|
|
+ }
|
|
|
+ signField = new ESignDoc(eSignFileId, accountMap.get(signer.getSignerIdNo()), null, null, null, 1,
|
|
|
+ posBean, "1", null, null);
|
|
|
}
|
|
|
- signField = new ESignDoc(eSignFileId, accountMap.get(signer.getSignerIdNo()), null, null, null, 1,
|
|
|
- posBean, "1", null, null);
|
|
|
- }
|
|
|
- if (null == signField) {
|
|
|
- log.error("签署任务-获取签章位置出错fileId:{},sealIdType:{},keyword:{}", signInfo.getFileId(),
|
|
|
- sealInfo.getSealIdType(), sealInfo.getKeyword());
|
|
|
- throw new ServiceException("签署任务-获取签章位置出错,请检查签章传参是否正确", HttpStatus.ERROR);
|
|
|
+ if (null == signField) {
|
|
|
+ log.error("签署任务-获取签章位置出错fileId:{},sealIdType:{},keyword:{}", signInfo.getFileId(),
|
|
|
+ sealInfo.getSealIdType(), keyword);
|
|
|
+ throw new ServiceException("签署任务-获取签章位置出错,请检查签章传参是否正确", HttpStatus.ERROR);
|
|
|
+ }
|
|
|
+ signField.setWillTypes(willTypes);
|
|
|
+ signFieldList.add(signField);
|
|
|
}
|
|
|
- signField.setWillTypes(willTypes);
|
|
|
- signFieldList.add(signField);
|
|
|
}
|
|
|
// 保存 流程签署方记录表
|
|
|
saveSignFlowSigner(flowId, accountMap);
|
|
@@ -350,7 +352,6 @@ public class ESignContractServiceImpl implements SignPlatformService, SignAccoun
|
|
|
* @param flowId 签署流程id
|
|
|
* @param sealInfo 签章信息
|
|
|
* @param signField e签宝签署任务对象
|
|
|
- * @return 是否自动签章
|
|
|
*/
|
|
|
private void handleAutoSign(String flowId, ContractSeal sealInfo, ESignDoc signField) {
|
|
|
String sealId = contractConfigProperties.getESignSealIdByIdNo(sealInfo.getSealIdNo());
|