package com.zjrs.ggfw.sggfw.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.zjrs.ggfw.sggfw.bpo.ExportPdfQueryBPO;
import com.zjrs.ggfw.sggfw.dto.Uca919DTO;
import com.zjrs.ggfw.sggfw.dto.Ucf074DTO;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
@Api(tags = "省公共服务接口:打印报表生成接口")
@RestController
@RequestMapping("/api/sggfw/exportPdfQuery")
public class ExportPdfQueryController {
    private static final Logger LOG = LoggerFactory.getLogger(ExportPdfQueryController.class);
    @Resource
    private ExportPdfQueryBPO exportPdfQueryBPO;

    @ApiOperation(value = "个人参保证明")
    @PostMapping("/ucf074")
    public void ucf074(@RequestBody @Valid Ucf074DTO dto, HttpServletResponse res) {
        try {
            exportPdfQueryBPO.ucf074(dto,res);
        } catch (Exception e) {
            e.printStackTrace();
            LOG.error(e.getMessage());
        }
    }
    @ApiOperation(value = "个人权益单打印")
    @PostMapping("/uca919")
    public void uca919(@RequestBody @Valid Uca919DTO dto, HttpServletResponse res) {
        try {
            exportPdfQueryBPO.uca919(dto,res);
        } catch (Exception e) {
            e.printStackTrace();
            LOG.error(e.getMessage());
        }
    }
}
