diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java index 41acf08..fcdae3e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.irs.sign; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.util.StrPool; @@ -74,7 +75,16 @@ public class IRSAPIRequest { throw new BizException("调用IRS盖章接口失败,印章编号为:" + sealSn + StrPool.SEMICOLON + e.getMessage()); } // return obj; - return resp.getBytes(); + JSONObject jsonObject = JSON.parseObject(resp, JSONObject.class); + String data = jsonObject.getString("data"); + JSONObject object = JSON.parseObject(data, JSONObject.class); + // 获取盖好章的PDF文件内容Base64字符串 + String signFileB64 = object.getString("signFileB64"); + if (Objects.nonNull(signFileB64)){ + return signFileB64.getBytes(); + }else { + return null; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index ba3f283..69ec8c0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -494,9 +494,7 @@ public class TodoCenterManage { Integer signType = req.getSignType(); signReq.setSignType(signType); // 调用盖章接口,获取盖章后返回的pdf文件字符数组 - byte[] signPdf = new byte[0]; - - signPdf = IRSAPIRequest.createSignPdf(signReq); + byte[] signPdf = IRSAPIRequest.createSignPdf(signReq); // 转换成MultipartFile MultipartFile multipartFile = new MockMultipartFile("file", originalFileName, "application/pdf", signPdf);