From 5b031de3c8e4cd51ed83cddfbf2ff985d70bea40 Mon Sep 17 00:00:00 2001 From: dangsn <dangsn@chicecm.com> Date: 星期五, 21 六月 2024 16:19:20 +0800 Subject: [PATCH] 1、调整流程启动模板和流程节点获取功能 2、调整文件上传和下载功能 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileObjectServiceImpl.java | 39 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileObjectServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileObjectServiceImpl.java index f283e24..59e6613 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileObjectServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/VciFileObjectServiceImpl.java @@ -1,5 +1,7 @@ package com.vci.web.service.impl; +import com.vci.corba.common.PLException; +import com.vci.corba.volume.VolumeServicePrx; import com.vci.file.dto.VciFileObjectDTO; import com.vci.file.lcstatuspck.FileLCStatus; import com.vci.file.pagemodel.VciFileObjectVO; @@ -15,7 +17,11 @@ import com.vci.starter.web.wrapper.VciQueryWrapperForDO; import com.vci.web.dao.VciFileObjectDaoI; import com.vci.web.model.VciFileObjectDO; +import com.vci.web.model.VciFileVolumeDO; import com.vci.web.service.VciFileObjectServiceI; +import com.vci.web.service.VciFileVolumeServiceI; +import com.vci.web.util.PlatformClientUtil; +import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,8 +66,20 @@ /** * 鐗堟湰鍜屾暟鎹璞″伐鍏风被 */ - @Autowired + @Resource private RevisionModelUtil revisionModelUtil; + + /** + * 鏂囦欢鐨勫嵎鏈嶅姟 + */ + @Resource + private VciFileVolumeServiceI vciFileVolumeServiceI; + + /** + * 骞冲彴鐨勫鎴风 + */ + @Resource + private PlatformClientUtil platformClientUtil; /** * 鏌ヨ鎵�鏈夌殑鏂囦欢瀵硅薄 @@ -496,10 +514,27 @@ public BaseResult deleteFiles(Collection<String> fileOids) throws VciBaseException { Collection<VciFileObjectVO> fileObjectVOS = listVciFileObjectByOids(fileOids); if(!CollectionUtils.isEmpty(fileObjectVOS)){ - //鎴戜滑鏆傛椂涓嶅垹闄ゆ枃浠讹紝闃叉鍒犻櫎閿欎簡 VciBaseUtil.switchCollectionForOracleIn(fileObjectVOS).stream().forEach(fileObjectVOList->{ vciFileObjectMapper.batchDeleteByOids(fileObjectVOList.stream().map(VciFileObjectVO::getOid).collect(Collectors.toList())); }); + + //鍒犻櫎浠撳簱涓殑鏂囦欢 + //鑾峰彇鏂囦欢浠撲綅缃� + VciFileVolumeDO vciFileVolumeDO = vciFileVolumeServiceI.getUploadVolume(); + String volumeName = vciFileVolumeDO.getName(); + VolumeServicePrx volumnCorbaService = platformClientUtil.getVolumeService(volumeName); + if(volumnCorbaService == null){ + throw new VciBaseException("娌℃湁鑾峰彇鍒板嵎鏈嶅姟"); + } + Set<String> filePathSet = fileObjectVOS.stream().map(VciFileObjectVO::getFilePath).collect(Collectors.toSet()); + String[] filePathArr = new String[filePathSet.size()]; + filePathSet.toArray(filePathArr); + try { + volumnCorbaService.deleteAllFiles(filePathArr); + } catch (PLException e) { + logger.error("鍗锋湇鍔″垹闄や粨搴撲腑鐨勬枃浠跺け璐ワ細", e); + logger.error("鍗锋湇鍔″垹闄ゅけ璐ョ殑鏂囦欢锛�"+ WebUtil.getJSONStringWithDateFormat(filePathSet)); + } } return BaseResult.success(); } -- Gitblit v1.9.3