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);
|
}
|
|
}
|