package com.panzhihua.service_community.api;
|
|
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.common.model.vos.community.ComMngCarExcelVO;
|
import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO;
|
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
|
import com.panzhihua.service_community.service.ComMngVillageService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import javax.validation.Valid;
|
import java.util.List;
|
|
/**
|
* @Author: llming
|
* @Description: 实有房屋管理
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/")
|
public class ComMngVillageApi {
|
@Resource
|
private ComMngVillageService comMngVillageService;
|
|
/**
|
* 新增实有房屋
|
* @param comMngVillageVO 新增信息
|
* @return 新增结果
|
*/
|
@PostMapping("addvillage")
|
@Transactional(rollbackFor = Exception.class)
|
public R addVillage(@Valid @RequestBody ComMngVillageVO comMngVillageVO) {
|
return comMngVillageService.addComActVillage(comMngVillageVO);
|
}
|
|
/**
|
* 分页查询实有房屋
|
* @param pageComMngVillageDTO 查询条件
|
* @return 新增结果
|
*/
|
@PostMapping("pagevillage")
|
public R pageVillage(@RequestBody PageComMngVillageDTO pageComMngVillageDTO) {
|
return comMngVillageService.pageComActVillage(pageComMngVillageDTO);
|
}
|
|
/**
|
* 查询实有房屋
|
* @param comMngVillageVO 查询条件
|
* @return 新增结果
|
*/
|
@PostMapping("listvillage")
|
public R listVillage(@RequestBody ComMngVillageVO comMngVillageVO) {
|
return comMngVillageService.listComActVillage(comMngVillageVO);
|
}
|
|
/**
|
* 删除实有房屋
|
* @param Ids 动态id
|
* @return 删除结果
|
*/
|
@PostMapping("deletevillage")
|
@Transactional(rollbackFor = Exception.class)
|
public R delectVillage(@RequestBody List<Long> Ids) {
|
return comMngVillageService.delecComActVillage(Ids);
|
}
|
|
/**
|
* 社区后台导入实有房屋
|
* @param list 数据
|
* @param communityId 社区编号
|
* @return
|
*/
|
@PostMapping("/village/import")
|
@Transactional(rollbackFor = Exception.class)
|
public R listSaveMngCarExcelVO(@RequestBody List<ComMngVillageServeExcelVO> list, @RequestParam(value = "communityId") Long communityId){
|
return comMngVillageService.listSaveVillage(list,communityId);
|
}
|
|
}
|