|
@@ -13,16 +13,15 @@ import com.example.wholeestate.dao.*;
|
13
|
13
|
import com.example.wholeestate.model.*;
|
14
|
14
|
import com.example.wholeestate.service.IBuildingService;
|
15
|
15
|
import com.fasterxml.jackson.databind.util.ArrayBuilders;
|
|
16
|
+import com.google.common.collect.Maps;
|
16
|
17
|
import com.sun.org.apache.bcel.internal.generic.NEW;
|
17
|
18
|
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
|
18
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
20
|
import org.springframework.stereotype.Service;
|
|
21
|
+import org.springframework.util.CollectionUtils;
|
20
|
22
|
|
21
|
23
|
import java.time.LocalDateTime;
|
22
|
|
-import java.util.ArrayList;
|
23
|
|
-import java.util.Date;
|
24
|
|
-import java.util.HashMap;
|
25
|
|
-import java.util.List;
|
|
24
|
+import java.util.*;
|
26
|
25
|
|
27
|
26
|
/**
|
28
|
27
|
* <p>
|
|
@@ -52,8 +51,10 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
52
|
51
|
@Autowired
|
53
|
52
|
private BuildingApartmentMapper buildingApartmentMapper;
|
54
|
53
|
|
55
|
|
-// @Autowired
|
56
|
|
-// private ApartmentImgMapper apartmentImgMapper;
|
|
54
|
+ @Autowired
|
|
55
|
+ private BuildingDynamicMapper buildingDynamicMapper;
|
|
56
|
+
|
|
57
|
+
|
57
|
58
|
|
58
|
59
|
private IdGen idGen = IdGen.get();
|
59
|
60
|
|
|
@@ -400,6 +401,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
400
|
401
|
buildingImgBannerQueryWrapper.orderBy(true, true, "order_no");
|
401
|
402
|
List<BuildingImg> buildingBannerImg = buildingImgMapper.selectList(buildingImgBannerQueryWrapper);
|
402
|
403
|
|
|
404
|
+ building.setBuildingImg(buildingBannerImg);
|
|
405
|
+
|
403
|
406
|
// 楼盘户型
|
404
|
407
|
QueryWrapper<BuildingApartment> buildingApartmentQueryWrapper = new QueryWrapper<>();
|
405
|
408
|
buildingApartmentQueryWrapper.eq("building_id", building.getBuildingId());
|
|
@@ -413,7 +416,22 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
413
|
416
|
e.setBuildingImgList(buildingImgList);
|
414
|
417
|
});
|
415
|
418
|
|
416
|
|
-
|
|
419
|
+ // 项目最新动态
|
|
420
|
+ QueryWrapper<BuildingDynamic> buildingDynamicQueryWrapper = new QueryWrapper<>();
|
|
421
|
+ buildingApartmentQueryWrapper.eq("building_id", building.getBuildingId());
|
|
422
|
+ buildingApartmentQueryWrapper.orderByDesc("create_date");
|
|
423
|
+ Page<BuildingDynamic> page = new Page<>();
|
|
424
|
+ page.setCurrent(1);
|
|
425
|
+ page.setSize(1);
|
|
426
|
+ IPage<BuildingDynamic> buildingDynamicIPage = buildingDynamicMapper.selectPage(page, buildingDynamicQueryWrapper);
|
|
427
|
+ List<BuildingDynamic> records = buildingDynamicIPage.getRecords();
|
|
428
|
+
|
|
429
|
+ Map<String, Object> buildingMap = Maps.newHashMap();
|
|
430
|
+ buildingMap.put("info", building);
|
|
431
|
+ buildingMap.put("buildingApartment", buildingApartmentList);
|
|
432
|
+ buildingMap.put("buildingDynamic", records);
|
|
433
|
+
|
|
434
|
+ responseBean.addSuccess(buildingMap);
|
417
|
435
|
|
418
|
436
|
return responseBean;
|
419
|
437
|
}
|