|
@@ -94,7 +94,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
94
|
94
|
private TaShareContentService taShareContentService;
|
95
|
95
|
|
96
|
96
|
@Autowired
|
97
|
|
- private TaOrgMapper taOrgMapper;
|
|
97
|
+ private TaOrgMapper taOrgMapper;
|
98
|
98
|
|
99
|
99
|
@Autowired
|
100
|
100
|
private ITaBuildingMapRelationService iTaBuildingMapRelationService;
|
|
@@ -105,16 +105,19 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
105
|
105
|
@Autowired
|
106
|
106
|
private ITaBuildingPanoramaService taBuildingPanoramaService;
|
107
|
107
|
|
|
108
|
+ @Autowired
|
|
109
|
+ private ITaSalesBatchService iTaSalesBatchService;
|
|
110
|
+
|
108
|
111
|
@Override
|
109
|
|
- public ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain, Integer orgId,List<TaPersonBuilding> taPersonBuildingList) {
|
|
112
|
+ public ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain, Integer orgId, List<TaPersonBuilding> taPersonBuildingList) {
|
110
|
113
|
Page<TaBuilding> page = new Page<>();
|
111
|
114
|
page.setSize(pageSize == null ? 10 : pageSize);
|
112
|
115
|
page.setCurrent(pageNum == null ? 1 : pageNum);
|
113
|
116
|
|
114
|
|
- List<TaBuilding> buildings = taBuildingMapper.buildingList(page, name, code,startDate,buildingStatus,marketStatus,cityId,isMain, orgId,taPersonBuildingList);
|
|
117
|
+ List<TaBuilding> buildings = taBuildingMapper.buildingList(page, name, code, startDate, buildingStatus, marketStatus, cityId, isMain, orgId, taPersonBuildingList);
|
115
|
118
|
|
116
|
119
|
if (null != buildings) {
|
117
|
|
- for(TaBuilding taBuilding: buildings) {
|
|
120
|
+ for (TaBuilding taBuilding : buildings) {
|
118
|
121
|
//查询当前图片
|
119
|
122
|
QueryWrapper<TaBuildingImg> queryWrapper = new QueryWrapper<>();
|
120
|
123
|
queryWrapper.eq("building_id", taBuilding.getBuildingId());
|
|
@@ -139,18 +142,20 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
139
|
142
|
|
140
|
143
|
return ResponseBean.success(page);
|
141
|
144
|
}
|
|
145
|
+
|
142
|
146
|
@Override
|
143
|
|
- public ResponseBean buildingListSelect(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain,Integer orgId,List<TaPersonBuilding> taPersonBuildingList) {
|
|
147
|
+ public ResponseBean buildingListSelect(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain, Integer orgId, List<TaPersonBuilding> taPersonBuildingList) {
|
144
|
148
|
Page<TaBuilding> page = new Page<>();
|
145
|
149
|
page.setSize(pageSize == null ? 10 : pageSize);
|
146
|
150
|
page.setCurrent(pageNum == null ? 1 : pageNum);
|
147
|
|
- List<TaBuilding> building = taBuildingMapper.buildingListSelect(page, name, code,startDate,buildingStatus,marketStatus,cityId,isMain,orgId,taPersonBuildingList);
|
|
151
|
+ List<TaBuilding> building = taBuildingMapper.buildingListSelect(page, name, code, startDate, buildingStatus, marketStatus, cityId, isMain, orgId, taPersonBuildingList);
|
148
|
152
|
page.setRecords(building);
|
149
|
153
|
return ResponseBean.success(page);
|
150
|
154
|
}
|
151
|
155
|
|
152
|
156
|
/**
|
153
|
157
|
* 查询项目图片
|
|
158
|
+ *
|
154
|
159
|
* @param buildingId
|
155
|
160
|
* @param imgType
|
156
|
161
|
* @return
|
|
@@ -162,15 +167,15 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
162
|
167
|
buildingImgQueryWrapper.eq("img_type", imgType);
|
163
|
168
|
buildingImgQueryWrapper.orderByAsc("order_no");
|
164
|
169
|
List<TaBuildingImg> buildingImg = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
|
165
|
|
- return buildingImg.size() > 0 ? buildingImg : null;
|
|
170
|
+ return buildingImg.size() > 0 ? buildingImg : null;
|
166
|
171
|
}
|
167
|
172
|
|
168
|
173
|
@Override
|
169
|
174
|
public ResponseBean buildingSelectId(String id) {
|
170
|
175
|
// 查询基础信息
|
171
|
176
|
QueryWrapper<TaBuilding> buildingtWrapper = new QueryWrapper<>();
|
172
|
|
- buildingtWrapper.lambda().gt(TaBuilding::getStatus,-1);
|
173
|
|
- buildingtWrapper.lambda().eq(TaBuilding::getBuildingId,id);
|
|
177
|
+ buildingtWrapper.lambda().gt(TaBuilding::getStatus, -1);
|
|
178
|
+ buildingtWrapper.lambda().eq(TaBuilding::getBuildingId, id);
|
174
|
179
|
TaBuilding building = taBuildingMapper.selectOne(buildingtWrapper);
|
175
|
180
|
|
176
|
181
|
//查询当前图片
|
|
@@ -185,7 +190,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
185
|
190
|
// 查询tag
|
186
|
191
|
QueryWrapper<TaBuildingTag> BuildingTagQueryWrapper = new QueryWrapper<>();
|
187
|
192
|
BuildingTagQueryWrapper.eq("building_id", id);
|
188
|
|
- List<TaBuildingTag> buildingTags= taBuildingTagMapper.selectList(BuildingTagQueryWrapper);
|
|
193
|
+ List<TaBuildingTag> buildingTags = taBuildingTagMapper.selectList(BuildingTagQueryWrapper);
|
189
|
194
|
building.setBuildingTag(buildingTags);
|
190
|
195
|
|
191
|
196
|
// 项目类型
|
|
@@ -193,8 +198,8 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
193
|
198
|
buildingProjectTypeQueryWrapper.eq("building_id", building.getBuildingId());
|
194
|
199
|
List<TaBuildingProjectType> taBuildingProjectTypes = taBuildingProjectTypeMapper.selectList(buildingProjectTypeQueryWrapper);
|
195
|
200
|
building.setBuildingProjectType(taBuildingProjectTypes);
|
196
|
|
- building.setPosters(taPosterService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
197
|
|
- building.setShareContents(taShareContentService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
|
201
|
+ building.setPosters(taPosterService.getPostersForTarget(id, CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
|
202
|
+ building.setShareContents(taShareContentService.getPostersForTarget(id, CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
198
|
203
|
|
199
|
204
|
// 查询 周边数据
|
200
|
205
|
QueryWrapper<TaBuildingMapRelation> mapRelationQueryWrapper = new QueryWrapper<>();
|
|
@@ -207,15 +212,15 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
207
|
212
|
}
|
208
|
213
|
|
209
|
214
|
@Override
|
210
|
|
- public ResponseBean buildingAllSelectId(String id,String personId, Integer orgId) {
|
|
215
|
+ public ResponseBean buildingAllSelectId(String id, String personId, Integer orgId) {
|
211
|
216
|
// 查询基础信息
|
212
|
217
|
QueryWrapper<TaBuilding> buildingtWrapper = new QueryWrapper<>();
|
213
|
|
- buildingtWrapper.lambda().gt(TaBuilding::getStatus,-1);
|
214
|
|
- buildingtWrapper.lambda().eq(TaBuilding::getBuildingId,id);
|
|
218
|
+ buildingtWrapper.lambda().gt(TaBuilding::getStatus, -1);
|
|
219
|
+ buildingtWrapper.lambda().eq(TaBuilding::getBuildingId, id);
|
215
|
220
|
TaBuilding building = taBuildingMapper.selectOne(buildingtWrapper);
|
216
|
221
|
|
217
|
|
- if (null == building){
|
218
|
|
- return ResponseBean.error("项目不存在",ResponseBean.ERROR_UNAVAILABLE);
|
|
222
|
+ if (null == building) {
|
|
223
|
+ return ResponseBean.error("项目不存在", ResponseBean.ERROR_UNAVAILABLE);
|
219
|
224
|
}
|
220
|
225
|
//查询当前图片
|
221
|
226
|
building.setBuildingImg(getBuildingImg(id, CommConstant.BUILDING_IMG_BANNER));
|
|
@@ -242,7 +247,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
242
|
247
|
AppointmentQueryWrapper.eq("status", 1);
|
243
|
248
|
AppointmentQueryWrapper.orderByDesc("create_date");
|
244
|
249
|
List<TaBuildingApartment> appoint = taBuildingApartmentMapper.selectList(AppointmentQueryWrapper);
|
245
|
|
- for (TaBuildingApartment apar:appoint) {
|
|
250
|
+ for (TaBuildingApartment apar : appoint) {
|
246
|
251
|
List<TaBuildingImg> imgs = taBuildingImgMapper.getBuildingImgByApartment(apar.getApartmentId());
|
247
|
252
|
apar.setBuildingImgList(imgs);
|
248
|
253
|
}
|
|
@@ -250,13 +255,13 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
250
|
255
|
|
251
|
256
|
getBuildingAttaches(building);
|
252
|
257
|
QueryWrapper<TaSave> saveQueryWrapper = new QueryWrapper<>();
|
253
|
|
- saveQueryWrapper.eq("tagert_type",CommConstant.FAVOR_PROJECT);
|
254
|
|
- saveQueryWrapper.eq("person_id",personId);
|
255
|
|
- saveQueryWrapper.eq("saved_target",building.getBuildingId());
|
|
258
|
+ saveQueryWrapper.eq("tagert_type", CommConstant.FAVOR_PROJECT);
|
|
259
|
+ saveQueryWrapper.eq("person_id", personId);
|
|
260
|
+ saveQueryWrapper.eq("saved_target", building.getBuildingId());
|
256
|
261
|
Integer num = taSaveMapper.selectCount(saveQueryWrapper);
|
257
|
|
- if (num>0){
|
|
262
|
+ if (num > 0) {
|
258
|
263
|
building.setIsSave(CommConstant.STATUS_NORMAL);
|
259
|
|
- }else {
|
|
264
|
+ } else {
|
260
|
265
|
building.setIsSave(CommConstant.STATUS_UNACCALIMED);
|
261
|
266
|
}
|
262
|
267
|
|
|
@@ -268,8 +273,8 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
268
|
273
|
building.setBuildingProjectType(buildingProjectTypes);
|
269
|
274
|
|
270
|
275
|
// 海报和分享
|
271
|
|
- building.setPosters(taPosterService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
272
|
|
- building.setShareContents(taShareContentService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
|
276
|
+ building.setPosters(taPosterService.getPostersForTarget(id, CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
|
277
|
+ building.setShareContents(taShareContentService.getPostersForTarget(id, CommConstant.POSTER_CONTENT_TYPE_BUILDING));
|
273
|
278
|
|
274
|
279
|
// 助力活动
|
275
|
280
|
QueryWrapper<HelpActivity> helpActivityQueryWrapper = new QueryWrapper<>();
|
|
@@ -304,18 +309,25 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
304
|
309
|
List<TaBuildingPanorama> panoramaList = taBuildingPanoramaService.list(panoramaQueryWrapper);
|
305
|
310
|
building.setPanoramaList(panoramaList);
|
306
|
311
|
|
|
312
|
+ // 查询关联的销售批次
|
|
313
|
+ QueryWrapper<TaSalesBatch> salesBatchQueryWrapper = new QueryWrapper<>();
|
|
314
|
+ salesBatchQueryWrapper.lambda().eq(TaSalesBatch::getBuildingId, id);
|
|
315
|
+ salesBatchQueryWrapper.lambda().eq(TaSalesBatch::getStatus, CommConstant.STATUS_NORMAL);
|
|
316
|
+ TaSalesBatch taSalesBatch = iTaSalesBatchService.getOne(salesBatchQueryWrapper);
|
|
317
|
+ building.setSalesBatch(taSalesBatch);
|
|
318
|
+
|
307
|
319
|
return ResponseBean.success(building);
|
308
|
320
|
}
|
309
|
321
|
|
310
|
322
|
@Override
|
311
|
323
|
public ResponseBean buildingUpdate(String parameter, Integer orgId) {
|
312
|
324
|
ResponseBean responseBean = new ResponseBean();
|
313
|
|
- JSONObject object= JSONObject.parseObject(parameter);
|
|
325
|
+ JSONObject object = JSONObject.parseObject(parameter);
|
314
|
326
|
|
315
|
327
|
TaBuilding building = object.toJavaObject(TaBuilding.class);
|
316
|
328
|
|
317
|
329
|
boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "update");
|
318
|
|
- if (!isMainMoreThanTenFlag){
|
|
330
|
+ if (!isMainMoreThanTenFlag) {
|
319
|
331
|
responseBean.addError("当前城市最多只能推荐10个项目至首页哦。");
|
320
|
332
|
return responseBean;
|
321
|
333
|
}
|
|
@@ -334,7 +346,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
334
|
346
|
buildingIdQueryWrapper.eq("building_id", building.getBuildingId());
|
335
|
347
|
buildingIdQueryWrapper.eq("org_id", orgId);
|
336
|
348
|
building.setName(building.getBuildingName());
|
337
|
|
- taBuildingMapper.update(building,buildingIdQueryWrapper);
|
|
349
|
+ taBuildingMapper.update(building, buildingIdQueryWrapper);
|
338
|
350
|
QueryWrapper<TaBuildingImg> BuildingImgQueryWrapper = new QueryWrapper<>();
|
339
|
351
|
BuildingImgQueryWrapper.eq("building_id", building.getBuildingId());
|
340
|
352
|
BuildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_BANNER);
|
|
@@ -375,7 +387,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
375
|
387
|
insertTagBatch(buildingTags, building.getBuildingId());
|
376
|
388
|
}
|
377
|
389
|
|
378
|
|
- if(null != building.getCityId()){
|
|
390
|
+ if (null != building.getCityId()) {
|
379
|
391
|
TdCity city = tdCityMapper.selectById(building.getCityId());
|
380
|
392
|
city.setStatus("1");
|
381
|
393
|
tdCityMapper.updateById(city);
|
|
@@ -456,22 +468,22 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
456
|
468
|
public ResponseBean buildingAdd(String parameter, Integer orgId) {
|
457
|
469
|
ResponseBean responseBean = new ResponseBean();
|
458
|
470
|
|
459
|
|
- JSONObject object= JSONObject.parseObject(parameter);
|
|
471
|
+ JSONObject object = JSONObject.parseObject(parameter);
|
460
|
472
|
// 根据orgId查询当前楼盘最大数
|
461
|
473
|
TaOrg taOrg = taOrgMapper.selectById(orgId);
|
462
|
474
|
// 查询当前org楼盘总数
|
463
|
|
- QueryWrapper<TaBuilding> taBuildingQuery = new QueryWrapper<>();
|
464
|
|
- taBuildingQuery.eq("org_id",orgId);
|
465
|
|
- taBuildingQuery.gt("status",-1);
|
466
|
|
- int orgNum= taBuildingMapper.selectCount(taBuildingQuery);
|
467
|
|
- if (orgNum >= taOrg.getBuildingNum()){
|
468
|
|
- return ResponseBean.error("当前系统仅供维护"+taOrg.getBuildingNum()+"个项目,需要维护更多项目,请联系相关管理人员", ResponseBean.ERROR_UNAVAILABLE);
|
|
475
|
+ QueryWrapper<TaBuilding> taBuildingQuery = new QueryWrapper<>();
|
|
476
|
+ taBuildingQuery.eq("org_id", orgId);
|
|
477
|
+ taBuildingQuery.gt("status", -1);
|
|
478
|
+ int orgNum = taBuildingMapper.selectCount(taBuildingQuery);
|
|
479
|
+ if (orgNum >= taOrg.getBuildingNum()) {
|
|
480
|
+ return ResponseBean.error("当前系统仅供维护" + taOrg.getBuildingNum() + "个项目,需要维护更多项目,请联系相关管理人员", ResponseBean.ERROR_UNAVAILABLE);
|
469
|
481
|
}
|
470
|
482
|
|
471
|
483
|
TaBuilding building = object.toJavaObject(TaBuilding.class);
|
472
|
484
|
|
473
|
485
|
boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "add");
|
474
|
|
- if (!isMainMoreThanTenFlag){
|
|
486
|
+ if (!isMainMoreThanTenFlag) {
|
475
|
487
|
responseBean.addError("当前城市最多只能推荐10个项目至首页哦。");
|
476
|
488
|
return responseBean;
|
477
|
489
|
}
|
|
@@ -483,7 +495,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
483
|
495
|
if (taBuildingMapper.insert(building) < 1) {
|
484
|
496
|
return ResponseBean.error("添加项目楼栋失败", ResponseBean.ERROR_UNAVAILABLE);
|
485
|
497
|
}
|
486
|
|
- if(null != building.getCityId()){
|
|
498
|
+ if (null != building.getCityId()) {
|
487
|
499
|
TdCity city = tdCityMapper.selectById(building.getCityId());
|
488
|
500
|
city.setStatus("1");
|
489
|
501
|
tdCityMapper.updateById(city);
|
|
@@ -531,13 +543,14 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
531
|
543
|
}
|
532
|
544
|
|
533
|
545
|
//添加默认意向值
|
534
|
|
- iTaBuildingIntentionService.saveDefaultIntention(building.getOrgId(),building.getBuildingId());
|
|
546
|
+ iTaBuildingIntentionService.saveDefaultIntention(building.getOrgId(), building.getBuildingId());
|
535
|
547
|
|
536
|
548
|
return ResponseBean.success(building);
|
537
|
549
|
}
|
538
|
550
|
|
539
|
551
|
/**
|
540
|
552
|
* 批量插入 周边地图数据
|
|
553
|
+ *
|
541
|
554
|
* @param list
|
542
|
555
|
* @param buildingId
|
543
|
556
|
* @param orgId
|
|
@@ -561,31 +574,31 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
561
|
574
|
ResponseBean responseBean = new ResponseBean();
|
562
|
575
|
|
563
|
576
|
JSONObject jsonobject = JSONObject.parseObject(parameter);
|
564
|
|
- Integer status= jsonobject.getInteger("status");
|
|
577
|
+ Integer status = jsonobject.getInteger("status");
|
565
|
578
|
String id = jsonobject.getString("id");
|
566
|
579
|
QueryWrapper<TaBuilding> buildingIdQueryWrapper = new QueryWrapper<>();
|
567
|
580
|
buildingIdQueryWrapper.eq("building_id", id);
|
568
|
581
|
buildingIdQueryWrapper.eq("org_id", orgId);
|
569
|
|
- TaBuilding building = taBuildingMapper.selectOne(buildingIdQueryWrapper);
|
|
582
|
+ TaBuilding building = taBuildingMapper.selectOne(buildingIdQueryWrapper);
|
570
|
583
|
|
571
|
584
|
boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, status, "updateStatus");
|
572
|
|
- if (!isMainMoreThanTenFlag){
|
|
585
|
+ if (!isMainMoreThanTenFlag) {
|
573
|
586
|
responseBean.addError("当前城市最多只能推荐10个项目至首页哦");
|
574
|
587
|
return responseBean;
|
575
|
588
|
}
|
576
|
589
|
building.setStatus(status);
|
577
|
|
- taBuildingMapper.update(building,buildingIdQueryWrapper);
|
|
590
|
+ taBuildingMapper.update(building, buildingIdQueryWrapper);
|
578
|
591
|
return ResponseBean.success("");
|
579
|
592
|
}
|
580
|
593
|
|
581
|
594
|
@Override
|
582
|
595
|
public ResponseBean buildingdelete(String id, Integer orgId) {
|
583
|
|
- TaBuilding building = new TaBuilding();
|
|
596
|
+ TaBuilding building = new TaBuilding();
|
584
|
597
|
QueryWrapper<TaBuilding> buildingtWrapper = new QueryWrapper<>();
|
585
|
|
- buildingtWrapper.lambda().eq(TaBuilding::getBuildingId,id);
|
586
|
|
- TaBuilding bui= taBuildingMapper.selectOne(buildingtWrapper);
|
|
598
|
+ buildingtWrapper.lambda().eq(TaBuilding::getBuildingId, id);
|
|
599
|
+ TaBuilding bui = taBuildingMapper.selectOne(buildingtWrapper);
|
587
|
600
|
|
588
|
|
- if (bui.getStatus().equals(1)){
|
|
601
|
+ if (bui.getStatus().equals(1)) {
|
589
|
602
|
return ResponseBean.error("楼盘已发布不可以删除", ResponseBean.ERROR_UNAVAILABLE);
|
590
|
603
|
}
|
591
|
604
|
QueryWrapper<TaBuilding> buildingIdQueryWrapper = new QueryWrapper<>();
|
|
@@ -593,14 +606,14 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
593
|
606
|
buildingIdQueryWrapper.eq("org_id", orgId);
|
594
|
607
|
building.setBuildingId(String.valueOf(id));
|
595
|
608
|
building.setStatus(-1);
|
596
|
|
- taBuildingMapper.update(building,buildingIdQueryWrapper);
|
|
609
|
+ taBuildingMapper.update(building, buildingIdQueryWrapper);
|
597
|
610
|
|
598
|
611
|
return ResponseBean.success("");
|
599
|
612
|
}
|
600
|
613
|
|
601
|
614
|
@Override
|
602
|
615
|
public ResponseBean buildingApartmentAdd(String parameter) {
|
603
|
|
- TaBuildingApartment building = JSONObject.parseObject(parameter,TaBuildingApartment.class);
|
|
616
|
+ TaBuildingApartment building = JSONObject.parseObject(parameter, TaBuildingApartment.class);
|
604
|
617
|
building.setStatus(1);
|
605
|
618
|
building.setCreateDate(LocalDateTime.now());
|
606
|
619
|
if (taBuildingApartmentMapper.insert(building) < 1) {
|
|
@@ -622,7 +635,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
622
|
635
|
@Override
|
623
|
636
|
public ResponseBean buildingApartmentUpdate(String parameter) {
|
624
|
637
|
ResponseBean responseBean = new ResponseBean();
|
625
|
|
- TaBuildingApartment building = JSONObject.parseObject(parameter,TaBuildingApartment.class);
|
|
638
|
+ TaBuildingApartment building = JSONObject.parseObject(parameter, TaBuildingApartment.class);
|
626
|
639
|
if (StringUtils.isEmpty(building.getApartmentId())) {
|
627
|
640
|
responseBean.addError("id不存在!");
|
628
|
641
|
return responseBean;
|
|
@@ -638,7 +651,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
638
|
651
|
buildingApartmentQueryWrapper.eq("apartment_id", building.getApartmentId());
|
639
|
652
|
building.setInsideArea(building.getInsideArea() == null ? 0d : building.getInsideArea());
|
640
|
653
|
building.setBuildingArea(building.getBuildingArea() == null ? 0d : building.getBuildingArea());
|
641
|
|
- taBuildingApartmentMapper.update(building,buildingApartmentQueryWrapper);
|
|
654
|
+ taBuildingApartmentMapper.update(building, buildingApartmentQueryWrapper);
|
642
|
655
|
|
643
|
656
|
JSONObject jsonobject = JSONObject.parseObject(parameter);
|
644
|
657
|
//图片数组
|
|
@@ -658,21 +671,21 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
658
|
671
|
buildingApartmentQueryWrapper.eq("apartment_id", id);
|
659
|
672
|
//拿到当前户型信息
|
660
|
673
|
TaBuildingApartment buildingApartment = taBuildingApartmentMapper.selectOne(buildingApartmentQueryWrapper);
|
661
|
|
- if ( null == buildingApartment ){
|
|
674
|
+ if (null == buildingApartment) {
|
662
|
675
|
return ResponseBean.success("", "没有发现户型图上传");
|
663
|
676
|
}
|
664
|
677
|
|
665
|
678
|
//根据户型ID查楼盘户型对应图片表
|
666
|
|
- ArrayList arrayList= new ArrayList<>();
|
|
679
|
+ ArrayList arrayList = new ArrayList<>();
|
667
|
680
|
QueryWrapper<TaApartmentImg> ApartmentImgQueryWrapper = new QueryWrapper<>();
|
668
|
681
|
ApartmentImgQueryWrapper.eq("apartment_id", buildingApartment.getApartmentId());
|
669
|
|
- List<TaApartmentImg> buildingImg= taApartmentImgMapper.selectList(ApartmentImgQueryWrapper);
|
670
|
|
- for (TaApartmentImg apartmentImg:buildingImg){
|
|
682
|
+ List<TaApartmentImg> buildingImg = taApartmentImgMapper.selectList(ApartmentImgQueryWrapper);
|
|
683
|
+ for (TaApartmentImg apartmentImg : buildingImg) {
|
671
|
684
|
QueryWrapper<TaBuildingImg> buildingImgQueryWrapper = new QueryWrapper<>();
|
672
|
|
- buildingImgQueryWrapper.eq("img_id",apartmentImg.getImgId());
|
673
|
|
- buildingImgQueryWrapper.eq("img_type",CommConstant.BUILDING_IMG_APARMENT);
|
674
|
|
- List<TaBuildingImg> buildingImgList= taBuildingImgMapper.selectList(buildingImgQueryWrapper);
|
675
|
|
- for (TaBuildingImg buImg:buildingImgList) {
|
|
685
|
+ buildingImgQueryWrapper.eq("img_id", apartmentImg.getImgId());
|
|
686
|
+ buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
|
|
687
|
+ List<TaBuildingImg> buildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
|
|
688
|
+ for (TaBuildingImg buImg : buildingImgList) {
|
676
|
689
|
arrayList.add(buImg);
|
677
|
690
|
}
|
678
|
691
|
}
|
|
@@ -697,10 +710,10 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
697
|
710
|
String[] buildingTypeList,
|
698
|
711
|
List<String[]> priceList,
|
699
|
712
|
List<String[]> areaList,
|
700
|
|
- Integer orgId,String priceType) {
|
|
713
|
+ Integer orgId, String priceType) {
|
701
|
714
|
IPage<TaBuilding> page = new Page<>(pageNum, pageSize);
|
702
|
715
|
|
703
|
|
- if(CollectionUtils.isEmpty(targets) && mine){
|
|
716
|
+ if (CollectionUtils.isEmpty(targets) && mine) {
|
704
|
717
|
return ResponseBean.success(page);
|
705
|
718
|
}
|
706
|
719
|
|
|
@@ -715,11 +728,11 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
715
|
728
|
//
|
716
|
729
|
// IPage<TaBuilding> result = taBuildingMapper.selectPage(page, buildingQueryWrapper);
|
717
|
730
|
|
718
|
|
- IPage<TaBuilding> result = taBuildingMapper.selectBuildingPage(page, name, cityId, targets, houseTypeList, buildingTypeList, priceList, areaList,orgId,priceType);
|
|
731
|
+ IPage<TaBuilding> result = taBuildingMapper.selectBuildingPage(page, name, cityId, targets, houseTypeList, buildingTypeList, priceList, areaList, orgId, priceType);
|
719
|
732
|
|
720
|
733
|
List<TaBuilding> buildingList = result.getRecords();
|
721
|
734
|
if (CollectionUtils.isNotEmpty(buildingList)) {
|
722
|
|
- for (TaBuilding build:buildingList) {
|
|
735
|
+ for (TaBuilding build : buildingList) {
|
723
|
736
|
getBuildingAttaches(build);
|
724
|
737
|
|
725
|
738
|
// 兼容 3.0/3.5 版本(3.0/3.5 封面取的全是 buildingListImg 的第一张),因为在3.5.1新增了封面图
|
|
@@ -799,9 +812,9 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
799
|
812
|
// tags
|
800
|
813
|
if (!StringUtils.isEmpty(building.getTags())) {
|
801
|
814
|
List<TaBuildingTag> tags = new ArrayList<>();
|
802
|
|
- String[] tagsArray = building.getTags().split(",");
|
|
815
|
+ String[] tagsArray = building.getTags().split(",");
|
803
|
816
|
if (null != tagsArray) {
|
804
|
|
- for(String tagName: tagsArray) {
|
|
817
|
+ for (String tagName : tagsArray) {
|
805
|
818
|
TaBuildingTag tag = new TaBuildingTag();
|
806
|
819
|
tag.setBuildingId(buildingId);
|
807
|
820
|
tag.setTagName(tagName);
|
|
@@ -875,14 +888,14 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
875
|
888
|
public ResponseBean buildingApartmentBuildingId(String id, String apartmentType) {
|
876
|
889
|
QueryWrapper<TaBuildingApartment> buildingApartmentQueryWrapper = new QueryWrapper<>();
|
877
|
890
|
buildingApartmentQueryWrapper.eq("building_id", id);
|
878
|
|
- buildingApartmentQueryWrapper.eq("status",1);
|
879
|
|
- buildingApartmentQueryWrapper.eq(org.apache.commons.lang3.StringUtils.isNotBlank(apartmentType),"apartment_type",apartmentType);
|
|
891
|
+ buildingApartmentQueryWrapper.eq("status", 1);
|
|
892
|
+ buildingApartmentQueryWrapper.eq(org.apache.commons.lang3.StringUtils.isNotBlank(apartmentType), "apartment_type", apartmentType);
|
880
|
893
|
buildingApartmentQueryWrapper.orderByDesc("create_date");
|
881
|
|
- List<TaBuildingApartment> buildingApartment= taBuildingApartmentMapper.selectList(buildingApartmentQueryWrapper);
|
|
894
|
+ List<TaBuildingApartment> buildingApartment = taBuildingApartmentMapper.selectList(buildingApartmentQueryWrapper);
|
882
|
895
|
buildingApartment.forEach(e -> {
|
883
|
896
|
QueryWrapper<TaApartmentImg> ApartmentImgQueryWrapper = new QueryWrapper<>();
|
884
|
897
|
ApartmentImgQueryWrapper.eq("apartment_id", e.getApartmentId());
|
885
|
|
- List<TaApartmentImg> buildingImg= taApartmentImgMapper.selectList(ApartmentImgQueryWrapper);
|
|
898
|
+ List<TaApartmentImg> buildingImg = taApartmentImgMapper.selectList(ApartmentImgQueryWrapper);
|
886
|
899
|
|
887
|
900
|
List<TaBuildingImg> buildingImag = buildingImg.stream().map(img -> {
|
888
|
901
|
QueryWrapper<TaBuildingImg> buildingImgQueryWrapper = new QueryWrapper<>();
|
|
@@ -907,21 +920,21 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
907
|
920
|
|
908
|
921
|
// TaBuilding building= new TaBuilding();
|
909
|
922
|
QueryWrapper<TaBuilding> buildingtWrapper = new QueryWrapper<>();
|
910
|
|
- buildingtWrapper.lambda().eq(TaBuilding::getBuildingId,buildingApartment.getBuildingId());
|
|
923
|
+ buildingtWrapper.lambda().eq(TaBuilding::getBuildingId, buildingApartment.getBuildingId());
|
911
|
924
|
// TaBuilding bui= taBuildingMapper.selectOne(buildingtWrapper);
|
912
|
925
|
// if (bui.getStatus().equals(1)){
|
913
|
926
|
// return ResponseBean.error("楼盘已发布不可以删除", ResponseBean.ERROR_UNAVAILABLE);
|
914
|
927
|
// }
|
915
|
928
|
|
916
|
929
|
buildingApartment.setStatus(-1);
|
917
|
|
- taBuildingApartmentMapper.update(buildingApartment,buildingApartmentQueryWrapper);
|
|
930
|
+ taBuildingApartmentMapper.update(buildingApartment, buildingApartmentQueryWrapper);
|
918
|
931
|
|
919
|
|
- return ResponseBean.success("");
|
|
932
|
+ return ResponseBean.success("");
|
920
|
933
|
}
|
921
|
934
|
|
922
|
935
|
@Override
|
923
|
936
|
public ResponseBean buildingAll(Integer orgId) {
|
924
|
|
- List<TaBuilding> taBuilding= taBuildingMapper.buildingAll(orgId);
|
|
937
|
+ List<TaBuilding> taBuilding = taBuildingMapper.buildingAll(orgId);
|
925
|
938
|
return ResponseBean.success(taBuilding);
|
926
|
939
|
}
|
927
|
940
|
|
|
@@ -936,8 +949,8 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
936
|
949
|
}
|
937
|
950
|
|
938
|
951
|
@Override
|
939
|
|
- public ResponseBean getBuildingListById(Integer orgId,Integer cityId) {
|
940
|
|
- List<TaBuilding> buildings = taBuildingMapper.getBuildingListById(orgId,cityId);
|
|
952
|
+ public ResponseBean getBuildingListById(Integer orgId, Integer cityId) {
|
|
953
|
+ List<TaBuilding> buildings = taBuildingMapper.getBuildingListById(orgId, cityId);
|
941
|
954
|
return ResponseBean.success(buildings);
|
942
|
955
|
}
|
943
|
956
|
|
|
@@ -948,6 +961,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
948
|
961
|
|
949
|
962
|
/**
|
950
|
963
|
* 推荐到首页楼盘不能超过10个
|
|
964
|
+ *
|
951
|
965
|
* @param taBuilding
|
952
|
966
|
* @return
|
953
|
967
|
*/
|
|
@@ -956,13 +970,13 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
956
|
970
|
queryWrapper.eq("building_id", taBuilding.getBuildingId());
|
957
|
971
|
queryWrapper.eq("org_id", orgId);
|
958
|
972
|
TaBuilding info = taBuildingMapper.selectOne(queryWrapper);
|
959
|
|
- if (taBuilding.getIsMain() != 1){
|
|
973
|
+ if (taBuilding.getIsMain() != 1) {
|
960
|
974
|
return true;
|
961
|
975
|
}
|
962
|
976
|
// if (operte.equals("update") && (info.getStatus() == 2)){
|
963
|
977
|
// return true;
|
964
|
978
|
// }
|
965
|
|
- if (operte.equals("updateStatus") && status == 2){
|
|
979
|
+ if (operte.equals("updateStatus") && status == 2) {
|
966
|
980
|
return true;
|
967
|
981
|
}
|
968
|
982
|
QueryWrapper<TaBuilding> taBuildingQueryWrapper = new QueryWrapper<>();
|
|
@@ -971,19 +985,17 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
971
|
985
|
taBuildingQueryWrapper.eq("org_id", orgId);
|
972
|
986
|
taBuildingQueryWrapper.ne("status", "-1");
|
973
|
987
|
taBuildingQueryWrapper.ne("status", "2");
|
974
|
|
- if (taBuilding.getBuildingId() != null){
|
|
988
|
+ if (taBuilding.getBuildingId() != null) {
|
975
|
989
|
taBuildingQueryWrapper.ne("building_id", taBuilding.getBuildingId());
|
976
|
990
|
}
|
977
|
991
|
List<TaBuilding> taBuildings = taBuildingMapper.selectList(taBuildingQueryWrapper);
|
978
|
|
- if (taBuildings != null && taBuildings.size() >= 10){
|
|
992
|
+ if (taBuildings != null && taBuildings.size() >= 10) {
|
979
|
993
|
return false;
|
980
|
994
|
}
|
981
|
995
|
return true;
|
982
|
996
|
}
|
983
|
997
|
|
984
|
998
|
|
985
|
|
-
|
986
|
|
-
|
987
|
999
|
private List<TaBuildingImg> insertImgBatch(List<TaBuildingImg> imgs, String buildingId) {
|
988
|
1000
|
return imgs.stream().map(img -> {
|
989
|
1001
|
TaBuildingImg Images = new TaBuildingImg();
|
|
@@ -1011,7 +1023,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
1011
|
1023
|
|
1012
|
1024
|
int insertApartmentImgBatch(List<TaBuildingImg> imgs, String buildingId, String apartmentId) {
|
1013
|
1025
|
int rows = 0;
|
1014
|
|
- for (TaBuildingImg img: imgs){
|
|
1026
|
+ for (TaBuildingImg img : imgs) {
|
1015
|
1027
|
TaBuildingImg Images = new TaBuildingImg();
|
1016
|
1028
|
Images.setBuildingId(buildingId);
|
1017
|
1029
|
Images.setImgType(img.getImgType());
|
|
@@ -1022,9 +1034,10 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
1022
|
1034
|
|
1023
|
1035
|
if (taBuildingImgMapper.insert(Images) < 1) {
|
1024
|
1036
|
continue;
|
1025
|
|
- };
|
|
1037
|
+ }
|
|
1038
|
+ ;
|
1026
|
1039
|
|
1027
|
|
- TaApartmentImg apartmentImg= new TaApartmentImg();
|
|
1040
|
+ TaApartmentImg apartmentImg = new TaApartmentImg();
|
1028
|
1041
|
apartmentImg.setApartmentId(apartmentId);
|
1029
|
1042
|
apartmentImg.setImgId(Images.getImgId());
|
1030
|
1043
|
apartmentImg.setStatus(1);
|