|
|
@@ -26,9 +26,13 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
-import org.springblade.community.entity.Agency;
|
|
|
-import org.springblade.community.entity.Room;
|
|
|
-import org.springblade.community.service.IAgencyService;
|
|
|
+import org.springblade.community.entity.*;
|
|
|
+import org.springblade.community.feign.BuildingClient;
|
|
|
+import org.springblade.community.feign.FloorClient;
|
|
|
+import org.springblade.community.feign.RoomClient;
|
|
|
+import org.springblade.community.feign.UnitClient;
|
|
|
+import org.springblade.community.service.*;
|
|
|
+import org.springblade.community.vo.*;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.BladeUser;
|
|
|
@@ -43,10 +47,7 @@ import org.springblade.third.doordevice.feign.IDoorDeviceButtClient;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import org.springblade.community.entity.Residential;
|
|
|
-import org.springblade.community.vo.ResidentialVO;
|
|
|
import org.springblade.community.wrapper.ResidentialWrapper;
|
|
|
-import org.springblade.community.service.IResidentialService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -70,6 +71,10 @@ public class ResidentialController extends BladeController {
|
|
|
private final ICompanyClient companyClient;
|
|
|
private final IDoorDeviceButtClient doorDeviceButtClient;
|
|
|
private final IConfClient confClient;
|
|
|
+ private final IBuildingService buildingService;
|
|
|
+ private final IUnitService unitService;
|
|
|
+ private final IFloorService floorService;
|
|
|
+ private final IRoomService roomService;
|
|
|
|
|
|
/**
|
|
|
* 查看详情,返回基本信息加所属物业名称和物业电话
|
|
|
@@ -187,4 +192,24 @@ public class ResidentialController extends BladeController {
|
|
|
queryWrapper.orderByDesc(Residential::getCreateTime);
|
|
|
return R.data(residentialService.list(queryWrapper));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 统计小区楼栋、单元、住户数量
|
|
|
+ */
|
|
|
+ @GetMapping("/statisticResidential")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "小区统计", notes = "传入residential")
|
|
|
+ public R statisticResidential(Residential residential){
|
|
|
+ QueryWrapper queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("residential_id",residential.getId());
|
|
|
+ List<Building> buildingList = buildingService.list(queryWrapper);
|
|
|
+ residential.setBuildingCount(buildingList.size());
|
|
|
+ List<Unit> unitList = unitService.list(queryWrapper);
|
|
|
+ residential.setUnitCount(unitList.size());
|
|
|
+ List<Floor> floorList = floorService.list(queryWrapper);
|
|
|
+ residential.setFloorCount(floorList.size());
|
|
|
+ List<Room> roomList = roomService.list(queryWrapper);
|
|
|
+ residential.setRoomCount(roomList.size());
|
|
|
+ return R.status(residentialService.updateById(residential));
|
|
|
+ }
|
|
|
}
|