促销相关代码批量提交
This commit is contained in:
parent
7276824a18
commit
e141d22504
@ -72,7 +72,7 @@ public class AfterSaleBuyerController {
|
|||||||
})
|
})
|
||||||
@GetMapping(value = "/applyAfterSaleInfo/{sn}")
|
@GetMapping(value = "/applyAfterSaleInfo/{sn}")
|
||||||
public ResultMessage<AfterSaleApplyVO> applyAfterSaleInfo(@PathVariable String sn) {
|
public ResultMessage<AfterSaleApplyVO> applyAfterSaleInfo(@PathVariable String sn) {
|
||||||
return ResultUtil.data(afterSaleService.getAfterSaleDTO(sn));
|
return ResultUtil.data(afterSaleService.getAfterSaleVO(sn));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(value = "/save/{orderItemSn}")
|
@PostMapping(value = "/save/{orderItemSn}")
|
||||||
|
@ -96,7 +96,7 @@ public class PromotionEverydayExecute implements EveryDayExecute {
|
|||||||
query.addCriteria(Criteria.where("promotionStatus").ne(PromotionStatusEnum.END.name())
|
query.addCriteria(Criteria.where("promotionStatus").ne(PromotionStatusEnum.END.name())
|
||||||
.orOperator(Criteria.where("promotionStatus").ne(PromotionStatusEnum.CLOSE.name())));
|
.orOperator(Criteria.where("promotionStatus").ne(PromotionStatusEnum.CLOSE.name())));
|
||||||
//结束条件 活动结束时间大于当前时间
|
//结束条件 活动结束时间大于当前时间
|
||||||
query.addCriteria(Criteria.where("endTime").lt(new Date()));
|
query.addCriteria(Criteria.where("endTime").lte(new Date()));
|
||||||
|
|
||||||
//结束满减活动
|
//结束满减活动
|
||||||
endFullDiscount(query);
|
endFullDiscount(query);
|
||||||
|
@ -14,6 +14,7 @@ public enum PromotionTypeEnum {
|
|||||||
PINTUAN("拼团"),
|
PINTUAN("拼团"),
|
||||||
SECKILL("秒杀"),
|
SECKILL("秒杀"),
|
||||||
COUPON("优惠券"),
|
COUPON("优惠券"),
|
||||||
|
PLATFORM_COUPON("平台优惠券"),
|
||||||
FULL_DISCOUNT("满减"),
|
FULL_DISCOUNT("满减"),
|
||||||
POINTS_GOODS("积分商品"),
|
POINTS_GOODS("积分商品"),
|
||||||
KANJIA("砍价"),
|
KANJIA("砍价"),
|
||||||
|
@ -268,7 +268,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
public Integer todayUpperNum() {
|
public Integer todayUpperNum() {
|
||||||
LambdaQueryWrapper<Goods> queryWrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<Goods> queryWrapper = Wrappers.lambdaQuery();
|
||||||
queryWrapper.eq(Goods::getMarketEnable, GoodsStatusEnum.UPPER.name());
|
queryWrapper.eq(Goods::getMarketEnable, GoodsStatusEnum.UPPER.name());
|
||||||
queryWrapper.gt(Goods::getCreateTime, DateUtil.beginOfDay(new DateTime()));
|
queryWrapper.ge(Goods::getCreateTime, DateUtil.beginOfDay(new DateTime()));
|
||||||
return this.count(queryWrapper);
|
return this.count(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer todayMemberEvaluation() {
|
public Integer todayMemberEvaluation() {
|
||||||
return this.count(new LambdaQueryWrapper<MemberEvaluation>().gt(MemberEvaluation::getCreateTime, DateUtil.beginOfDay(new DateTime())));
|
return this.count(new LambdaQueryWrapper<MemberEvaluation>().ge(MemberEvaluation::getCreateTime, DateUtil.beginOfDay(new DateTime())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -8,9 +8,9 @@ public enum RenderStepEnums {
|
|||||||
CHECK_DATA("校验商品"),
|
CHECK_DATA("校验商品"),
|
||||||
CHECKED_FILTER("选择商品过滤"),
|
CHECKED_FILTER("选择商品过滤"),
|
||||||
COUPON("优惠券价格渲染"),
|
COUPON("优惠券价格渲染"),
|
||||||
SKU_FREIGHT("运费计算"),
|
|
||||||
SKU_PROMOTION("商品促销计算"),
|
SKU_PROMOTION("商品促销计算"),
|
||||||
FULL_DISCOUNT("满减计算"),
|
FULL_DISCOUNT("满减计算"),
|
||||||
|
SKU_FREIGHT("运费计算"),
|
||||||
DISTRIBUTION("分配需要分配的促销金额"),
|
DISTRIBUTION("分配需要分配的促销金额"),
|
||||||
PLATFORM_COMMISSION("平台佣金"),
|
PLATFORM_COMMISSION("平台佣金"),
|
||||||
CART_PRICE("购物车金额计算"),
|
CART_PRICE("购物车金额计算"),
|
||||||
|
@ -45,6 +45,9 @@ public class CartSkuVO extends CartBase implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "小记")
|
@ApiModelProperty(value = "小记")
|
||||||
private Double subTotal;
|
private Double subTotal;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小记")
|
||||||
|
private Double utilPrice;
|
||||||
/**
|
/**
|
||||||
* 是否选中,要去结算 0:未选中 1:已选中,默认
|
* 是否选中,要去结算 0:未选中 1:已选中,默认
|
||||||
*/
|
*/
|
||||||
@ -55,7 +58,7 @@ public class CartSkuVO extends CartBase implements Serializable {
|
|||||||
private Boolean isFreeFreight;
|
private Boolean isFreeFreight;
|
||||||
|
|
||||||
@ApiModelProperty(value = "积分购买 积分数量")
|
@ApiModelProperty(value = "积分购买 积分数量")
|
||||||
private Integer point;
|
private Long point;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否失效 ")
|
@ApiModelProperty(value = "是否失效 ")
|
||||||
private Boolean invalid;
|
private Boolean invalid;
|
||||||
@ -101,6 +104,7 @@ public class CartSkuVO extends CartBase implements Serializable {
|
|||||||
this.isShip = true;
|
this.isShip = true;
|
||||||
this.purchasePrice = goodsSku.getIsPromotion() != null && goodsSku.getIsPromotion() ? goodsSku.getPromotionPrice() : goodsSku.getPrice();
|
this.purchasePrice = goodsSku.getIsPromotion() != null && goodsSku.getIsPromotion() ? goodsSku.getPromotionPrice() : goodsSku.getPrice();
|
||||||
this.isFreeFreight = false;
|
this.isFreeFreight = false;
|
||||||
|
this.utilPrice = 0D;
|
||||||
this.setStoreId(goodsSku.getStoreId());
|
this.setStoreId(goodsSku.getStoreId());
|
||||||
this.setStoreName(goodsSku.getStoreName());
|
this.setStoreName(goodsSku.getStoreName());
|
||||||
}
|
}
|
||||||
|
@ -98,4 +98,5 @@ public class CartVO extends CartBase implements Serializable {
|
|||||||
this.goodsNum += goodsNum;
|
this.goodsNum += goodsNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,11 @@ public class CartPriceRender implements CartRenderStep {
|
|||||||
cartVO.getSkuList().stream().filter(CartSkuVO::getChecked)
|
cartVO.getSkuList().stream().filter(CartSkuVO::getChecked)
|
||||||
.map(CartSkuVO::getPriceDetailDTO).collect(Collectors.toList())
|
.map(CartSkuVO::getPriceDetailDTO).collect(Collectors.toList())
|
||||||
);
|
);
|
||||||
|
List<Integer> skuNum = cartVO.getSkuList().stream().filter(CartSkuVO::getChecked)
|
||||||
|
.map(CartSkuVO::getNum).collect(Collectors.toList());
|
||||||
|
for (Integer num : skuNum) {
|
||||||
|
cartVO.addGoodsNum(num);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ import cn.lili.modules.promotion.service.PointsGoodsService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -67,7 +66,6 @@ public class CommissionRender implements CartRenderStep {
|
|||||||
//计算购物车价格
|
//计算购物车价格
|
||||||
for (CartVO cart : cartVOS) {
|
for (CartVO cart : cartVOS) {
|
||||||
//累加价格
|
//累加价格
|
||||||
List<PriceDetailDTO> priceDetailDTOS = new ArrayList<>();
|
|
||||||
for (CartSkuVO cartSkuVO : cart.getSkuList()) {
|
for (CartSkuVO cartSkuVO : cart.getSkuList()) {
|
||||||
|
|
||||||
PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO();
|
PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO();
|
||||||
|
@ -85,7 +85,9 @@ public class CouponRender implements CartRenderStep {
|
|||||||
//减免现金,则按照商品价格计算 需要通过工具类进行优惠金额的分发,分发给每个商品
|
//减免现金,则按照商品价格计算 需要通过工具类进行优惠金额的分发,分发给每个商品
|
||||||
if (coupon.getCouponType().equals(CouponTypeEnum.PRICE.name())) {
|
if (coupon.getCouponType().equals(CouponTypeEnum.PRICE.name())) {
|
||||||
//分发优惠券
|
//分发优惠券
|
||||||
promotionPriceUtil.recountPrice(tradeDTO, memberCouponDTO.getSkuDetail(), memberCouponDTO.getMemberCoupon().getPrice(), PromotionTypeEnum.COUPON);
|
promotionPriceUtil.recountPrice(tradeDTO, memberCouponDTO.getSkuDetail(), memberCouponDTO.getMemberCoupon().getPrice(),
|
||||||
|
coupon.getIsPlatform() ?
|
||||||
|
PromotionTypeEnum.PLATFORM_COUPON : PromotionTypeEnum.COUPON);
|
||||||
//如果是平台券 则需要计算商家承担比例
|
//如果是平台券 则需要计算商家承担比例
|
||||||
if (coupon.getIsPlatform() && coupon.getStoreCommission() > 0) {
|
if (coupon.getIsPlatform() && coupon.getStoreCommission() > 0) {
|
||||||
|
|
||||||
@ -95,7 +97,7 @@ public class CouponRender implements CartRenderStep {
|
|||||||
for (CartSkuVO cartSkuVO : tradeDTO.getSkuList()) {
|
for (CartSkuVO cartSkuVO : tradeDTO.getSkuList()) {
|
||||||
//写入平台优惠券承担比例
|
//写入平台优惠券承担比例
|
||||||
if (cartSkuVO.getGoodsSku().getId().equals(skuId)) {
|
if (cartSkuVO.getGoodsSku().getId().equals(skuId)) {
|
||||||
cartSkuVO.getPriceDetailDTO().setSiteCouponPrice(cartSkuVO.getPriceDetailDTO().getSiteCouponPrice());
|
//写入店铺承担比例
|
||||||
cartSkuVO.getPriceDetailDTO().setSiteCouponPoint(coupon.getStoreCommission());
|
cartSkuVO.getPriceDetailDTO().setSiteCouponPoint(coupon.getStoreCommission());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,8 +109,8 @@ public class FullDiscountRender implements CartRenderStep {
|
|||||||
for (PromotionGoods promotionGoods : fullDiscount.getPromotionGoodsList()) {
|
for (PromotionGoods promotionGoods : fullDiscount.getPromotionGoodsList()) {
|
||||||
//sku 集合判定
|
//sku 集合判定
|
||||||
for (CartSkuVO cartSkuVO : cartSkuVOS) {
|
for (CartSkuVO cartSkuVO : cartSkuVOS) {
|
||||||
//如果参加,则记录商品sku
|
// 如果参加满减,并且购物车选中状态 ,则记录商品sku
|
||||||
if (cartSkuVO.getGoodsSku().getId().equals(promotionGoods.getSkuId())) {
|
if (cartSkuVO.getChecked() && cartSkuVO.getGoodsSku().getId().equals(promotionGoods.getSkuId())) {
|
||||||
skuPriceDetail.put(cartSkuVO.getGoodsSku().getId(), cartSkuVO.getPriceDetailDTO().getGoodsPrice());
|
skuPriceDetail.put(cartSkuVO.getGoodsSku().getId(), cartSkuVO.getPriceDetailDTO().getGoodsPrice());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package cn.lili.modules.order.cart.render.impl;
|
package cn.lili.modules.order.cart.render.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
|
||||||
import cn.lili.common.utils.CurrencyUtil;
|
import cn.lili.common.utils.CurrencyUtil;
|
||||||
import cn.lili.modules.member.entity.dos.MemberAddress;
|
import cn.lili.modules.member.entity.dos.MemberAddress;
|
||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
@ -13,7 +12,6 @@ import cn.lili.modules.store.entity.enums.FreightTemplateEnum;
|
|||||||
import cn.lili.modules.store.entity.vos.FreightTemplateVO;
|
import cn.lili.modules.store.entity.vos.FreightTemplateVO;
|
||||||
import cn.lili.modules.store.service.FreightTemplateService;
|
import cn.lili.modules.store.service.FreightTemplateService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -96,14 +94,8 @@ public class SkuFreightRender implements CartRenderStep {
|
|||||||
|
|
||||||
//计算运费
|
//计算运费
|
||||||
Double countFreight = countFreight(count, freightTemplateChildDTO);
|
Double countFreight = countFreight(count, freightTemplateChildDTO);
|
||||||
//写入运费
|
//写入SKU运费
|
||||||
cartSkuVO.getPriceDetailDTO().setFreightPrice(countFreight);
|
cartSkuVO.getPriceDetailDTO().setFreightPrice(countFreight);
|
||||||
//运费逻辑处理
|
|
||||||
if (tradeDTO.getPriceDetailDTO().getFreightPrice() != null) {
|
|
||||||
tradeDTO.getPriceDetailDTO().setFreightPrice(CurrencyUtil.add(tradeDTO.getPriceDetailDTO().getFreightPrice(), countFreight));
|
|
||||||
} else {
|
|
||||||
tradeDTO.getPriceDetailDTO().setFreightPrice(countFreight);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,14 +110,19 @@ public class SkuFreightRender implements CartRenderStep {
|
|||||||
private Double countFreight(Double count, FreightTemplateChildDTO template) {
|
private Double countFreight(Double count, FreightTemplateChildDTO template) {
|
||||||
try {
|
try {
|
||||||
Double finalFreight = template.getFirstPrice();
|
Double finalFreight = template.getFirstPrice();
|
||||||
//不满首重
|
//不满首重 / 首件
|
||||||
if (template.getFirstCompany() >= count) {
|
if (template.getFirstCompany() >= count) {
|
||||||
return finalFreight;
|
return finalFreight;
|
||||||
}
|
}
|
||||||
|
//如果续重/续件,费用不为空,则返回
|
||||||
|
if (template.getContinuedCompany() == 0 || template.getContinuedPrice() == 0) {
|
||||||
|
return finalFreight;
|
||||||
|
}
|
||||||
|
|
||||||
|
//计算 续重 / 续件 价格
|
||||||
Double continuedCount = count - template.getFirstCompany();
|
Double continuedCount = count - template.getFirstCompany();
|
||||||
//计算续重价格
|
|
||||||
return CurrencyUtil.add(finalFreight,
|
return CurrencyUtil.add(finalFreight,
|
||||||
CurrencyUtil.mul(NumberUtil.parseInt(String.valueOf((continuedCount / template.getContinuedCompany()))), template.getContinuedPrice()));
|
CurrencyUtil.mul(Math.ceil(continuedCount / template.getContinuedCompany()), template.getContinuedPrice()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return 0D;
|
return 0D;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@ public class SkuPromotionRender implements CartRenderStep {
|
|||||||
cartVO -> {
|
cartVO -> {
|
||||||
cartVO.getSkuList().forEach(cartSkuVO -> {
|
cartVO.getSkuList().forEach(cartSkuVO -> {
|
||||||
PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO();
|
PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO();
|
||||||
priceDetailDTO.setOriginalPrice(CurrencyUtil.mul(cartSkuVO.getGoodsSku().getPrice(), cartSkuVO.getNum()));
|
|
||||||
priceDetailDTO.setGoodsPrice(cartSkuVO.getSubTotal());
|
priceDetailDTO.setGoodsPrice(cartSkuVO.getSubTotal());
|
||||||
priceDetailDTO.setDiscountPrice(CurrencyUtil.sub(priceDetailDTO.getOriginalPrice(), cartSkuVO.getSubTotal()));
|
priceDetailDTO.setDiscountPrice(CurrencyUtil.sub(priceDetailDTO.getOriginalPrice(), cartSkuVO.getSubTotal()));
|
||||||
});
|
});
|
||||||
|
@ -141,6 +141,13 @@ public class PromotionPriceUtil {
|
|||||||
|
|
||||||
cartSkuVO.getPriceDetailDTO().setCouponPrice(
|
cartSkuVO.getPriceDetailDTO().setCouponPrice(
|
||||||
CurrencyUtil.add(cartSkuVO.getPriceDetailDTO().getCouponPrice(), skuDiscountPrice));
|
CurrencyUtil.add(cartSkuVO.getPriceDetailDTO().getCouponPrice(), skuDiscountPrice));
|
||||||
|
} else if (promotionTypeEnum == PromotionTypeEnum.PLATFORM_COUPON) {
|
||||||
|
|
||||||
|
cartSkuVO.getPriceDetailDTO().setSiteCouponPrice(
|
||||||
|
CurrencyUtil.add(cartSkuVO.getPriceDetailDTO().getCouponPrice(), skuDiscountPrice));
|
||||||
|
|
||||||
|
cartSkuVO.getPriceDetailDTO().setCouponPrice(
|
||||||
|
CurrencyUtil.add(cartSkuVO.getPriceDetailDTO().getCouponPrice(), cartSkuVO.getPriceDetailDTO().getSiteCouponPrice()));
|
||||||
} else {
|
} else {
|
||||||
cartSkuVO.getPriceDetailDTO().setDiscountPrice(
|
cartSkuVO.getPriceDetailDTO().setDiscountPrice(
|
||||||
CurrencyUtil.add(cartSkuVO.getPriceDetailDTO().getDiscountPrice(), skuDiscountPrice));
|
CurrencyUtil.add(cartSkuVO.getPriceDetailDTO().getDiscountPrice(), skuDiscountPrice));
|
||||||
|
@ -32,6 +32,7 @@ import cn.lili.modules.promotion.entity.dto.KanjiaActivityGoodsDTO;
|
|||||||
import cn.lili.modules.promotion.entity.enums.CouponScopeTypeEnum;
|
import cn.lili.modules.promotion.entity.enums.CouponScopeTypeEnum;
|
||||||
import cn.lili.modules.promotion.entity.enums.KanJiaStatusEnum;
|
import cn.lili.modules.promotion.entity.enums.KanJiaStatusEnum;
|
||||||
import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum;
|
import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum;
|
||||||
|
import cn.lili.modules.promotion.entity.vos.PointsGoodsVO;
|
||||||
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivitySearchParams;
|
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivitySearchParams;
|
||||||
import cn.lili.modules.promotion.service.*;
|
import cn.lili.modules.promotion.service.*;
|
||||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||||
@ -76,6 +77,11 @@ public class CartServiceImpl implements CartService {
|
|||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private PromotionGoodsService promotionGoodsService;
|
private PromotionGoodsService promotionGoodsService;
|
||||||
|
/**
|
||||||
|
* 促销商品
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private PointsGoodsService pointsGoodsService;
|
||||||
/**
|
/**
|
||||||
* 会员地址
|
* 会员地址
|
||||||
*/
|
*/
|
||||||
@ -565,6 +571,9 @@ public class CartServiceImpl implements CartService {
|
|||||||
|
|
||||||
//循环符合优惠券的商品
|
//循环符合优惠券的商品
|
||||||
for (CartSkuVO cartSkuVO : cartSkuVOS) {
|
for (CartSkuVO cartSkuVO : cartSkuVOS) {
|
||||||
|
if (!cartSkuVO.getChecked()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//获取商品的促销信息
|
//获取商品的促销信息
|
||||||
Optional<PromotionGoods> promotionOptional =
|
Optional<PromotionGoods> promotionOptional =
|
||||||
cartSkuVO.getPromotions().parallelStream().filter(promotionGoods ->
|
cartSkuVO.getPromotions().parallelStream().filter(promotionGoods ->
|
||||||
@ -649,6 +658,9 @@ public class CartServiceImpl implements CartService {
|
|||||||
} else if (cartTypeEnum.equals(CartTypeEnum.KANJIA)) {
|
} else if (cartTypeEnum.equals(CartTypeEnum.KANJIA)) {
|
||||||
//检测购物车的数量
|
//检测购物车的数量
|
||||||
checkKanjia(cartSkuVO);
|
checkKanjia(cartSkuVO);
|
||||||
|
} else if (cartTypeEnum.equals(CartTypeEnum.POINTS)) {
|
||||||
|
//检测购物车的数量
|
||||||
|
checkPoint(cartSkuVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,7 +670,6 @@ public class CartServiceImpl implements CartService {
|
|||||||
* @param cartSkuVO 购物车信息
|
* @param cartSkuVO 购物车信息
|
||||||
*/
|
*/
|
||||||
private void checkPintuan(CartSkuVO cartSkuVO) {
|
private void checkPintuan(CartSkuVO cartSkuVO) {
|
||||||
|
|
||||||
//拼团活动,需要对限购数量进行判定
|
//拼团活动,需要对限购数量进行判定
|
||||||
//获取拼团信息
|
//获取拼团信息
|
||||||
List<PromotionGoods> currentPromotion = cartSkuVO.getPromotions().stream().filter(
|
List<PromotionGoods> currentPromotion = cartSkuVO.getPromotions().stream().filter(
|
||||||
@ -666,8 +677,12 @@ public class CartServiceImpl implements CartService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//拼团活动判定
|
//拼团活动判定
|
||||||
if (!currentPromotion.isEmpty()) {
|
if (!currentPromotion.isEmpty()) {
|
||||||
|
PromotionGoods promotionGoods = currentPromotion.get(0);
|
||||||
//写入拼团信息
|
//写入拼团信息
|
||||||
cartSkuVO.setPintuanId(currentPromotion.get(0).getPromotionId());
|
cartSkuVO.setPintuanId(promotionGoods.getPromotionId());
|
||||||
|
//写入成交信息
|
||||||
|
cartSkuVO.setUtilPrice(promotionGoods.getPrice());
|
||||||
|
cartSkuVO.setPurchasePrice(promotionGoods.getPrice());
|
||||||
} else {
|
} else {
|
||||||
throw new ServiceException(ResultCode.CART_PINTUAN_NOT_EXIST_ERROR);
|
throw new ServiceException(ResultCode.CART_PINTUAN_NOT_EXIST_ERROR);
|
||||||
}
|
}
|
||||||
@ -702,9 +717,26 @@ public class CartServiceImpl implements CartService {
|
|||||||
throw new ServiceException(ResultCode.KANJIA_ACTIVITY_NOT_FOUND_ERROR);
|
throw new ServiceException(ResultCode.KANJIA_ACTIVITY_NOT_FOUND_ERROR);
|
||||||
//判断砍价活动是否已满足条件
|
//判断砍价活动是否已满足条件
|
||||||
} else if (!KanJiaStatusEnum.SUCCESS.name().equals(kanjiaActivity.getStatus())) {
|
} else if (!KanJiaStatusEnum.SUCCESS.name().equals(kanjiaActivity.getStatus())) {
|
||||||
|
cartSkuVO.setKanjiaId(kanjiaActivity.getKanjiaActivityGoodsId());
|
||||||
|
cartSkuVO.setPurchasePrice(0D);
|
||||||
throw new ServiceException(ResultCode.KANJIA_ACTIVITY_NOT_PASS_ERROR);
|
throw new ServiceException(ResultCode.KANJIA_ACTIVITY_NOT_PASS_ERROR);
|
||||||
}
|
}
|
||||||
//砍价商品默认一件货物
|
//砍价商品默认一件货物
|
||||||
cartSkuVO.setNum(1);
|
cartSkuVO.setNum(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验积分商品信息
|
||||||
|
*
|
||||||
|
* @param cartSkuVO 购物车信息
|
||||||
|
*/
|
||||||
|
private void checkPoint(CartSkuVO cartSkuVO) {
|
||||||
|
|
||||||
|
PointsGoodsVO pointsGoodsVO = pointsGoodsService.getPointsGoodsVOByMongo(cartSkuVO.getGoodsSku().getId());
|
||||||
|
|
||||||
|
if (pointsGoodsVO != null) {
|
||||||
|
cartSkuVO.setPoint(pointsGoodsVO.getPoints());
|
||||||
|
cartSkuVO.setPurchasePrice(0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,6 +143,7 @@ public class PriceDetailDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
public void setUpdatePrice(Double updatePrice) {
|
public void setUpdatePrice(Double updatePrice) {
|
||||||
this.updatePrice = updatePrice;
|
this.updatePrice = updatePrice;
|
||||||
|
this.recount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -155,8 +156,8 @@ public class PriceDetailDTO implements Serializable {
|
|||||||
CurrencyUtil.add(goodsPrice, freightPrice),
|
CurrencyUtil.add(goodsPrice, freightPrice),
|
||||||
CurrencyUtil.add(discountPrice,
|
CurrencyUtil.add(discountPrice,
|
||||||
couponPrice != null ? couponPrice : 0));
|
couponPrice != null ? couponPrice : 0));
|
||||||
if (updatePrice > 0) {
|
if (updatePrice != 0) {
|
||||||
CurrencyUtil.add(flowPrice, updatePrice);
|
flowPrice = CurrencyUtil.add(flowPrice, updatePrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
//计算平台佣金 流水金额*平台佣金比例
|
//计算平台佣金 流水金额*平台佣金比例
|
||||||
@ -190,7 +191,8 @@ public class PriceDetailDTO implements Serializable {
|
|||||||
platFormCommission = CurrencyUtil.add(platFormCommission, priceDetailDTO.getPlatFormCommission());
|
platFormCommission = CurrencyUtil.add(platFormCommission, priceDetailDTO.getPlatFormCommission());
|
||||||
|
|
||||||
siteCouponPrice = CurrencyUtil.add(siteCouponPrice, priceDetailDTO.getSiteCouponPrice());
|
siteCouponPrice = CurrencyUtil.add(siteCouponPrice, priceDetailDTO.getSiteCouponPrice());
|
||||||
siteCouponPoint = CurrencyUtil.add(siteCouponPoint, priceDetailDTO.getSiteCouponPoint());
|
//平台优惠券一笔交易只有一个,所以这里直接移值就好了
|
||||||
|
siteCouponPoint = priceDetailDTO.getSiteCouponPoint();
|
||||||
siteCouponCommission = CurrencyUtil.add(siteCouponCommission, priceDetailDTO.getSiteCouponCommission());
|
siteCouponCommission = CurrencyUtil.add(siteCouponCommission, priceDetailDTO.getSiteCouponCommission());
|
||||||
|
|
||||||
updatePrice = CurrencyUtil.add(updatePrice, priceDetailDTO.getUpdatePrice());
|
updatePrice = CurrencyUtil.add(updatePrice, priceDetailDTO.getUpdatePrice());
|
||||||
@ -326,7 +328,7 @@ public class PriceDetailDTO implements Serializable {
|
|||||||
this.siteCouponPoint = siteCouponPoint;
|
this.siteCouponPoint = siteCouponPoint;
|
||||||
|
|
||||||
if (siteCouponPoint != null && siteCouponPoint != 0) {
|
if (siteCouponPoint != null && siteCouponPoint != 0) {
|
||||||
this.siteCouponCommission = CurrencyUtil.mul(siteCouponPrice, siteCouponPoint);
|
this.siteCouponCommission = CurrencyUtil.div(CurrencyUtil.mul(siteCouponPrice, siteCouponPoint), 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public interface AfterSaleService extends IService<AfterSale> {
|
|||||||
* @param sn 订单编号
|
* @param sn 订单编号
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AfterSaleApplyVO getAfterSaleDTO(String sn);
|
AfterSaleApplyVO getAfterSaleVO(String sn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 售后申请
|
* 售后申请
|
||||||
|
@ -121,7 +121,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AfterSaleApplyVO getAfterSaleDTO(String sn) {
|
public AfterSaleApplyVO getAfterSaleVO(String sn) {
|
||||||
|
|
||||||
AfterSaleApplyVO afterSaleApplyVO = new AfterSaleApplyVO();
|
AfterSaleApplyVO afterSaleApplyVO = new AfterSaleApplyVO();
|
||||||
|
|
||||||
@ -429,8 +429,15 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
|||||||
if (afterSaleDTO.getImages() != null) {
|
if (afterSaleDTO.getImages() != null) {
|
||||||
afterSale.setAfterSaleImage(afterSaleDTO.getImages());
|
afterSale.setAfterSaleImage(afterSaleDTO.getImages());
|
||||||
}
|
}
|
||||||
//计算退回金额
|
|
||||||
afterSale.setApplyRefundPrice(CurrencyUtil.mul(orderItem.getUnitPrice(), afterSale.getNum()));
|
if (afterSale.getNum().equals(orderItem.getNum())) {
|
||||||
|
//计算退回金额
|
||||||
|
afterSale.setApplyRefundPrice(orderItem.getFlowPrice());
|
||||||
|
} else {
|
||||||
|
//单价计算
|
||||||
|
Double utilPrice = CurrencyUtil.div(orderItem.getPriceDetailDTO().getFlowPrice(), orderItem.getNum());
|
||||||
|
afterSale.setApplyRefundPrice(CurrencyUtil.mul(afterSale.getNum(), utilPrice));
|
||||||
|
}
|
||||||
//添加售后
|
//添加售后
|
||||||
this.save(afterSale);
|
this.save(afterSale);
|
||||||
//发送售后消息
|
//发送售后消息
|
||||||
|
@ -156,7 +156,7 @@ public class OrderPriceServiceImpl implements OrderPriceService {
|
|||||||
Double priceFluctuationRatio = CurrencyUtil.div(priceDetailDTO.getOriginalPrice(), order.getPriceDetailDTO().getOriginalPrice(), 4);
|
Double priceFluctuationRatio = CurrencyUtil.div(priceDetailDTO.getOriginalPrice(), order.getPriceDetailDTO().getOriginalPrice(), 4);
|
||||||
|
|
||||||
//记录修改金额
|
//记录修改金额
|
||||||
priceDetailDTO.setUpdatePrice(CurrencyUtil.sub(order.getUpdatePrice(), priceFluctuationRatio));
|
priceDetailDTO.setUpdatePrice(CurrencyUtil.mul(order.getUpdatePrice(), priceFluctuationRatio));
|
||||||
|
|
||||||
//修改订单货物金额
|
//修改订单货物金额
|
||||||
orderItem.setFlowPrice(priceDetailDTO.getFlowPrice());
|
orderItem.setFlowPrice(priceDetailDTO.getFlowPrice());
|
||||||
|
@ -70,7 +70,7 @@ public class SystemLogServiceImpl implements SystemLogService {
|
|||||||
//时间有效性判定
|
//时间有效性判定
|
||||||
if (searchVo.getConvertStartDate() != null && searchVo.getConvertEndDate() != null) {
|
if (searchVo.getConvertStartDate() != null && searchVo.getConvertEndDate() != null) {
|
||||||
//大于方法
|
//大于方法
|
||||||
Criteria gt = Criteria.where("createTime").gt(searchVo.getConvertStartDate());
|
Criteria gt = Criteria.where("createTime").gte(searchVo.getConvertStartDate());
|
||||||
//小于方法
|
//小于方法
|
||||||
Criteria lt = Criteria.where("createTime").lte(searchVo.getConvertEndDate());
|
Criteria lt = Criteria.where("createTime").lte(searchVo.getConvertEndDate());
|
||||||
query.addCriteria(new Criteria().andOperator(gt, lt));
|
query.addCriteria(new Criteria().andOperator(gt, lt));
|
||||||
|
@ -5,7 +5,6 @@ import cn.lili.modules.promotion.entity.enums.*;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import org.springframework.data.mongodb.core.query.Criteria;
|
import org.springframework.data.mongodb.core.query.Criteria;
|
||||||
import org.springframework.data.mongodb.core.query.Query;
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
|
|
||||||
@ -189,25 +188,25 @@ public class CouponSearchParams implements Serializable {
|
|||||||
if (CharSequenceUtil.isNotEmpty(price)) {
|
if (CharSequenceUtil.isNotEmpty(price)) {
|
||||||
String[] s = price.split("_");
|
String[] s = price.split("_");
|
||||||
if (s.length > 1) {
|
if (s.length > 1) {
|
||||||
query.addCriteria(Criteria.where(PRICE_COLUMN).gt(s[1]));
|
query.addCriteria(Criteria.where(PRICE_COLUMN).gte(s[1]));
|
||||||
} else {
|
} else {
|
||||||
query.addCriteria(Criteria.where(PRICE_COLUMN).lt(s[0]));
|
query.addCriteria(Criteria.where(PRICE_COLUMN).lte(s[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CharSequenceUtil.isNotEmpty(publishNum)) {
|
if (CharSequenceUtil.isNotEmpty(publishNum)) {
|
||||||
String[] s = publishNum.split("_");
|
String[] s = publishNum.split("_");
|
||||||
if (s.length > 1) {
|
if (s.length > 1) {
|
||||||
query.addCriteria(Criteria.where("publishNum").gt(s[1]));
|
query.addCriteria(Criteria.where("publishNum").gte(s[1]));
|
||||||
} else {
|
} else {
|
||||||
query.addCriteria(Criteria.where("publishNum").lt(s[0]));
|
query.addCriteria(Criteria.where("publishNum").lte(s[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CharSequenceUtil.isNotEmpty(receivedNum)) {
|
if (CharSequenceUtil.isNotEmpty(receivedNum)) {
|
||||||
String[] s = receivedNum.split("_");
|
String[] s = receivedNum.split("_");
|
||||||
if (s.length > 1) {
|
if (s.length > 1) {
|
||||||
query.addCriteria(Criteria.where("receivedNum").gt(s[1]));
|
query.addCriteria(Criteria.where("receivedNum").gte(s[1]));
|
||||||
} else {
|
} else {
|
||||||
query.addCriteria(Criteria.where("receivedNum").lt(s[0]));
|
query.addCriteria(Criteria.where("receivedNum").lte(s[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,8 +364,8 @@ public class FullDiscountServiceImpl extends ServiceImpl<FullDiscountMapper, Ful
|
|||||||
Query query = new Query();
|
Query query = new Query();
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
query.addCriteria(Criteria.where(PROMOTION_STATUS_COLUMN).is(PromotionStatusEnum.START.name()));
|
query.addCriteria(Criteria.where(PROMOTION_STATUS_COLUMN).is(PromotionStatusEnum.START.name()));
|
||||||
query.addCriteria(Criteria.where("startTime").lt(now));
|
query.addCriteria(Criteria.where("startTime").lte(now));
|
||||||
query.addCriteria(Criteria.where("endTime").gt(now));
|
query.addCriteria(Criteria.where("endTime").gte(now));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -105,7 +105,7 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, Mem
|
|||||||
.or(j -> j.eq(MemberCoupon::getScopeType, CouponScopeTypeEnum.ALL.name())));
|
.or(j -> j.eq(MemberCoupon::getScopeType, CouponScopeTypeEnum.ALL.name())));
|
||||||
queryWrapper.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name());
|
queryWrapper.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name());
|
||||||
queryWrapper.le(MemberCoupon::getConsumeThreshold, totalPrice);
|
queryWrapper.le(MemberCoupon::getConsumeThreshold, totalPrice);
|
||||||
queryWrapper.gt(MemberCoupon::getEndTime, new Date());
|
queryWrapper.ge(MemberCoupon::getEndTime, new Date());
|
||||||
return this.page(PageUtil.initPage(pageVo), queryWrapper);
|
return this.page(PageUtil.initPage(pageVo), queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, Mem
|
|||||||
queryWrapper.in(MemberCoupon::getCouponId, couponIds);
|
queryWrapper.in(MemberCoupon::getCouponId, couponIds);
|
||||||
queryWrapper.ne(MemberCoupon::getScopeType, CouponScopeTypeEnum.ALL.name());
|
queryWrapper.ne(MemberCoupon::getScopeType, CouponScopeTypeEnum.ALL.name());
|
||||||
queryWrapper.le(MemberCoupon::getConsumeThreshold, totalPrice);
|
queryWrapper.le(MemberCoupon::getConsumeThreshold, totalPrice);
|
||||||
queryWrapper.gt(MemberCoupon::getEndTime, new Date());
|
queryWrapper.ge(MemberCoupon::getEndTime, new Date());
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, Mem
|
|||||||
queryWrapper.eq(MemberCoupon::getMemberId, memberId);
|
queryWrapper.eq(MemberCoupon::getMemberId, memberId);
|
||||||
queryWrapper.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name());
|
queryWrapper.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name());
|
||||||
queryWrapper.eq(MemberCoupon::getScopeType, CouponScopeTypeEnum.ALL.name());
|
queryWrapper.eq(MemberCoupon::getScopeType, CouponScopeTypeEnum.ALL.name());
|
||||||
queryWrapper.gt(MemberCoupon::getEndTime, new Date()).and(i -> i.in(MemberCoupon::getStoreId, storeId).or(j -> j.eq(MemberCoupon::getIsPlatform, true)));
|
queryWrapper.ge(MemberCoupon::getEndTime, new Date()).and(i -> i.in(MemberCoupon::getStoreId, storeId).or(j -> j.eq(MemberCoupon::getIsPlatform, true)));
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,8 +216,8 @@ public class PromotionGoodsServiceImpl extends ServiceImpl<PromotionGoodsMapper,
|
|||||||
promotionGoodsPage.setCurrent(pageVo.getPageNumber());
|
promotionGoodsPage.setCurrent(pageVo.getPageNumber());
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
Query query = new Query();
|
Query query = new Query();
|
||||||
query.addCriteria(Criteria.where("startTime").lt(now));
|
query.addCriteria(Criteria.where("startTime").lte(now));
|
||||||
query.addCriteria(Criteria.where("endTime").gt(now));
|
query.addCriteria(Criteria.where("endTime").gte(now));
|
||||||
List<PromotionGoodsDTO> promotionGoodsDTOList = new ArrayList<>();
|
List<PromotionGoodsDTO> promotionGoodsDTOList = new ArrayList<>();
|
||||||
int total = 0;
|
int total = 0;
|
||||||
//根据促销活动类型的不同,将满足当前促销活动类型且正在进行的促销商品返回出去
|
//根据促销活动类型的不同,将满足当前促销活动类型且正在进行的促销商品返回出去
|
||||||
|
@ -154,8 +154,8 @@ public class PromotionServiceImpl implements PromotionService {
|
|||||||
Map<String, Object> resultMap = new HashMap<>(16);
|
Map<String, Object> resultMap = new HashMap<>(16);
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.eq("promotion_status", PromotionStatusEnum.START.name());
|
queryWrapper.eq("promotion_status", PromotionStatusEnum.START.name());
|
||||||
queryWrapper.gt("start_time", new Date());
|
queryWrapper.ge("start_time", new Date());
|
||||||
queryWrapper.lt("end_time", new Date());
|
queryWrapper.le("end_time", new Date());
|
||||||
//获取当前进行的秒杀活动活动
|
//获取当前进行的秒杀活动活动
|
||||||
List<Seckill> seckillList = seckillService.list(queryWrapper);
|
List<Seckill> seckillList = seckillService.list(queryWrapper);
|
||||||
if (seckillList != null && !seckillList.isEmpty()) {
|
if (seckillList != null && !seckillList.isEmpty()) {
|
||||||
@ -192,7 +192,7 @@ public class PromotionServiceImpl implements PromotionService {
|
|||||||
Query query = new Query();
|
Query query = new Query();
|
||||||
query.addCriteria(Criteria.where("deleteFlag").is(false));
|
query.addCriteria(Criteria.where("deleteFlag").is(false));
|
||||||
query.addCriteria(Criteria.where("promotionStatus").is(PromotionStatusEnum.START.name()));
|
query.addCriteria(Criteria.where("promotionStatus").is(PromotionStatusEnum.START.name()));
|
||||||
query.addCriteria(Criteria.where("endTime").gt(new Date()));
|
query.addCriteria(Criteria.where("endTime").gte(new Date()));
|
||||||
List<FullDiscountVO> fullDiscountVOS = mongoTemplate.find(query, FullDiscountVO.class);
|
List<FullDiscountVO> fullDiscountVOS = mongoTemplate.find(query, FullDiscountVO.class);
|
||||||
for (FullDiscountVO fullDiscountVO : fullDiscountVOS) {
|
for (FullDiscountVO fullDiscountVO : fullDiscountVOS) {
|
||||||
if (fullDiscountVO.getPromotionGoodsList() == null) {
|
if (fullDiscountVO.getPromotionGoodsList() == null) {
|
||||||
@ -211,13 +211,13 @@ public class PromotionServiceImpl implements PromotionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<PromotionGoods> queryWrapper1 = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PromotionGoods> promotionGoodsQuery = new LambdaQueryWrapper<>();
|
||||||
queryWrapper1.eq(PromotionGoods::getDeleteFlag, false);
|
promotionGoodsQuery.eq(PromotionGoods::getDeleteFlag, false);
|
||||||
queryWrapper1.eq(PromotionGoods::getPromotionStatus, PromotionStatusEnum.START.name());
|
promotionGoodsQuery.eq(PromotionGoods::getPromotionStatus, PromotionStatusEnum.START.name());
|
||||||
queryWrapper1.gt(PromotionGoods::getEndTime, new Date());
|
promotionGoodsQuery.ge(PromotionGoods::getEndTime, new Date());
|
||||||
queryWrapper1.eq(PromotionGoods::getSkuId, index.getId());
|
promotionGoodsQuery.eq(PromotionGoods::getSkuId, index.getId());
|
||||||
List<PromotionGoods> list1 = promotionGoodsService.list(queryWrapper1);
|
List<PromotionGoods> promotionGoodsList = promotionGoodsService.list(promotionGoodsQuery);
|
||||||
for (PromotionGoods promotionGoods : list1) {
|
for (PromotionGoods promotionGoods : promotionGoodsList) {
|
||||||
String esPromotionKey = promotionGoods.getPromotionType() + "-" + promotionGoods.getPromotionId();
|
String esPromotionKey = promotionGoods.getPromotionType() + "-" + promotionGoods.getPromotionId();
|
||||||
switch (PromotionTypeEnum.valueOf(promotionGoods.getPromotionType())) {
|
switch (PromotionTypeEnum.valueOf(promotionGoods.getPromotionType())) {
|
||||||
case COUPON:
|
case COUPON:
|
||||||
|
@ -277,7 +277,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
|
|||||||
List<SeckillTimelineVO> timelineList = new ArrayList<>();
|
List<SeckillTimelineVO> timelineList = new ArrayList<>();
|
||||||
LambdaQueryWrapper<Seckill> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Seckill> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
//查询当天时间段内的且状态不为结束或关闭的秒杀活动活动
|
//查询当天时间段内的且状态不为结束或关闭的秒杀活动活动
|
||||||
queryWrapper.gt(Seckill::getStartTime, new Date(cn.lili.common.utils.DateUtil.startOfTodDay() * 1000)).lt(Seckill::getEndTime, cn.lili.common.utils.DateUtil.endOfDate())
|
queryWrapper.ge(Seckill::getStartTime, new Date(cn.lili.common.utils.DateUtil.startOfTodDay() * 1000)).le(Seckill::getEndTime, cn.lili.common.utils.DateUtil.endOfDate())
|
||||||
.and(i -> i.eq(Seckill::getPromotionStatus, PromotionStatusEnum.NEW.name())
|
.and(i -> i.eq(Seckill::getPromotionStatus, PromotionStatusEnum.NEW.name())
|
||||||
.or(j -> j.eq(Seckill::getPromotionStatus, PromotionStatusEnum.START.name())));
|
.or(j -> j.eq(Seckill::getPromotionStatus, PromotionStatusEnum.START.name())));
|
||||||
List<Seckill> seckillList = seckillService.list(queryWrapper);
|
List<Seckill> seckillList = seckillService.list(queryWrapper);
|
||||||
@ -326,7 +326,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
|
|||||||
private List<SeckillGoodsVO> wrapperSeckillGoods(Integer startTimeline) {
|
private List<SeckillGoodsVO> wrapperSeckillGoods(Integer startTimeline) {
|
||||||
List<SeckillGoodsVO> seckillGoodsVoS = new ArrayList<>();
|
List<SeckillGoodsVO> seckillGoodsVoS = new ArrayList<>();
|
||||||
LambdaQueryWrapper<Seckill> seckillLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Seckill> seckillLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
seckillLambdaQueryWrapper.gt(Seckill::getStartTime, new Date(cn.lili.common.utils.DateUtil.startOfTodDay() * 1000)).lt(Seckill::getEndTime, cn.lili.common.utils.DateUtil.endOfDate())
|
seckillLambdaQueryWrapper.ge(Seckill::getStartTime, new Date(cn.lili.common.utils.DateUtil.startOfTodDay() * 1000)).le(Seckill::getEndTime, cn.lili.common.utils.DateUtil.endOfDate())
|
||||||
.and(i -> i.eq(Seckill::getPromotionStatus, PromotionStatusEnum.NEW.name())
|
.and(i -> i.eq(Seckill::getPromotionStatus, PromotionStatusEnum.NEW.name())
|
||||||
.or(j -> j.eq(Seckill::getPromotionStatus, PromotionStatusEnum.START.name())));
|
.or(j -> j.eq(Seckill::getPromotionStatus, PromotionStatusEnum.START.name())));
|
||||||
List<Seckill> seckillList = this.seckillService.list(seckillLambdaQueryWrapper);
|
List<Seckill> seckillList = this.seckillService.list(seckillLambdaQueryWrapper);
|
||||||
|
@ -35,14 +35,14 @@ public class MemberStatisticsDataServiceImpl extends ServiceImpl<MemberStatistic
|
|||||||
@Override
|
@Override
|
||||||
public Integer todayMemberNum() {
|
public Integer todayMemberNum() {
|
||||||
QueryWrapper queryWrapper = Wrappers.query();
|
QueryWrapper queryWrapper = Wrappers.query();
|
||||||
queryWrapper.gt("create_time", DateUtil.beginOfDay(new Date()));
|
queryWrapper.ge("create_time", DateUtil.beginOfDay(new Date()));
|
||||||
return this.baseMapper.customSqlQuery(queryWrapper);
|
return this.baseMapper.customSqlQuery(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer memberCount(Date endTime) {
|
public Integer memberCount(Date endTime) {
|
||||||
QueryWrapper queryWrapper = Wrappers.query();
|
QueryWrapper queryWrapper = Wrappers.query();
|
||||||
queryWrapper.lt("create_time", endTime);
|
queryWrapper.le("create_time", endTime);
|
||||||
return this.baseMapper.customSqlQuery(queryWrapper);
|
return this.baseMapper.customSqlQuery(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ public class OrderStatisticsDataServiceImpl extends ServiceImpl<OrderStatisticsD
|
|||||||
queryWrapper.eq("store_id", authUser.getStoreId());
|
queryWrapper.eq("store_id", authUser.getStoreId());
|
||||||
}
|
}
|
||||||
//大于今天凌晨
|
//大于今天凌晨
|
||||||
queryWrapper.gt("create_time", DateUtil.startOfTodDayTime());
|
queryWrapper.ge("create_time", DateUtil.startOfTodDayTime());
|
||||||
|
|
||||||
queryWrapper.select("SUM(final_price) AS price , COUNT(0) AS num");
|
queryWrapper.select("SUM(final_price) AS price , COUNT(0) AS num");
|
||||||
return this.getMap(queryWrapper);
|
return this.getMap(queryWrapper);
|
||||||
|
@ -302,7 +302,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||||||
public Integer todayStoreNum() {
|
public Integer todayStoreNum() {
|
||||||
LambdaQueryWrapper<Store> queryWrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<Store> queryWrapper = Wrappers.lambdaQuery();
|
||||||
queryWrapper.eq(Store::getStoreDisable, StoreStatusEnum.OPEN.name());
|
queryWrapper.eq(Store::getStoreDisable, StoreStatusEnum.OPEN.name());
|
||||||
queryWrapper.gt(Store::getCreateTime, DateUtil.beginOfDay(new DateTime()));
|
queryWrapper.ge(Store::getCreateTime, DateUtil.beginOfDay(new DateTime()));
|
||||||
return this.count(queryWrapper);
|
return this.count(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user