From 46f216c19165f2bd73819090938fe027827e7b40 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 30 Jun 2021 10:26:32 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=BA=97=E9=93=BA=E5=85=B3=E9=97=AD=EF=BC=8C?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8B=E6=9E=B6=E5=BA=97=E9=93=BA=E5=95=86?= =?UTF-8?q?=E5=93=81=E9=97=AE=E9=A2=98=E3=80=82=202.=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=AE=9E=E7=89=A9/=E8=99=9A=E6=8B=9F=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E9=80=BB=E8=BE=91=E5=88=A4=E6=96=AD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/goods/mapper/GoodsMapper.java | 10 ++++---- .../goods/serviceimpl/GoodsServiceImpl.java | 5 +++- .../modules/order/order/entity/dos/Order.java | 24 +++++++++---------- .../order/entity/enums/OrderTypeEnum.java | 11 +-------- .../order/order/entity/vo/AllowOperation.java | 7 +++--- 5 files changed, 26 insertions(+), 31 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/mapper/GoodsMapper.java b/framework/src/main/java/cn/lili/modules/goods/mapper/GoodsMapper.java index 928248c7..cea5e6a8 100644 --- a/framework/src/main/java/cn/lili/modules/goods/mapper/GoodsMapper.java +++ b/framework/src/main/java/cn/lili/modules/goods/mapper/GoodsMapper.java @@ -10,6 +10,8 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; +import java.util.List; + /** * 规格项数据处理层 * @@ -19,12 +21,12 @@ import org.apache.ibatis.annotations.Update; public interface GoodsMapper extends BaseMapper { /** - * 下架所有商家商品 + * 根据店铺ID获取商品ID列表 * - * @param storeId + * @param storeId 店铺ID */ - @Update("update li_goods set market_enable = 0 WHERE store_id = #{storeId}") - void underStoreGoods(String storeId); + @Select("SELECT id FROM li_goods WHERE store_id = #{storeId}") + List getGoodsIdByStoreId(String storeId); @Update("UPDATE li_goods SET comment_num = comment_num + #{commentNum} WHERE id = #{goodsId}") void addGoodsCommentNum(Integer commentNum, String goodsId); 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 a2560973..b9167c90 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 @@ -93,7 +93,10 @@ public class GoodsServiceImpl extends ServiceImpl implements @Override public void underStoreGoods(String storeId) { - this.baseMapper.underStoreGoods(storeId); + //获取商品ID列表 + List list= this.baseMapper.getGoodsIdByStoreId(storeId); + //下架店铺下的商品 + updateGoodsMarketAble(list,GoodsStatusEnum.DOWN,"店铺关闭"); } @Override diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/Order.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/Order.java index 09903e68..daafdca9 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/dos/Order.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dos/Order.java @@ -219,27 +219,25 @@ public class Order extends BaseEntity { BeanUtil.copyProperties(tradeDTO, this); BeanUtil.copyProperties(cartVO.getPriceDetailDTO(), this); BeanUtil.copyProperties(cartVO, this); - //订单类型判断--普通订单,活动订单。 + //订单类型判断--普通订单,虚拟订单。 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(tradeDTO.getCartTypeEnum().name()); - } else { - this.setOrderType(OrderTypeEnum.NORMAL.name()); } this.setId(oldId); //促销信息填充 - if (cartVO.getSkuList().get(0).getPromotions() != null && tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN)) { - Optional 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(""); - } - } - } +// if (cartVO.getSkuList().get(0).getPromotions() != null && tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN)) { +// Optional 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()); diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderTypeEnum.java b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderTypeEnum.java index e670e523..8fba1a49 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderTypeEnum.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderTypeEnum.java @@ -13,17 +13,8 @@ public enum OrderTypeEnum { */ NORMAL, - /** - * 赠品订单 - */ - GIFT, - /** * 虚拟订单 */ - VIRTUAL, - /** - * 拼团订单 - */ - PINTUAN + VIRTUAL } diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AllowOperation.java b/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AllowOperation.java index 29a956e5..2e39d768 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AllowOperation.java +++ b/framework/src/main/java/cn/lili/modules/order/order/entity/vo/AllowOperation.java @@ -69,9 +69,10 @@ public class AllowOperation implements Serializable { //新订单,允许支付 this.pay = status.equals(OrderStatusEnum.UNPAID.name()) && payStatus.equals(PayStatusEnum.UNPAID.name()); - //订单未发货,就可以编辑收货人信息(实物订单) - this.editConsignee = order.getOrderType().equals(OrderTypeEnum.VIRTUAL.name()) && - order.getDeliverStatus().equals(DeliverStatusEnum.UNDELIVERED.name()) && !status.equals(OrderStatusEnum.CANCELLED.name()); + //可编辑订单收件人信息=实物订单 && 订单未发货 && 订单未取消 + this.editConsignee = order.getOrderType().equals(OrderTypeEnum.NORMAL.name()) + && order.getDeliverStatus().equals(DeliverStatusEnum.UNDELIVERED.name()) + && !status.equals(OrderStatusEnum.CANCELLED.name()); //是否允许被发货 this.ship = editConsignee && status.equals(OrderStatusEnum.UNDELIVERED.name());