|
@@ -15,6 +15,7 @@ import com.example.wholeestate.model.Building;
|
15
|
15
|
import com.example.wholeestate.model.Customer;
|
16
|
16
|
import com.example.wholeestate.service.IBuildingService;
|
17
|
17
|
import com.fasterxml.jackson.databind.util.ArrayBuilders;
|
|
18
|
+import com.sun.org.apache.bcel.internal.generic.NEW;
|
18
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
20
|
import org.springframework.stereotype.Service;
|
20
|
21
|
|
|
@@ -184,5 +185,29 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
184
|
185
|
return ResponseBean;
|
185
|
186
|
}
|
186
|
187
|
|
|
188
|
+ @Override
|
|
189
|
+ public ResponseBean buildingdelete(String parameter) {
|
|
190
|
+ ResponseBean responseBean= new ResponseBean<>();
|
|
191
|
+ Building building= new Building();
|
|
192
|
+ JSONObject jsonobject = JSONObject.parseObject(parameter);
|
|
193
|
+ Integer id= jsonobject.getInteger("id");
|
|
194
|
+ QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
|
|
195
|
+ buildingtWrapper.lambda().eq(Building::getBuildingId,id);
|
|
196
|
+ Building bui= buildingMapper.selectOne(buildingtWrapper);
|
|
197
|
+
|
|
198
|
+ if (bui.getStatus().equals(2)){
|
|
199
|
+ responseBean.addSuccess("楼盘已发布不可以删除");
|
|
200
|
+ return responseBean;
|
|
201
|
+ }
|
|
202
|
+ QueryWrapper<Building> buildingIdQueryWrapper = new QueryWrapper<>();
|
|
203
|
+ buildingIdQueryWrapper.eq("building_id", id);
|
|
204
|
+ building.setBuildingId(String.valueOf(id));
|
|
205
|
+ building.setStatus(-1);
|
|
206
|
+ buildingMapper.update(building,buildingIdQueryWrapper);
|
|
207
|
+ ResponseBean ResponseBean= new ResponseBean<>();
|
|
208
|
+ ResponseBean.addSuccess("成功");
|
|
209
|
+ return ResponseBean;
|
|
210
|
+ }
|
|
211
|
+
|
187
|
212
|
|
188
|
213
|
}
|