|
@@ -1,5 +1,6 @@
|
1
|
1
|
package com.huiju.estateagents.service.impl;
|
2
|
2
|
|
|
3
|
+import com.alibaba.fastjson.JSONArray;
|
3
|
4
|
import com.alibaba.fastjson.JSONObject;
|
4
|
5
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
5
|
6
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -12,6 +13,8 @@ import com.huiju.estateagents.entity.*;
|
12
|
13
|
import com.huiju.estateagents.mapper.*;
|
13
|
14
|
import com.huiju.estateagents.service.ITaBuildingService;
|
14
|
15
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
16
|
+import jodd.util.CollectionUtil;
|
|
17
|
+import org.apache.commons.collections.CollectionUtils;
|
15
|
18
|
import org.checkerframework.checker.units.qual.A;
|
16
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
17
|
20
|
import org.springframework.stereotype.Service;
|
|
@@ -62,6 +65,9 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
62
|
65
|
@Autowired
|
63
|
66
|
TdCityMapper tdCityMapper;
|
64
|
67
|
|
|
68
|
+ @Autowired
|
|
69
|
+ private TaBuildingProjectTypeMapper taBuildingProjectTypeMapper;
|
|
70
|
+
|
65
|
71
|
|
66
|
72
|
@Override
|
67
|
73
|
public ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain) {
|
|
@@ -105,6 +111,12 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
105
|
111
|
List<TaBuildingTag> buildingTags= taBuildingTagMapper.selectList(BuildingTagQueryWrapper);
|
106
|
112
|
building.setBuildingTag(buildingTags);
|
107
|
113
|
|
|
114
|
+ // 项目类型
|
|
115
|
+ QueryWrapper<TaBuildingProjectType> buildingProjectTypeQueryWrapper = new QueryWrapper<>();
|
|
116
|
+ buildingProjectTypeQueryWrapper.eq("building_id", building.getBuildingId());
|
|
117
|
+ List<TaBuildingProjectType> taBuildingProjectTypes = taBuildingProjectTypeMapper.selectList(buildingProjectTypeQueryWrapper);
|
|
118
|
+ building.setBuildingProjectType(taBuildingProjectTypes);
|
|
119
|
+
|
108
|
120
|
return ResponseBean.success(building);
|
109
|
121
|
}
|
110
|
122
|
|
|
@@ -192,6 +204,14 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
192
|
204
|
city.setStatus("1");
|
193
|
205
|
tdCityMapper.updateById(city);
|
194
|
206
|
}
|
|
207
|
+
|
|
208
|
+ // 项目类型
|
|
209
|
+ // 先删除之前关联的
|
|
210
|
+ taBuildingProjectTypeMapper.deleteByBuildingId(building.getBuildingId());
|
|
211
|
+ JSONArray buildingProjectTypeArray = object.getJSONArray("buildingProjectType");
|
|
212
|
+ if (CollectionUtils.isNotEmpty(buildingProjectTypeArray)) {
|
|
213
|
+ taBuildingProjectTypeMapper.insertBuildingProjectTypeBatch(buildingProjectTypeArray);
|
|
214
|
+ }
|
195
|
215
|
return ResponseBean.success("");
|
196
|
216
|
}
|
197
|
217
|
|
|
@@ -231,6 +251,13 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
231
|
251
|
List<TaBuildingTag> buildingTags = JSONObject.parseArray(tagStr, TaBuildingTag.class);
|
232
|
252
|
insertTagBatch(buildingTags, building.getBuildingId());
|
233
|
253
|
|
|
254
|
+ // 项目类型
|
|
255
|
+ // 先删除之前关联的
|
|
256
|
+ JSONArray buildingProjectTypeArray = object.getJSONArray("buildingProjectType");
|
|
257
|
+ if (CollectionUtils.isNotEmpty(buildingProjectTypeArray)) {
|
|
258
|
+ taBuildingProjectTypeMapper.insertBuildingProjectTypeBatch(buildingProjectTypeArray);
|
|
259
|
+ }
|
|
260
|
+
|
234
|
261
|
return ResponseBean.success("");
|
235
|
262
|
}
|
236
|
263
|
|