This commit is contained in:
pikachu1995@126.com
2024-01-24 14:54:29 +08:00
7 changed files with 92 additions and 60 deletions

View File

@@ -23,7 +23,7 @@ public enum PromotionTypeEnum {
/**
* 有促销库存的活动类型
*/
static final PromotionTypeEnum[] haveStockPromotion = new PromotionTypeEnum[]{PINTUAN, SECKILL, KANJIA, POINTS_GOODS};
public static final PromotionTypeEnum[] haveStockPromotion = new PromotionTypeEnum[]{PINTUAN, SECKILL, KANJIA, POINTS_GOODS};
private final String description;

View File

@@ -132,7 +132,7 @@ public class GoodsSearchParams extends PageVO {
queryWrapper.le("quantity", leQuantity);
}
if (geQuantity != null) {
queryWrapper.ge("quantity", geQuantity);
queryWrapper.gt("quantity", geQuantity);
}
if (recommend != null) {
queryWrapper.le("recommend", recommend);
@@ -145,6 +145,7 @@ public class GoodsSearchParams extends PageVO {
}
if(alertQuantity != null && alertQuantity){
queryWrapper.apply("quantity <= alert_quantity");
queryWrapper.ge("alert_quantity", 0);
}
queryWrapper.in(CollUtil.isNotEmpty(ids), "id", ids);

View File

@@ -328,7 +328,11 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
}
}
goodsSkuDetail.getGoodsGalleryList().addAll(goodsVO.getGoodsGalleryList());
if (goodsSkuDetail.getGoodsGalleryList() == null || goodsSkuDetail.getGoodsGalleryList().isEmpty()) {
goodsSkuDetail.setGoodsGalleryList(goodsVO.getGoodsGalleryList());
} else {
goodsSkuDetail.getGoodsGalleryList().addAll(goodsVO.getGoodsGalleryList());
}
map.put("data", goodsSkuDetail);
//获取分类

View File

@@ -399,6 +399,8 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
Object quantity = cache.get(promotionGoodsStockCacheKey);
if (quantity != null) {
goodsVO.setQuantity((Integer) quantity);
} else {
cache.put(promotionGoodsStockCacheKey, seckillApply.getQuantity());
}
seckillGoodsVoS.add(goodsVO);
}

View File

@@ -28,6 +28,10 @@ public interface GoodsStatisticsService extends IService<Goods> {
*/
long todayUpperNum();
/**
* 预警库存数
* @return
*/
long alertQuantityNum();
}

View File

@@ -68,6 +68,7 @@ public class GoodsStatisticsServiceImpl extends ServiceImpl<GoodsStatisticsMappe
"store_id", currentUser.getStoreId());
queryWrapper.eq("market_enable",GoodsStatusEnum.UPPER.name());
queryWrapper.apply("quantity < alert_quantity");
queryWrapper.gt("alert_quantity",0);
return goodsSkuService.count(queryWrapper);
}
}