From 76b2029c183be83acc656df7027392e470b150ad Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 8 Sep 2023 14:16:24 +0800 Subject: [PATCH] =?UTF-8?q?debug=20=E6=96=87=E4=BB=B6=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov/manage/GovProjectCollectionManage.java | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index 2078498..894f0dc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java @@ -992,19 +992,24 @@ public class GovProjectCollectionManage { String[] baseProjBasisFileArr = baseProjBasisFile.split(";"); StringJoiner sj = new StringJoiner(";"); for(String bpb : baseProjBasisFileArr){ - JSONArray fileArray = JSON.parseArray(bpb); - fileArray.forEach(j -> { - JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(j)); - byte[] btyes = wpsConvertManage.downloadToPdfStream(jsonObject.getLong("id")); - String suffix = jsonObject.getString("suffix"); - String originalFileName = jsonObject.getString("originalFileName"); - if(!BizConst.DEV.equals(active)){ - originalFileName = originalFileName.replace(StrPool.DOT + suffix, ".pdf"); - } + try{ + JSONArray fileArray = JSON.parseArray(bpb); + fileArray.forEach(j -> { + JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(j)); + byte[] btyes = wpsConvertManage.downloadToPdfStream(jsonObject.getLong("id")); + String suffix = jsonObject.getString("suffix"); + String originalFileName = jsonObject.getString("originalFileName"); + if(!BizConst.DEV.equals(active)){ + originalFileName = originalFileName.replace(StrPool.DOT + suffix, ".pdf"); + } // upload(btyes,"/temp",originalFileName); - String oss = ProvincialManage.uploadToOss(btyes, originalFileName); - sj.add(oss); - }); + String oss = ProvincialManage.uploadToOss(btyes, originalFileName); + sj.add(oss); + }); + }catch (Exception e){ + log.error("解析文件出错!" + e); + } + } return sj; }