package com.ningdatech.carapi.report.controller;

import javax.validation.Valid;

import org.springframework.validation.annotation.Validated;
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 com.ningdatech.basic.model.PageVo;
import com.ningdatech.carapi.report.manage.BulkCementLogFacStaManage;
import com.ningdatech.carapi.report.model.dto.ReqBulkCementLogFacStaDataUploadDTO;
import com.ningdatech.carapi.report.model.po.ReqBulkCementLogFacStaDataUploadPO;
import com.ningdatech.carapi.report.model.po.ReqDataUploadListPO;
import com.ningdatech.carapi.report.model.vo.ResBulkCementLogFacStaDataUploadDetailVO;
import com.ningdatech.carapi.report.model.vo.ResBulkCementLogFacStaRelatedDataVO;
import com.ningdatech.carapi.report.model.vo.ResDataUploadListVO;
import com.ningdatech.log.annotation.WebLog;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;

/**
 * <p>
 * 散装水泥直报系统 前端控制器
 * </p>
 *
 * @author CMM
 * @since 2023-09-27
 */
@RequestMapping("/api/v1/direct/report/system")
@RestController
@Api(tags = "数据上报-散装水泥物流设施统计年报")
@Validated
@RequiredArgsConstructor
public class BulkCementLogFacStaAnnualReportController {

    private final BulkCementLogFacStaManage bulkCementLogFacStaManage;

    @PostMapping("/get/bulk-cement-log-fac-sta/related/data")
    @ApiOperation("获取散装水泥物流设施统计年报相关数据")
    public ResBulkCementLogFacStaRelatedDataVO getConcreteSupplyRelatedData(@Valid @RequestBody ReqBulkCementLogFacStaDataUploadDTO dto) {
        return bulkCementLogFacStaManage.getBulkCementLogFacStaRelatedData(dto);
    }

    @PostMapping("/get/bulk-cement-log-fac-sta/upload/data")
    @ApiOperation("获取散装水泥物流设施统计年报计算数据")
    public ResBulkCementLogFacStaDataUploadDetailVO getBulkCementLogFacStaUploadData(@Valid @RequestBody ReqBulkCementLogFacStaDataUploadDTO dto) {
        return bulkCementLogFacStaManage.getBulkCementLogFacStaUploadData(dto);
    }
    @PostMapping("/bulk-cement-log-fac-sta/data/upload")
    @ApiOperation("散装水泥物流设施统计年报数据上报")
    @WebLog(value = "散装水泥物流设施统计年报数据上报", modular = "数据上报-散装水泥物流设施统计年报数据上报")
    public String bulkCementSupplyDataUpload(@Valid @RequestBody ReqBulkCementLogFacStaDataUploadPO po) {
        return bulkCementLogFacStaManage.bulkCementLogFacStaDataUpload(po);
    }
    @PostMapping("/bulk-cement-log-fac-sta/data/upload/list")
    @ApiOperation("散装水泥物流设施统计年报年报数据上报列表")
    public PageVo<ResDataUploadListVO> dataUploadList(@Valid @RequestBody ReqDataUploadListPO po) {
        return bulkCementLogFacStaManage.dataUploadList(po);
    }
}
