|
|
@@ -11,6 +11,7 @@ import com.cyksj.model.views.YhShopAvailableGoodsView;
|
|
|
import com.cyksj.model.views.YhShopGoodsRateView;
|
|
|
import com.cyksj.model.views.YhShopGoodsView;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
+import com.cyksj.service.mange.RefreshCacheService;
|
|
|
import com.cyksj.service.shop.YhShopGoodsSkuService;
|
|
|
import com.cyksj.web.util.StpYhShopManageUser;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -22,7 +23,6 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.List;
|
|
|
-import java.util.Set;
|
|
|
|
|
|
/*
|
|
|
*项目名: yhlxj
|
|
|
@@ -45,6 +45,8 @@ public class YhShopGoodsController {
|
|
|
|
|
|
private final HttpServletRequest request;
|
|
|
|
|
|
+ private final RefreshCacheService refreshCacheService;
|
|
|
+
|
|
|
/**
|
|
|
* 新增平台
|
|
|
*/
|
|
|
@@ -72,9 +74,7 @@ public class YhShopGoodsController {
|
|
|
sku.setYhsId(yhShop.getId());
|
|
|
});
|
|
|
yhShopGoodsSkuService.saveOrUpdateBatch(goodsSkus);
|
|
|
- String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhShop.getId() + "*";
|
|
|
- Set<String> keys = redisService.keys(yhShopCacheKey);
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshShopUserIdCacheByYshId(yhShop.getId());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -87,9 +87,7 @@ public class YhShopGoodsController {
|
|
|
YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
|
|
|
.eq(YhShop::getUserId, userId).last("limit 1"));
|
|
|
yhShopGoodsSkuService.update(Wrappers.lambdaUpdate(YhShopGoodsSku.class).eq(YhShopGoodsSku::getGoodsId, goodsId).eq(YhShopGoodsSku::getDeleted, true).eq(YhShopGoodsSku::getUserId, userId).set(YhShopGoodsSku::getStatus, status));
|
|
|
- String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhShop.getId() + "*";
|
|
|
- Set<String> keys = redisService.keys(yhShopCacheKey);
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshShopUserIdCacheByYshId(yhShop.getId());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -103,9 +101,7 @@ public class YhShopGoodsController {
|
|
|
YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
|
|
|
.eq(YhShop::getUserId, userId).last("limit 1"));
|
|
|
yhShopGoodsSkuService.update(Wrappers.lambdaUpdate(YhShopGoodsSku.class).eq(YhShopGoodsSku::getGoodsId, goodsId).eq(YhShopGoodsSku::getUserId, userId).set(YhShopGoodsSku::getDeleted, false));
|
|
|
- String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhShop.getId() + "*";
|
|
|
- Set<String> keys = redisService.keys(yhShopCacheKey);
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshShopUserIdCacheByYshId(yhShop.getId());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -142,4 +138,25 @@ public class YhShopGoodsController {
|
|
|
.field(YhShopGoodsView.YhShopGoodsSkuView::getGoodsId, goodsId).build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(views);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 小店规格被下架提示
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/get/sku/down/info")
|
|
|
+ public Result<String> yhShopSkuSysStatusDownInfo() {
|
|
|
+ long userId = StpYhShopManageUser.getLoginIdAsLong();
|
|
|
+ String info = yhShopGoodsSkuService.yhShopSkuSysStatusDownInfo(userId);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(info);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除提示
|
|
|
+ */
|
|
|
+ @DeleteMapping("/delete/sku/down/info")
|
|
|
+ public Result<String> deleteSkuDownInfo() {
|
|
|
+ long userId = StpYhShopManageUser.getLoginIdAsLong();
|
|
|
+ yhShopGoodsSkuService.deleteSkuDownInfo(userId);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
}
|