소스 검색

店铺删除

ytf 3 년 전
부모
커밋
b19755feb5
1개의 변경된 파일13개의 추가작업 그리고 10개의 파일을 삭제
  1. 13 10
      b2b2c/b2b2c-web/src/main/java/com/slodon/b2b2c/model/seller/StoreModel.java

+ 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 327
         Integer count;
328
-        store.setState(StoreConst.STORE_STATE_DELETE);
329
-        count = storeWriteMapper.updateByPrimaryKeySelective(store);
328
+        count = storeWriteMapper.deleteByPrimaryKey(store.getStoreId());
330 329
         if (count == 0) {
331 330
             log.error("根据storeId:" + storeId + "删除店铺表失败");
332 331
             throw new MallException("删除店铺表失败,请重试");
333 332
         }
334 333
 
335
-        //禁止vendor登陆
334
+        //删除vendor登陆
336 335
         VendorExample vendorExample = new VendorExample();
337 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 342
         //删除与店铺关联的store_apply表
@@ -361,6 +356,14 @@ public class StoreModel {
361 356
         if (count == 0) {
362 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 367
         return count;
365 368
     }
366 369