|
@@ -28,15 +28,27 @@ public class LargeHousingLandServiceImpl extends ServiceImpl<PlatHousingLandMapp
|
|
|
|
|
|
|
|
|
public Map<String, Object> getStockOfEstateResources(){
|
|
|
+ String[] strArr = {"办公用房", "周转用房", "生产管理", "教育培训用房", "交流干部住房", "单身公寓/单身宿舍"};
|
|
|
+ List<LargeHousingLand> arr = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 6; i++){
|
|
|
+ LargeHousingLand land = new LargeHousingLand();
|
|
|
+ land.setNum(0L);
|
|
|
+ land.setAcreage(BigDecimal.valueOf(0));
|
|
|
+ land.setType((long) i);
|
|
|
+ land.setTypeName(strArr[i]);
|
|
|
+ arr.add(land);
|
|
|
+ }
|
|
|
List<LargeHousingLand> list = platHousingLandMapper.getStockOfEstateResources();
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("pieChart", list);
|
|
|
BigDecimal housingAcreage = new BigDecimal(0);
|
|
|
Long housingNum = 0L;
|
|
|
for (LargeHousingLand it : list){
|
|
|
housingAcreage = housingAcreage.add(it.getAcreage());
|
|
|
housingNum += it.getNum();
|
|
|
+ arr.get(it.getType().intValue()).setAcreage(it.getAcreage());
|
|
|
+ arr.get(it.getType().intValue()).setNum(it.getNum());
|
|
|
}
|
|
|
+ map.put("pieChart", arr);
|
|
|
map.put("housingNum", housingNum);
|
|
|
map.put("housingAcreage", housingAcreage);
|
|
|
return map;
|