| | |
| | | */ |
| | | package org.springblade.modules.house.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.house.excel.HouseImporter; |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.excel.UserImporter; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.excel.HouseAndHoldExcel; |
| | | import org.springblade.modules.house.excel.HouseAndHoldImporter; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | import org.springblade.modules.house.excel.HouseImporter; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.house.wrapper.HouseWrapper; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 房屋 控制器 |
| | |
| | | /** |
| | | * 导入房屋 |
| | | */ |
| | | @GetMapping("import-house") |
| | | @PostMapping("import-house") |
| | | public R importHouse(MultipartFile file, Integer isCovered) { |
| | | HouseImporter houseImporter = new HouseImporter(houseService, isCovered == 1); |
| | | ExcelUtil.save(file, houseImporter, HouseExcel.class); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入房屋及住户/租户人员数据 |
| | | */ |
| | | @PostMapping("import-houseAndHold") |
| | | public R importHouseAndHold(MultipartFile file, Integer isCovered) { |
| | | HouseAndHoldImporter houseImporter = new HouseAndHoldImporter(houseService, isCovered == 1); |
| | | ExcelUtil.save(file, houseImporter, HouseAndHoldExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("getHouseStatistics") |
| | | public R getHouseStatistics(@RequestParam("code") String code, |
| | | @RequestParam("roleType") String roleType, |
| | | @RequestParam(value = "aoiCode", required = false) String aoiCode, |
| | | @RequestParam(value = "buildingCode", required = false) String buildingCode, |
| | | @RequestParam(value = "unitCode", required = false) String unitCode) { |
| | | Map<String, Object> result = houseService.getHouseStatistics(code, roleType,aoiCode,buildingCode,unitCode); |
| | | return R.data(result); |
| | | } |
| | | |
| | | } |