From dcb96821f905f3fd93c059d8703517bdcac4d336 Mon Sep 17 00:00:00 2001
From: 刘帅 <rr.iii@qq.com>
Date: 星期二, 29 九月 2026 20:02:02 +0800
Subject: [PATCH] 排序问题及门店手机号展示问题
---
cloud-server-other/src/main/java/com/dsh/other/controller/StoreConfigController.java | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/StoreConfigController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/StoreConfigController.java
index c809190..990e9d4 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/controller/StoreConfigController.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/StoreConfigController.java
@@ -3,7 +3,9 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.other.entity.HomeModule;
import com.dsh.other.entity.StoreConfig;
+import com.dsh.other.feignclient.communityWorldCup.WorldCupClient;
import com.dsh.other.feignclient.communityWorldCup.WorldCupStoreClient;
+import com.dsh.other.feignclient.communityWorldCup.model.WorldCup;
import com.dsh.other.feignclient.communityWorldCup.model.WorldCupStore;
import com.dsh.other.model.StoreConfigVo;
import com.dsh.other.service.IHomeModuleService;
@@ -42,6 +44,9 @@
@Resource
private WorldCupStoreClient worldCupStoreClient;
+ @Resource
+ private WorldCupClient worldCupClient;
+
@@ -60,15 +65,17 @@
try {
List<StoreConfig> list = storeConfigService.list(new QueryWrapper<StoreConfig>().eq("storeId", storeId)
.orderByAsc("sort").eq("isOpen", 1));
- HomeModule homeModule = homeModuleService.getOne(new QueryWrapper<HomeModule>().eq("isOpen", 1));
+ List<HomeModule> homeModules = homeModuleService.list(new QueryWrapper<HomeModule>().eq("isOpen", 1).eq("storeId",storeId));
List<StoreConfigVo> listVo = new ArrayList<>();
- if(null != homeModule){
+ for (HomeModule homeModule : homeModules) {
StoreConfigVo vo = new StoreConfigVo();
vo.setType(0);
vo.setIsOpen(homeModule.getIsOpen());
vo.setIsTop(homeModule.getIsTop());
vo.setSort(homeModule.getSort());
vo.setBackgroundImage(homeModule.getBackgroundImage());
+ vo.setDisplayType(homeModule.getDisplayType());
+ vo.setId(homeModule.getId());
listVo.add(vo);
}
for (StoreConfig storeConfig : list) {
@@ -109,38 +116,36 @@
storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/0771fb3bd4de43c08492d0912209e51f.png");
break;
}
-
}
}
-
listVo.add(storeConfigVo);
}
List<WorldCupStore> worldCupStoreList = worldCupStoreClient.getWorldCupStoreList(storeId);
for (WorldCupStore worldCupStore : worldCupStoreList) {
+ WorldCup worldCup = worldCupClient.getWorldCup(worldCupStore.getWorldCupId());
StoreConfigVo storeConfigVo = new StoreConfigVo();
storeConfigVo.setIsTop(0);
storeConfigVo.setId(worldCupStore.getWorldCupId());
- storeConfigVo.setBackgroundImage(ToolUtil.isNotEmpty(worldCupStore.getBackgroundImage()) ? worldCupStore.getBackgroundImage() : "https://we-park-life.oss-cn-beijing.aliyuncs.com/img/760934115ff6468591ed51f0d760a989.jpg");
+ storeConfigVo.setBackgroundImage(ToolUtil.isNotEmpty(worldCupStore.getBackgroundImage()) ? worldCupStore.getBackgroundImage() : worldCup.getHomeBackdropImg());
storeConfigVo.setType(9);
storeConfigVo.setIsOpen(worldCupStore.getIsOpen());
+ storeConfigVo.setDisplayType(worldCupStore.getDisplayType());
storeConfigVo.setSort(worldCupStore.getSort());
listVo.add(storeConfigVo);
}
-
-
//排序
Collections.sort(listVo, new Comparator<StoreConfigVo>() {
@Override
public int compare(StoreConfigVo o1, StoreConfigVo o2) {
- return o1.getSort().compareTo(o2.getSort());
+ return Comparator.nullsLast(Integer::compareTo).compare(o1.getSort(), o2.getSort());
}
});
//排序
Collections.sort(listVo, new Comparator<StoreConfigVo>() {
@Override
public int compare(StoreConfigVo o1, StoreConfigVo o2) {
- return o1.getIsTop().compareTo(o2.getIsTop()) * -1;
+ return Comparator.nullsLast(Integer::compareTo).compare(o2.getIsTop(), o1.getIsTop());
}
});
for (int i = 0; i < listVo.size(); i++) {
--
Gitblit v1.7.1