xiaoyi
2 天以前 b5e1bceabb36fe1d1e5e88397280d12e7044c6dd
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
package cn.iocoder.yudao.module.mes.controller.admin.safety;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.mes.controller.admin.safety.vo.ledger.SafetyLedgerExportReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.safety.vo.ledger.SafetyOverviewRespVO;
import cn.iocoder.yudao.module.mes.service.safety.SafetyLedgerExportService;
import cn.iocoder.yudao.module.mes.service.safety.SafetyOverviewService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.io.IOException;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * 安全生产 - 总览统计与标准化台账导出
 *
 * @author 超级管理员
 */
@Tag(name = "管理后台 - 安全生产-台账与统计")
@RestController
@RequestMapping("/safety/ledger")
@Validated
public class SafetyLedgerController {
 
    @Resource
    private SafetyOverviewService overviewService;
    @Resource
    private SafetyLedgerExportService ledgerExportService;
 
    @GetMapping("/overview")
    @Operation(summary = "获得安全生产总览统计")
    @PreAuthorize("@ss.hasPermission('safety:ledger:query')")
    public CommonResult<SafetyOverviewRespVO> overview() {
        return success(overviewService.getOverview());
    }
 
    @GetMapping("/export")
    @Operation(summary = "导出电力行业安全标准化台账(全套或多选其一)")
    @PreAuthorize("@ss.hasPermission('safety:ledger:export')")
    public void export(@Valid SafetyLedgerExportReqVO reqVO, HttpServletResponse response) throws IOException {
        ledgerExportService.export(reqVO, response);
    }
 
}