张延森 4 years ago
parent
commit
18dd1636ea

+ 1
- 1
pom.xml View File

10
 	</parent>
10
 	</parent>
11
 	<groupId>com.shigongli</groupId>
11
 	<groupId>com.shigongli</groupId>
12
 	<artifactId>shigongli</artifactId>
12
 	<artifactId>shigongli</artifactId>
13
-	<version>1.0.5</version>
13
+	<version>1.0.8</version>
14
 	<name>shigongli</name>
14
 	<name>shigongli</name>
15
 	<description>ShiGongli Service</description>
15
 	<description>ShiGongli Service</description>
16
 
16
 

+ 1
- 0
src/main/java/com/shigongli/controller/TaHouseController.java View File

180
         }
180
         }
181
 
181
 
182
         taHouse.setStatus(StatusConstant.DELETE);
182
         taHouse.setStatus(StatusConstant.DELETE);
183
+        iTaHouseSurroundService.deleteByHouse(id);
183
 
184
 
184
         return taHouseUpdate(id, taHouse);
185
         return taHouseUpdate(id, taHouse);
185
     }
186
     }

+ 11
- 0
src/main/java/com/shigongli/controller/TaShopController.java View File

7
 import com.shigongli.common.ResponseBean;
7
 import com.shigongli.common.ResponseBean;
8
 import com.shigongli.common.StringUtils;
8
 import com.shigongli.common.StringUtils;
9
 import com.shigongli.constants.StatusConstant;
9
 import com.shigongli.constants.StatusConstant;
10
+import com.shigongli.service.ITaHouseService;
11
+import com.shigongli.service.ITaShopKeeperService;
10
 import io.swagger.annotations.Api;
12
 import io.swagger.annotations.Api;
11
 import io.swagger.annotations.ApiOperation;
13
 import io.swagger.annotations.ApiOperation;
12
 import io.swagger.annotations.ApiParam;
14
 import io.swagger.annotations.ApiParam;
41
     @Autowired
43
     @Autowired
42
     public ITaShopService iTaShopService;
44
     public ITaShopService iTaShopService;
43
 
45
 
46
+    @Autowired
47
+    public ITaHouseService iTaHouseService;
48
+
49
+    @Autowired
50
+    public ITaShopKeeperService iTaShopKeeperService;
51
+
44
 
52
 
