From 9e6692ec5187e446572aa61b3c087754f5924b02 Mon Sep 17 00:00:00 2001 From: xs Date: Thu, 5 Dec 2024 21:57:16 +0800 Subject: [PATCH] =?UTF-8?q?3.5.13=20=E5=9B=BE=E7=89=87=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=85=BC=E5=AE=B9pda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DmsBillsFaultInstanceServiceImpl.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java index 9ada6890..74fcac82 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java @@ -19,6 +19,9 @@ import com.hw.dms.domain.vo.DmsBillsFaultInstanceScanVo; import com.hw.dms.mapper.DmsFaultInstanceActivityMapper; import com.hw.dms.mapper.DmsInstanceFileMapper; import com.hw.system.api.domain.SysFile; +import com.hw.system.api.factory.RemoteFileFallbackFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -36,6 +39,8 @@ import org.springframework.util.CollectionUtils; */ @Service public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceService { + private static final Logger log = LoggerFactory.getLogger(DmsBillsFaultInstanceServiceImpl.class); + @Autowired private DmsBillsFaultInstanceMapper dmsBillsFaultInstanceMapper; @Autowired @@ -62,12 +67,15 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS for (DmsInstanceFile dmsInstanceFile : dmsInstanceFiles){ String filePath = dmsInstanceFile.getFilePath(); + log.info("filePath1:"+filePath); if(!filePath.contains("7309")){ if(filePath.contains("https")){ filePath.replaceFirst("https","http"); } int index= filePath.indexOf("/statics"); filePath = "http://172.16.12.100:7309"+filePath.substring(index); + log.info("filePath2:"+filePath); + dmsInstanceFile.setUrl(filePath); }else{ dmsInstanceFile.setUrl(dmsInstanceFile.getFilePath()); } @@ -480,4 +488,16 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS } } + + public static void main(String[] args) { + String filePath = "https://172.16.12.100/statics/2024/12/05/output_imgage20241205_215325_20241205215439A002.jpg"; + if(!filePath.contains("7309")){ + if(filePath.contains("https")){ + filePath.replaceFirst("https","http"); + } + int index= filePath.indexOf("/statics"); + filePath = "http://172.16.12.100:7309"+filePath.substring(index); + } + System.out.println(filePath); + } }