Parcourir la source

Merge remote-tracking branch 'origin/master'

chenbiao il y a 2 ans
Parent
commit
b763f4a3bd
19 fichiers modifiés avec 155 ajouts et 83 suppressions
  1. 2 14
      netflix-service/src/main/java/com/cyksj/redis/RedisService.java
  2. 2 2
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java
  3. 1 1
      netflix-service/src/main/java/com/cyksj/service/giftcard/impl/GiftCardGoodsSkuServiceImpl.java
  4. 6 6
      netflix-service/src/main/java/com/cyksj/service/mange/impl/RefreshCacheServiceImpl.java
  5. 1 1
      netflix-service/src/main/java/com/cyksj/service/sys/impl/SysConfigChangeRecordServiceImpl.java
  6. 1 1
      netflix-service/src/main/java/com/cyksj/service/sys/impl/SysFuncTimingShelfServiceImpl.java
  7. 2 2
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserIdentCertServiceImpl.java
  8. 4 4
      netflix-service/src/main/java/com/cyksj/task/CorpChatScheduler.java
  9. 57 39
      netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java
  10. 1 0
      netflix-web/src/main/java/com/cyksj/web/controller/group/GroupController.java
  11. 7 1
      netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java
  12. 22 3
      netflix-web/src/main/java/com/cyksj/web/controller/information/InformationController.java
  13. 1 0
      netflix-web/src/main/java/com/cyksj/web/controller/market/LuckyDrawFrontController.java
  14. 1 0
      netflix-web/src/main/java/com/cyksj/web/controller/market/SignFrontController.java
  15. 1 0
      netflix-web/src/main/java/com/cyksj/web/controller/market/TaskFrontController.java
  16. 22 4
      netflix-web/src/main/java/com/cyksj/web/controller/sys/SysConfigController.java
  17. 18 5
      netflix-web/src/main/java/com/cyksj/web/controller/user/AddressController.java
  18. 4 0
      netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java
  19. 2 0
      netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

+ 2 - 14
netflix-service/src/main/java/com/cyksj/redis/RedisService.java

@@ -3,12 +3,10 @@ package com.cyksj.redis;
 import com.cyksj.common.util.StringUtil;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.ZSetOperations;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import java.util.Arrays;
 import java.util.List;
