|
@@ -13,6 +13,8 @@ import com.huiju.estateagents.entity.*;
|
13
|
13
|
import com.huiju.estateagents.mapper.*;
|
14
|
14
|
import com.huiju.estateagents.service.ITaBuildingService;
|
15
|
15
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
16
|
+import jodd.util.CollectionUtil;
|
|
17
|
+import org.apache.commons.collections.CollectionUtils;
|
16
|
18
|
import org.checkerframework.checker.units.qual.A;
|
17
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
18
|
20
|
import org.springframework.stereotype.Service;
|
|
@@ -63,6 +65,9 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
63
|
65
|
@Autowired
|
64
|
66
|
TdCityMapper tdCityMapper;
|
65
|
67
|
|
|
68
|
+ @Autowired
|
|
69
|
+ private TaBuildingProjectTypeMapper taBuildingProjectTypeMapper;
|
|
70
|
+
|
66
|
71
|
|
67
|
72
|
@Override
|
68
|
73
|
public ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain) {
|
|
@@ -106,6 +111,12 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
106
|
111
|
List<TaBuildingTag> buildingTags= taBuildingTagMapper.selectList(BuildingTagQueryWrapper);
|
107
|
112
|
building.setBuildingTag(buildingTags);
|
108
|
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
|
+
|
109
|
120
|
return ResponseBean.success(building);
|
110
|
121
|
}
|
111
|
122
|
|
|
@@ -193,6 +204,14 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
193
|
204
|
city.setStatus("1");
|
194
|
205
|
tdCityMapper.updateById(city);
|
195
|
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
|
+ }
|
196
|
215
|
return ResponseBean.success("");
|
197
|
216
|
}
|
198
|
217
|
|
|
@@ -234,10 +253,10 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
234
|
253
|
|
235
|
254
|
// 项目类型
|
236
|
255
|
// 先删除之前关联的
|
237
|
|
-
|
238
|
|
-
|
239
|
|
- JSONArray buildingProjectType = object.getJSONArray("buildingProjectType");
|
240
|
|
-
|
|
256
|
+ JSONArray buildingProjectTypeArray = object.getJSONArray("buildingProjectType");
|
|
257
|
+ if (CollectionUtils.isNotEmpty(buildingProjectTypeArray)) {
|
|
258
|
+ taBuildingProjectTypeMapper.insertBuildingProjectTypeBatch(buildingProjectTypeArray);
|
|
259
|
+ }
|
241
|
260
|
|
242
|
261
|
return ResponseBean.success("");
|
243
|
262
|
}
|