| | |
| | | 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.secure.BladeUser; |
| | | 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.secure.utils.AuthUtil; |
| | | 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.HouseHoldExcel; |
| | | import org.springblade.modules.house.excel.HouseHoldImporter; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | |
| | | import org.springblade.modules.house.wrapper.HouseholdWrapper; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 住户 控制器 |
| | |
| | | public R<HouseholdVO> detail(HouseholdEntity household) { |
| | | HouseholdEntity detail = householdService.getOne(Condition.getQueryWrapper(household)); |
| | | return R.data(HouseholdWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 住户 自定义查询详情 |
| | | * @param household |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDetail") |
| | | @ApiOperation(value = "详情", notes = "传入household") |
| | | public R getDetail(HouseholdEntity household) { |
| | | return R.data(householdService.getDetail(household)); |
| | | } |
| | | /** |
| | | * 住户 分页 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 住户 自定义新增或修改 |
| | | * @param household |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveOrUpdateHousehold") |
| | | @ApiOperation(value = "自定义新增或修改", notes = "传入household") |
| | | public R saveOrUpdateHousehold(@Valid @RequestBody HouseholdEntity household) { |
| | | return R.status(householdService.saveOrUpdateHousehold(household)); |
| | | } |
| | | |
| | | /** |
| | | * 住户 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | |
| | | return R.status(householdService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 住户审核统计 |
| | | */ |
| | | @PostMapping("/statistics") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "住户审核统计", notes = "网格员调用") |
| | | public R remove( ) { |
| | | return R.data(householdService.statistics(AuthUtil.getUserId())); |
| | | } |
| | | |
| | | /** |
| | | * 导入用户 |
| | | */ |
| | | @PostMapping("import-household") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导入住户", notes = "传入excel") |
| | | public R importUser(MultipartFile file, Integer isCovered) { |
| | | HouseHoldImporter houseHoldImporter = new HouseHoldImporter(householdService, isCovered == 1); |
| | | ExcelUtil.save(file, houseHoldImporter, HouseHoldExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 导出用户 |
| | | */ |
| | | @GetMapping("export-household") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "导出住户", notes = "传入user") |
| | | public void exportUser(HouseholdVO household, HttpServletResponse response) { |
| | | List<HouseHoldExcel> list = householdService.export(household); |
| | | ExcelUtil.export(response, "住户户数据" + DateUtil.time(), "住户数据表", list, HouseHoldExcel.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 住户对应物业,网格,公安负责人查询 |
| | | * @param household |
| | | * @return |
| | | */ |
| | | @GetMapping("/getHouseholdOtherInfo") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "住户对应物业,网格,公安负责人查询", notes = "住户对应物业,网格,公安负责人查询") |
| | | public R getHouseholdOtherInfo(HouseholdVO household) { |
| | | return R.data(householdService.getHouseholdOtherInfo(household)); |
| | | } |
| | | |
| | | /** |
| | | * 用户信息统计 |
| | | * @param code |
| | | * @param roleType |
| | | * @return |
| | | */ |
| | | @GetMapping("/getHouseHoldStatistics") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "用户信息统计", notes = " ") |
| | | public R getHouseHoldStatistics(@RequestParam("code") String code, @RequestParam("roleType") String roleType) { |
| | | return R.data(householdService.getHouseHoldStatistics(code,roleType)); |
| | | } |
| | | |
| | | |
| | | } |