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());