From 841588bc33c7ab2f547b046ada0d91bc4be67ade Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期一, 24 六月 2024 17:56:10 +0800 Subject: [PATCH] 增加按钮的权限控制 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileUploadServiceImpl.java | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileUploadServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileUploadServiceImpl.java index 84b6487..09addb7 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileUploadServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileUploadServiceImpl.java @@ -1,5 +1,6 @@ package com.vci.web.service.impl; +import com.vci.corba.common.PLException; import com.vci.corba.volume.VolumeServicePrx; import com.vci.file.constant.VciFileDefaultValueConstant; import com.vci.file.constant.VciFileLangCodeConstant; @@ -145,8 +146,6 @@ */ @Override public BaseResult uploadFile(MultipartFile multipartFile, VciFileObjectDTO fileObjectDTO) throws VciBaseException { - VciBaseUtil.alertNotNull(fileObjectDTO.getFileDocClassify(), "鏂囨。绫诲瀷缂栧彿"); - String sourceFileName = multipartFile.getOriginalFilename(); String fileExtension = getFileExtension(sourceFileName); String fileNameNoExtension = getFileNameNoExtension(sourceFileName); @@ -265,7 +264,7 @@ long currentTime = volumnCorbaService.getCurrrentTimeMillions(); in = multipartFile.getInputStream(); long fileSize = multipartFile.getSize(); - int blockSize = (int)webProperties.getBlockLength()*1024; + int blockSize = webProperties.getBlockLength()*1024; byte[] buffer = new byte[blockSize]; long temp =0L; for(temp = 0L; temp < fileSize - (long)blockSize; temp += (long)blockSize) { @@ -306,6 +305,18 @@ sourceFileObject.setFileSize(vciFileObjectDO.getFileSize()); vciFileObjectMapper.updateByPrimaryKey(sourceFileObject); //娌″姙娉曞垹闄や箣鍓嶇殑鏂囦欢锛� + + String volumeName = vciFileVolumeDO.getName(); + VolumeServicePrx volumnCorbaService = platformClientUtil.getVolumeService(volumeName); + if(volumnCorbaService == null){ + throw new VciBaseException("娌℃湁鑾峰彇鍒板嵎鏈嶅姟"); + } + try { + volumnCorbaService.deleteFile(sourceFileObject.getFilePath()); + } catch (PLException e) { + e.printStackTrace(); + System.out.println("鍒犻櫎浠撳簱涓殑鏂囦欢澶辫触锛�"+e.getMessage()); + } }else { vciFileObjectMapper.insert(vciFileObjectDO); } -- Gitblit v1.9.3