📝 补充金蝶附件同步关键链路日志(A902/A801-2 调用、单附件成功、内码反查回填与推送完成)

This commit is contained in:
刘泉佳
2026-09-24 13:47:30 +08:00
parent c2f3a48c0e
commit 1932ffe2d7
4 changed files with 16 additions and 0 deletions
@@ -536,12 +536,15 @@ public class BfiServiceImpl implements IBfiService {
BfiInvoiceDownloadDTO param = new BfiInvoiceDownloadDTO();
param.setPath(path);
String accessToken = getAccessToken();
long start = System.currentTimeMillis();
log.info("调用BFI接口 进项发票下载开始 path:{}", path);
try {
Response response = client.invoiceDownload(accessToken, param);
if (response == null || response.status() != 200) {
log.error("调用BFI接口 进项发票下载异常响应状态:{}", response == null ? "无响应" : response.status());
throw new BfiException("调用BFI接口进项发票下载异常,响应状态:" + (response == null ? "无响应" : response.status()));
}
log.info("调用BFI接口 进项发票下载结束 耗时:{}ms", System.currentTimeMillis() - start);
return response;
} catch (BfiException e) {
throw e;
@@ -566,12 +569,16 @@ public class BfiServiceImpl implements IBfiService {
args.set("billPkId", billPkId);
args.set("controlKey", StringUtil.isBlank(controlKey) ? "attachmentpanel" : controlKey);
InMemoryMultipartFile file = new InMemoryMultipartFile("file", fileName, MediaType.APPLICATION_OCTET_STREAM_VALUE, fileContent);
long start = System.currentTimeMillis();
log.info("调用BFI接口 附件上传开始 entityNumber:{},billPkId:{},文件:{},大小:{}字节",
entityNumber, billPkId, fileName, fileContent.length);
BfiResultVO<BfiAttachmentUploadVO> result = commonCall("附件上传", () -> client.uploadAttachment(accessToken, file, args.toString()));
BfiAttachmentUploadVO uploadVO = result.getData();
if (uploadVO == null || StringUtil.isBlank(uploadVO.getPath())) {
log.error("调用BFI接口 附件上传返回数据为空:{}", JSONUtil.toJsonStr(result));
throw new BfiException("调用BFI接口附件上传异常,返回数据为空");
}
log.info("调用BFI接口 附件上传结束 耗时:{}ms,kingdeePath:{}", System.currentTimeMillis() - start, uploadVO.getPath());
return uploadVO;
}