微信小程序优化
This commit is contained in:
parent
7fa0fb75b1
commit
0324951d9a
@ -12,8 +12,8 @@ import cn.lili.modules.member.service.MemberService;
|
|||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
|
import cn.lili.modules.order.order.entity.enums.OrderPromotionTypeEnum;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderTypeEnum;
|
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
@ -77,7 +77,7 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
|||||||
if(orderMessage.getNewStatus().equals(OrderStatusEnum.COMPLETED)){
|
if(orderMessage.getNewStatus().equals(OrderStatusEnum.COMPLETED)){
|
||||||
//根据订单编号获取订单数据,如果为积分订单则跳回
|
//根据订单编号获取订单数据,如果为积分订单则跳回
|
||||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||||
if(order.getOrderType().equals(OrderTypeEnum.POINT)){
|
if(order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINT.name())){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//获取积分设置
|
//获取积分设置
|
||||||
|
@ -11,12 +11,11 @@ import cn.lili.modules.message.service.NoticeMessageService;
|
|||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderTypeEnum;
|
import cn.lili.modules.order.order.entity.enums.OrderPromotionTypeEnum;
|
||||||
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
|
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleTypeEnum;
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleTypeEnum;
|
||||||
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;
|
||||||
|
|
||||||
@ -83,7 +82,7 @@ public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent,
|
|||||||
break;
|
break;
|
||||||
//如果是拼团订单,发送拼团成功消息
|
//如果是拼团订单,发送拼团成功消息
|
||||||
case UNDELIVERED:
|
case UNDELIVERED:
|
||||||
if(orderDetailVO.getOrder().getOrderType().equals(OrderTypeEnum.PINTUAN.name())){
|
if(orderDetailVO.getOrder().getOrderPromotionType().equals(OrderPromotionTypeEnum.PINTUAN.name())){
|
||||||
//拼团成功消息
|
//拼团成功消息
|
||||||
noticeMessageDTO.setNoticeMessageNodeEnum(NoticeMessageNodeEnum.PINTUAN_SUCCESS);
|
noticeMessageDTO.setNoticeMessageNodeEnum(NoticeMessageNodeEnum.PINTUAN_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.lili.modules.broadcast.entity.enums;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播间状态
|
||||||
|
* @author Bulbasaur
|
||||||
|
* @date: 2021/5/31 10:32 上午
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum StudioStatusEnum {
|
||||||
|
|
||||||
|
NEW("新建"), START("开始"), END("结束");
|
||||||
|
|
||||||
|
private final String clientName;
|
||||||
|
|
||||||
|
StudioStatusEnum(String des) {
|
||||||
|
this.clientName = des;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String clientName() {
|
||||||
|
return this.clientName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return this.name();
|
||||||
|
}
|
||||||
|
}
|
@ -8,15 +8,15 @@ import lombok.Data;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author liushuai(liushuai711 @ gmail.com)
|
* 直播间VO
|
||||||
* @version v4.1
|
*
|
||||||
* @Description:
|
* @author Bulbasaur
|
||||||
* @since 2021/5/17 3:04 下午
|
* @date: 2021/5/31 11:58 上午
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class StudioVO extends Studio {
|
public class StudioVO extends Studio {
|
||||||
|
|
||||||
@ApiModelProperty(value = "直播间商品列表")
|
@ApiModelProperty(value = "直播间商品列表")
|
||||||
private List<Commodity> CommodityList;
|
private List<Commodity> commodityList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,8 @@ public interface CommodityMapper extends BaseMapper<Commodity> {
|
|||||||
@Select("SELECT * FROM li_commodity c INNER JOIN li_studio_commodity sc ON sc.goods_id = c.live_goods_id WHERE sc.room_id =#{roomId}")
|
@Select("SELECT * FROM li_commodity c INNER JOIN li_studio_commodity sc ON sc.goods_id = c.live_goods_id WHERE sc.room_id =#{roomId}")
|
||||||
List<Commodity> getCommodityByRoomId(Integer roomId);
|
List<Commodity> getCommodityByRoomId(Integer roomId);
|
||||||
|
|
||||||
@Select("SELECT name,goods_image FROM li_commodity c INNER JOIN li_studio_commodity sc ON sc.goods_id = c.live_goods_id WHERE sc.room_id =#{roomId}")
|
@Select("SELECT goods_image FROM li_commodity c INNER JOIN li_studio_commodity sc ON sc.goods_id = c.live_goods_id WHERE sc.room_id =#{roomId}")
|
||||||
List<SimpleCommodity> getSimpleCommodityByRoomId(Integer roomId);
|
List<String> getSimpleCommodityByRoomId(Integer roomId);
|
||||||
|
|
||||||
@Select("SELECT c.*,gs.quantity,s.store_name FROM li_commodity c INNER JOIN li_goods_sku gs ON c.sku_id = gs.id INNER JOIN li_store s ON s.id=c.store_id ${ew.customSqlSegment}")
|
@Select("SELECT c.*,gs.quantity,s.store_name FROM li_commodity c INNER JOIN li_goods_sku gs ON c.sku_id = gs.id INNER JOIN li_store s ON s.id=c.store_id ${ew.customSqlSegment}")
|
||||||
IPage<CommodityVO> commodityVOList(IPage<CommodityVO> page, @Param(Constants.WRAPPER) Wrapper<CommodityVO> queryWrapper);
|
IPage<CommodityVO> commodityVOList(IPage<CommodityVO> page, @Param(Constants.WRAPPER) Wrapper<CommodityVO> queryWrapper);
|
||||||
|
@ -78,7 +78,7 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
|||||||
public boolean deleteCommodity(String goodsId) {
|
public boolean deleteCommodity(String goodsId) {
|
||||||
JSONObject json = wechatLivePlayerUtil.deleteGoods(goodsId);
|
JSONObject json = wechatLivePlayerUtil.deleteGoods(goodsId);
|
||||||
if (json.getStr("errcode").equals("0")) {
|
if (json.getStr("errcode").equals("0")) {
|
||||||
return this.remove(this.lambdaQuery().eq(Commodity::getLiveGoodsId, goodsId));
|
return this.remove(new LambdaQueryWrapper<Commodity>().eq(Commodity::getLiveGoodsId, goodsId));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -106,6 +106,7 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
|||||||
return this.baseMapper.commodityVOList(PageUtil.initPage(pageVO),
|
return this.baseMapper.commodityVOList(PageUtil.initPage(pageVO),
|
||||||
new QueryWrapper<CommodityVO>().like(name != null, "c.name", name)
|
new QueryWrapper<CommodityVO>().like(name != null, "c.name", name)
|
||||||
.eq(auditStatus != null, "c.audit_status", auditStatus)
|
.eq(auditStatus != null, "c.audit_status", auditStatus)
|
||||||
.eq(UserContext.getCurrentUser().getRole().equals(UserEnums.STORE), "c.store_id", UserContext.getCurrentUser().getStoreId()));
|
.eq(UserContext.getCurrentUser().getRole().equals(UserEnums.STORE), "c.store_id", UserContext.getCurrentUser().getStoreId())
|
||||||
|
.orderByDesc("create_time"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import cn.lili.common.security.context.UserContext;
|
|||||||
import cn.lili.common.utils.BeanUtil;
|
import cn.lili.common.utils.BeanUtil;
|
||||||
import cn.lili.common.utils.PageUtil;
|
import cn.lili.common.utils.PageUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
|
import cn.lili.modules.broadcast.entity.StudioStatusEnum;
|
||||||
import cn.lili.modules.broadcast.entity.dos.Studio;
|
import cn.lili.modules.broadcast.entity.dos.Studio;
|
||||||
import cn.lili.modules.broadcast.entity.dos.StudioCommodity;
|
import cn.lili.modules.broadcast.entity.dos.StudioCommodity;
|
||||||
import cn.lili.modules.broadcast.entity.vos.StudioVO;
|
import cn.lili.modules.broadcast.entity.vos.StudioVO;
|
||||||
@ -49,6 +50,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
studio.setRoomId(Integer.parseInt(roomMap.get("roomId")));
|
studio.setRoomId(Integer.parseInt(roomMap.get("roomId")));
|
||||||
studio.setQrCodeUrl(roomMap.get("qrcodeUrl"));
|
studio.setQrCodeUrl(roomMap.get("qrcodeUrl"));
|
||||||
studio.setStoreId(UserContext.getCurrentUser().getStoreId());
|
studio.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||||
|
studio.setStatus(StudioStatusEnum.NEW.name());
|
||||||
return this.save(studio);
|
return this.save(studio);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -98,7 +100,6 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
//设置直播间默认的商品(前台展示)只展示两个
|
//设置直播间默认的商品(前台展示)只展示两个
|
||||||
if (studio.getRoomGoodsNum() < 3) {
|
if (studio.getRoomGoodsNum() < 3) {
|
||||||
studio.setRoomGoodsList(JSONUtil.toJsonStr(commodityMapper.getSimpleCommodityByRoomId(roomId)));
|
studio.setRoomGoodsList(JSONUtil.toJsonStr(commodityMapper.getSimpleCommodityByRoomId(roomId)));
|
||||||
;
|
|
||||||
}
|
}
|
||||||
return this.updateById(studio);
|
return this.updateById(studio);
|
||||||
}
|
}
|
||||||
@ -116,7 +117,6 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
//设置直播间默认的商品(前台展示)只展示两个
|
//设置直播间默认的商品(前台展示)只展示两个
|
||||||
if (studio.getRoomGoodsNum() < 3) {
|
if (studio.getRoomGoodsNum() < 3) {
|
||||||
studio.setRoomGoodsList(JSONUtil.toJsonStr(commodityMapper.getSimpleCommodityByRoomId(roomId)));
|
studio.setRoomGoodsList(JSONUtil.toJsonStr(commodityMapper.getSimpleCommodityByRoomId(roomId)));
|
||||||
;
|
|
||||||
}
|
}
|
||||||
return this.updateById(studio);
|
return this.updateById(studio);
|
||||||
}
|
}
|
||||||
@ -127,7 +127,8 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
public IPage<Studio> studioList(PageVO pageVO, Integer recommend, String status) {
|
public IPage<Studio> studioList(PageVO pageVO, Integer recommend, String status) {
|
||||||
return this.page(PageUtil.initPage(pageVO), new QueryWrapper<Studio>()
|
return this.page(PageUtil.initPage(pageVO), new QueryWrapper<Studio>()
|
||||||
.eq(recommend != null, "recommend", true)
|
.eq(recommend != null, "recommend", true)
|
||||||
.eq(status!=null,"status",status));
|
.eq(status!=null,"status",status)
|
||||||
|
.orderByDesc("create_time"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ public class WechatLivePlayerUtil {
|
|||||||
String url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/delete?access_token=" + token;
|
String url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/delete?access_token=" + token;
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("goodsId", goodsId);
|
map.put("goodsId", goodsId);
|
||||||
String content = HttpUtils.doPostWithJson(url, goodsId);
|
String content = HttpUtils.doPostWithJson(url, map);
|
||||||
JSONObject json = new JSONObject(content);
|
JSONObject json = new JSONObject(content);
|
||||||
log.info("微信小程序删除直播商品结果:" + content);
|
log.info("微信小程序删除直播商品结果:" + content);
|
||||||
return json;
|
return json;
|
||||||
|
@ -13,22 +13,8 @@ public enum OrderTypeEnum {
|
|||||||
*/
|
*/
|
||||||
NORMAL,
|
NORMAL,
|
||||||
|
|
||||||
/**
|
|
||||||
* 赠品订单
|
|
||||||
*/
|
|
||||||
GIFT,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 虚拟订单
|
* 虚拟订单
|
||||||
*/
|
*/
|
||||||
VIRTUAL,
|
VIRTUAL;
|
||||||
/**
|
|
||||||
* 拼团订单
|
|
||||||
*/
|
|
||||||
PINTUAN,
|
|
||||||
/**
|
|
||||||
* 积分订单
|
|
||||||
*/
|
|
||||||
POINT
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
@OrderLogPoint(description = "'订单['+#orderSn+']取消,原因为:'+#reason", orderSn = "#orderSn")
|
@OrderLogPoint(description = "'订单['+#orderSn+']取消,原因为:'+#reason", orderSn = "#orderSn")
|
||||||
public Order cancel(String orderSn, String reason) {
|
public Order cancel(String orderSn, String reason) {
|
||||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||||
if (order.getOrderType().equals(OrderTypeEnum.PINTUAN.name()) && !order.getOrderStatus().equals(OrderStatusEnum.UNDELIVERED.name())) {
|
if (order.getOrderPromotionType().equals(OrderPromotionTypeEnum.PINTUAN.name()) && !order.getOrderStatus().equals(OrderStatusEnum.UNDELIVERED.name())) {
|
||||||
throw new ServiceException("未成团订单不可取消");
|
throw new ServiceException("未成团订单不可取消");
|
||||||
}
|
}
|
||||||
if (CharSequenceUtil.equalsAny(order.getOrderStatus(),
|
if (CharSequenceUtil.equalsAny(order.getOrderStatus(),
|
||||||
@ -635,7 +635,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
//寻找拼团的所有订单
|
//寻找拼团的所有订单
|
||||||
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(Order::getPromotionId, pintuanId)
|
queryWrapper.eq(Order::getPromotionId, pintuanId)
|
||||||
.eq(Order::getOrderType, OrderTypeEnum.PINTUAN.name())
|
.eq(Order::getOrderPromotionType, OrderPromotionTypeEnum.PINTUAN.name())
|
||||||
.eq(Order::getPayStatus, PayStatusEnum.PAID.name());
|
.eq(Order::getPayStatus, PayStatusEnum.PAID.name());
|
||||||
// 拼团sn=开团订单sn 或者 参团订单的开团订单sn
|
// 拼团sn=开团订单sn 或者 参团订单的开团订单sn
|
||||||
queryWrapper.and(i -> i.eq(Order::getSn, parentOrderSn)
|
queryWrapper.and(i -> i.eq(Order::getSn, parentOrderSn)
|
||||||
@ -692,7 +692,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
BeanUtil.copyProperties(priceDetailDTO, order, "id");
|
BeanUtil.copyProperties(priceDetailDTO, order, "id");
|
||||||
order.setSn(SnowFlake.createStr("G"));
|
order.setSn(SnowFlake.createStr("G"));
|
||||||
order.setTradeSn(tradeDTO.getSn());
|
order.setTradeSn(tradeDTO.getSn());
|
||||||
order.setOrderType(OrderTypeEnum.GIFT.name());
|
order.setOrderType(OrderPromotionTypeEnum.GIFT.name());
|
||||||
order.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
order.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
||||||
order.setPayStatus(PayStatusEnum.UNPAID.name());
|
order.setPayStatus(PayStatusEnum.UNPAID.name());
|
||||||
order.setDeliverStatus(DeliverStatusEnum.UNDELIVERED.name());
|
order.setDeliverStatus(DeliverStatusEnum.UNDELIVERED.name());
|
||||||
@ -772,7 +772,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
*/
|
*/
|
||||||
private void checkOrder(Order order) {
|
private void checkOrder(Order order) {
|
||||||
//订单类型为拼团订单,检测购买数量是否超过了限购数量
|
//订单类型为拼团订单,检测购买数量是否超过了限购数量
|
||||||
if (OrderTypeEnum.PINTUAN.name().equals(order.getOrderType())) {
|
if (OrderPromotionTypeEnum.PINTUAN.name().equals(order.getOrderPromotionType())) {
|
||||||
Pintuan pintuan = pintuanService.getPintuanById(order.getPromotionId());
|
Pintuan pintuan = pintuanService.getPintuanById(order.getPromotionId());
|
||||||
Integer limitNum = pintuan.getLimitNum();
|
Integer limitNum = pintuan.getLimitNum();
|
||||||
if (limitNum != 0 && order.getGoodsNum() > limitNum) {
|
if (limitNum != 0 && order.getGoodsNum() > limitNum) {
|
||||||
|
@ -17,7 +17,6 @@ import cn.lili.modules.member.entity.dos.Member;
|
|||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderTypeEnum;
|
|
||||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.promotion.entity.dos.Pintuan;
|
import cn.lili.modules.promotion.entity.dos.Pintuan;
|
||||||
@ -103,8 +102,10 @@ public class PintuanServiceImpl extends ServiceImpl<PintuanMapper, Pintuan> impl
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(Order::getPromotionId, pintuanId).eq(Order::getOrderType, OrderTypeEnum.PINTUAN.name())
|
queryWrapper.eq(Order::getPromotionId, pintuanId)
|
||||||
.eq(Order::getOrderStatus, OrderStatusEnum.PAID.name()).eq(Order::getParentOrderSn, "");
|
.eq(Order::getOrderPromotionType, PromotionTypeEnum.PINTUAN.name())
|
||||||
|
.eq(Order::getOrderStatus, OrderStatusEnum.PAID.name())
|
||||||
|
.eq(Order::getParentOrderSn, "");
|
||||||
List<Order> orders = orderService.list(queryWrapper);
|
List<Order> orders = orderService.list(queryWrapper);
|
||||||
// 遍历订单状态为已支付,为团长的拼团订单
|
// 遍历订单状态为已支付,为团长的拼团订单
|
||||||
for (Order order : orders) {
|
for (Order order : orders) {
|
||||||
@ -266,7 +267,7 @@ public class PintuanServiceImpl extends ServiceImpl<PintuanMapper, Pintuan> impl
|
|||||||
} else {
|
} else {
|
||||||
pintuan.setPromotionStatus(PromotionStatusEnum.END.name());
|
pintuan.setPromotionStatus(PromotionStatusEnum.END.name());
|
||||||
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(Order::getOrderType, OrderTypeEnum.PINTUAN.name());
|
queryWrapper.eq(Order::getOrderPromotionType, PromotionTypeEnum.PINTUAN.name());
|
||||||
queryWrapper.eq(Order::getPromotionId, pintuanId);
|
queryWrapper.eq(Order::getPromotionId, pintuanId);
|
||||||
queryWrapper.nested(i -> i.eq(Order::getPayStatus, PayStatusEnum.PAID.name()).or().eq(Order::getOrderStatus, OrderStatusEnum.PAID.name()));
|
queryWrapper.nested(i -> i.eq(Order::getPayStatus, PayStatusEnum.PAID.name()).or().eq(Order::getOrderStatus, OrderStatusEnum.PAID.name()));
|
||||||
// 过滤父级拼团订单,根据父级拼团订单分组
|
// 过滤父级拼团订单,根据父级拼团订单分组
|
||||||
@ -323,7 +324,7 @@ public class PintuanServiceImpl extends ServiceImpl<PintuanMapper, Pintuan> impl
|
|||||||
pintuanShareVO.setPintuanMemberVOS(new ArrayList<>());
|
pintuanShareVO.setPintuanMemberVOS(new ArrayList<>());
|
||||||
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
// 查找团长订单和已和当前拼团订单拼团的订单
|
// 查找团长订单和已和当前拼团订单拼团的订单
|
||||||
queryWrapper.eq(Order::getOrderType, OrderTypeEnum.PINTUAN.name())
|
queryWrapper.eq(Order::getOrderPromotionType, PromotionTypeEnum.PINTUAN.name())
|
||||||
.eq(Order::getPayStatus, OrderStatusEnum.PAID.name())
|
.eq(Order::getPayStatus, OrderStatusEnum.PAID.name())
|
||||||
.and(i -> i.eq(Order::getParentOrderSn, parentOrderSn).or(j -> j.eq(Order::getSn, parentOrderSn)));
|
.and(i -> i.eq(Order::getParentOrderSn, parentOrderSn).or(j -> j.eq(Order::getSn, parentOrderSn)));
|
||||||
List<Order> orders = orderService.list(queryWrapper);
|
List<Order> orders = orderService.list(queryWrapper);
|
||||||
@ -332,7 +333,7 @@ public class PintuanServiceImpl extends ServiceImpl<PintuanMapper, Pintuan> impl
|
|||||||
if (!orders.isEmpty() && pintuanShareVO.getPromotionGoods() == null) {
|
if (!orders.isEmpty() && pintuanShareVO.getPromotionGoods() == null) {
|
||||||
LambdaQueryWrapper<Order> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Order> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
// 查找团长订单和已和当前拼团订单拼团的订单
|
// 查找团长订单和已和当前拼团订单拼团的订单
|
||||||
orderLambdaQueryWrapper.eq(Order::getOrderType, OrderTypeEnum.PINTUAN.name())
|
orderLambdaQueryWrapper.eq(Order::getOrderPromotionType, PromotionTypeEnum.PINTUAN.name())
|
||||||
.eq(Order::getPayStatus, OrderStatusEnum.PAID.name())
|
.eq(Order::getPayStatus, OrderStatusEnum.PAID.name())
|
||||||
.ne(Order::getSn, parentOrderSn)
|
.ne(Order::getSn, parentOrderSn)
|
||||||
.and(i -> i.eq(Order::getParentOrderSn, orders.get(0).getParentOrderSn()).or(j -> j.eq(Order::getSn, orders.get(0).getParentOrderSn())));
|
.and(i -> i.eq(Order::getParentOrderSn, orders.get(0).getParentOrderSn()).or(j -> j.eq(Order::getSn, orders.get(0).getParentOrderSn())));
|
||||||
@ -424,7 +425,7 @@ public class PintuanServiceImpl extends ServiceImpl<PintuanMapper, Pintuan> impl
|
|||||||
if (Boolean.FALSE.equals(pintuan.getFictitious()) && entry.getValue().size() < requiredNum) {
|
if (Boolean.FALSE.equals(pintuan.getFictitious()) && entry.getValue().size() < requiredNum) {
|
||||||
// 如果未开启虚拟成团且已参团人数小于成团人数,则自动取消订单
|
// 如果未开启虚拟成团且已参团人数小于成团人数,则自动取消订单
|
||||||
LambdaUpdateWrapper<Order> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<Order> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(Order::getOrderType, OrderTypeEnum.PINTUAN.name());
|
updateWrapper.eq(Order::getOrderPromotionType, PromotionTypeEnum.PINTUAN.name());
|
||||||
updateWrapper.eq(Order::getPromotionId, pintuan.getId());
|
updateWrapper.eq(Order::getPromotionId, pintuan.getId());
|
||||||
updateWrapper.eq(Order::getParentOrderSn, entry.getKey());
|
updateWrapper.eq(Order::getParentOrderSn, entry.getKey());
|
||||||
updateWrapper.set(Order::getOrderStatus, OrderStatusEnum.CANCELLED.name());
|
updateWrapper.set(Order::getOrderStatus, OrderStatusEnum.CANCELLED.name());
|
||||||
|
@ -6,6 +6,7 @@ import cn.lili.common.exception.ServiceException;
|
|||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.broadcast.entity.dos.Studio;
|
import cn.lili.modules.broadcast.entity.dos.Studio;
|
||||||
|
import cn.lili.modules.broadcast.entity.vos.StudioVO;
|
||||||
import cn.lili.modules.broadcast.service.StudioService;
|
import cn.lili.modules.broadcast.service.StudioService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -14,10 +15,9 @@ import io.swagger.annotations.ApiImplicitParam;
|
|||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import javax.validation.constraints.NotNull;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理端,直播间接口
|
* 管理端,直播间接口
|
||||||
@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @date: 2021/5/28 11:56 上午
|
* @date: 2021/5/28 11:56 上午
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "店铺端,直播商品接口")
|
@Api(tags = "店铺端,直播间接口")
|
||||||
@RequestMapping("/manager/broadcast/studio")
|
@RequestMapping("/manager/broadcast/studio")
|
||||||
public class StudioManagerController {
|
public class StudioManagerController {
|
||||||
|
|
||||||
@ -34,26 +34,26 @@ public class StudioManagerController {
|
|||||||
private StudioService studioService;
|
private StudioService studioService;
|
||||||
|
|
||||||
@ApiOperation(value = "获取店铺直播间列表")
|
@ApiOperation(value = "获取店铺直播间列表")
|
||||||
@ApiImplicitParam(name = "status", value = "直播间状态", paramType = "query", dataType = "String")
|
@ApiImplicitParam(name = "status", value = "直播间状态", paramType = "query")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<IPage<Studio>> page(PageVO pageVO, String status) {
|
public ResultMessage<IPage<Studio>> page(PageVO pageVO, String status) {
|
||||||
return ResultUtil.data(studioService.studioList(pageVO, null, status));
|
return ResultUtil.data(studioService.studioList(pageVO, null, status));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "获取店铺直播间详情")
|
@ApiOperation(value = "获取店铺直播间详情")
|
||||||
@ApiImplicitParam(name = "studioId", value = "直播间ID", required = true, dataType = "String", paramType = "path")
|
@ApiImplicitParam(name = "studioId", value = "直播间ID", required = true, paramType = "path")
|
||||||
@GetMapping("/studioInfo/{studioId}")
|
@GetMapping("/studioInfo/{studioId}")
|
||||||
public ResultMessage<Studio> studioInfo(@PathVariable String studioId) {
|
public ResultMessage<StudioVO> studioInfo(@PathVariable String studioId) {
|
||||||
return ResultUtil.data(studioService.getById(studioId));
|
return ResultUtil.data(studioService.getStudioVO(studioId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "是否推荐直播间")
|
@ApiOperation(value = "是否推荐直播间")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "id", value = "Id", required = true, dataType = "String", paramType = "path"),
|
@ApiImplicitParam(name = "id", value = "Id", required = true, paramType = "path"),
|
||||||
@ApiImplicitParam(name = "recommend", value = "是否推荐", required = true, dataType = "boolean", paramType = "path")
|
@ApiImplicitParam(name = "recommend", value = "是否推荐", required = true, paramType = "query")
|
||||||
})
|
})
|
||||||
@GetMapping("/id/{studioId}")
|
@PutMapping("/recommend/{id}")
|
||||||
public ResultMessage<Object> recommend(@PathVariable String id, @PathVariable boolean recommend) {
|
public ResultMessage<Object> recommend(@PathVariable String id, @NotNull boolean recommend) {
|
||||||
if (studioService.update(new UpdateWrapper<Studio>()
|
if (studioService.update(new UpdateWrapper<Studio>()
|
||||||
.eq("id", id)
|
.eq("id", id)
|
||||||
.set("recommend", recommend))) {
|
.set("recommend", recommend))) {
|
||||||
|
@ -6,13 +6,13 @@ import cn.lili.common.exception.ServiceException;
|
|||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.broadcast.entity.dos.Studio;
|
import cn.lili.modules.broadcast.entity.dos.Studio;
|
||||||
|
import cn.lili.modules.broadcast.entity.vos.StudioVO;
|
||||||
import cn.lili.modules.broadcast.service.StudioService;
|
import cn.lili.modules.broadcast.service.StudioService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.ibatis.annotations.Delete;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -41,8 +41,8 @@ public class StudioStoreController {
|
|||||||
@ApiOperation(value = "获取店铺直播间详情")
|
@ApiOperation(value = "获取店铺直播间详情")
|
||||||
@ApiImplicitParam(name = "studioId", value = "直播间ID", required = true, dataType = "String", paramType = "path")
|
@ApiImplicitParam(name = "studioId", value = "直播间ID", required = true, dataType = "String", paramType = "path")
|
||||||
@GetMapping("/studioInfo/{studioId}")
|
@GetMapping("/studioInfo/{studioId}")
|
||||||
public ResultMessage<Studio> studioInfo(@PathVariable String studioId) {
|
public ResultMessage<StudioVO> studioInfo(@PathVariable String studioId) {
|
||||||
return ResultUtil.data(studioService.getById(studioId));
|
return ResultUtil.data(studioService.getStudioVO(studioId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "添加直播间")
|
@ApiOperation(value = "添加直播间")
|
||||||
@ -81,7 +81,7 @@ public class StudioStoreController {
|
|||||||
@ApiImplicitParam(name = "roomId", value = "房间ID", required = true, dataType = "Integer", paramType = "path"),
|
@ApiImplicitParam(name = "roomId", value = "房间ID", required = true, dataType = "Integer", paramType = "path"),
|
||||||
@ApiImplicitParam(name = "liveGoodsId", value = "直播商品ID", required = true, dataType = "Integer", paramType = "path")
|
@ApiImplicitParam(name = "liveGoodsId", value = "直播商品ID", required = true, dataType = "Integer", paramType = "path")
|
||||||
})
|
})
|
||||||
@Delete(value = "/deleteInRoom/{roomId}/{liveGoodsId}")
|
@DeleteMapping(value = "/deleteInRoom/{roomId}/{liveGoodsId}")
|
||||||
public ResultMessage<Studio> deleteInRoom(@PathVariable Integer roomId, @PathVariable Integer liveGoodsId) {
|
public ResultMessage<Studio> deleteInRoom(@PathVariable Integer roomId, @PathVariable Integer liveGoodsId) {
|
||||||
if (studioService.goodsDeleteInRoom(roomId, liveGoodsId)) {
|
if (studioService.goodsDeleteInRoom(roomId, liveGoodsId)) {
|
||||||
return ResultUtil.success(ResultCode.SUCCESS);
|
return ResultUtil.success(ResultCode.SUCCESS);
|
||||||
|
@ -125,8 +125,11 @@ public class OrderStoreController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "订单核验")
|
@ApiOperation(value = "订单核验")
|
||||||
@ApiImplicitParam(name = "verificationCode", value = "核验码", required = true, paramType = "path")
|
@ApiImplicitParams({
|
||||||
@PutMapping(value = "/take/${order}/{verificationCode}")
|
@ApiImplicitParam(name = "orderSn", value = "订单号", required = true, paramType = "path"),
|
||||||
|
@ApiImplicitParam(name = "verificationCode", value = "核验码", required = true, paramType = "path")
|
||||||
|
})
|
||||||
|
@PutMapping(value = "/take/{orderSn}/{verificationCode}")
|
||||||
public ResultMessage<Object> take(@PathVariable String orderSn,@PathVariable String verificationCode) {
|
public ResultMessage<Object> take(@PathVariable String orderSn,@PathVariable String verificationCode) {
|
||||||
return ResultUtil.data(orderService.take(orderSn,verificationCode));
|
return ResultUtil.data(orderService.take(orderSn,verificationCode));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user