From 927359fdce884acdcd76b90008eb0303f4bdd29d Mon Sep 17 00:00:00 2001 From: 许鹏程 <1821349743@qq.com> Date: 星期二, 28 五月 2024 16:09:04 +0800 Subject: [PATCH] commit --- src/main/java/com/product/file/service/FileManagerService.java | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/product/file/service/FileManagerService.java b/src/main/java/com/product/file/service/FileManagerService.java index 02613ba..e01e65a 100644 --- a/src/main/java/com/product/file/service/FileManagerService.java +++ b/src/main/java/com/product/file/service/FileManagerService.java @@ -348,7 +348,7 @@ attachmentFse.setValue(CmnConst.ENCRPT_SIGN, Global.getPropertyToBoolean("file.encrypt", "true") ? 1 : 0); attachmentFse.setValue(CmnConst.ATTACHMENT_SIZE, fileLength); attachmentFse.setValue(CmnConst.UPLOAD_SIGN, needUpload2FileServerFlag ? 1 : 0); - + attachmentFse.setValue(CmnConst.FUNCTION_UUID, fse.getString(CmnConst.FUNCTION_UUID)); attachmentFse.setValue(CmnConst.ATTACHMENT_CONTAINER, fse.getString(CmnConst.ATTACHMENT_CONTAINER)); attachmentFse.setValue(CmnConst.ATTACHMENT_DOMAIN, fse.getString(CmnConst.ATTACHMENT_DOMAIN)); attachmentFse.setValue(CmnConst.MODULE_UUID, fse.getString(CmnConst.MODULE_UUID)); @@ -406,8 +406,8 @@ String viewOnlineSign = attachmentFse.getString(CmnConst.VIEW_ONLINE_SIGN); boolean encrptSignFlag = "1".equals(attachmentFse.getString(CmnConst.ENCRPT_SIGN)); boolean needOnlineViewFlag = "1".equals(fse.getString(CmnConst.NEED_ONLINE_VIEW)) && "1".equals(viewOnlineSign); - if (needOnlineViewFlag) { - // 闇�瑕佸湪绾块瑙堜笖杞崲涔嬪悗鎵嶈兘鍦ㄧ嚎棰勮 + if (needOnlineViewFlag && !realFileName.endsWith(".xlsx") && !realFileName.endsWith(".xls")) { + // 闇�瑕佸湪绾块瑙堜笖杞崲涔嬪悗鎵嶈兘鍦ㄧ嚎棰勮 excel 鏂囦欢涓嶉渶瑕佽浆鎹㈢洿鎺ヨ緭鍑洪瑙� dir += File.separator + CmnConst.TRANSFER_DIR_NAME; } @@ -541,7 +541,7 @@ try { temp.createNewFile(); } catch (IOException e) { - throw new BaseException(FileCode.GET_FILE_FAIL.getValue(), FileCode.GET_FILE_FAIL.getText() + (e.getMessage() != null ? e.getMessage() : "")); + throw new BaseException(FileCode.GET_FILE_FAIL.getValue(), FileCode.GET_FILE_FAIL.getText() + (e.getMessage() != null ? e.getMessage() + ",uuid:" + attachmentFse.getUUID() : "")); } try (FileOutputStream fos = new FileOutputStream(temp); BufferedOutputStream out = new BufferedOutputStream(fos)) { @@ -549,10 +549,10 @@ return temp; } catch (Exception e) { e.printStackTrace(); - throw new BaseException(FileCode.GET_FILE_FAIL.getValue(), FileCode.GET_FILE_FAIL.getText() + (e.getMessage() != null ? e.getMessage() : "")); + throw new BaseException(FileCode.GET_FILE_FAIL.getValue(), FileCode.GET_FILE_FAIL.getText() + (e.getMessage() != null ? e.getMessage() + ",uuid:" + attachmentFse.getUUID() : "")); } } - throw new BaseException(FileCode.GET_FILE_FAIL.getValue(), FileCode.GET_FILE_FAIL.getText()); + throw new BaseException(FileCode.GET_FILE_FAIL.getValue(), FileCode.GET_FILE_FAIL.getText() + ",uuid:" + attachmentFse.getUUID()); } /** @@ -560,7 +560,8 @@ */ public byte[] getFileContent(FieldSetEntity attachmentFse) throws BaseException { if (attachmentFse == null || !CmnConst.PRODUCT_SYS_ATTACHMENTS.equals(attachmentFse.getTableName())) { - return new byte[16]; + //杩斿洖涓�涓┖鐨勫瓧鑺傛暟缁� + return new byte[0]; } try (ByteArrayOutputStream os = new ByteArrayOutputStream();) { FTPService ftpService = new FTPService(); -- Gitblit v1.9.2