forked from luyan/epmet-cloud-lingshan
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.
83 lines
3.0 KiB
83 lines
3.0 KiB
|
3 years ago
|
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.UpdateGroup;
|
||
|
|
import com.epmet.commons.tools.validator.group.DefaultGroup;
|
||
|
|
import com.epmet.dto.IcPointVaccinesInoculationDTO;
|
||
|
|
import com.epmet.excel.IcPointVaccinesInoculationExcel;
|
||
|
|
import com.epmet.service.IcPointVaccinesInoculationService;
|
||
|
|
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-20
|
||
|
|
*/
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("icPointVaccinesInoculation")
|
||
|
|
public class IcPointVaccinesInoculationController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private IcPointVaccinesInoculationService icPointVaccinesInoculationService;
|
||
|
|
|
||
|
|
@RequestMapping("page")
|
||
|
|
public Result<PageData<IcPointVaccinesInoculationDTO>> page(@RequestParam Map<String, Object> params){
|
||
|
|
PageData<IcPointVaccinesInoculationDTO> page = icPointVaccinesInoculationService.page(params);
|
||
|
|
return new Result<PageData<IcPointVaccinesInoculationDTO>>().ok(page);
|
||
|
|
}
|
||
|
|
|
||
|
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
|
||
|
|
public Result<IcPointVaccinesInoculationDTO> get(@PathVariable("id") String id){
|
||
|
|
IcPointVaccinesInoculationDTO data = icPointVaccinesInoculationService.get(id);
|
||
|
|
return new Result<IcPointVaccinesInoculationDTO>().ok(data);
|
||
|
|
}
|
||
|
|
|
||
|
|
@NoRepeatSubmit
|
||
|
|
@PostMapping("save")
|
||
|
|
public Result save(@RequestBody IcPointVaccinesInoculationDTO dto){
|
||
|
|
//效验数据
|
||
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||
|
|
icPointVaccinesInoculationService.save(dto);
|
||
|
|
return new Result();
|
||
|
|
}
|
||
|
|
|
||
|
|
@NoRepeatSubmit
|
||
|
|
@PutMapping("update")
|
||
|
|
public Result update(@RequestBody IcPointVaccinesInoculationDTO dto){
|
||
|
|
//效验数据
|
||
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||
|
|
icPointVaccinesInoculationService.update(dto);
|
||
|
|
return new Result();
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("delete")
|
||
|
|
public Result delete(@RequestBody String[] ids){
|
||
|
|
//效验数据
|
||
|
|
AssertUtils.isArrayEmpty(ids, "id");
|
||
|
|
icPointVaccinesInoculationService.delete(ids);
|
||
|
|
return new Result();
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("export")
|
||
|
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||
|
|
List<IcPointVaccinesInoculationDTO> list = icPointVaccinesInoculationService.list(params);
|
||
|
|
ExcelUtils.exportExcelToTarget(response, null, list, IcPointVaccinesInoculationExcel.class);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|