Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop into feature/pg
This commit is contained in:
commit
cf6b1a60f4
3
DB/README.md
Normal file
3
DB/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
## PS:数据库位置
|
||||||
|
|
||||||
|
点击跳转 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码,则需要在lilishop项目根目录的update-sql目录中,获取对应的升级sql。
|
31
README.md
31
README.md
@ -1,11 +1,18 @@
|
|||||||
## 🔥 Lilishop B2B2C商城系统
|
## 🔥 Lilishop B2B2C商城系统
|
||||||
|
|
||||||
##### 🌹官方公众号 & 开源不易,如有帮助请点Star
|
##### 🌹 开源不易,如有帮助请点Star
|
||||||
|
|
||||||
##### 官方qq 1群 961316482(已满)
|
|
||||||
##### 官方qq 2群 875294241
|
|
||||||
|
|
||||||
##### 官方公众号/小程序体验,扫描二维码
|
|
||||||
|
#### 欢迎交流需求,交流业务,交流技术
|
||||||
|
|
||||||
|
##### 交流 qq 1群 961316482(已满)
|
||||||
|
|
||||||
|
##### 交流 qq 2群 875294241
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### 商城 公众号/小程序体验,扫描二维码
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -13,26 +20,26 @@
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
### 🔥介绍
|
### 🔥 商城介绍
|
||||||
**官网**:https://pickmall.cn
|
**官网**:https://pickmall.cn
|
||||||
|
|
||||||
Lilishop 基于SpringBoot研发的B2B2C多用户商城系统,前端使用 Vue、uniapp开发 **系统全端全部代码开源**
|
Lilishop 商城系统 基于SpringBoot 研发,B2B2C多用户商城系统,前端使用 Vue、uniapp开发 **系统全端全部代码开源**
|
||||||
|
|
||||||
业务兼容O2O商城/B2B商城/B2B2C商城/F2B2C商城/S2B2C商城。支持小程序商城、H5商城、APP商城、 PC商城。
|
业务兼容O2O商城/B2B商城/B2B2C商城/F2B2C商城/S2B2C商城。支持小程序商城、H5商城、APP商城、 PC商城。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
产品前后端分离、支持分布式部署。
|
商城前后端分离、支持分布式部署。
|
||||||
|
|
||||||
商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块
|
商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块
|
||||||
|
|
||||||
系统包含各种中间件、搜索引擎、多级缓存、分布式事务、分布式任务调度等,支持Docker,支持k8s。是一款高性能,支持高并发等商城系统。
|
商城包含各种中间件、搜索引擎、多级缓存、分布式事务、分布式任务调度等,支持Docker,支持k8s。是一款高性能,支持高并发的商城系统。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### ☃️文档
|
### ☃️ 帮助文档
|
||||||
|
|
||||||
**产品文档**:https://docs.pickmall.cn
|
https://docs.pickmall.cn
|
||||||
|
|
||||||
### 💧 项目链接(gitee)
|
### 💧 项目链接(gitee)
|
||||||
|
|
||||||
@ -68,7 +75,7 @@ Lilishop 基于SpringBoot研发的B2B2C多用户商城系统,前端使用 Vue
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 🚙3行命令搭建本地环境
|
### 🚙 3行命令搭建本地运行环境
|
||||||
|
|
||||||
温馨提示:由于服务中间件较多,如果笔记本环境启动内存没有32g可能无法启动成功(macbookpro 2020 16g内存启动无法成功),台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。
|
温馨提示:由于服务中间件较多,如果笔记本环境启动内存没有32g可能无法启动成功(macbookpro 2020 16g内存启动无法成功),台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。
|
||||||
|
|
||||||
@ -91,7 +98,7 @@ Lilishop 基于SpringBoot研发的B2B2C多用户商城系统,前端使用 Vue
|
|||||||
|
|
||||||
PS:单独部署的话,点击跳转 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码,则需要在lilishop项目根目录的update-sql目录中,获取对应的升级sql。
|
PS:单独部署的话,点击跳转 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码,则需要在lilishop项目根目录的update-sql目录中,获取对应的升级sql。
|
||||||
|
|
||||||
##### 商城部署后 API/UI 地址
|
##### 商城 API/UI 地址
|
||||||
|
|
||||||
| API | 地址 |
|
| API | 地址 |
|
||||||
| -------------- | --------------- |
|
| -------------- | --------------- |
|
||||||
|
@ -53,6 +53,8 @@ public class KanjiaGoodsActivityBuyerController {
|
|||||||
public ResultMessage<IPage<KanjiaActivityGoodsListVO>> kanjiaActivityGoodsPage(KanjiaActivityGoodsParams kanjiaActivityGoodsParams, PageVO page) {
|
public ResultMessage<IPage<KanjiaActivityGoodsListVO>> kanjiaActivityGoodsPage(KanjiaActivityGoodsParams kanjiaActivityGoodsParams, PageVO page) {
|
||||||
// 会员端查询到的肯定是已经开始的活动商品
|
// 会员端查询到的肯定是已经开始的活动商品
|
||||||
kanjiaActivityGoodsParams.setPromotionStatus(PromotionStatusEnum.START.name());
|
kanjiaActivityGoodsParams.setPromotionStatus(PromotionStatusEnum.START.name());
|
||||||
|
kanjiaActivityGoodsParams.setStartTime(System.currentTimeMillis());
|
||||||
|
kanjiaActivityGoodsParams.setEndTime(System.currentTimeMillis());
|
||||||
return ResultUtil.data(kanJiaActivityGoodsService.kanjiaGoodsVOPage(kanjiaActivityGoodsParams, page));
|
return ResultUtil.data(kanJiaActivityGoodsService.kanjiaGoodsVOPage(kanjiaActivityGoodsParams, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,9 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
|||||||
} else if (orderMessage.getNewStatus().equals(OrderStatusEnum.CANCELLED)) {
|
} else if (orderMessage.getNewStatus().equals(OrderStatusEnum.CANCELLED)) {
|
||||||
//根据订单编号获取订单数据,如果为积分订单则跳回
|
//根据订单编号获取订单数据,如果为积分订单则跳回
|
||||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||||
if (order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name()) && order.getPriceDetailDTO().getPayPoint() != null) {
|
//增加对积分订单的判定,如果积分支付,取消订单则退还用户积分
|
||||||
|
if (StringUtils.isNotEmpty(order.getOrderPromotionType()) &&
|
||||||
|
order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name()) && order.getPriceDetailDTO().getPayPoint() != null) {
|
||||||
memberService.updateMemberPoint(Convert.toLong(order.getPriceDetailDTO().getPayPoint()), PointTypeEnum.INCREASE.name(), order.getMemberId(), "订单取消,恢复积分:" + order.getPriceDetailDTO().getPayPoint() + "分");
|
memberService.updateMemberPoint(Convert.toLong(order.getPriceDetailDTO().getPayPoint()), PointTypeEnum.INCREASE.name(), order.getMemberId(), "订单取消,恢复积分:" + order.getPriceDetailDTO().getPayPoint() + "分");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,6 +275,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
//循环订单
|
//循环订单
|
||||||
for (OrderItem orderItem : order.getOrderItems()) {
|
for (OrderItem orderItem : order.getOrderItems()) {
|
||||||
skuKeys.add(GoodsSkuService.getStockCacheKey(orderItem.getSkuId()));
|
skuKeys.add(GoodsSkuService.getStockCacheKey(orderItem.getSkuId()));
|
||||||
|
|
||||||
GoodsSku goodsSku = new GoodsSku();
|
GoodsSku goodsSku = new GoodsSku();
|
||||||
goodsSku.setId(orderItem.getSkuId());
|
goodsSku.setId(orderItem.getSkuId());
|
||||||
goodsSku.setGoodsId(orderItem.getGoodsId());
|
goodsSku.setGoodsId(orderItem.getGoodsId());
|
||||||
@ -282,18 +283,22 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
if (null != orderItem.getPromotionType() && null != orderItem.getPromotionId() && PromotionTypeEnum.haveStock(orderItem.getPromotionType())) {
|
if (null != orderItem.getPromotionType() && null != orderItem.getPromotionId() && PromotionTypeEnum.haveStock(orderItem.getPromotionType())) {
|
||||||
//如果促销有库存信息
|
//如果促销有库存信息
|
||||||
PromotionTypeEnum promotionTypeEnum = PromotionTypeEnum.valueOf(orderItem.getPromotionType());
|
PromotionTypeEnum promotionTypeEnum = PromotionTypeEnum.valueOf(orderItem.getPromotionType());
|
||||||
List promotionStocks = cache.multiGet(promotionKey);
|
|
||||||
//修改砍价商品库存
|
//修改砍价商品库存
|
||||||
if (promotionTypeEnum.equals(PromotionTypeEnum.KANJIA)) {
|
if (promotionTypeEnum.equals(PromotionTypeEnum.KANJIA)) {
|
||||||
KanjiaActivity kanjiaActivity = kanjiaActivityService.getById(orderItem.getPromotionId());
|
KanjiaActivity kanjiaActivity = kanjiaActivityService.getById(orderItem.getPromotionId());
|
||||||
KanjiaActivityGoodsDTO kanjiaActivityGoodsDTO = kanjiaActivityGoodsService.getKanjiaGoodsDetail(kanjiaActivity.getKanjiaActivityGoodsId());
|
KanjiaActivityGoodsDTO kanjiaActivityGoodsDTO = kanjiaActivityGoodsService.getKanjiaGoodsDetail(kanjiaActivity.getKanjiaActivityGoodsId());
|
||||||
kanjiaActivityGoodsDTO.setStock(Convert.toInt(promotionStocks.get(0).toString()));
|
|
||||||
|
Integer stock = Integer.parseInt(cache.get(PromotionGoodsService.getPromotionGoodsStockCacheKey(promotionTypeEnum, orderItem.getPromotionId(), orderItem.getSkuId())).toString());
|
||||||
|
kanjiaActivityGoodsDTO.setStock(stock);
|
||||||
|
|
||||||
kanjiaActivityGoodsService.updateById(kanjiaActivityGoodsDTO);
|
kanjiaActivityGoodsService.updateById(kanjiaActivityGoodsDTO);
|
||||||
this.mongoTemplate.save(kanjiaActivityGoodsDTO);
|
this.mongoTemplate.save(kanjiaActivityGoodsDTO);
|
||||||
//修改积分商品库存
|
//修改积分商品库存
|
||||||
} else if (promotionTypeEnum.equals(PromotionTypeEnum.POINTS_GOODS)) {
|
} else if (promotionTypeEnum.equals(PromotionTypeEnum.POINTS_GOODS)) {
|
||||||
PointsGoodsVO pointsGoodsVO = pointsGoodsService.getPointsGoodsDetail(orderItem.getPromotionId());
|
PointsGoodsVO pointsGoodsVO = pointsGoodsService.getPointsGoodsDetail(orderItem.getPromotionId());
|
||||||
pointsGoodsVO.setActiveStock(Convert.toLong(promotionStocks.get(0).toString()));
|
Integer stock = Integer.parseInt(cache.get(PromotionGoodsService.getPromotionGoodsStockCacheKey(promotionTypeEnum, orderItem.getPromotionId(), orderItem.getSkuId())).toString());
|
||||||
|
pointsGoodsVO.setActiveStock(stock);
|
||||||
pointsGoodsService.updateById(pointsGoodsVO);
|
pointsGoodsService.updateById(pointsGoodsVO);
|
||||||
this.mongoTemplate.save(pointsGoodsVO);
|
this.mongoTemplate.save(pointsGoodsVO);
|
||||||
} else {
|
} else {
|
||||||
|
@ -119,7 +119,6 @@ public enum ResultCode {
|
|||||||
USER_OLD_PASSWORD_ERROR(20016, "旧密码不正确"),
|
USER_OLD_PASSWORD_ERROR(20016, "旧密码不正确"),
|
||||||
USER_COLLECTION_EXIST(20017, "无法重复收藏"),
|
USER_COLLECTION_EXIST(20017, "无法重复收藏"),
|
||||||
USER_GRADE_IS_DEFAULT(20018, "会员等级为默认会员等级"),
|
USER_GRADE_IS_DEFAULT(20018, "会员等级为默认会员等级"),
|
||||||
DELETE_EXIST(20019, "无法重复收藏"),
|
|
||||||
USER_NOT_BINDING(20020, "未绑定用户"),
|
USER_NOT_BINDING(20020, "未绑定用户"),
|
||||||
USER_AUTO_REGISTER_ERROR(20021, "自动注册失败,请稍后重试"),
|
USER_AUTO_REGISTER_ERROR(20021, "自动注册失败,请稍后重试"),
|
||||||
USER_OVERDUE_CONNECT_ERROR(20022, "授权信息已过期,请重新授权/登录"),
|
USER_OVERDUE_CONNECT_ERROR(20022, "授权信息已过期,请重新授权/登录"),
|
||||||
|
@ -37,7 +37,7 @@ public class PointsGoods extends BasePromotion {
|
|||||||
private String pointsGoodsCategoryName;
|
private String pointsGoodsCategoryName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "活动库存数量")
|
@ApiModelProperty(value = "活动库存数量")
|
||||||
private Long activeStock;
|
private Integer activeStock;
|
||||||
|
|
||||||
@ApiModelProperty(value = "兑换积分")
|
@ApiModelProperty(value = "兑换积分")
|
||||||
private Long points;
|
private Long points;
|
||||||
|
@ -2,6 +2,8 @@ package cn.lili.modules.promotion.entity.vos.kanjia;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.lili.common.security.context.UserContext;
|
||||||
|
import cn.lili.common.security.enums.UserEnums;
|
||||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
||||||
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;
|
||||||
@ -53,10 +55,14 @@ public class KanjiaActivityGoodsParams implements Serializable {
|
|||||||
queryWrapper.eq("promotion_status", promotionStatus);
|
queryWrapper.eq("promotion_status", promotionStatus);
|
||||||
}
|
}
|
||||||
if (startTime != null) {
|
if (startTime != null) {
|
||||||
queryWrapper.ge("start_time", new Date(startTime));
|
queryWrapper.le("start_time", new Date(startTime));
|
||||||
}
|
}
|
||||||
if (endTime != null) {
|
if (endTime != null) {
|
||||||
queryWrapper.le("end_time", new Date(endTime));
|
queryWrapper.ge("end_time", new Date(endTime));
|
||||||
|
}
|
||||||
|
if (UserContext.getCurrentUser() != null && UserContext.getCurrentUser().getRole().equals(UserEnums.MEMBER)) {
|
||||||
|
|
||||||
|
queryWrapper.gt("stock", 0);
|
||||||
}
|
}
|
||||||
queryWrapper.eq("delete_flag", false);
|
queryWrapper.eq("delete_flag", false);
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
|
@ -281,7 +281,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void usedCoupon(String couponId, Integer usedNum) {
|
public void usedCoupon(String couponId, Integer usedNum) {
|
||||||
CouponVO couponVO = checkStatus(couponId);
|
CouponVO couponVO = this.mongoTemplate.findById(couponId, CouponVO.class);
|
||||||
couponVO.setUsedNum(couponVO.getUsedNum() + usedNum);
|
couponVO.setUsedNum(couponVO.getUsedNum() + usedNum);
|
||||||
LambdaUpdateWrapper<Coupon> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<Coupon> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(Coupon::getId, couponId);
|
updateWrapper.eq(Coupon::getId, couponId);
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package cn.lili.modules.promotion.serviceimpl;
|
package cn.lili.modules.promotion.serviceimpl;
|
||||||
|
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.member.entity.dos.MemberAddress;
|
import cn.lili.modules.member.entity.dos.MemberAddress;
|
||||||
import cn.lili.modules.member.mapper.MemberAddressMapper;
|
import cn.lili.modules.member.mapper.MemberAddressMapper;
|
||||||
import cn.lili.modules.promotion.service.MemberAddressService;
|
import cn.lili.modules.promotion.service.MemberAddressService;
|
||||||
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -14,8 +14,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
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.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收货地址业务层实现
|
* 收货地址业务层实现
|
||||||
*
|
*
|
||||||
@ -69,10 +67,6 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
|||||||
public MemberAddress updateMemberAddress(MemberAddress memberAddress) {
|
public MemberAddress updateMemberAddress(MemberAddress memberAddress) {
|
||||||
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
||||||
updateDefaultShippingAddress(memberAddress);
|
updateDefaultShippingAddress(memberAddress);
|
||||||
//修改会员地址
|
|
||||||
this.update(memberAddress,
|
|
||||||
new QueryWrapper<MemberAddress>()
|
|
||||||
.eq("id", memberAddress.getId()));
|
|
||||||
return memberAddress;
|
return memberAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,21 +79,21 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
|||||||
/**
|
/**
|
||||||
* 修改会员默认收件地址
|
* 修改会员默认收件地址
|
||||||
*
|
*
|
||||||
* @param shippingAddress 收件地址
|
* @param memberAddress 收件地址
|
||||||
*/
|
*/
|
||||||
private void updateDefaultShippingAddress(MemberAddress shippingAddress) {
|
private void updateDefaultShippingAddress(MemberAddress memberAddress) {
|
||||||
//校验此地址是否为第一个会员地址 如果是默认是会员默认地址
|
|
||||||
List<MemberAddress> list = this.baseMapper.selectList(new QueryWrapper<MemberAddress>().eq("member_id", shippingAddress.getMemberId()));
|
|
||||||
if (list.size() == 1) {
|
|
||||||
shippingAddress.setIsDefault(true);
|
|
||||||
}
|
|
||||||
//如果不是默认地址不需要处理
|
//如果不是默认地址不需要处理
|
||||||
if (shippingAddress.getIsDefault()) {
|
if (memberAddress.getIsDefault()) {
|
||||||
//将会员的地址修改为非默认地址
|
//将会员的地址修改为非默认地址
|
||||||
LambdaUpdateWrapper<MemberAddress> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
LambdaUpdateWrapper<MemberAddress> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||||
lambdaUpdateWrapper.set(MemberAddress::getIsDefault, false);
|
lambdaUpdateWrapper.set(MemberAddress::getIsDefault, false);
|
||||||
lambdaUpdateWrapper.eq(MemberAddress::getMemberId, shippingAddress.getMemberId());
|
lambdaUpdateWrapper.eq(MemberAddress::getMemberId, memberAddress.getMemberId());
|
||||||
this.update(lambdaUpdateWrapper);
|
this.update(lambdaUpdateWrapper);
|
||||||
|
|
||||||
|
//修改会员地址
|
||||||
|
this.update(memberAddress,
|
||||||
|
new QueryWrapper<MemberAddress>()
|
||||||
|
.eq("id", memberAddress.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
5
pom.xml
5
pom.xml
@ -75,6 +75,11 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.spotify</groupId>
|
<groupId>com.spotify</groupId>
|
||||||
<artifactId>docker-maven-plugin</artifactId>
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user