优化订单商品类型
This commit is contained in:
parent
6235faba96
commit
00e93c91f5
@ -144,6 +144,7 @@ ignored:
|
|||||||
- /buyer/promotion/pintuan/**
|
- /buyer/promotion/pintuan/**
|
||||||
- /buyer/promotion/seckill/**
|
- /buyer/promotion/seckill/**
|
||||||
- /buyer/promotion/pointsGoods/**
|
- /buyer/promotion/pointsGoods/**
|
||||||
|
- /buyer/promotion/coupon
|
||||||
- /buyer/memberEvaluation/**/goodsEvaluation
|
- /buyer/memberEvaluation/**/goodsEvaluation
|
||||||
- /buyer/memberEvaluation/**/evaluationNumber
|
- /buyer/memberEvaluation/**/evaluationNumber
|
||||||
- /buyer/appVersion/**
|
- /buyer/appVersion/**
|
||||||
@ -163,6 +164,7 @@ ignored:
|
|||||||
- /v2/api-docs
|
- /v2/api-docs
|
||||||
- /configuration/ui
|
- /configuration/ui
|
||||||
- /boot-admin
|
- /boot-admin
|
||||||
|
- /manager/promotion/seckill/init
|
||||||
statics:
|
statics:
|
||||||
- /**/*.js
|
- /**/*.js
|
||||||
- /**/*.css
|
- /**/*.css
|
||||||
@ -295,6 +297,8 @@ lili:
|
|||||||
notice-send-group: lili_send_notice_group
|
notice-send-group: lili_send_notice_group
|
||||||
rocketmq:
|
rocketmq:
|
||||||
name-server: 192.168.0.116:9876
|
name-server: 192.168.0.116:9876
|
||||||
|
namesrvAddr: 192.168.0.116:9876
|
||||||
|
isVIPChannel: false
|
||||||
producer:
|
producer:
|
||||||
group: lili_group
|
group: lili_group
|
||||||
send-message-timeout: 30000
|
send-message-timeout: 30000
|
||||||
|
@ -61,7 +61,6 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean create(Studio studio) {
|
public Boolean create(Studio studio) {
|
||||||
try {
|
|
||||||
//创建小程序直播
|
//创建小程序直播
|
||||||
Map<String, String> roomMap = wechatLivePlayerUtil.create(studio);
|
Map<String, String> roomMap = wechatLivePlayerUtil.create(studio);
|
||||||
studio.setRoomId(Convert.toInt(roomMap.get("roomId")));
|
studio.setRoomId(Convert.toInt(roomMap.get("roomId")));
|
||||||
@ -92,10 +91,6 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new ServiceException(ResultCode.ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,7 +37,7 @@ public class WechatLivePlayerUtil {
|
|||||||
* @param studio 小程序直播
|
* @param studio 小程序直播
|
||||||
* @return 房间ID
|
* @return 房间ID
|
||||||
*/
|
*/
|
||||||
public Map<String, String> create(Studio studio) throws Exception {
|
public Map<String, String> create(Studio studio) {
|
||||||
//发送url
|
//发送url
|
||||||
String url = "https://api.weixin.qq.com/wxaapi/broadcast/room/create?access_token=";
|
String url = "https://api.weixin.qq.com/wxaapi/broadcast/room/create?access_token=";
|
||||||
//添加直播间
|
//添加直播间
|
||||||
|
@ -4,6 +4,7 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import cn.lili.base.BaseEntity;
|
import cn.lili.base.BaseEntity;
|
||||||
import cn.lili.common.utils.BeanUtil;
|
import cn.lili.common.utils.BeanUtil;
|
||||||
import cn.lili.modules.base.entity.enums.ClientTypeEnum;
|
import cn.lili.modules.base.entity.enums.ClientTypeEnum;
|
||||||
|
import cn.lili.modules.goods.entity.enums.GoodsTypeEnum;
|
||||||
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
|
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
|
||||||
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
||||||
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
||||||
@ -14,10 +15,7 @@ import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
|||||||
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
||||||
import cn.lili.modules.promotion.entity.enums.PromotionTypeEnum;
|
import cn.lili.modules.promotion.entity.enums.PromotionTypeEnum;
|
||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
|
|
||||||
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
|
||||||
import cn.lili.modules.order.cart.entity.vo.CartVO;
|
import cn.lili.modules.order.cart.entity.vo.CartVO;
|
||||||
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
|
||||||
import cn.lili.modules.order.order.entity.enums.*;
|
import cn.lili.modules.order.order.entity.enums.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
@ -172,7 +170,7 @@ public class Order extends BaseEntity {
|
|||||||
private Boolean needReceipt;
|
private Boolean needReceipt;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否为其他订单下的订单,如果是则为依赖订单的sn,否则为空")
|
@ApiModelProperty(value = "是否为其他订单下的订单,如果是则为依赖订单的sn,否则为空")
|
||||||
private String parentOrderSn;
|
private String parentOrderSn="";
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否为某订单类型的订单,如果是则为订单类型的id,否则为空")
|
@ApiModelProperty(value = "是否为某订单类型的订单,如果是则为订单类型的id,否则为空")
|
||||||
private String promotionId;
|
private String promotionId;
|
||||||
@ -219,25 +217,9 @@ public class Order extends BaseEntity {
|
|||||||
BeanUtil.copyProperties(tradeDTO, this);
|
BeanUtil.copyProperties(tradeDTO, this);
|
||||||
BeanUtil.copyProperties(cartVO.getPriceDetailDTO(), this);
|
BeanUtil.copyProperties(cartVO.getPriceDetailDTO(), this);
|
||||||
BeanUtil.copyProperties(cartVO, this);
|
BeanUtil.copyProperties(cartVO, this);
|
||||||
//订单类型判断--普通订单,虚拟订单。
|
//填写订单类型
|
||||||
if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.CART) || tradeDTO.getCartTypeEnum().equals(CartTypeEnum.BUY_NOW)) {
|
this.setTradeType(cartVO,tradeDTO);
|
||||||
this.setOrderType(OrderTypeEnum.NORMAL.name());
|
setId(oldId);
|
||||||
} else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.VIRTUAL)) {
|
|
||||||
this.setOrderType(tradeDTO.getCartTypeEnum().name());
|
|
||||||
}
|
|
||||||
this.setId(oldId);
|
|
||||||
|
|
||||||
//促销信息填充
|
|
||||||
// if (cartVO.getSkuList().get(0).getPromotions() != null && tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN)) {
|
|
||||||
// Optional<String> pintuanId = cartVO.getSkuList().get(0).getPromotions().stream().filter(i -> i.getPromotionType().equals(PromotionTypeEnum.PINTUAN.name())).map(PromotionGoods::getPromotionId).findFirst();
|
|
||||||
// if (pintuanId.isPresent()) {
|
|
||||||
// promotionId = pintuanId.get();
|
|
||||||
// this.setOrderType(OrderTypeEnum.PINTUAN.name());
|
|
||||||
// if (tradeDTO.getParentOrderSn() == null) {
|
|
||||||
// this.setParentOrderSn("");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//设置默认支付状态
|
//设置默认支付状态
|
||||||
this.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
this.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
||||||
@ -264,8 +246,46 @@ public class Order extends BaseEntity {
|
|||||||
}
|
}
|
||||||
this.setUseStoreMemberCouponIds(storeCouponIds.toString());
|
this.setUseStoreMemberCouponIds(storeCouponIds.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写交易(订单)类型
|
||||||
|
* 1.判断是普通、促销订单
|
||||||
|
* 2.普通订单进行区分:实物订单、虚拟订单
|
||||||
|
* 3.促销订单判断货物进行区分实物、虚拟商品。
|
||||||
|
* 4.拼团订单需要填写父订单ID
|
||||||
|
* @param cartVO 购物车VO
|
||||||
|
* @param tradeDTO 交易DTO
|
||||||
|
*/
|
||||||
|
private void setTradeType(CartVO cartVO, TradeDTO tradeDTO){
|
||||||
|
|
||||||
|
//判断是否为普通订单、促销订单
|
||||||
|
if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.CART) || tradeDTO.getCartTypeEnum().equals(CartTypeEnum.BUY_NOW)) {
|
||||||
|
this.setOrderType(OrderTypeEnum.NORMAL.name());
|
||||||
|
}else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.VIRTUAL)) {
|
||||||
|
this.setOrderType(OrderTypeEnum.VIRTUAL.name());
|
||||||
|
}else{
|
||||||
|
//促销订单(拼团、积分)-判断购买的是虚拟商品还是实物商品
|
||||||
|
String goodsType=cartVO.getSkuList().get(0).getGoodsSku().getGoodsType();
|
||||||
|
if(goodsType.equals(GoodsTypeEnum.PHYSICAL_GOODS.name())){
|
||||||
|
this.setOrderType(OrderTypeEnum.NORMAL.name());
|
||||||
|
}else{
|
||||||
|
this.setOrderType(OrderTypeEnum.VIRTUAL.name());
|
||||||
|
}
|
||||||
|
//填写订单的促销类型
|
||||||
|
this.setOrderPromotionType(tradeDTO.getCartTypeEnum().name());
|
||||||
|
|
||||||
|
//判断是否为拼团订单,如果为拼团订单获取拼团ID,判断是否为主订单
|
||||||
|
if (tradeDTO.getCartTypeEnum().name().equals(PromotionTypeEnum.PINTUAN.name())) {
|
||||||
|
Optional<String> pintuanId = cartVO.getSkuList().get(0).getPromotions().stream().filter(i -> i.getPromotionType().equals(PromotionTypeEnum.PINTUAN.name())).map(PromotionGoods::getPromotionId).findFirst();
|
||||||
|
promotionId = pintuanId.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public PriceDetailDTO getPriceDetailDTO() {
|
public PriceDetailDTO getPriceDetailDTO() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -279,4 +299,5 @@ public class Order extends BaseEntity {
|
|||||||
this.priceDetail = JSONUtil.toJsonStr(priceDetail);
|
this.priceDetail = JSONUtil.toJsonStr(priceDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -666,16 +666,16 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
* 根据提供的拼团订单列表更新拼团状态为拼团成功
|
* 根据提供的拼团订单列表更新拼团状态为拼团成功
|
||||||
* 循环订单列表根据不同的订单类型进行确认订单
|
* 循环订单列表根据不同的订单类型进行确认订单
|
||||||
*
|
*
|
||||||
* @param list 需要更新拼团状态为成功的拼团订单列表
|
* @param orderList 需要更新拼团状态为成功的拼团订单列表
|
||||||
*/
|
*/
|
||||||
private void pintuanOrderSuccess(List<Order> list) {
|
private void pintuanOrderSuccess(List<Order> orderList) {
|
||||||
list.forEach(order -> {
|
for (Order order:orderList) {
|
||||||
if (order.getOrderType().equals(OrderTypeEnum.VIRTUAL.name())) {
|
if (order.getOrderType().equals(OrderTypeEnum.VIRTUAL.name())) {
|
||||||
this.virtualOrderConfirm(order.getSn());
|
this.virtualOrderConfirm(order.getSn());
|
||||||
} else if (order.getOrderType().equals(OrderTypeEnum.NORMAL.name())) {
|
} else if (order.getOrderType().equals(OrderTypeEnum.NORMAL.name())) {
|
||||||
this.normalOrderConfirm(order.getSn());
|
this.normalOrderConfirm(order.getSn());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,6 +63,12 @@ public class PromotionGoods extends BaseEntity {
|
|||||||
@ApiModelProperty(value = "促销工具类型")
|
@ApiModelProperty(value = "促销工具类型")
|
||||||
private String promotionType;
|
private String promotionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "商品类型")
|
||||||
|
private String goodsType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "活动标题")
|
@ApiModelProperty(value = "活动标题")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class StudioStoreController {
|
|||||||
|
|
||||||
@ApiOperation(value = "修改直播间")
|
@ApiOperation(value = "修改直播间")
|
||||||
@PutMapping("/edit")
|
@PutMapping("/edit")
|
||||||
public ResultMessage<Object> edit(@Validated Studio studio) {
|
public ResultMessage<Object> edit(Studio studio) {
|
||||||
if (studioService.edit(studio)) {
|
if (studioService.edit(studio)) {
|
||||||
return ResultUtil.success(ResultCode.SUCCESS);
|
return ResultUtil.success(ResultCode.SUCCESS);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user