diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
index 9faf7a80..44a95fac 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
+++ b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
@@ -562,6 +562,7 @@ public class AuthController {
// 20241010 鎵撳嵃鏂瑰紡 瀛楁榛樿缁 0
shop.setPrintingMethod(ShopConstant.PRINTING_METHOD[0]);
shop.setContactPhone(registerShopVo.getMobile());
+ shop.setStatus(0);
shopService.save(shop);
shopService.refreshShopCache(shop.getId(), shop.getRegionId());
// 澧炲姞搴楅摵鍜屽憳宸ュ叧鑱旇〃淇℃伅
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java
index 091a92b7..51d66929 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java
@@ -323,9 +323,13 @@ public class ShopController {
try {
ShopListPageCache cache = JSONUtil.toBean(cacheJson, ShopListPageCache.class);
if (cache != null && cache.getContent() != null) {
- fillBaseDeliveryFee(cache.getContent(), regionId);
- Page
pageResult = new PageImpl<>(cache.getContent(), PageUtil.initPage(pageVo), cache.getTotalElements());
- return new ResultUtil>().setData(pageResult);
+ if (containsUserHiddenShop(cache.getContent())) {
+ redisTemplateHelper.delete(defaultPageCacheKey);
+ } else {
+ fillBaseDeliveryFee(cache.getContent(), regionId);
+ Page pageResult = new PageImpl<>(cache.getContent(), PageUtil.initPage(pageVo), cache.getTotalElements());
+ return new ResultUtil>().setData(pageResult);
+ }
}
} catch (Exception e) {
redisTemplateHelper.delete(defaultPageCacheKey);
@@ -344,6 +348,10 @@ public class ShopController {
continue;
}
s.setShopTakeaway(dto.getShopTakeaway());
+ // 鐢ㄦ埛绔笉杩斿洖宸茬鐢ㄥ簵閾猴紱鍚庡彴鏌ヨ鐢 shopIcon 鏍囪瘑锛屼笉鍙楀奖鍝嶃
+ if (!adminQuery && !isUserVisibleShop(s)) {
+ continue;
+ }
if (CharSequenceUtil.isNotBlank(shop.getShopArea())) {
if (!shop.getShopArea().equals(s.getShopArea())) {
continue;
@@ -365,10 +373,6 @@ public class ShopController {
continue;
}
}
- //宸茬鐢
- if(s.getStatus() != null && s.getStatus() < 1 && !adminQuery){
- continue;
- }
if (CharSequenceUtil.isNotBlank(shop.getShopType())) {
if (!shop.getShopType().equals(s.getShopType())) {
continue;
@@ -574,18 +578,34 @@ public class ShopController {
return dto;
}
+ private boolean containsUserHiddenShop(List shops) {
+ for (Shop shop : shops) {
+ if (!isUserVisibleShop(shop)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isUserVisibleShop(Shop shop) {
+ return shop != null && !ShopConstant.SHOP_STATUS_LOCK.equals(shop.getStatus());
+ }
+
private int compareUserShopPriority(Shop s1, Shop s2, String currentTime) {
- int compareResult = Integer.compare(getTakeawayStatusOrder(s1), getTakeawayStatusOrder(s2));
+ int compareResult = Integer.compare(getShopStatusOrder(s1), getShopStatusOrder(s2));
if (compareResult != 0) {
return compareResult;
}
- compareResult = Integer.compare(getBusinessTimeOrder(s1, currentTime), getBusinessTimeOrder(s2, currentTime));
+ compareResult = Integer.compare(getTakeawayStatusOrder(s1), getTakeawayStatusOrder(s2));
if (compareResult != 0) {
return compareResult;
}
- Integer status1 = s1.getStatus() == null ? ShopConstant.SHOP_STATUS_LOCK : s1.getStatus();
- Integer status2 = s2.getStatus() == null ? ShopConstant.SHOP_STATUS_LOCK : s2.getStatus();
- return status1.compareTo(status2);
+ return Integer.compare(getBusinessTimeOrder(s1, currentTime), getBusinessTimeOrder(s2, currentTime));
+ }
+
+ private int getShopStatusOrder(Shop shop) {
+ Integer status = shop == null ? null : shop.getStatus();
+ return ShopConstant.SHOP_STATUS_NORMAL.equals(status) ? 0 : 1;
}
private int getTakeawayStatusOrder(Shop shop) {
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/legal/controller/AdminAgreementSettingController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/legal/controller/AdminAgreementSettingController.java
new file mode 100644
index 00000000..5a66a10f
--- /dev/null
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/legal/controller/AdminAgreementSettingController.java
@@ -0,0 +1,81 @@
+package cc.hiver.mall.legal.controller;
+
+import cc.hiver.core.common.utils.ResultUtil;
+import cc.hiver.core.common.vo.Result;
+import cc.hiver.mall.legal.entity.MallAgreementSetting;
+import cc.hiver.mall.legal.pojo.AgreementSettingPageQuery;
+import cc.hiver.mall.legal.service.MallAgreementSettingService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@Api(tags = "鍗忚璁剧疆鍚庡彴绠$悊鎺ュ彛")
+@RequestMapping("/hiver/mall/admin/agreementSetting")
+@Transactional
+public class AdminAgreementSettingController {
+
+ @Autowired
+ private MallAgreementSettingService agreementSettingService;
+
+ @RequestMapping(value = "/page", method = RequestMethod.GET)
+ @ApiOperation("鍒嗛〉鑾峰彇鍗忚璁剧疆")
+ public Result> page(AgreementSettingPageQuery query) {
+ return new ResultUtil>().setData(agreementSettingService.pageAgreementSettings(query));
+ }
+
+ @RequestMapping(value = "/get", method = RequestMethod.GET)
+ @ApiOperation("鏍规嵁ID鑾峰彇鍗忚璁剧疆")
+ public Result get(String id) {
+ if (StringUtils.isBlank(id)) {
+ return ResultUtil.error("鍗忚ID涓嶈兘涓虹┖");
+ }
+ return new ResultUtil().setData(agreementSettingService.getById(id));
+ }
+
+ @RequestMapping(value = "/save", method = RequestMethod.POST)
+ @ApiOperation("鏂板鍗忚璁剧疆")
+ public Result save(MallAgreementSetting setting) {
+ if (setting == null || StringUtils.isBlank(setting.getTitle())) {
+ return ResultUtil.error("鍗忚鏍囬涓嶈兘涓虹┖");
+ }
+ try {
+ return new ResultUtil().setData(agreementSettingService.saveAgreementSetting(setting));
+ } catch (IllegalArgumentException e) {
+ return ResultUtil.error(e.getMessage());
+ }
+ }
+
+ @RequestMapping(value = "/edit", method = RequestMethod.POST)
+ @ApiOperation("缂栬緫鍗忚璁剧疆")
+ public Result edit(MallAgreementSetting setting) {
+ if (setting == null || StringUtils.isBlank(setting.getId())) {
+ return ResultUtil.error("鍗忚ID涓嶈兘涓虹┖");
+ }
+ if (StringUtils.isBlank(setting.getTitle())) {
+ return ResultUtil.error("鍗忚鏍囬涓嶈兘涓虹┖");
+ }
+ try {
+ MallAgreementSetting saved = agreementSettingService.editAgreementSetting(setting);
+ return saved == null ? ResultUtil.error("鍗忚涓嶅瓨鍦") : new ResultUtil().setData(saved);
+ } catch (IllegalArgumentException e) {
+ return ResultUtil.error(e.getMessage());
+ }
+ }
+
+ @RequestMapping(value = "/delByIds", method = RequestMethod.POST)
+ @ApiOperation("鎵归噺鍒犻櫎鍗忚璁剧疆")
+ public Result