From ba48e647dc07c5f880cf47d70b0debc9f3a009e7 Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 12 Mar 2024 11:50:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E9=A1=B9=E5=88=B6=E5=BA=A6=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB=E5=92=8C=E8=87=AA=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TextLibraryServiceImpl.java | 22 ++++++++++++++----- src/main/resources/application-dev.properties | 2 ++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java index 89aab676..7b802460 100644 --- a/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java +++ b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java @@ -10,6 +10,7 @@ import com.zcloud.mapper.datasource.depository.TextLibraryMapper; import com.zcloud.service.depository.TextLibraryService; import com.zcloud.util.*; import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -50,6 +51,9 @@ public class TextLibraryServiceImpl implements TextLibraryService { @Resource private TextInfoMapper textInfoMapper; + @Value("${heBeiQinAnFile}") + private String heBeiQinAnFile; + /** * 新增 * @@ -101,6 +105,12 @@ public class TextLibraryServiceImpl implements TextLibraryService { entity.put("ATTRIBUTE_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("ATTRIBUTE_LIST")).collect(Collectors.toList())); entity.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).collect(Collectors.toList())); } + // 如果是迁移数据就用河北秦安的路径 + for (PageData entity : list) { + if(!"1".equals(entity.getString("MIGRATION_FLAG"))){ + entity.put("PATH",heBeiQinAnFile + entity.getString("PATH")); + } + } return list; } @@ -160,11 +170,12 @@ public class TextLibraryServiceImpl implements TextLibraryService { if (StringUtils.isNotBlank(condition.getString("BUS_TEXT_LIBRARY_ID"))) { // 保存历史文件 PageData entity = textlibraryMapper.findById(condition); - condition.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH"))); - condition.put("CREATED_TIME", entity.get("CREATED_TIME")); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - condition.put("STATUS", "1"); - textlibraryMapper.edit(condition); + entity.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH"))); + entity.put("CREATED_TIME", entity.get("CREATED_TIME")); + entity.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + entity.put("STATUS", "1"); + entity.put("MIGRATION_FLAG", "1"); + textlibraryMapper.edit(entity); libraryLabelsMapper.deleteByLibraryId(condition); List types = Warden.getList(condition.getString("TYPES")); List list = new ArrayList<>(types); @@ -238,6 +249,7 @@ public class TextLibraryServiceImpl implements TextLibraryService { condition.put("ISDELETE", "0"); condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); condition.put("STATUS", "1"); + condition.put("MIGRATION_FLAG", "1"); textlibraryMapper.save(condition); List list = new ArrayList<>(); diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index db8a52d9..8bff7007 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -126,3 +126,5 @@ mq.gwj.file.topic=czks_dockingPicture #港务局文件服务器前缀 cfd.prevention.api.url=http://192.168.0.31:7021/qa-regulatory-cfd +#河北秦安文件服务器前缀 +heBeiQinAnFile=https://file.zcloudchina.com/YTHFile