diff --git a/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java index bc16e587..3a3da949 100644 --- a/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/trade/AfterSaleBuyerController.java @@ -72,7 +72,7 @@ public class AfterSaleBuyerController { }) @GetMapping(value = "/applyAfterSaleInfo/{sn}") public ResultMessage applyAfterSaleInfo(@PathVariable String sn) { - return ResultUtil.data(afterSaleService.getAfterSaleDTO(sn)); + return ResultUtil.data(afterSaleService.getAfterSaleVO(sn)); } @PostMapping(value = "/save/{orderItemSn}") diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java index 4b397e38..c26475a1 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java @@ -96,7 +96,7 @@ public class PromotionEverydayExecute implements EveryDayExecute { query.addCriteria(Criteria.where("promotionStatus").ne(PromotionStatusEnum.END.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); diff --git a/framework/src/main/java/cn/lili/common/enums/PromotionTypeEnum.java b/framework/src/main/java/cn/lili/common/enums/PromotionTypeEnum.java index d2698984..3a121d81 100644 --- a/framework/src/main/java/cn/lili/common/enums/PromotionTypeEnum.java +++ b/framework/src/main/java/cn/lili/common/enums/PromotionTypeEnum.java @@ -14,6 +14,7 @@ public enum PromotionTypeEnum { PINTUAN("拼团"), SECKILL("秒杀"), COUPON("优惠券"), + PLATFORM_COUPON("平台优惠券"), FULL_DISCOUNT("满减"), POINTS_GOODS("积分商品"), KANJIA("砍价"), diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index e28ac122..8bcafb5e 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -268,7 +268,7 @@ public class GoodsServiceImpl extends ServiceImpl implements public Integer todayUpperNum() { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); 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); } diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java index 532b21ed..6c6432e7 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java @@ -198,7 +198,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl().gt(MemberEvaluation::getCreateTime, DateUtil.beginOfDay(new DateTime()))); + return this.count(new LambdaQueryWrapper().ge(MemberEvaluation::getCreateTime, DateUtil.beginOfDay(new DateTime()))); } @Override diff --git a/framework/src/main/java/cn/lili/modules/order/cart/entity/enums/RenderStepEnums.java b/framework/src/main/java/cn/lili/modules/order/cart/entity/enums/RenderStepEnums.java index 53e0bf86..43f08cd2 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/entity/enums/RenderStepEnums.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/entity/enums/RenderStepEnums.java @@ -8,9 +8,9 @@ public enum RenderStepEnums { CHECK_DATA("校验商品"), CHECKED_FILTER("选择商品过滤"), COUPON("优惠券价格渲染"), - SKU_FREIGHT("运费计算"), SKU_PROMOTION("商品促销计算"), FULL_DISCOUNT("满减计算"), + SKU_FREIGHT("运费计算"), DISTRIBUTION("分配需要分配的促销金额"), PLATFORM_COMMISSION("平台佣金"), CART_PRICE("购物车金额计算"), diff --git a/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartSkuVO.java b/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartSkuVO.java index 2a359478..9900612a 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartSkuVO.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartSkuVO.java @@ -45,6 +45,9 @@ public class CartSkuVO extends CartBase implements Serializable { @ApiModelProperty(value = "小记") private Double subTotal; + + @ApiModelProperty(value = "小记") + private Double utilPrice; /** * 是否选中,要去结算 0:未选中 1:已选中,默认 */ @@ -55,7 +58,7 @@ public class CartSkuVO extends CartBase implements Serializable { private Boolean isFreeFreight; @ApiModelProperty(value = "积分购买 积分数量") - private Integer point; + private Long point; @ApiModelProperty(value = "是否失效 ") private Boolean invalid; @@ -101,6 +104,7 @@ public class CartSkuVO extends CartBase implements Serializable { this.isShip = true; this.purchasePrice = goodsSku.getIsPromotion() != null && goodsSku.getIsPromotion() ? goodsSku.getPromotionPrice() : goodsSku.getPrice(); this.isFreeFreight = false; + this.utilPrice = 0D; this.setStoreId(goodsSku.getStoreId()); this.setStoreName(goodsSku.getStoreName()); } diff --git a/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartVO.java b/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartVO.java index 6a40360a..c5598f92 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartVO.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/entity/vo/CartVO.java @@ -98,4 +98,5 @@ public class CartVO extends CartBase implements Serializable { this.goodsNum += goodsNum; } } + } diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java index 86df4269..eeb61216 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java @@ -66,6 +66,11 @@ public class CartPriceRender implements CartRenderStep { cartVO.getSkuList().stream().filter(CartSkuVO::getChecked) .map(CartSkuVO::getPriceDetailDTO).collect(Collectors.toList()) ); + List skuNum = cartVO.getSkuList().stream().filter(CartSkuVO::getChecked) + .map(CartSkuVO::getNum).collect(Collectors.toList()); + for (Integer num : skuNum) { + cartVO.addGoodsNum(num); + } }); } diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java index 7e96c1e0..3479492f 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java @@ -16,7 +16,6 @@ import cn.lili.modules.promotion.service.PointsGoodsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.List; /** @@ -67,7 +66,6 @@ public class CommissionRender implements CartRenderStep { //计算购物车价格 for (CartVO cart : cartVOS) { //累加价格 - List priceDetailDTOS = new ArrayList<>(); for (CartSkuVO cartSkuVO : cart.getSkuList()) { PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO(); diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java index e71a65e0..498c7165 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java @@ -85,7 +85,9 @@ public class CouponRender implements CartRenderStep { //减免现金,则按照商品价格计算 需要通过工具类进行优惠金额的分发,分发给每个商品 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) { @@ -95,7 +97,7 @@ public class CouponRender implements CartRenderStep { for (CartSkuVO cartSkuVO : tradeDTO.getSkuList()) { //写入平台优惠券承担比例 if (cartSkuVO.getGoodsSku().getId().equals(skuId)) { - cartSkuVO.getPriceDetailDTO().setSiteCouponPrice(cartSkuVO.getPriceDetailDTO().getSiteCouponPrice()); + //写入店铺承担比例 cartSkuVO.getPriceDetailDTO().setSiteCouponPoint(coupon.getStoreCommission()); } } diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java index 68191a63..3314e99a 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java @@ -109,8 +109,8 @@ public class FullDiscountRender implements CartRenderStep { for (PromotionGoods promotionGoods : fullDiscount.getPromotionGoodsList()) { //sku 集合判定 for (CartSkuVO cartSkuVO : cartSkuVOS) { - //如果参加,则记录商品sku - if (cartSkuVO.getGoodsSku().getId().equals(promotionGoods.getSkuId())) { + // 如果参加满减,并且购物车选中状态 ,则记录商品sku + if (cartSkuVO.getChecked() && cartSkuVO.getGoodsSku().getId().equals(promotionGoods.getSkuId())) { skuPriceDetail.put(cartSkuVO.getGoodsSku().getId(), cartSkuVO.getPriceDetailDTO().getGoodsPrice()); } } diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuFreightRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuFreightRender.java index 21119b9a..f66cf38f 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuFreightRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuFreightRender.java @@ -1,6 +1,5 @@ package cn.lili.modules.order.cart.render.impl; -import cn.hutool.core.util.NumberUtil; import cn.lili.common.utils.CurrencyUtil; import cn.lili.modules.member.entity.dos.MemberAddress; 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.service.FreightTemplateService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.annotation.Order; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -96,14 +94,8 @@ public class SkuFreightRender implements CartRenderStep { //计算运费 Double countFreight = countFreight(count, freightTemplateChildDTO); - //写入运费 + //写入SKU运费 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) { try { Double finalFreight = template.getFirstPrice(); - //不满首重 + //不满首重 / 首件 if (template.getFirstCompany() >= count) { return finalFreight; } + //如果续重/续件,费用不为空,则返回 + if (template.getContinuedCompany() == 0 || template.getContinuedPrice() == 0) { + return finalFreight; + } + + //计算 续重 / 续件 价格 Double continuedCount = count - template.getFirstCompany(); - //计算续重价格 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) { return 0D; } diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java index 9e955a18..f6162890 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/SkuPromotionRender.java @@ -52,7 +52,6 @@ public class SkuPromotionRender implements CartRenderStep { cartVO -> { cartVO.getSkuList().forEach(cartSkuVO -> { PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO(); - priceDetailDTO.setOriginalPrice(CurrencyUtil.mul(cartSkuVO.getGoodsSku().getPrice(), cartSkuVO.getNum())); priceDetailDTO.setGoodsPrice(cartSkuVO.getSubTotal()); priceDetailDTO.setDiscountPrice(CurrencyUtil.sub(priceDetailDTO.getOriginalPrice(), cartSkuVO.getSubTotal())); }); diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/util/PromotionPriceUtil.java b/framework/src/main/java/cn/lili/modules/order/cart/render/util/PromotionPriceUtil.java index d97c51c6..d67e864a 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/util/PromotionPriceUtil.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/util/PromotionPriceUtil.java @@ -141,6 +141,13 @@ public class PromotionPriceUtil { cartSkuVO.getPriceDetailDTO().setCouponPrice( 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 { cartSkuVO.getPriceDetailDTO().setDiscountPrice( CurrencyUtil.add(cartSkuVO.getPriceDetailDTO().getDiscountPrice(), skuDiscountPrice)); diff --git a/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java index 39a49f93..b60a5947 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java @@ -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.KanJiaStatusEnum; 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.service.*; import cn.lili.modules.search.entity.dos.EsGoodsIndex; @@ -76,6 +77,11 @@ public class CartServiceImpl implements CartService { */ @Autowired private PromotionGoodsService promotionGoodsService; + /** + * 促销商品 + */ + @Autowired + private PointsGoodsService pointsGoodsService; /** * 会员地址 */ @@ -565,6 +571,9 @@ public class CartServiceImpl implements CartService { //循环符合优惠券的商品 for (CartSkuVO cartSkuVO : cartSkuVOS) { + if (!cartSkuVO.getChecked()) { + continue; + } //获取商品的促销信息 Optional promotionOptional = cartSkuVO.getPromotions().parallelStream().filter(promotionGoods -> @@ -649,6 +658,9 @@ public class CartServiceImpl implements CartService { } else if (cartTypeEnum.equals(CartTypeEnum.KANJIA)) { //检测购物车的数量 checkKanjia(cartSkuVO); + } else if (cartTypeEnum.equals(CartTypeEnum.POINTS)) { + //检测购物车的数量 + checkPoint(cartSkuVO); } } @@ -658,7 +670,6 @@ public class CartServiceImpl implements CartService { * @param cartSkuVO 购物车信息 */ private void checkPintuan(CartSkuVO cartSkuVO) { - //拼团活动,需要对限购数量进行判定 //获取拼团信息 List currentPromotion = cartSkuVO.getPromotions().stream().filter( @@ -666,8 +677,12 @@ public class CartServiceImpl implements CartService { .collect(Collectors.toList()); //拼团活动判定 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 { 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); //判断砍价活动是否已满足条件 } else if (!KanJiaStatusEnum.SUCCESS.name().equals(kanjiaActivity.getStatus())) { + cartSkuVO.setKanjiaId(kanjiaActivity.getKanjiaActivityGoodsId()); + cartSkuVO.setPurchasePrice(0D); throw new ServiceException(ResultCode.KANJIA_ACTIVITY_NOT_PASS_ERROR); } //砍价商品默认一件货物 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); + } + } } diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dto/PriceDetailDTO.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dto/PriceDetailDTO.java index 18e8c532..f94f418d 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dto/PriceDetailDTO.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dto/PriceDetailDTO.java @@ -143,6 +143,7 @@ public class PriceDetailDTO implements Serializable { */ public void setUpdatePrice(Double updatePrice) { this.updatePrice = updatePrice; + this.recount(); } @@ -155,8 +156,8 @@ public class PriceDetailDTO implements Serializable { CurrencyUtil.add(goodsPrice, freightPrice), CurrencyUtil.add(discountPrice, couponPrice != null ? couponPrice : 0)); - if (updatePrice > 0) { - CurrencyUtil.add(flowPrice, updatePrice); + if (updatePrice != 0) { + flowPrice = CurrencyUtil.add(flowPrice, updatePrice); } //计算平台佣金 流水金额*平台佣金比例 @@ -190,7 +191,8 @@ public class PriceDetailDTO implements Serializable { platFormCommission = CurrencyUtil.add(platFormCommission, priceDetailDTO.getPlatFormCommission()); siteCouponPrice = CurrencyUtil.add(siteCouponPrice, priceDetailDTO.getSiteCouponPrice()); - siteCouponPoint = CurrencyUtil.add(siteCouponPoint, priceDetailDTO.getSiteCouponPoint()); + //平台优惠券一笔交易只有一个,所以这里直接移值就好了 + siteCouponPoint = priceDetailDTO.getSiteCouponPoint(); siteCouponCommission = CurrencyUtil.add(siteCouponCommission, priceDetailDTO.getSiteCouponCommission()); updatePrice = CurrencyUtil.add(updatePrice, priceDetailDTO.getUpdatePrice()); @@ -326,7 +328,7 @@ public class PriceDetailDTO implements Serializable { this.siteCouponPoint = siteCouponPoint; if (siteCouponPoint != null && siteCouponPoint != 0) { - this.siteCouponCommission = CurrencyUtil.mul(siteCouponPrice, siteCouponPoint); + this.siteCouponCommission = CurrencyUtil.div(CurrencyUtil.mul(siteCouponPrice, siteCouponPoint), 100); } } diff --git a/framework/src/main/java/cn/lili/modules/order/order/service/AfterSaleService.java b/framework/src/main/java/cn/lili/modules/order/order/service/AfterSaleService.java index 00cee243..96975954 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/service/AfterSaleService.java +++ b/framework/src/main/java/cn/lili/modules/order/order/service/AfterSaleService.java @@ -54,7 +54,7 @@ public interface AfterSaleService extends IService { * @param sn 订单编号 * @return */ - AfterSaleApplyVO getAfterSaleDTO(String sn); + AfterSaleApplyVO getAfterSaleVO(String sn); /** * 售后申请 diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java index ece06cbc..42a137c0 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/AfterSaleServiceImpl.java @@ -121,7 +121,7 @@ public class AfterSaleServiceImpl extends ServiceImpl 1) { - query.addCriteria(Criteria.where(PRICE_COLUMN).gt(s[1])); + query.addCriteria(Criteria.where(PRICE_COLUMN).gte(s[1])); } else { - query.addCriteria(Criteria.where(PRICE_COLUMN).lt(s[0])); + query.addCriteria(Criteria.where(PRICE_COLUMN).lte(s[0])); } } if (CharSequenceUtil.isNotEmpty(publishNum)) { String[] s = publishNum.split("_"); if (s.length > 1) { - query.addCriteria(Criteria.where("publishNum").gt(s[1])); + query.addCriteria(Criteria.where("publishNum").gte(s[1])); } else { - query.addCriteria(Criteria.where("publishNum").lt(s[0])); + query.addCriteria(Criteria.where("publishNum").lte(s[0])); } } if (CharSequenceUtil.isNotEmpty(receivedNum)) { String[] s = receivedNum.split("_"); if (s.length > 1) { - query.addCriteria(Criteria.where("receivedNum").gt(s[1])); + query.addCriteria(Criteria.where("receivedNum").gte(s[1])); } else { - query.addCriteria(Criteria.where("receivedNum").lt(s[0])); + query.addCriteria(Criteria.where("receivedNum").lte(s[0])); } } } diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java index 8f0b24a9..1e5ec7c4 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java @@ -364,8 +364,8 @@ public class FullDiscountServiceImpl extends ServiceImpl j.eq(MemberCoupon::getScopeType, CouponScopeTypeEnum.ALL.name()))); queryWrapper.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name()); queryWrapper.le(MemberCoupon::getConsumeThreshold, totalPrice); - queryWrapper.gt(MemberCoupon::getEndTime, new Date()); + queryWrapper.ge(MemberCoupon::getEndTime, new Date()); return this.page(PageUtil.initPage(pageVo), queryWrapper); } @@ -124,7 +124,7 @@ public class MemberCouponServiceImpl extends ServiceImpl 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); } diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java index ec904f44..3dad031e 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java @@ -216,8 +216,8 @@ public class PromotionGoodsServiceImpl extends ServiceImpl promotionGoodsDTOList = new ArrayList<>(); int total = 0; //根据促销活动类型的不同,将满足当前促销活动类型且正在进行的促销商品返回出去 diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java index fa2565c0..1aed871e 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionServiceImpl.java @@ -154,8 +154,8 @@ public class PromotionServiceImpl implements PromotionService { Map resultMap = new HashMap<>(16); QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("promotion_status", PromotionStatusEnum.START.name()); - queryWrapper.gt("start_time", new Date()); - queryWrapper.lt("end_time", new Date()); + queryWrapper.ge("start_time", new Date()); + queryWrapper.le("end_time", new Date()); //获取当前进行的秒杀活动活动 List seckillList = seckillService.list(queryWrapper); if (seckillList != null && !seckillList.isEmpty()) { @@ -192,7 +192,7 @@ public class PromotionServiceImpl implements PromotionService { Query query = new Query(); query.addCriteria(Criteria.where("deleteFlag").is(false)); 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 fullDiscountVOS = mongoTemplate.find(query, FullDiscountVO.class); for (FullDiscountVO fullDiscountVO : fullDiscountVOS) { if (fullDiscountVO.getPromotionGoodsList() == null) { @@ -211,13 +211,13 @@ public class PromotionServiceImpl implements PromotionService { } } } - LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); - queryWrapper1.eq(PromotionGoods::getDeleteFlag, false); - queryWrapper1.eq(PromotionGoods::getPromotionStatus, PromotionStatusEnum.START.name()); - queryWrapper1.gt(PromotionGoods::getEndTime, new Date()); - queryWrapper1.eq(PromotionGoods::getSkuId, index.getId()); - List list1 = promotionGoodsService.list(queryWrapper1); - for (PromotionGoods promotionGoods : list1) { + LambdaQueryWrapper promotionGoodsQuery = new LambdaQueryWrapper<>(); + promotionGoodsQuery.eq(PromotionGoods::getDeleteFlag, false); + promotionGoodsQuery.eq(PromotionGoods::getPromotionStatus, PromotionStatusEnum.START.name()); + promotionGoodsQuery.ge(PromotionGoods::getEndTime, new Date()); + promotionGoodsQuery.eq(PromotionGoods::getSkuId, index.getId()); + List promotionGoodsList = promotionGoodsService.list(promotionGoodsQuery); + for (PromotionGoods promotionGoods : promotionGoodsList) { String esPromotionKey = promotionGoods.getPromotionType() + "-" + promotionGoods.getPromotionId(); switch (PromotionTypeEnum.valueOf(promotionGoods.getPromotionType())) { case COUPON: diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index 54232a9d..59d45b94 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -277,7 +277,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl timelineList = new ArrayList<>(); LambdaQueryWrapper 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()) .or(j -> j.eq(Seckill::getPromotionStatus, PromotionStatusEnum.START.name()))); List seckillList = seckillService.list(queryWrapper); @@ -326,7 +326,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl wrapperSeckillGoods(Integer startTimeline) { List seckillGoodsVoS = new ArrayList<>(); LambdaQueryWrapper 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()) .or(j -> j.eq(Seckill::getPromotionStatus, PromotionStatusEnum.START.name()))); List seckillList = this.seckillService.list(seckillLambdaQueryWrapper); diff --git a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberStatisticsDataServiceImpl.java b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberStatisticsDataServiceImpl.java index 145eb320..d6b3fc89 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberStatisticsDataServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/MemberStatisticsDataServiceImpl.java @@ -35,14 +35,14 @@ public class MemberStatisticsDataServiceImpl extends ServiceImpl implements public Integer todayStoreNum() { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); 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); }