| | |
| | | */ |
| | | 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.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | 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.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.modules.house.excel.ExportHouseTenantExcel; |
| | | import org.springblade.modules.house.excel.HouseTenantExcel; |
| | | import org.springblade.modules.house.excel.ImportHouseholdExcel; |
| | | import org.springblade.modules.house.service.IHouseTenantService; |
| | | import org.springblade.modules.house.vo.HouseTenantVO; |
| | | import org.springblade.modules.house.wrapper.HouseTenantWrapper; |
| | | import org.springblade.modules.house.service.IHouseTenantService; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 租户管理 控制器 |
| | |
| | | return R.status(houseTenantService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | @GetMapping("downLoadTenantTemplate") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "导出模板") |
| | | public void downLoadTenantTemplate(HttpServletResponse response) { |
| | | List<HouseTenantExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "租客数据模板", "租客数据表", list, HouseTenantExcel.class); |
| | | } |
| | | |
| | | @GetMapping("export-tenant") |
| | | @ApiOperationSupport(order = 15) |
| | | @ApiOperation(value = "导出租客") |
| | | public void exportTenant(HttpServletResponse response) { |
| | | List<ExportHouseTenantExcel> list = houseTenantService.export(); |
| | | ExcelUtil.export(response, "租客数据" + DateUtil.time(), "租客数据表", list, ExportHouseTenantExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导入住户 |
| | | */ |
| | | @PostMapping("import-tenant") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导入住户", notes = "传入excel") |
| | | public R importUser(MultipartFile file, Integer isCovered) { |
| | | String data = houseTenantService.importUserTenant(ExcelUtil.read(file, HouseTenantExcel.class),isCovered==1); |
| | | return R.data(200,data,null); |
| | | } |
| | | |
| | | |
| | | } |