@@ -31,14 +29,6 @@ public class RedisService {
 
     public static String env = "dev";
 
-    @Value("${spring.profiles.active}")
-    private String active;
-
-    @PostConstruct
-    public void init(){
-        env = active + ":";
-    }
-
 
     /**
      * 指定缓存失效时间
@@ -848,6 +838,7 @@ public class RedisService {
         MIDJOURNEY_ACCOUNT("midjourney:account:", "midjourney account", 60 * 60 * 48L),
         APPLY_MONEY_DAY_LIMIT_KEY("apply_money_day_limit_key:%s:%s:%s", "每日提现次数限制", 60 * 60 * 24L),
         NETFLIX_SET_LIMIT_TIME("netflix_set_limit_time", "奈飞设置限制", 30l),
+        SYS_CONFIG_CACHE_KEY("sys_config_cache_key:", "系统配置缓存key", 60 * 60 * 23L),
         ;
 
         private String name;
@@ -856,11 +847,8 @@ public class RedisService {
 
         private long timeout;
 
-        public String getEnvName() {
-            return this.name + env;
-        }
         public String getNameFormat(Object ... str) {
-            return String.format(this.getEnvName(), str);
+            return String.format(this.getName(), str);
         }
 
     }

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -588,7 +588,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 					.eq(CorpCustomerAcquisitionLinkPopularize::getIsChat, 1)
 					.eq(CorpCustomerAcquisitionLinkPopularize::getCustomerAcquistionLinkId, corpCustomerAcquisitionLink.getId()).last("limit 1"));
 			if (corpCustomerAcquisitionLinkPopularize != null) {
-				redisService.sSet(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getEnvName(), externalUserId);
+				redisService.sSet(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getName(), externalUserId);
 			}
 		}
 
@@ -1211,7 +1211,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 					//是否为对话 回传
 					if (corpCustomerAcquisitionLinkPopularize.getIsChat()) {
 						jsonObject.putOpt("event", corpCustomerAcquisitionLinkPopularize.getAddEvent());
-						redisService.hset(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getEnvName(), unionId, jsonObject.toString(), RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getTimeout());
+						redisService.hset(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getName(), unionId, jsonObject.toString(), RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getTimeout());
 					}
 				}
 			}

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/giftcard/impl/GiftCardGoodsSkuServiceImpl.java

@@ -118,7 +118,7 @@ public class GiftCardGoodsSkuServiceImpl extends ServiceImpl<GiftCardGoodsSkuMap
 			if (minPrice == null || min.getPrice().compareTo(minPrice) != 0) {
 				goodsDon.setMinPrice(min.getPrice());
 				goodsDonMapper.updateById(goodsDon);
-				Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
+				Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "*");
 				redisService.del(keys.toArray(String[]::new));
 			}
 		}

+ 6 - 6
netflix-service/src/main/java/com/cyksj/service/mange/impl/RefreshCacheServiceImpl.java

@@ -26,35 +26,35 @@ public class RefreshCacheServiceImpl implements RefreshCacheService {
 
 	@Override
 	public void refreshYhHomeCategoryPageCache() {
-		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "category" + "*");
-		Set<String> shoKeys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + "category" + "*");
+		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "category" + "*");
+		Set<String> shoKeys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + "category" + "*");
 		redisService.del(keys.toArray(String[]::new));
 		redisService.del(shoKeys.toArray(String[]::new));
 	}
 
 	@Override
 	public void refreshGoodsSkuSubsidyPageCache() {
-		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "subsidy" + "*");
+		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy" + "*");
 		redisService.del(keys.toArray(String[]::new));
 	}
 
 	@Override
 	public void refreshShopUserIdCacheByYshId(Long yhsId) {
-		String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId + "*";
+		String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + "*";
 		Set<String> keys = redisService.keys(yhShopCacheKey);
 		redisService.del(keys.toArray(String[]::new));
 	}
 
 	@Override
 	public void refreshUserShopMangeCache(String customId) {
-		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + customId + "*");
+		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + customId + "*");
 		redisService.del(keys.toArray(String[]::new));
 	}
 
 	@Override
 	public void goodsQuestionCache() {
 		//售前
-		String goodsQuestionKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "goods_detail:*";
+		String goodsQuestionKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "goods_detail:*";
 		Set<String> keys = redisService.keys(goodsQuestionKey);
 		redisService.del(keys.toArray(String[]::new));
 		//售后缓存

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/sys/impl/SysConfigChangeRecordServiceImpl.java

@@ -134,7 +134,7 @@ public class SysConfigChangeRecordServiceImpl extends ServiceImpl<SysConfigChang
 					DayOfWeek nowDayOfWeek = LocalDateTime.now().getDayOfWeek();
 					if (weekdayMsgNotifySb.length() > 0 && (nowDayOfWeek == DayOfWeek.SATURDAY || nowDayOfWeek == DayOfWeek.SUNDAY) && envCommonService.isPrdEnv()) {
 						//一个小时内 不重复发送
-						if (redisService.setNx(RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getEnvName(), RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getName(), RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getTimeout())) {
+						if (redisService.setNx(RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getName(), RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getName(), RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getTimeout())) {
 							SmsUtil.sendLuoKey2Msg(Constant.DUTY_SERVICE_CHANGE_NOTIFY_PHONE, String.format(Constant.DUTY_SERVICE_CHANGE_MSG, weekdayMsgNotifySb));
 						}
 					}

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/sys/impl/SysFuncTimingShelfServiceImpl.java

@@ -83,7 +83,7 @@ public class SysFuncTimingShelfServiceImpl extends ServiceImpl<SysFuncTimingShel
 				homeManagementConfigMapper.updateById(homeManagementConfig);
 				log.info("将首页配置:{}的状态置为:{}状态", funcId, timingShelf.getPreStatus());
 
-				Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
+				Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "*");
 				redisService.del(keys.toArray(String[]::new));
 			});
 		});

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/user/impl/UserIdentCertServiceImpl.java

@@ -105,7 +105,7 @@ public class UserIdentCertServiceImpl implements UserIdentCertService {
 			return null;
 		}
 		String state = StringUtil.randomString(6);
-		redisService.set(RedisService.key.WX_INDENT_BIND_KEY.getEnvName() + state, userId, RedisService.key.WX_INDENT_BIND_KEY.getTimeout());
+		redisService.set(RedisService.key.WX_INDENT_BIND_KEY.getName() + state, userId, RedisService.key.WX_INDENT_BIND_KEY.getTimeout());
 		return state;
 	}
 
@@ -118,7 +118,7 @@ public class UserIdentCertServiceImpl implements UserIdentCertService {
 //		if (userIdList.size() == 1 && StrUtil.isNotEmpty(bindState)) {
 //			User user = userMapper.selectById(userId);
 //			if (StrUtil.isEmpty(user.getOpenId())) {
-//				String key = RedisService.key.WX_INDENT_BIND_KEY.getEnvName() + bindState;
+//				String key = RedisService.key.WX_INDENT_BIND_KEY.getName() + bindState;
 //				Object bindInfo = redisService.get(key);
 //				if (bindInfo == null) {
 //					throw BusinessRuntimeException.getInstance("认证信息已失效,请重新操作..");

+ 4 - 4
netflix-service/src/main/java/com/cyksj/task/CorpChatScheduler.java

@@ -45,7 +45,7 @@ public class CorpChatScheduler {
 	 */
     @Scheduled(cron = "5 0/2 * * * ?")
 	public void chatPost() {
-		Set<Object> chatRecord = redisService.sGet(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getEnvName());
+		Set<Object> chatRecord = redisService.sGet(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getName());
 		log.info("发起对话回传. size: {}", chatRecord.size());
 		chatRecord.forEach((key) -> {
 			log.info("发起对话回传. key: {}", key);
@@ -60,13 +60,13 @@ public class CorpChatScheduler {
 			}
 			log.info("发起对话回传. unionId: {}", unionId);
 			if (StrUtil.isNotBlank(unionId)) {
-				String json = StringUtil.getString(redisService.hget(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getEnvName(), unionId));
+				String json = StringUtil.getString(redisService.hget(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getName(), unionId));
 				if (StringUtil.isNotBlank(json)) {
 					JSONObject jsonObject = JSONUtil.parseObj(json);
 					String callback = jsonObject.getStr("callback");
 					try {
 						orderDonPostService.post(OrderDonPost.Type.OE.getType(), callback, Optional.ofNullable(jsonObject.getStr("event")).orElse("customer_effective"));
-						redisService.setRemove(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getEnvName(), key);
+						redisService.setRemove(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getName(), key);
 						log.info("发起对话回传成功. {}", key);
 					} catch (Exception e) {
 						log.error("发起对话回传失败. {}", e.getMessage());
@@ -75,7 +75,7 @@ public class CorpChatScheduler {
 			}else {
 				Long count = redisService.incr(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_COUNT.getNameFormat(key), 1L);
 				if(count > 3){
-					redisService.setRemove(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getEnvName(), key);
+					redisService.setRemove(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getName(), key);
 				}
 			}
 		});

+ 57 - 39
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -96,7 +96,7 @@ public class GoodsDonController {
 	    if (StrUtil.isNotBlank(customId)) {
 		    yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
 	    }
-	    String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "category";
+	    String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "category";
 	    if (yhsId != null) {
 		    key += ":yhShop:" + yhsId;
 	    }
@@ -231,7 +231,7 @@ public class GoodsDonController {
 	    }
 	    //List<Long> filter_goodsIds = getFilterGoodsIds();
 	    List<Long> filter_goodsIds = null;
-	    String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "PC";
+	    String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "PC";
 	    if (CollUtil.isNotEmpty(filter_goodsIds)) {
 		    pcCacheKey += ":hz-ip";
 	    }
@@ -274,7 +274,7 @@ public class GoodsDonController {
 	    }
 	    //List<Long> filter_goodsIds = getFilterGoodsIds();
 		List<Long> filter_goodsIds = null;
-	    String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "H5";
+	    String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
 	    if (CollUtil.isNotEmpty(filter_goodsIds)) {
 		    h5CacheKey += ":hz-ip";
 	    }
@@ -310,7 +310,7 @@ public class GoodsDonController {
      */
     @GetMapping("/get/register")
     public Result<List<RegisterGoodsDonView>> getRegisterGoodsDon() {
-        String registerCacheKey = RedisService.key.REGISTER_HOME_PAGE_CACHE.getEnvName();
+        String registerCacheKey = RedisService.key.REGISTER_HOME_PAGE_CACHE.getName();
         Object value = redisService.get(registerCacheKey);
         if (value != null) {
             try {
@@ -344,7 +344,7 @@ public class GoodsDonController {
 			Result<YhShopGoodsFrontView> yhShopGoodsDetail = getGoodsDetailByYhsId(yhShopFrontService.getYhsIdByCustomId(customId), id);
 			return yhShopGoodsDetail;
 		}
-		String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "goods_detail:" + id;
+		String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "goods_detail:" + id;
 		//List<Long> filter_goodsIds = getFilterGoodsIds();
 		List<Long> filter_goodsIds = null;
 		//存在过滤平台 商品详情不返回
@@ -450,11 +450,11 @@ public class GoodsDonController {
      */
     @GetMapping("/get/recommend/{id}")
     public Result<List<GoodsFrontListView>> getRecommendGoodsByGid(@PathVariable Long id, String customId, String dsCode) throws Exception {
-	    String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "recommend:" + id;
+	    String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "recommend:" + id;
 	    Long yhsId = null;
 	    if (StrUtil.isNotBlank(customId)) {
 		    yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
-		    key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId + ":recommend:" + id;
+		    key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":recommend:" + id;
 	    }
 	    Object o = redisService.get(key);
 	    Long fUid = StpUserUtil.getUserIdAfterLogin();
@@ -554,11 +554,11 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/homeManage")
 	public Result<Map<String, List<HomeManagementFrontView>>> getHomeManagementFrontPage(String customId, String dsCode) {
-		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "homeManage";
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "homeManage";
 		Long yhsId = null;
 		if (StrUtil.isNotBlank(customId)) {
 			yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
-			key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId + ":homeManage";
+			key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":homeManage";
 		}
 //		List<Long> filter_goodsIds = getFilterGoodsIds();
 		List<Long> filter_goodsIds = null;
@@ -733,7 +733,7 @@ public class GoodsDonController {
 	    if (fUid != null) {
 		    if (data.getIsSp()) {
 			    //查找所有特定规格最小价格 满足条件
-			    String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "specific:" + data.getId();
+			    String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "specific:" + data.getId();
 			    Object speciObj = redisService.get(specificGoodsKey);
 			    List<GoodsDonSku> specificSkus = null;
 			    if (speciObj != null) {
@@ -785,7 +785,7 @@ public class GoodsDonController {
 		if (fUid != null) {
 			if (data.getIsSp()) {
 				//查找所有特定规格最小价格 满足条件
-				String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "specific:" + data.getId();
+				String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "specific:" + data.getId();
 				Object speciObj = redisService.get(specificGoodsKey);
 				List<GoodsDonSku> specificSkus = null;
 				if (speciObj != null) {
@@ -835,7 +835,7 @@ public class GoodsDonController {
 	 */
 	public List<GoodsDonSku> getSpecificSku(Long goodsId) {
 		//查找所有特定规格最小价格 满足条件
-		String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "specific:" + goodsId;
+		String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "specific:" + goodsId;
 		Object speciObj = redisService.get(specificGoodsKey);
 		List<GoodsDonSku> specificSkus = null;
 		if (speciObj != null) {
@@ -917,7 +917,7 @@ public class GoodsDonController {
      */
     @GetMapping("/get/shop/goods/{yhsId}")
     public Result<List<YhShopGoodsFrontView>> getShopGoods(@PathVariable Long yhsId) {
-        String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId;
+        String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId;
         Object value = redisService.get(yhShopCacheKey);
         List<YhShopGoodsFrontView> list = null;
         if (value != null) {
@@ -945,22 +945,29 @@ public class GoodsDonController {
      */
     @GetMapping("/get/shop/goods/detail/{yhsId}/{goodsId}")
     public Result<YhShopGoodsFrontView> getGoodsDetailByYhsId(@PathVariable Long yhsId, @PathVariable Long goodsId) {
-        MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
-        String condition = String.format("and yhs_id = %s and ys.goods_id = %s", yhsId, goodsId);
-        builder.put("condition", condition);
-        YhShopGoodsFrontView goodsDetailView = beanSearcher.searchFirst(YhShopGoodsFrontView.class, builder.build());
-        if (goodsDetailView == null) {
-            throw BusinessRuntimeException.getInstance("该平台不存在或已下架,请刷新页面");
-        }
-        goodsDetailView.setSkuList(beanSearcher.searchAll(YhShopGoodsSkuFrontView.class, MapUtils.builder().put("condition", condition).orderBy(YhShopGoodsSkuFrontView::getSorted).asc().build()));
-        goodsDetailView.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, goodsDetailView.getId()).build()));
-        OrderCommentFrontView comments = beanSearcher.searchFirst(OrderCommentFrontView.class, MapUtils.builder()
-                .field(OrderCommentFrontView::getGoodsId, goodsDetailView.getId())
-                .orderBy(OrderCommentFrontView::getCommentTime).desc()
-                .orderBy(OrderCommentFrontView::getId).desc()
-                .build());
-        goodsDetailView.setComments(comments);
-        return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDetailView);
+	    String yhShopDetailCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":goodsId:" + goodsId;
+	    Object value = redisService.get(yhShopDetailCacheKey);
+	    if (value == null) {
+		    MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
+		    String condition = String.format("and yhs_id = %s and ys.goods_id = %s", yhsId, goodsId);
+		    builder.put("condition", condition);
+		    YhShopGoodsFrontView goodsDetailView = beanSearcher.searchFirst(YhShopGoodsFrontView.class, builder.build());
+		    if (goodsDetailView == null) {
+			    throw BusinessRuntimeException.getInstance("该平台不存在或已下架,请刷新页面");
+		    }
+		    goodsDetailView.setSkuList(beanSearcher.searchAll(YhShopGoodsSkuFrontView.class, MapUtils.builder().put("condition", condition).orderBy(YhShopGoodsSkuFrontView::getSorted).asc().build()));
+		    goodsDetailView.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, goodsDetailView.getId()).build()));
+		    OrderCommentFrontView comments = beanSearcher.searchFirst(OrderCommentFrontView.class, MapUtils.builder()
+				    .field(OrderCommentFrontView::getGoodsId, goodsDetailView.getId())
+				    .orderBy(OrderCommentFrontView::getCommentTime).desc()
+				    .orderBy(OrderCommentFrontView::getId).desc()
+				    .build());
+		    goodsDetailView.setComments(comments);
+		    redisService.setNx(yhShopDetailCacheKey, goodsDetailView, RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getTimeout() + RandomUtil.randomInt(1000));
+		    value = redisService.get(yhShopDetailCacheKey);
+	    }
+	    YhShopGoodsFrontView goodsDetailView = Jsons.parseObject(value, YhShopGoodsFrontView.class);
+	    return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDetailView);
     }
 
 	/**
@@ -973,7 +980,7 @@ public class GoodsDonController {
 			return shopGoods;
 		}
 		Long fUid = StpUserUtil.getUserIdAfterLogin();
-		String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "category:goods";
+		String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "category:goods";
 		if (cgy != null) {
 			categoryGoodsKey += ":" + cgy;
 		}
@@ -1051,7 +1058,7 @@ public class GoodsDonController {
 
 	@GetMapping("/get/shop/categoryGoods/{yhsId}")
 	public Result<List<YhShopGoodsFrontCategoryView>> getShopCategoryGoods(@PathVariable Long yhsId, Long category) {
-		String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId + ":category";
+		String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":category";
 		if (category != null) {
 			categoryGoodsKey += ":" + category;
 		}
@@ -1101,7 +1108,7 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/deposit")
 	public Result<? extends Object> getDepositGoods() {
-		String depositGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "deposit";
+		String depositGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "deposit";
 		Object o = redisService.get(depositGoodsKey);
 		if (o == null) {
 			List<GoodsDon> depositList = beanSearcher.searchAll(GoodsDon.class, MapUtils.builder()
@@ -1125,7 +1132,7 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/pc/homeManage")
 	public Result<Map<String, List<HomeManagementFrontView>>> getPcHomeManagementFrontPage() {
-		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "pc:homeManage";
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "pc:homeManage";
 		//移除奈飞客厅 临时
 		Long filterConfigId = null;
 //		if (isHzIp()) {
@@ -1153,7 +1160,7 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/pc/realGoodsConfig")
 	public Result<? extends Object> getPcRealGoodsConfig() throws Exception {
-		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "pc:realHomePage";
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "pc:realHomePage";
 		Object o = redisService.get(key);
 		List<HomeManagementFrontView> list = null;
 		if (o == null) {
@@ -1172,7 +1179,7 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/subsidy")
 	public Result<List<GoodsDonSkuSubsidyFrontView>> getSubsidyGoods() {
-		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "subsidy";
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy";
 		Object o = redisService.get(key);
 		if (o == null) {
 			List<GoodsDonSkuSubsidyFrontView> subsidyList = beanSearcher.searchAll(GoodsDonSkuSubsidyFrontView.class, MapUtils.builder().build());
@@ -1209,7 +1216,7 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/subsidy/detail/{id}")
 	public Result<GoodsDonSubsidyDetailView> getSubsidyDetailById(@PathVariable Long id) throws Exception {
-		String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "subsidy:detail:" + id;
+		String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy:detail:" + id;
 		Object o = redisService.get(goodsDetailKey);
 		GoodsDonSubsidyDetailView subsidyDetail = null;
 		if (o == null) {
@@ -1238,7 +1245,17 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/available/subsidy/sku/{goodsId}")
 	public Result<List<GoodsDonSkuSubsidyAvailableView>> getAvailableSubsidySku(@PathVariable Long goodsId) {
-		List<GoodsDonSkuSubsidyAvailableView> goodsDonSkuSubsidyAvailableViews = beanSearcher.searchAll(GoodsDonSkuSubsidyAvailableView.class, MapUtils.builder().put("gid", String.format(" and goods_id = %s", goodsId)).build());
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy:" + goodsId;
+		Object o = redisService.get(key);
+		if (o == null) {
+			List<GoodsDonSkuSubsidyAvailableView> goodsDonSkuSubsidyAvailableViews = beanSearcher.searchAll(GoodsDonSkuSubsidyAvailableView.class, MapUtils.builder().put("gid", String.format(" and goods_id = %s", goodsId)).build());
+			if (CollUtil.isEmpty(goodsDonSkuSubsidyAvailableViews)) {
+				return GatewayResponse.SUCCESS.newBuilder().toResult();
+			}
+			redisService.set(key, goodsDonSkuSubsidyAvailableViews, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout() + RandomUtil.randomInt(10000));
+			o = redisService.get(key);
+		}
+		List<GoodsDonSkuSubsidyAvailableView> goodsDonSkuSubsidyAvailableViews = Jsons.parseList(o, GoodsDonSkuSubsidyAvailableView.class);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDonSkuSubsidyAvailableViews);
 	}
 
@@ -1248,7 +1265,7 @@ public class GoodsDonController {
 	@GetMapping("/get/shop/homeManage")
 	public Result<Map<String, List<HomeManagementFrontView>>> getShopHomeManageConfig(String customId) {
 		//是否同意展示对应首页广告位
-		String key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + customId + ":homeManage";
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + customId + ":homeManage";
 		Object o = redisService.get(key);
 		if (o == null) {
 			MapBuilder builder = MapUtils.builder()
@@ -1272,7 +1289,8 @@ public class GoodsDonController {
 	 */
 	@GetMapping("/get/upgradePackage")
 	public Result<SearchResult<UpgradePackageView>> list(Long skuId) {
-		log.info("获取套餐列表");
+		long userId = StpUserUtil.getLoginIdAsLong();
+		log.info("userId:{}获取套餐列表", userId);
 		Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
 		if (skuId != null) {
 			build.put("sku", String.format(" and JSON_CONTAINS(up.sku_ids,'\"%s\"')", skuId));

+ 1 - 0
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupController.java

@@ -37,6 +37,7 @@ public class GroupController {
     private final GoodsDonSkuMapper goodsDonSkuMapper;
 
     @GetMapping("/get")
+    @Deprecated
     public Result<SearchResult<GroupsView>> get() {
         SearchResult<GroupsView> search = beanSearcher.search(GroupsView.class, MapUtils.flatBuilder(request.getParameterMap())
                 .orderBy(GroupsView::getOrderBy).asc()

+ 7 - 1
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -295,7 +295,7 @@ public class GroupRelationController {
             if (count >= num) throw BusinessRuntimeException.getInstance("获取双重验证码次数上限");
         }
         //一分钟内 只能一人获取
-        boolean b = redisService.setNx(RedisService.key.DOUBLE_VERIFY_CODE_VIEW_MINUTES_KEY.getEnvName() + groupsRelationView.getTripsAccount(), relationId, RedisService.key.DOUBLE_VERIFY_CODE_VIEW_MINUTES_KEY.getTimeout());
+        boolean b = redisService.setNx(RedisService.key.DOUBLE_VERIFY_CODE_VIEW_MINUTES_KEY.getName() + groupsRelationView.getTripsAccount(), relationId, RedisService.key.DOUBLE_VERIFY_CODE_VIEW_MINUTES_KEY.getTimeout());
         if (!b) {
             throw BusinessRuntimeException.getInstance("一分钟内已有人获取该账号验证码,请稍后获取..");
         }
@@ -514,6 +514,8 @@ public class GroupRelationController {
      */
     @GetMapping("/get/advertise/{goodsId}")
     public Result<List<TicketAdvertiseConfigFrontView>> getTicketAdvertiseConfig(@PathVariable Long goodsId) {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        log.info("userId:{}获取广告位配置", userId);
         List<TicketAdvertiseConfigFrontView> views = beanSearcher.searchAll(TicketAdvertiseConfigFrontView.class, MapUtils.flatBuilder(request.getParameterMap())
                 .field(TicketAdvertiseConfig::getGoodsId, goodsId)
                 .orderBy(TicketAdvertiseConfig::getSorted).desc()
@@ -825,6 +827,8 @@ public class GroupRelationController {
      */
     @GetMapping("/get/questions/{goodsId}")
     public Result<List<GoodsDonQaFrontView>> getTicketQuestions(@PathVariable Long goodsId, @RequestParam(defaultValue = "1") Integer type) {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        log.info("userId:{}查看车票:{}售后问题", userId, goodsId);
         if (type < 1 || type > 2) {
             return GatewayResponse.SUCCESS.newBuilder().toResult();
         }
@@ -880,6 +884,8 @@ public class GroupRelationController {
      */
     @GetMapping("/get/pin/status/{taskId}")
     public Result<Integer> getPinStatus(@PathVariable String taskId) throws Exception {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        log.info("userId:{}查看设置pin码状态", userId);
         return GatewayResponse.SUCCESS.newBuilder().toResult(groupsRelationNetflixService.getPinStatus(taskId));
     }
 

+ 22 - 3
netflix-web/src/main/java/com/cyksj/web/controller/information/InformationController.java

@@ -1,5 +1,7 @@
 package com.cyksj.web.controller.information;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.RandomUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.dto.Result;
@@ -45,7 +47,15 @@ public class InformationController {
      */
     @GetMapping("/get")
     public Result<IPage<InformationListView>> getInformation(Long categoryId, @RequestParam(defaultValue = "0") Integer start, @RequestParam(defaultValue = "5") Integer limit) {
-        IPage<InformationListView> information = informationService.getInformation(categoryId, start, limit);
+        String key = RedisService.key.INFORMATION_KEY.getName() + String.format(":list:%s:%s", start, limit);
+        if (categoryId != null) {
+            key += ":ct:" + categoryId;
+        }
+        IPage<InformationListView> information  = (IPage<InformationListView>) redisService.get(key);
+        if (information == null) {
+            information = informationService.getInformation(categoryId, start, limit);
+            redisService.setNx(key, information, RedisService.key.INFORMATION_KEY.getTimeout() + RandomUtil.randomInt(10000));
+        }
         return GatewayResponse.SUCCESS.newBuilder().toResult(information);
     }
 
@@ -55,7 +65,16 @@ public class InformationController {
      */
     @GetMapping("/get/category")
     public Result<List<InformationCategory>> getInformationCategory() {
-        return GatewayResponse.SUCCESS.newBuilder().toResult(informationCategoryService.getInformationCategory());
+        String key = RedisService.key.INFORMATION_KEY.getName() + ":category";
+        List<InformationCategory> informationCategory = (List<InformationCategory>) redisService.get(key);
+        if (informationCategory == null) {
+            informationCategory = informationCategoryService.getInformationCategory();
+            if (CollUtil.isEmpty(informationCategory)) {
+                return GatewayResponse.SUCCESS.newBuilder().toResult();
+            }
+            redisService.setNx(key, informationCategory, RedisService.key.INFORMATION_KEY.getTimeout() + RandomUtil.randomInt(100000));
+        }
+        return GatewayResponse.SUCCESS.newBuilder().toResult(informationCategory);
     }
 
     /**
@@ -63,7 +82,7 @@ public class InformationController {
      */
     @GetMapping("/get/detail/{id}")
     public Result<InformationDetailView> getInformation(@PathVariable Long id) {
-        String key = RedisService.key.INFORMATION_KEY.getEnvName() + "id:" + id;
+        String key = RedisService.key.INFORMATION_KEY.getName() + "id:" + id;
         InformationDetailView view = (InformationDetailView) redisService.get(key);
         if (view == null){
             view = beanSearcher.searchFirst(InformationDetailView.class, MapUtils.flatBuilder(request.getParameterMap())

+ 1 - 0
netflix-web/src/main/java/com/cyksj/web/controller/market/LuckyDrawFrontController.java

@@ -53,6 +53,7 @@ public class LuckyDrawFrontController {
 	 */
 	@GetMapping("/get")
 	public Result<List<LuckyDrawView>> getLuckyDraw(@RequestParam(defaultValue = "true") Boolean isRepeat) throws Exception {
+		long userId = StpUserUtil.getLoginIdAsLong();
 		List<LuckyDrawView> drawViews = beanSearcher.searchAll(LuckyDrawView.class, MapUtils.flatBuilder(request.getParameterMap())
 				.field(LuckyDrawView::getStatus, true).op(Operator.Equal).build());
 		if (drawViews.isEmpty()) {

+ 1 - 0
netflix-web/src/main/java/com/cyksj/web/controller/market/SignFrontController.java

@@ -63,6 +63,7 @@ public class SignFrontController {
      */
     @GetMapping("/get/points/config")
     public Result<List<SignConfig>> getSign() {
+        long userId = StpUserUtil.getLoginIdAsLong();
         return GatewayResponse.SUCCESS.newBuilder().toResult(signConfigMapper.selectList(Wrappers.lambdaQuery(SignConfig.class).orderByAsc(SignConfig::getId)));
     }
 

+ 1 - 0
netflix-web/src/main/java/com/cyksj/web/controller/market/TaskFrontController.java

@@ -57,6 +57,7 @@ public class TaskFrontController {
 	private final BadIntentionOpService badIntentionOpService;
 
 	private final HttpServletRequest request;
+
 	/**
 	 * 任务列表
 	 */

+ 22 - 4
netflix-web/src/main/java/com/cyksj/web/controller/sys/SysConfigController.java

@@ -80,6 +80,12 @@ public class SysConfigController {
 			throw new BusinessRuntimeException("配置不存在");
 		}
 
+		//缓存
+		String cacheKey = RedisService.key.SYS_CONFIG_CACHE_KEY.getName() + key;
+		Object o = redisService.get(cacheKey);
+		if (o == null) {
+			redisService.setNx(RedisService.key.SYS_CONFIG_CACHE_KEY.getName() + key, sysConfig, RedisService.key.SYS_CONFIG_CACHE_KEY.getTimeout());
+		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
 	}
 
@@ -87,7 +93,6 @@ public class SysConfigController {
 	@Log(module = "系统设置/新增配置", businessType = BusinessType.POST, isSaveRequestData = true)
 	public Result<SysConfig> post(@RequestBody SysConfig sysConfig) {
 		sysConfigService.save(sysConfig);
-
 		return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
 	}
 
@@ -130,14 +135,27 @@ public class SysConfigController {
 			sysConfigChangeRecordService.updateCorpFollowLinkConfig(changeRecord.getUpdateFollowIndxs());
 		}
 
+		String key = sysConfig.getSysKey();
+		String cacheKey = RedisService.key.SYS_CONFIG_CACHE_KEY.getName() + key;
+		if (redisService.hasKey(cacheKey)) {
+			redisService.set(cacheKey, sysConfig, RedisService.key.SYS_CONFIG_CACHE_KEY.getTimeout());
+		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
 	}
 
 	@DeleteMapping("/delete/{id}")
 	@Log(module = "系统设置/删除配置", businessType = BusinessType.DELETE)
 	public Result<String> update(@PathVariable Long id) {
-		sysConfigService.removeById(id);
+		SysConfig byId = sysConfigService.getById(id);
+		if (byId != null) {
+			sysConfigService.removeById(id);
 
+			String key = byId.getSysKey();
+			String cacheKey = RedisService.key.SYS_CONFIG_CACHE_KEY.getName() + key;
+			if (redisService.hasKey(cacheKey)) {
+				redisService.del(cacheKey);
+			}
+		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
 
@@ -205,7 +223,7 @@ public class SysConfigController {
 	public Result getServiceIndx() {
 		long userId = StpUserUtil.getLoginIdAsLong();
 		long time = DateUtil.beginOfDay(DateTime.now()).getTime();
-		Object re = redisService.get(RedisService.key.EQUIPMENT_USER_SERVICE_RECORD.getEnvName() + time + userId);
+		Object re = redisService.get(RedisService.key.EQUIPMENT_USER_SERVICE_RECORD.getName() + time + userId);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(re);
 	}
 
@@ -216,7 +234,7 @@ public class SysConfigController {
 	public Result<Integer> serviceRecord(@PathVariable Long indx) {
 		long userId = StpUserUtil.getLoginIdAsLong();
 		long time = DateUtil.beginOfDay(DateTime.now()).getTime();
-		redisService.set(RedisService.key.EQUIPMENT_USER_SERVICE_RECORD.getEnvName() + time + userId, indx, RedisService.key.EQUIPMENT_USER_SERVICE_RECORD.getTimeout());
+		redisService.set(RedisService.key.EQUIPMENT_USER_SERVICE_RECORD.getName() + time + userId, indx, RedisService.key.EQUIPMENT_USER_SERVICE_RECORD.getTimeout());
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
 

+ 18 - 5
netflix-web/src/main/java/com/cyksj/web/controller/user/AddressController.java

@@ -6,6 +6,7 @@ import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.model.entity.Address;
 import com.cyksj.service.user.AddressService;
+import com.cyksj.service.user.UserBindRelationService;
 import com.cyksj.web.util.StpUserUtil;
 import lombok.RequiredArgsConstructor;
 import org.springframework.transaction.annotation.Transactional;
@@ -24,10 +25,13 @@ public class AddressController {
 
     private final AddressService addressService;
 
+    private final UserBindRelationService userBindRelationService;
+
     @GetMapping("/get")
     public Result<List<Address>> get(){
         long userId = StpUserUtil.getLoginIdAsLong();
-        List<Address> addressList = addressService.list(Wrappers.lambdaQuery(Address.class).eq(Address::getUserId, userId));
+        List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+        List<Address> addressList = addressService.list(Wrappers.lambdaQuery(Address.class).in(Address::getUserId, userIdList));
         return GatewayResponse.SUCCESS.newBuilder().toResult(addressList);
     }
 
@@ -35,7 +39,8 @@ public class AddressController {
     @PostMapping("/post")
     public Result<Address> save(@RequestBody Address address){
         long userId = StpUserUtil.getLoginIdAsLong();
-        int count = addressService.count(Wrappers.lambdaQuery(Address.class).eq(Address::getUserId, userId));
+        List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+        int count = addressService.count(Wrappers.lambdaQuery(Address.class).in(Address::getUserId, userIdList));
         if (count >= 20) {
             throw new BusinessRuntimeException("收货地址最多可添加20条, 请清理后再添加.");
         }
@@ -45,7 +50,7 @@ public class AddressController {
         }
 
         if(address.getIsDefault() != null && address.getIsDefault() ){
-            addressService.update(Wrappers.lambdaUpdate(Address.class).eq(Address::getUserId,userId).set(Address::getIsDefault,false));
+            addressService.update(Wrappers.lambdaUpdate(Address.class).in(Address::getUserId,userIdList).set(Address::getIsDefault,false));
         }
         address.setUserId(userId);
         addressService.save(address);
@@ -57,8 +62,9 @@ public class AddressController {
     public Result<Address> update(@RequestBody Address address){
 
         long userId = StpUserUtil.getLoginIdAsLong();
+        List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
         if(address.getIsDefault() != null && address.getIsDefault() ){
-            addressService.update(Wrappers.lambdaUpdate(Address.class).eq(Address::getUserId,userId).set(Address::getIsDefault,false));
+            addressService.update(Wrappers.lambdaUpdate(Address.class).in(Address::getUserId,userIdList).set(Address::getIsDefault,false));
         }
 
         addressService.updateById(address);
@@ -67,7 +73,14 @@ public class AddressController {
 
     @DeleteMapping("/delete/{id}")
     public Result<String> delete(@PathVariable Long id){
-        addressService.removeById(id);
+        long userId = StpUserUtil.getLoginIdAsLong();
+        List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+        Address one = addressService.getOne(Wrappers.lambdaQuery(Address.class)
+                .eq(Address::getId, id)
+                .in(Address::getUserId, userIdList));
+        if (one != null) {
+            addressService.removeById(id);
+        }
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 

+ 4 - 0
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -430,6 +430,10 @@ public class AuthorizationController {
                 }
             }
         }
+        Object exists = redisService.get(RedisService.key.EMAIL_CODE_KEY.getNameFormat(email));
+        if (exists != null) {
+            throw BusinessRuntimeException.getInstance("验证码未失效");
+        }
         String code = mailService.sendLoginCodeEmailToPeople(digit, email);
         if (code == null) {
             throw BusinessRuntimeException.getInstance("获取邮箱验证码错误");

+ 2 - 0
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -245,6 +245,7 @@ public class DistributePopularizeController {
 	 */
 	@GetMapping("/applyMoney/threshold")
 	public Result<DistributePointsExchangeMoney> getThreshold() {
+		Long userId = StpUserUtil.getLoginIdAsLong();
 		return GatewayResponse.SUCCESS.newBuilder().toResult(distributePointsExchangeMoneyMapper.selectOne(Wrappers.lambdaQuery(DistributePointsExchangeMoney.class).last("limit 1")));
 	}
 
@@ -278,6 +279,7 @@ public class DistributePopularizeController {
 	 */
 	@GetMapping("/get/general/distribute/detail")
 	public Result<DistributePopularizeView> getGeneralDistributeDetail() {
+		Long userId = StpUserUtil.getLoginIdAsLong();
 		List<GoodsDon> goodsDons = goodsDonMapper.selectList(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getDeleted, true).eq(GoodsDon::getStatus, true).eq(GoodsDon::getType, 1).orderByAsc(GoodsDon::getRate).select(GoodsDon::getRate, GoodsDon::getTitle));
 		if (goodsDons.isEmpty()) {
 			return GatewayResponse.SUCCESS.newBuilder().toResult();