日照智慧社区接口服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

95 lines
3.1 KiB

package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.excel.IcResiUserConfirmExcel;
import com.epmet.service.IcResiUserConfirmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 居民信息审核表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@RestController
@RequestMapping("icResiUserConfirm")
public class IcResiUserConfirmController {
@Autowired
private IcResiUserConfirmService icResiUserConfirmService;
@RequestMapping("page")
public Result<PageData<IcResiUserConfirmDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiUserConfirmDTO> page = icResiUserConfirmService.page(params);
return new Result<PageData<IcResiUserConfirmDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcResiUserConfirmDTO> get(@PathVariable("id") String id){
IcResiUserConfirmDTO data = icResiUserConfirmService.get(id);
return new Result<IcResiUserConfirmDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcResiUserConfirmDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiUserConfirmService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcResiUserConfirmDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiUserConfirmService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiUserConfirmService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcResiUserConfirmDTO> list = icResiUserConfirmService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcResiUserConfirmExcel.class);
}
/**
* 审核
*
* @Param tokenDto
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/6/1 17:26
*/
@PostMapping("confirm")
public Result confirm(@RequestBody IcResiUserConfirmDTO dto) {
icResiUserConfirmService.confirm(dto);
return new Result();
}
}