Browse Source

Pull request #8738: REPORT-70682 cid设置推送隐藏时 悬浮按钮还是有新增文章标记提示 && REPORT-70472 alphafine中打开插件管理,弹窗的层级不正确

Merge in DESIGN/design from ~HADES/design:feature/x to feature/x

* commit '9c10525ece18cfd5da017ded1ca04abc29331f9f':
  REPORT-70472 alphafine中打开插件管理,弹窗的层级不正确
  REPORT-70682 cid设置推送隐藏时 悬浮按钮还是有新增文章标记提示
feature/x
Hades 3 years ago
parent
commit
8d38d56c20
  1. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java
  2. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java
  3. 14
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java

@ -1,10 +1,8 @@
package com.fr.design.mainframe.alphafine; package com.fr.design.mainframe.alphafine;
import com.fr.design.DesignerEnvManager; 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.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
@ -57,7 +55,7 @@ public class AlphaFineUtil {
public static boolean unread() { public static boolean unread() {
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
List<ProductNews> productNewsList = ProductNewsSearchManager.getInstance().getCachedProductNewsList(); Set<Long> idSet = ProductNewsSearchManager.getInstance().getIdSet();
return !productNewsList.isEmpty() && (readSet.size() != productNewsList.size()); return !idSet.isEmpty() && !readSet.containsAll(idSet);
} }
} }

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java

@ -24,10 +24,10 @@ public class AlphaFineList extends JList<AlphaCellModel> {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
AlphaCellModel selectedValue = getSelectedValue(); AlphaCellModel selectedValue = getSelectedValue();
if (e.getClickCount() == 2 && selectedValue.hasAction()) { if (e.getClickCount() == 2 && selectedValue.hasAction()) {
// 点击搜索结果 主页面移动到后面
AlphaFineHelper.getAlphaFineDialog().toBack();
dealWithSearchResult(); dealWithSearchResult();
} }
// 点击搜索结果 主页面移动到后面
AlphaFineHelper.getAlphaFineDialog().toBack();
} }
}); });

14
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.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -30,6 +32,12 @@ public class ProductNewsSearchManager {
private List<ProductNews> productNewsList = new ArrayList<>(); private List<ProductNews> productNewsList = new ArrayList<>();
/**
* 单独记录一份cid的唯一id 用来判断是否已读
*/
private Set<Long> idSet = new HashSet<>();
private ScheduledExecutorService service; private ScheduledExecutorService service;
private ProductNewsSearchManager() { private ProductNewsSearchManager() {
@ -71,6 +79,7 @@ public class ProductNewsSearchManager {
public List<ProductNews> getProductNewsList() throws Exception { public List<ProductNews> getProductNewsList() throws Exception {
productNewsList = new ArrayList<>(); productNewsList = new ArrayList<>();
idSet = new HashSet<>();
String jsonStr = HttpToolbox.get(AlphaFineConstants.ALPHA_CID); String jsonStr = HttpToolbox.get(AlphaFineConstants.ALPHA_CID);
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr); JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr);
@ -88,6 +97,7 @@ public class ProductNewsSearchManager {
// 推送时间check // 推送时间check
if (productNews.getPushDate().before(currentDate)) { if (productNews.getPushDate().before(currentDate)) {
productNewsList.add(productNews); productNewsList.add(productNews);
idSet.add(productNews.getId());
} }
} }
return productNewsList; return productNewsList;
@ -97,6 +107,10 @@ public class ProductNewsSearchManager {
return productNewsList; return productNewsList;
} }
public Set<Long> getIdSet() {
return idSet;
}
@Nullable @Nullable
private Image getCoverImage(String url) { private Image getCoverImage(String url) {
try { try {

Loading…
Cancel
Save