From 79dd20bae9e8af17d5d66b67da4ca6ebc56cd9dd Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 26 六月 2024 11:15:43 +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