合并
This commit is contained in:
		
						commit
						116a52ea14
					
				
							
								
								
									
										32
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								README.md
									
									
									
									
									
								
							| @ -1,15 +1,19 @@ | |||||||
| ## Lilishop B2B2C商城系统 | ## Lilishop B2B2C商城系统 | ||||||
| 
 | 
 | ||||||
| ##### 开源不易,如有帮助请点Star  | ##### 官方公众号 & 开源不易,如有帮助请点Star | ||||||
|  |  | ||||||
|  | 
 | ||||||
| [](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers) | [](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ### 介绍 | ### 介绍 | ||||||
| **官网**:https://pickmall.cn | **官网**:https://pickmall.cn | ||||||
| 
 | 
 | ||||||
| Lilishop 是一款Java开发,基于SpringBoot的B2B2C多用户商城,前端使用 Vue、uniapp-app开发 **系统全端全部代码开源** | Lilishop 是一款Java开发,基于SpringBoot研发的B2B2C多用户商城,前端使用 Vue、uniapp开发 **系统全端全部代码开源** | ||||||
| 
 | 
 | ||||||
| 商城展示端包含 PC、H5、小程序、APP。 | 产品前后端分离、支持分布式部署。 | ||||||
|  | 
 | ||||||
|  | 商城展示端包含 PC、H5、微信小程序、APP。 | ||||||
| 
 | 
 | ||||||
| 商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块 | 商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块 | ||||||
| 
 | 
 | ||||||
| @ -17,8 +21,6 @@ Lilishop 是一款Java开发,基于SpringBoot的B2B2C多用户商城,前端 | |||||||
| 
 | 
 | ||||||
| 开箱即用,简单配置即可部署一套属于您的系统。 | 开箱即用,简单配置即可部署一套属于您的系统。 | ||||||
| 
 | 
 | ||||||
| 完美支持二开、学生毕业设计答辩等各个场景 |  | ||||||
| 
 |  | ||||||
| ### 文档 | ### 文档 | ||||||
| 
 | 
 | ||||||
| **产品文档**(需求、架构、使用、部署、开发):https://docs.pickmall.cn | **产品文档**(需求、架构、使用、部署、开发):https://docs.pickmall.cn | ||||||
| @ -116,20 +118,23 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_ | |||||||
| 
 | 
 | ||||||
| #### 移动端 | #### 移动端 | ||||||
| 
 | 
 | ||||||
|  | <img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="管理端功能展示" style="zoom:50%;" /> | ||||||
|  | 
 | ||||||
| <img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" /> | <img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" /> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| #### 管理端 | #### 管理端 | ||||||
| 
 | 
 | ||||||
| <img src="https://pickmall.cn/assets/imgs/other/manager.gif" alt="管理端功能展示" /> |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ### 技术选型 | ### 技术选型 | ||||||
| 
 | 
 | ||||||
|  | #### 架构图 | ||||||
|  | 
 | ||||||
|  |  | ||||||
|  | 
 | ||||||
| ##### Java后台 | ##### Java后台 | ||||||
| 
 | 
 | ||||||
| | 说明           | 框架            | 说明           |               | | | 说明           | 框架            | 说明           |               | | ||||||
| @ -163,6 +168,8 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_ | |||||||
| 
 | 
 | ||||||
| ### 升级计划 | ### 升级计划 | ||||||
| 
 | 
 | ||||||
|  | #### 计划每个月发布一个版本,具体时间可能有出入 | ||||||
|  | 
 | ||||||
| 时间:2021年6月15日 | 时间:2021年6月15日 | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| @ -217,7 +224,13 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_ | |||||||
| 增加供应商功能 | 增加供应商功能 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | ### 版本升级 | ||||||
| 
 | 
 | ||||||
|  | ``` | ||||||
|  | 后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商 | ||||||
|  | 
 | ||||||
|  | 后续会考虑推出微服务/中台等 企业级版本 | ||||||
|  | ``` | ||||||
| 
 | 
 | ||||||
| ### 技术亮点 | ### 技术亮点 | ||||||
| 
 | 
 | ||||||
| @ -261,3 +274,4 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_ | |||||||
| ### 交流群 | ### 交流群 | ||||||
| 
 | 
 | ||||||
| **QQ群**:961316482 | **QQ群**:961316482 | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -36,7 +36,7 @@ public abstract class AbstractDelayQueueMachineFactory { | |||||||
|         instance.add(Calendar.SECOND, time); |         instance.add(Calendar.SECOND, time); | ||||||
|         long delaySeconds = instance.getTimeInMillis() / 1000; |         long delaySeconds = instance.getTimeInMillis() / 1000; | ||||||
|         boolean result = redisUtil.zadd(setDelayQueueName(), delaySeconds, jobId); |         boolean result = redisUtil.zadd(setDelayQueueName(), delaySeconds, jobId); | ||||||
|         log.info("redis add delay, key {}, delay time {}", setDelayQueueName(), delaySeconds); |         log.info("redis add delay, key {}, delay time {}", setDelayQueueName(), time); | ||||||
|         return result; |         return result; | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -24,6 +24,7 @@ import cn.lili.modules.order.cart.render.TradeBuilder; | |||||||
| import cn.lili.modules.order.order.entity.dos.Trade; | import cn.lili.modules.order.order.entity.dos.Trade; | ||||||
| import cn.lili.modules.order.order.entity.vo.ReceiptVO; | import cn.lili.modules.order.order.entity.vo.ReceiptVO; | ||||||
| import cn.lili.modules.promotion.entity.dos.MemberCoupon; | import cn.lili.modules.promotion.entity.dos.MemberCoupon; | ||||||
|  | import cn.lili.modules.promotion.entity.dos.PromotionGoods; | ||||||
| import cn.lili.modules.promotion.entity.enums.CouponScopeTypeEnum; | import cn.lili.modules.promotion.entity.enums.CouponScopeTypeEnum; | ||||||
| import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum; | import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum; | ||||||
| import cn.lili.modules.promotion.entity.enums.PromotionTypeEnum; | import cn.lili.modules.promotion.entity.enums.PromotionTypeEnum; | ||||||
| @ -43,6 +44,7 @@ import org.springframework.stereotype.Service; | |||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.HashMap; | import java.util.HashMap; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  | import java.util.Optional; | ||||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -137,6 +139,9 @@ public class CartServiceImpl implements CartService { | |||||||
|                 cartSkuVOS.add(cartSkuVO); |                 cartSkuVOS.add(cartSkuVO); | ||||||
|             } |             } | ||||||
|             tradeDTO.setCartTypeEnum(cartTypeEnum); |             tradeDTO.setCartTypeEnum(cartTypeEnum); | ||||||
|  |             // 如购物车发生更改,则重置优惠券 | ||||||
|  |             tradeDTO.setStoreCoupons(null); | ||||||
|  |             tradeDTO.setPlatformCoupon(null); | ||||||
|             this.resetTradeDTO(tradeDTO); |             this.resetTradeDTO(tradeDTO); | ||||||
|         } catch (Exception e) { |         } catch (Exception e) { | ||||||
|             log.error("购物车渲染异常", e); |             log.error("购物车渲染异常", e); | ||||||
| @ -294,7 +299,7 @@ public class CartServiceImpl implements CartService { | |||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public TradeDTO getCheckedTradeDTO(CartTypeEnum way) { |     public TradeDTO getCheckedTradeDTO(CartTypeEnum way) { | ||||||
|         return this.readDTO(way); |         return tradeBuilder.buildTrade(way); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -474,7 +479,7 @@ public class CartServiceImpl implements CartService { | |||||||
|         } |         } | ||||||
|         //使用优惠券 与否 |         //使用优惠券 与否 | ||||||
|         if (use && checkCoupon(memberCoupon, tradeDTO)) { |         if (use && checkCoupon(memberCoupon, tradeDTO)) { | ||||||
|             this.useCoupon(tradeDTO, memberCoupon); |             this.useCoupon(tradeDTO, memberCoupon, cartTypeEnum); | ||||||
|         } else if (!use) { |         } else if (!use) { | ||||||
|             if (Boolean.TRUE.equals(memberCoupon.getIsPlatform())) { |             if (Boolean.TRUE.equals(memberCoupon.getIsPlatform())) { | ||||||
|                 tradeDTO.setPlatformCoupon(null); |                 tradeDTO.setPlatformCoupon(null); | ||||||
| @ -563,10 +568,23 @@ public class CartServiceImpl implements CartService { | |||||||
|         return cartTypeEnum; |         return cartTypeEnum; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void useCoupon(TradeDTO tradeDTO, MemberCoupon memberCoupon) { |     private void useCoupon(TradeDTO tradeDTO, MemberCoupon memberCoupon, CartTypeEnum cartTypeEnum) { | ||||||
|         //如果是平台优惠券 |         //如果是平台优惠券 | ||||||
|         if (Boolean.TRUE.equals(memberCoupon.getIsPlatform())) { |         if (Boolean.TRUE.equals(memberCoupon.getIsPlatform())) { | ||||||
|             if (memberCoupon.getConsumeThreshold() <= tradeDTO.getPriceDetailDTO().getGoodsPrice()) { |             // 购物车价格 | ||||||
|  |             Double cartPrice = 0d; | ||||||
|  |             for (CartSkuVO cartSkuVO : tradeDTO.getSkuList()) { | ||||||
|  |                 // 获取商品的促销信息 | ||||||
|  |                 Optional<PromotionGoods> promotionOptional = cartSkuVO.getPromotions().parallelStream().filter(i -> (i.getPromotionType().equals(PromotionTypeEnum.PINTUAN.name()) && cartTypeEnum.equals(CartTypeEnum.PINTUAN)) | ||||||
|  |                         || i.getPromotionType().equals(PromotionTypeEnum.SECKILL.name())).findAny(); | ||||||
|  |                 if (promotionOptional.isPresent()) { | ||||||
|  |                     cartPrice += CurrencyUtil.mul(promotionOptional.get().getPrice(), cartSkuVO.getNum()); | ||||||
|  |                 } else { | ||||||
|  |                     cartPrice += CurrencyUtil.mul(cartSkuVO.getGoodsSku().getPrice(), cartSkuVO.getNum()); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |             } | ||||||
|  |             if (memberCoupon.getConsumeThreshold() <= cartPrice) { | ||||||
|                 tradeDTO.setPlatformCoupon(new MemberCouponDTO(memberCoupon)); |                 tradeDTO.setPlatformCoupon(new MemberCouponDTO(memberCoupon)); | ||||||
|                 tradeDTO.setStoreCoupons(new HashMap<>()); |                 tradeDTO.setStoreCoupons(new HashMap<>()); | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -33,4 +33,23 @@ public interface PromotionGoodsMapper extends BaseMapper<PromotionGoods> { | |||||||
|                                              @Param("skuId") String skuId, |                                              @Param("skuId") String skuId, | ||||||
|                                              @Param("startTime") Date startTime, |                                              @Param("startTime") Date startTime, | ||||||
|                                              @Param("endTime") Date endTime); |                                              @Param("endTime") Date endTime); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询参加活动促销商品是否同时参加指定类型的活动 | ||||||
|  |      * | ||||||
|  |      * @param promotionType 促销类型 | ||||||
|  |      * @param skuId         skuId | ||||||
|  |      * @param startTime     开始时间 | ||||||
|  |      * @param endTime       结束时间 | ||||||
|  |      * @return 共参加了几种活动 | ||||||
|  |      */ | ||||||
|  |     @Select("select count(0) from li_promotion_goods where promotion_type = #{promotionType} and sku_id = #{skuId} and (" + | ||||||
|  |             "( start_time < #{startTime}  && end_time > #{startTime} ) || ( start_time < #{endTime}  && end_time > #{endTime} ) || " + | ||||||
|  |             "( start_time < #{startTime}  && end_time > #{endTime} ) || ( start_time > #{startTime}  && end_time < #{endTime} )" + | ||||||
|  |             " || promotion_status = 'START' ) and promotion_id != #{promotionId}") | ||||||
|  |     Integer selectInnerOverlapPromotionGoodsWithout(@Param("promotionType") String promotionType, | ||||||
|  |                                              @Param("skuId") String skuId, | ||||||
|  |                                              @Param("startTime") Date startTime, | ||||||
|  |                                              @Param("endTime") Date endTime, | ||||||
|  |                                              @Param("promotionId") String promotionId); | ||||||
| } | } | ||||||
| @ -106,9 +106,10 @@ public interface PromotionGoodsService extends IService<PromotionGoods> { | |||||||
|      * @param skuId         skuId |      * @param skuId         skuId | ||||||
|      * @param startTime     开始时间 |      * @param startTime     开始时间 | ||||||
|      * @param endTime       结束时间 |      * @param endTime       结束时间 | ||||||
|  |      * @param promotionId   促销活动id(是否排除当前活动,如排除,则填写,没有的话,为null) | ||||||
|      * @return 共参加了几种活动 |      * @return 共参加了几种活动 | ||||||
|      */ |      */ | ||||||
|     Integer findInnerOverlapPromotionGoods(String promotionType, String skuId, Date startTime, Date endTime); |     Integer findInnerOverlapPromotionGoods(String promotionType, String skuId, Date startTime, Date endTime, String promotionId); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -20,11 +20,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
| import lombok.RequiredArgsConstructor; |  | ||||||
| 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 org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||||
| 
 | 
 | ||||||
|  | import java.util.ArrayList; | ||||||
| import java.util.Arrays; | import java.util.Arrays; | ||||||
| import java.util.Date; | import java.util.Date; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @ -59,7 +59,7 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, Mem | |||||||
|             throw new ServiceException("优惠券剩余领取数量不足"); |             throw new ServiceException("优惠券剩余领取数量不足"); | ||||||
|         } |         } | ||||||
|         if (haveCoupons >= coupon.getCouponLimitNum()) { |         if (haveCoupons >= coupon.getCouponLimitNum()) { | ||||||
|             throw new ServiceException("此优惠券最多领取" + coupon.getCouponLimitNum()+"张"); |             throw new ServiceException("此优惠券最多领取" + coupon.getCouponLimitNum() + "张"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -96,7 +96,9 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, Mem | |||||||
|     @Override |     @Override | ||||||
|     public IPage<MemberCoupon> getMemberCouponsByCanUse(CouponSearchParams param, Double totalPrice, PageVO pageVo) { |     public IPage<MemberCoupon> getMemberCouponsByCanUse(CouponSearchParams param, Double totalPrice, PageVO pageVo) { | ||||||
|         LambdaQueryWrapper<MemberCoupon> queryWrapper = new LambdaQueryWrapper<>(); |         LambdaQueryWrapper<MemberCoupon> queryWrapper = new LambdaQueryWrapper<>(); | ||||||
|         queryWrapper.in(MemberCoupon::getStoreId, Arrays.asList(param.getStoreId(), "platform")); |         List<String> storeIds = new ArrayList<>(Arrays.asList(param.getStoreId().split(","))); | ||||||
|  |         storeIds.add("platform"); | ||||||
|  |         queryWrapper.in(MemberCoupon::getStoreId, storeIds); | ||||||
|         queryWrapper.eq(MemberCoupon::getMemberId, param.getMemberId()); |         queryWrapper.eq(MemberCoupon::getMemberId, param.getMemberId()); | ||||||
|         queryWrapper.and( |         queryWrapper.and( | ||||||
|                 i -> i.like(MemberCoupon::getScopeId, param.getScopeId()) |                 i -> i.like(MemberCoupon::getScopeId, param.getScopeId()) | ||||||
|  | |||||||
| @ -504,9 +504,9 @@ public class PintuanServiceImpl extends ServiceImpl<PintuanMapper, Pintuan> impl | |||||||
|                     throw new ServiceException(); |                     throw new ServiceException(); | ||||||
|                 } |                 } | ||||||
|                 // 查询是否在同一时间段参与了拼团活动 |                 // 查询是否在同一时间段参与了拼团活动 | ||||||
|                 Integer count = promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.SECKILL.name(), promotionGood.getSkuId(), pintuan.getStartTime(), pintuan.getEndTime()); |                 Integer count = promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.SECKILL.name(), promotionGood.getSkuId(), pintuan.getStartTime(), pintuan.getEndTime(), pintuan.getId()); | ||||||
|                 // 查询是否在同一时间段参与了秒杀活动活动 |                 // 查询是否在同一时间段参与了限时抢购活动 | ||||||
|                 count += promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.PINTUAN.name(), promotionGood.getSkuId(), pintuan.getStartTime(), pintuan.getEndTime()); |                 count += promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.PINTUAN.name(), promotionGood.getSkuId(), pintuan.getStartTime(), pintuan.getEndTime(), pintuan.getId()); | ||||||
|                 if (count > 0) { |                 if (count > 0) { | ||||||
|                     log.error("商品[" + promotionGood.getGoodsName() + "]已经在重叠的时间段参加了秒杀活动或拼团活动,不能参加拼团活动"); |                     log.error("商品[" + promotionGood.getGoodsName() + "]已经在重叠的时间段参加了秒杀活动或拼团活动,不能参加拼团活动"); | ||||||
|                     throw new ServiceException("商品[" + promotionGood.getGoodsName() + "]已经在重叠的时间段参加了秒杀活动或拼团活动,不能参加拼团活动"); |                     throw new ServiceException("商品[" + promotionGood.getGoodsName() + "]已经在重叠的时间段参加了秒杀活动或拼团活动,不能参加拼团活动"); | ||||||
|  | |||||||
| @ -113,7 +113,7 @@ public class PromotionGoodsServiceImpl extends ServiceImpl<PromotionGoodsMapper, | |||||||
|         if (pointsGoods != null) { |         if (pointsGoods != null) { | ||||||
|             cartSkuVO.setPoint(pointsGoods.getPoints().intValue()); |             cartSkuVO.setPoint(pointsGoods.getPoints().intValue()); | ||||||
|         } |         } | ||||||
|         DistributionGoods distributionGoods=distributionGoodsService.distributionGoodsVOBySkuId(cartSkuVO.getGoodsSku().getId()); |         DistributionGoods distributionGoods = distributionGoodsService.distributionGoodsVOBySkuId(cartSkuVO.getGoodsSku().getId()); | ||||||
|         if (distributionGoods != null) { |         if (distributionGoods != null) { | ||||||
|             cartSkuVO.setDistributionGoods(distributionGoods); |             cartSkuVO.setDistributionGoods(distributionGoods); | ||||||
|         } |         } | ||||||
| @ -246,8 +246,12 @@ public class PromotionGoodsServiceImpl extends ServiceImpl<PromotionGoodsMapper, | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public Integer findInnerOverlapPromotionGoods(String promotionType, String skuId, Date startTime, Date endTime) { |     public Integer findInnerOverlapPromotionGoods(String promotionType, String skuId, Date startTime, Date endTime, String promotionId) { | ||||||
|         return this.baseMapper.selectInnerOverlapPromotionGoods(promotionType, skuId, startTime, endTime); |         if (promotionId != null) { | ||||||
|  |             return this.baseMapper.selectInnerOverlapPromotionGoodsWithout(promotionType, skuId, startTime, endTime, promotionId); | ||||||
|  |         } else { | ||||||
|  |             return this.baseMapper.selectInnerOverlapPromotionGoods(promotionType, skuId, startTime, endTime); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -292,7 +292,7 @@ public class PromotionPriceServiceImpl implements PromotionPriceService { | |||||||
|     private double calculationSingleCoupon(MemberCoupon coupon, List<GoodsSkuPromotionPriceDTO> conformCollect) { |     private double calculationSingleCoupon(MemberCoupon coupon, List<GoodsSkuPromotionPriceDTO> conformCollect) { | ||||||
|         double couponTotalPrice = 0; |         double couponTotalPrice = 0; | ||||||
|         // 合计优惠券范围内的所有商品的原价 |         // 合计优惠券范围内的所有商品的原价 | ||||||
|         double totalPrice = conformCollect.parallelStream().mapToDouble(GoodsSkuPromotionPriceDTO::getOriginalPrice).sum(); |         double totalPrice = conformCollect.parallelStream().mapToDouble(GoodsSkuPromotionPriceDTO::getTotalFinalePrice).sum(); | ||||||
| 
 | 
 | ||||||
|         // 根据优惠券优惠类型,判断是否满足条件 |         // 根据优惠券优惠类型,判断是否满足条件 | ||||||
|         if (CouponTypeEnum.PRICE.name().equals(coupon.getCouponType()) && coupon.getConsumeThreshold() <= totalPrice) { |         if (CouponTypeEnum.PRICE.name().equals(coupon.getCouponType()) && coupon.getConsumeThreshold() <= totalPrice) { | ||||||
| @ -314,14 +314,14 @@ public class PromotionPriceServiceImpl implements PromotionPriceService { | |||||||
| 
 | 
 | ||||||
|         // 分配到每个商品的优惠券金额 |         // 分配到每个商品的优惠券金额 | ||||||
|         for (GoodsSkuPromotionPriceDTO goodsSkuPromotionPriceDTO : conformCollect) { |         for (GoodsSkuPromotionPriceDTO goodsSkuPromotionPriceDTO : conformCollect) { | ||||||
|             double rate = CurrencyUtil.div(goodsSkuPromotionPriceDTO.getFinalePrice(), totalPrice, 5); |             double rate = CurrencyUtil.div(goodsSkuPromotionPriceDTO.getTotalFinalePrice(), totalPrice, 5); | ||||||
|             double distributeCouponPrice = CurrencyUtil.mul(couponTotalPrice, rate); |             double distributeCouponPrice = CurrencyUtil.div(CurrencyUtil.mul(couponTotalPrice, rate), goodsSkuPromotionPriceDTO.getNumber()); | ||||||
|             if (goodsSkuPromotionPriceDTO.getFinalePrice() != null) { |             if (goodsSkuPromotionPriceDTO.getFinalePrice() != null) { | ||||||
|                 goodsSkuPromotionPriceDTO.setFinalePrice(CurrencyUtil.sub(goodsSkuPromotionPriceDTO.getFinalePrice(), distributeCouponPrice)); |                 goodsSkuPromotionPriceDTO.setFinalePrice(CurrencyUtil.sub(goodsSkuPromotionPriceDTO.getFinalePrice(), distributeCouponPrice)); | ||||||
|             } else { |             } else { | ||||||
|                 goodsSkuPromotionPriceDTO.setFinalePrice(CurrencyUtil.sub(goodsSkuPromotionPriceDTO.getOriginalPrice(), distributeCouponPrice)); |                 goodsSkuPromotionPriceDTO.setFinalePrice(CurrencyUtil.sub(goodsSkuPromotionPriceDTO.getOriginalPrice(), distributeCouponPrice)); | ||||||
|             } |             } | ||||||
|             goodsSkuPromotionPriceDTO.setCouponPrice(distributeCouponPrice); |             goodsSkuPromotionPriceDTO.setCouponPrice(CurrencyUtil.mul(distributeCouponPrice, goodsSkuPromotionPriceDTO.getNumber())); | ||||||
|             goodsSkuPromotionPriceDTO.setTotalFinalePrice(CurrencyUtil.mul(goodsSkuPromotionPriceDTO.getFinalePrice(), goodsSkuPromotionPriceDTO.getNumber())); |             goodsSkuPromotionPriceDTO.setTotalFinalePrice(CurrencyUtil.mul(goodsSkuPromotionPriceDTO.getFinalePrice(), goodsSkuPromotionPriceDTO.getNumber())); | ||||||
|             BasePromotion basePromotion = new BasePromotion(); |             BasePromotion basePromotion = new BasePromotion(); | ||||||
|             basePromotion.setId(coupon.getId()); |             basePromotion.setId(coupon.getId()); | ||||||
|  | |||||||
| @ -325,14 +325,18 @@ public class PromotionServiceImpl implements PromotionService { | |||||||
|         pintuanVO.setPromotionStatus(promotionMessage.getPromotionStatus()); |         pintuanVO.setPromotionStatus(promotionMessage.getPromotionStatus()); | ||||||
|         result = this.pintuanService.update(promotionMessage.updateWrapper()); |         result = this.pintuanService.update(promotionMessage.updateWrapper()); | ||||||
|         this.promotionGoodsService.updateBatchById(pintuanVO.getPromotionGoodsList()); |         this.promotionGoodsService.updateBatchById(pintuanVO.getPromotionGoodsList()); | ||||||
|         List<PromotionGoods> promotionGoodsList = pintuanVO.getPromotionGoodsList(); |         if (pintuanVO.getPromotionGoodsList() != null) { | ||||||
|         // 更新促销商品索引 |             List<PromotionGoods> promotionGoodsList = pintuanVO.getPromotionGoodsList(); | ||||||
|         for (PromotionGoods promotionGoods : promotionGoodsList) { |             // 更新促销商品索引 | ||||||
|             Pintuan pintuan1 = JSONUtil.toBean(JSONUtil.toJsonStr(pintuanVO), Pintuan.class); |             for (PromotionGoods promotionGoods : promotionGoodsList) { | ||||||
|             this.goodsIndexService.updateEsGoodsIndex(promotionGoods.getSkuId(), pintuan1, esPromotionKey, promotionGoods.getPrice()); |                 Pintuan pintuan1 = JSONUtil.toBean(JSONUtil.toJsonStr(pintuanVO), Pintuan.class); | ||||||
|  |                 this.goodsIndexService.updateEsGoodsIndex(promotionGoods.getSkuId(), pintuan1, esPromotionKey, promotionGoods.getPrice()); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|         this.mongoTemplate.save(pintuanVO); |         this.mongoTemplate.save(pintuanVO); | ||||||
|         return result; |         return result; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -366,10 +366,10 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec | |||||||
|     /** |     /** | ||||||
|      * 检测秒杀申请的商品 |      * 检测秒杀申请的商品 | ||||||
|      * |      * | ||||||
|      * @param seckill   秒杀活动 |      * @param seckill      秒杀活动 | ||||||
|      * @param seckillApply 秒杀活动申请 |      * @param seckillApply 秒杀活动申请 | ||||||
|      * @param goodsSku  商品SKU |      * @param goodsSku     商品SKU | ||||||
|      * @param startTime 秒杀时段开启时间 |      * @param startTime    秒杀时段开启时间 | ||||||
|      */ |      */ | ||||||
|     private void checkSeckillGoodsSKU(SeckillVO seckill, SeckillApplyVO seckillApply, GoodsSku goodsSku, DateTime startTime) { |     private void checkSeckillGoodsSKU(SeckillVO seckill, SeckillApplyVO seckillApply, GoodsSku goodsSku, DateTime startTime) { | ||||||
|         //活动库存不能大于商品库存 |         //活动库存不能大于商品库存 | ||||||
| @ -377,11 +377,11 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec | |||||||
|             throw new ServiceException(seckillApply.getGoodsName() + ",此商品库存不足"); |             throw new ServiceException(seckillApply.getGoodsName() + ",此商品库存不足"); | ||||||
|         } |         } | ||||||
|         // 查询是否在同一时间段参与了拼团活动 |         // 查询是否在同一时间段参与了拼团活动 | ||||||
|         if (promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.PINTUAN.name(), goodsSku.getId(), startTime, seckill.getEndTime()) > 0) { |         if (promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.PINTUAN.name(), goodsSku.getId(), startTime, seckill.getEndTime(), seckill.getId()) > 0) { | ||||||
|             throw new ServiceException("商品[" + goodsSku.getGoodsName() + "]已经在重叠的时间段参加了拼团活动,不能参加秒杀活动"); |             throw new ServiceException("商品[" + goodsSku.getGoodsName() + "]已经在重叠的时间段参加了拼团活动,不能参加秒杀活动"); | ||||||
|         } |         } | ||||||
|         // 查询是否在同一时间段参与了秒杀活动活动 |         // 查询是否在同一时间段参与了秒杀活动活动 | ||||||
|         if (promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.SECKILL.name(), goodsSku.getId(), startTime, seckill.getEndTime()) > 0) { |         if (promotionGoodsService.findInnerOverlapPromotionGoods(PromotionTypeEnum.SECKILL.name(), goodsSku.getId(), startTime, seckill.getEndTime(), seckill.getId()) > 0) { | ||||||
|             throw new ServiceException("商品[" + goodsSku.getGoodsName() + "]已经在重叠的时间段参加了秒杀活动,不能参加秒杀活动活动"); |             throw new ServiceException("商品[" + goodsSku.getGoodsName() + "]已经在重叠的时间段参加了秒杀活动,不能参加秒杀活动活动"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | |||||||
							
								
								
									
										18
									
								
								pushGithub.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								pushGithub.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,18 @@ | |||||||
|  | echo '开始推送github' | ||||||
|  | echo '切换git地址' | ||||||
|  | git remote rm origin | ||||||
|  | 
 | ||||||
|  | git remote add origin git@github.com:hongyehuicheng/lilishop.git | ||||||
|  | echo '设置上传代码分支,推送github' | ||||||
|  | git push --set-upstream origin master --force | ||||||
|  | echo '推送github完成' | ||||||
|  | git remote rm origin | ||||||
|  | 
 | ||||||
|  | git remote add origin git@gitee.com:beijing_hongye_huicheng/lilishop.git | ||||||
|  | 
 | ||||||
|  | git pull origin master | ||||||
|  | 
 | ||||||
|  | echo '切回gitee资源' | ||||||
|  | git branch --set-upstream-to=origin/master master | ||||||
|  | echo '设置git跟踪资源' | ||||||
|  | 
 | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 lifenlong
						lifenlong