Browse Source

店铺注销 代码优化

qxy 4 months ago
parent
commit
b2d2805046

+ 2 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -1810,7 +1810,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             //判断店铺存在正在售卖的商品 0:未通过 1:通过
             //判断店铺存在正在售卖的商品 0:未通过 1:通过
             List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,id).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
             List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,id).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
             List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
             List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
-                    .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, id).eq(LifeCoupon::getDeleteFlag, 0));
+                    .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, id).eq(LifeCoupon::getType,1).eq(LifeCoupon::getDeleteFlag, 0));
             if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
             if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
                 storeInfoMap.put("storeGoodsStatus", "0");
                 storeInfoMap.put("storeGoodsStatus", "0");
             } else {
             } else {
@@ -1906,7 +1906,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             //判断店铺有正在售卖的商品
             //判断店铺有正在售卖的商品
             List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,storeInfo.getId()).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
             List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,storeInfo.getId()).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
             List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
             List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
-                    .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, storeInfo.getId()).eq(LifeCoupon::getDeleteFlag, 0));
+                    .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, storeInfo.getId()).eq(LifeCoupon::getType,1).eq(LifeCoupon::getDeleteFlag, 0));
             if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
             if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
                 throw new RuntimeException("店铺有正在销售的商品");
                 throw new RuntimeException("店铺有正在销售的商品");
             }
             }