xieb
2023-10-26 f6ec72eb97af8b98ec99230850d297075496e5c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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);
    }
 
}