45
     /**
53
     /**
46
      * 分页查询列表
54
      * 分页查询列表
101
 
109
 
102
         taShop.setStatus(StatusConstant.DELETE);
110
         taShop.setStatus(StatusConstant.DELETE);
103
 
111
 
112
+        iTaHouseService.deleteByShop(id);
113
+        iTaShopKeeperService.deleteByShop(id);
114
+
104
         return taShopUpdate(id, taShop);
115
         return taShopUpdate(id, taShop);
105
     }
116
     }
106
 
117
 

+ 2
- 0
src/main/java/com/shigongli/service/ITaHouseService.java View File

18
     IPage<TaHouse> getHousesOfKeeper(IPage<TaHouse> pg, TaPerson taPerson, String shopId);
18
     IPage<TaHouse> getHousesOfKeeper(IPage<TaHouse> pg, TaPerson taPerson, String shopId);
19
 
19
 
20
     boolean isOwner(String personId, String houseId);
20
     boolean isOwner(String personId, String houseId);
21
+
22
+    boolean deleteByShop(String shopId);
21
 }
23
 }

+ 2
- 0
src/main/java/com/shigongli/service/ITaHouseSurroundService.java View File

17
     IPage<TaHouseSurround> getListByHouseOrNot(IPage<TaHouseSurround> pg, String houseId);
17
     IPage<TaHouseSurround> getListByHouseOrNot(IPage<TaHouseSurround> pg, String houseId);
18
 
18
 
19
     void copySurroundByHouse(String fromHouse, String toHouse);
19
     void copySurroundByHouse(String fromHouse, String toHouse);
20
+
21
+    boolean deleteByHouse(String houseId);
20
 }
22
 }

+ 2
- 0
src/main/java/com/shigongli/service/ITaShopKeeperService.java View File

25
     TaShopKeeper getByPhone(String phone, String shopId);
25
     TaShopKeeper getByPhone(String phone, String shopId);
26
 
26
 
27
     List<TaShopKeeper> getByHouse(String houseId);
27
     List<TaShopKeeper> getByHouse(String houseId);
28
+
29
+    boolean deleteByShop(String shopId);
28
 }
30
 }

+ 18
- 0
src/main/java/com/shigongli/service/impl/TaHouseServiceImpl.java View File

1
 package com.shigongli.service.impl;
1
 package com.shigongli.service.impl;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.shigongli.common.StringUtils;
6
 import com.shigongli.common.StringUtils;
6
 import com.shigongli.constants.StatusConstant;
7
 import com.shigongli.constants.StatusConstant;
63
 
64
 
64
         return count(queryWrapper) > 0;
65
         return count(queryWrapper) > 0;
65
     }
66
     }
67
+
68
+    @Override
69
+    public boolean deleteByShop(String shopId) {
70
+        if (StringUtils.isEmpty(shopId)) {
71
+            return false;
72
+        }
73
+
74
+        try {
75
+            UpdateWrapper<TaHouse> wrapper = new UpdateWrapper<>();
76
+            wrapper.set("status", StatusConstant.DELETE);
77
+            wrapper.eq("shop_id", shopId);
78
+            return update(wrapper);
79
+        } catch (Exception e) {
80
+            e.printStackTrace();
81
+            return false;
82
+        }
83
+    }
66
 }
84
 }

+ 21
- 0
src/main/java/com/shigongli/service/impl/TaHouseSurroundServiceImpl.java View File

1
 package com.shigongli.service.impl;
1
 package com.shigongli.service.impl;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.shigongli.common.StringUtils;
6
+import com.shigongli.constants.StatusConstant;
4
 import com.shigongli.entity.TaHouseSurround;
7
 import com.shigongli.entity.TaHouseSurround;
8
+import com.shigongli.entity.TaShopKeeper;
5
 import com.shigongli.mapper.TaHouseSurroundMapper;
9
 import com.shigongli.mapper.TaHouseSurroundMapper;
6
 import com.shigongli.service.ITaHouseSurroundService;
10
 import com.shigongli.service.ITaHouseSurroundService;
7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
30
     public void copySurroundByHouse(String fromHouse, String toHouse) {
34
     public void copySurroundByHouse(String fromHouse, String toHouse) {
31
         taHouseSurroundMapper.copySurroundByHouse(fromHouse, toHouse);
35
         taHouseSurroundMapper.copySurroundByHouse(fromHouse, toHouse);
32
     }
36
     }
37
+
38
+    @Override
39
+    public boolean deleteByHouse(String houseId) {
40
+        if (StringUtils.isEmpty(houseId)) {
41
+            return false;
42
+        }
43
+
44
+        try {
45
+            UpdateWrapper<TaHouseSurround> wrapper = new UpdateWrapper<>();
46
+            wrapper.set("status", StatusConstant.DELETE);
47
+            wrapper.eq("house_id", houseId);
48
+            return update(wrapper);
49
+        } catch (Exception e) {
50
+            e.printStackTrace();
51
+            return false;
52
+        }
53
+    }
33
 }
54
 }

+ 19
- 0
src/main/java/com/shigongli/service/impl/TaShopKeeperServiceImpl.java View File

1
 package com.shigongli.service.impl;
1
 package com.shigongli.service.impl;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
4
 import com.shigongli.common.StringUtils;
5
 import com.shigongli.common.StringUtils;
5
 import com.shigongli.constants.StatusConstant;
6
 import com.shigongli.constants.StatusConstant;
7
+import com.shigongli.entity.TaHouse;
6
 import com.shigongli.entity.TaPerson;
8
 import com.shigongli.entity.TaPerson;
7
 import com.shigongli.entity.TaShop;
9
 import com.shigongli.entity.TaShop;
8
 import com.shigongli.entity.TaShopKeeper;
10
 import com.shigongli.entity.TaShopKeeper;
91
     public List<TaShopKeeper> getByHouse(String houseId) {
93
     public List<TaShopKeeper> getByHouse(String houseId) {
92
         return taShopKeeperMapper.getByHouse(houseId);
94
         return taShopKeeperMapper.getByHouse(houseId);
93
     }
95
     }
96
+
97
+    @Override
98
+    public boolean deleteByShop(String shopId) {
99
+        if (StringUtils.isEmpty(shopId)) {
100
+            return false;
101
+        }
102
+
103
+        try {
104
+            UpdateWrapper<TaShopKeeper> wrapper = new UpdateWrapper<>();
105
+            wrapper.set("status", StatusConstant.DELETE);
106
+            wrapper.eq("shop_id", shopId);
107
+            return update(wrapper);
108
+        } catch (Exception e) {
109
+            e.printStackTrace();
110
+            return false;
111
+        }
112
+    }
94
 }
113
 }

+ 1
- 1
src/main/resources/mapper/TaHouseMapper.xml View File

15
         </if>
15
         </if>
16
             AND s.`status` = 1
16
             AND s.`status` = 1
17
             AND t.`status` = 1
17
             AND t.`status` = 1
18
-        ORDER BY t.title DESC
18
+        ORDER BY t.create_date DESC
19
     </select>
19
     </select>
20
 </mapper>
20
 </mapper>

+ 1
- 1
src/main/resources/mapper/TaHouseSurroundMapper.xml View File

9
             t.image_id,
9
             t.image_id,
10
             t.sort_no,
10
             t.sort_no,
11
             t.`status`,
11
             t.`status`,
12
-            NOW( )
12
+            t.create_date
13
         FROM
13
         FROM
14
             ta_house_surround t
14
             ta_house_surround t
15
         WHERE
15
         WHERE