Commit f68f200e authored by shiyu's avatar shiyu

查询可交换商品时默认标签去除拍卖中、已结缘、我收藏的

parent 9c46d2fd
...@@ -75,4 +75,10 @@ public class CollectionBookRequestDto extends BaseRequestDto implements Entity ...@@ -75,4 +75,10 @@ public class CollectionBookRequestDto extends BaseRequestDto implements Entity
* 1:展示默认的标签,为空不展示 * 1:展示默认的标签,为空不展示
*/ */
private Integer viewLabelType; private Integer viewLabelType;
/**
* 类型
* 1交换商品,排除默认标签
*/
private Integer type;
} }
...@@ -124,6 +124,11 @@ public class CollectionBookServiceImpl implements CollectionBookService { ...@@ -124,6 +124,11 @@ public class CollectionBookServiceImpl implements CollectionBookService {
if (dto.getViewLabelType().intValue() == 1) { if (dto.getViewLabelType().intValue() == 1) {
if (collectorWhiteListDao.isExisted(userId)) { if (collectorWhiteListDao.isExisted(userId)) {
for (CollectionBookConstants.DefaultBookEnum defaultBookEnum : CollectionBookConstants.DefaultBookEnum.values()) { for (CollectionBookConstants.DefaultBookEnum defaultBookEnum : CollectionBookConstants.DefaultBookEnum.values()) {
if (dto.getType() != null && dto.getType() == 1) {
if (CollectionBookConstants.DefaultBookEnum.FINISHED.getId().intValue() == defaultBookEnum.getId()
|| CollectionBookConstants.DefaultBookEnum.AUCTIONING.getId().intValue() == defaultBookEnum.getId()) {
continue;
} else {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id", defaultBookEnum.getId()); map.put("id", defaultBookEnum.getId());
map.put("title", defaultBookEnum.getName()); map.put("title", defaultBookEnum.getName());
...@@ -131,12 +136,16 @@ public class CollectionBookServiceImpl implements CollectionBookService { ...@@ -131,12 +136,16 @@ public class CollectionBookServiceImpl implements CollectionBookService {
} }
} }
} }
}
}
if (dto.getType() != null && dto.getType() != 1) {
if (dto.getIsHasExtraLabel()) { if (dto.getIsHasExtraLabel()) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id", 0); map.put("id", 0);
map.put("title", "我收藏的"); map.put("title", "我收藏的");
list.add(map); list.add(map);
} }
}
collectionBookList.forEach(collectionBook -> { collectionBookList.forEach(collectionBook -> {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id", collectionBook.getId()); map.put("id", collectionBook.getId());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment