package cn.gistack.sm.sjztmd.controller;
|
|
import cn.gistack.sm.sjztmd.excel.AttResStagCapDiscExcel;
|
import cn.gistack.sm.sjztmd.excel.TbRelResUserExcel;
|
import cn.gistack.sm.sjztmd.excel.TbRelResUserImport;
|
import cn.gistack.sm.sjztmd.service.ITbRelResUserService;
|
import io.swagger.annotations.Api;
|
import lombok.AllArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springblade.core.excel.util.ExcelUtil;
|
import org.springblade.core.tool.api.R;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
/**
|
* @PROJECT_NAME: skjcmanager
|
* @DESCRIPTION:
|
* @USER: aix
|
* @DATE: 2023/10/26 11:27
|
*/
|
@Slf4j
|
@Api(tags = "中台水库填报责任人")
|
@RestController
|
@RequestMapping("/sjztmd/tbRelResUser")
|
@AllArgsConstructor
|
public class TbRelResUserController {
|
|
private ITbRelResUserService tbRelResUserService;
|
|
/**
|
* 导入填报责任人
|
*/
|
@PostMapping("importTbRelResUser")
|
public R importTbRelResUser(MultipartFile file) {
|
TbRelResUserImport tbRelResUserImport = new TbRelResUserImport(tbRelResUserService);
|
ExcelUtil.save(file, tbRelResUserImport, TbRelResUserExcel.class);
|
return R.success("操作成功");
|
}
|
|
/**
|
* 导出库容模板
|
*/
|
@GetMapping("exportTbRelResUserTemplate")
|
public void exportTbRelResUserTemplate(HttpServletResponse response) {
|
List<TbRelResUserExcel> list = new ArrayList<>();
|
ExcelUtil.export(response, "水库填报责任人", "水库填报责任人", list, TbRelResUserExcel.class);
|
}
|
|
}
|