From ad7328e959e7ad92b1f0a1d549423df4717c56bb Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 29 Apr 2022 11:43:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-70682=20cid=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=9A=90=E8=97=8F=E6=97=B6=20=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E6=8C=89=E9=92=AE=E8=BF=98=E6=98=AF=E6=9C=89=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=96=87=E7=AB=A0=E6=A0=87=E8=AE=B0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/AlphaFineUtil.java | 6 ++---- .../manager/impl/ProductNewsSearchManager.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java index 66210cddc..0d23a6fc9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java @@ -1,10 +1,8 @@ package com.fr.design.mainframe.alphafine; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager; import com.fr.stable.StringUtils; -import java.util.List; import java.util.Set; /** @@ -57,7 +55,7 @@ public class AlphaFineUtil { public static boolean unread() { Set readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); - List productNewsList = ProductNewsSearchManager.getInstance().getCachedProductNewsList(); - return !productNewsList.isEmpty() && (readSet.size() != productNewsList.size()); + Set idSet = ProductNewsSearchManager.getInstance().getIdSet(); + return !idSet.isEmpty() && !readSet.containsAll(idSet); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java index 655eec2c8..205735ab3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java @@ -16,7 +16,9 @@ import java.awt.Image; import java.net.URL; import java.util.ArrayList; import java.util.Date; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -30,6 +32,12 @@ public class ProductNewsSearchManager { private List productNewsList = new ArrayList<>(); + /** + * 单独记录一份cid的唯一id 用来判断是否已读 + */ + private Set idSet = new HashSet<>(); + + private ScheduledExecutorService service; private ProductNewsSearchManager() { @@ -71,6 +79,7 @@ public class ProductNewsSearchManager { public List getProductNewsList() throws Exception { productNewsList = new ArrayList<>(); + idSet = new HashSet<>(); String jsonStr = HttpToolbox.get(AlphaFineConstants.ALPHA_CID); AlphaFineHelper.checkCancel(); JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr); @@ -88,6 +97,7 @@ public class ProductNewsSearchManager { // 推送时间check if (productNews.getPushDate().before(currentDate)) { productNewsList.add(productNews); + idSet.add(productNews.getId()); } } return productNewsList; @@ -97,6 +107,10 @@ public class ProductNewsSearchManager { return productNewsList; } + public Set getIdSet() { + return idSet; + } + @Nullable private Image getCoverImage(String url) { try { From 9c10525ece18cfd5da017ded1ca04abc29331f9f Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 29 Apr 2022 11:43:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-70472=20alphafine=E4=B8=AD=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=EF=BC=8C=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E7=9A=84=E5=B1=82=E7=BA=A7=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/component/AlphaFineList.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java index 75348468e..0ac1c637a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java @@ -24,10 +24,10 @@ public class AlphaFineList extends JList { public void mouseClicked(MouseEvent e) { AlphaCellModel selectedValue = getSelectedValue(); if (e.getClickCount() == 2 && selectedValue.hasAction()) { + // 点击搜索结果 主页面移动到后面 + AlphaFineHelper.getAlphaFineDialog().toBack(); dealWithSearchResult(); } - // 点击搜索结果 主页面移动到后面 - AlphaFineHelper.getAlphaFineDialog().toBack(); } });