From d46e2943a40f1a65ea8d6790073551bc8dddb97c Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 28 Mar 2024 18:37:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20IT=E6=9C=8D=E5=8A=A1-?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E5=B7=A5=E5=8D=95(=E4=BE=9B=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E6=96=B9=E4=BD=BF=E7=94=A8)=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E5=88=97=E8=A1=A8=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1122514737004544]IT服务-上报工单(供第三方使用)接口文件路径列表参数处理逻辑调整 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1122514737004544 --- .../ProcessTaskCreatePublicServiceImpl.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java b/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java index 45f1eb1d2..5dec3b0ac 100644 --- a/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java +++ b/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java @@ -39,9 +39,7 @@ import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import javax.activation.MimetypesFileTypeMap; import javax.annotation.Resource; -import java.io.File; import java.util.*; @Service @@ -121,20 +119,17 @@ public class ProcessTaskCreatePublicServiceImpl implements ProcessTaskCreatePubl if( filePathList != null && filePathList.size() > 0 ){ String filePathPrefix = paramObj.getString("filePathPrefix"); JSONArray fileIdList = new JSONArray(); - MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap(); +// MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap(); for (Object filePath: filePathList ) { - File file = new File(filePath.toString()); - if(file.exists()){ - FileVo fileVo = new FileVo(); - fileVo.setName(file.getName()); - fileVo.setSize(file.length()); - fileVo.setUserUuid(userVo.getUuid()); - fileVo.setType("itsm"); //itsm - fileVo.setContentType(mimeTypesMap.getContentType(filePath.toString())); - fileVo.setPath(filePathPrefix + filePath); - fileMapper.insertFile(fileVo); - fileIdList.add(fileVo.getId()); - } + FileVo fileVo = new FileVo(); + fileVo.setName(filePath.toString().substring(filePath.toString().lastIndexOf("/")+1 , filePath.toString().length())); + fileVo.setSize(100*1024*1024L); + fileVo.setUserUuid(userVo.getUuid()); + fileVo.setType("itsm"); //itsm +// fileVo.setContentType(mimeTypesMap.getContentType(filePath.toString())); + fileVo.setPath(filePathPrefix + filePath); + fileMapper.insertFile(fileVo); + fileIdList.add(fileVo.getId()); } paramObj.put("fileIdList" , fileIdList); } -- Gitee