Browse Source

店铺删除

ytf 3 years ago
parent
commit
b19755feb5

+ 13 - 10
b2b2c/b2b2c-web/src/main/java/com/slodon/b2b2c/model/seller/StoreModel.java

@@ -325,23 +325,18 @@ public class StoreModel {
325
         }
325
         }
326
 
326
 
327
         Integer count;
327
         Integer count;
328
-        store.setState(StoreConst.STORE_STATE_DELETE);
329
-        count = storeWriteMapper.updateByPrimaryKeySelective(store);
328
+        count = storeWriteMapper.deleteByPrimaryKey(store.getStoreId());
330
         if (count == 0) {
329
         if (count == 0) {
331
             log.error("根据storeId:" + storeId + "删除店铺表失败");
330
             log.error("根据storeId:" + storeId + "删除店铺表失败");
332
             throw new MallException("删除店铺表失败,请重试");
331
             throw new MallException("删除店铺表失败,请重试");
333
         }
332
         }
334
 
333
 
335
-        //禁止vendor登陆
334
+        //删除vendor登陆
336
         VendorExample vendorExample = new VendorExample();
335
         VendorExample vendorExample = new VendorExample();
337
         vendorExample.setStoreId(storeId);
336
         vendorExample.setStoreId(storeId);
338
-        List<Vendor> vendors = vendorReadMapper.listByExample(vendorExample);
339
-        for (Vendor vendor : vendors) {
340
-            vendor.setIsAllowLogin(VendorConst.NOT_ALLOW_LOGIN);
341
-            count = vendorWriteMapper.updateByPrimaryKeySelective(vendor);
342
-            if (count == 0) {
343
-                throw new MallException("编辑商户管理员表失败,请重试");
344
-            }
337
+        count = vendorWriteMapper.deleteByExample(vendorExample);
338
+        if (count == 0) {
339
+            throw new MallException("删除商户管理员表失败,请重试");
345
         }
340
         }
346
 
341
 
347
         //删除与店铺关联的store_apply表
342
         //删除与店铺关联的store_apply表
@@ -361,6 +356,14 @@ public class StoreModel {
361
         if (count == 0) {
356
         if (count == 0) {
362
             throw new MallException("删除店铺资质信息表失败,请重试");
357
             throw new MallException("删除店铺资质信息表失败,请重试");
363
         }
358
         }
359
+
360
+        //删除店铺商品
361
+        GoodsExample goodsExtend = new GoodsExample();
362
+        goodsExtend.setStoreId(store.getStoreId());
363
+        count = goodsWriteMapper.deleteByExample(goodsExtend);
364
+        if (count == 0) {
365
+            throw new MallException("删除店铺商品表失败,请重试");
366
+        }
364
         return count;
367
         return count;
365
     }
368
     }
366
 
369