package com.ningdatech.carapi.report.controller;

import java.math.BigDecimal;

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.BulkCementThreeCityUsageBulletinManage;
import com.ningdatech.carapi.report.model.po.ReqBulkCementThreeCityUsageDataUploadPO;
import com.ningdatech.carapi.report.model.po.ReqDataUploadListPO;
import com.ningdatech.carapi.report.model.vo.ResBulkCementThreeCityUsageDataUploadDetailVO;
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 BulkCementThreeCityUsageBulletinController {

    private final BulkCementThreeCityUsageBulletinManage bulkCementThreeCityUsageBulletinManage;

    @PostMapping("/get/bulk-cement-three-city-usage/yearTarget")
    @ApiOperation("获取温台舟使用量年目标数据")
    public BigDecimal getBulkCementThreeCityUsageYearTarget(@Valid @RequestBody ReqBulkCementThreeCityUsageDataUploadPO po) {
        return bulkCementThreeCityUsageBulletinManage.getBulkCementThreeCityUsageYearTarget(po);
    }
    @PostMapping("/get/bulk-cement-three-city-usage/upload/data")
    @ApiOperation("获取温台舟使用量快报计算数据")
    public ResBulkCementThreeCityUsageDataUploadDetailVO getBulkCementThreeCityUsageUploadData(@Valid @RequestBody ReqBulkCementThreeCityUsageDataUploadPO po) {
        return bulkCementThreeCityUsageBulletinManage.getBulkCementThreeCityUsageUploadData(po);
    }
    @PostMapping("/bulk-cement-three-city-usage/data/upload")
    @ApiOperation("温台舟使用量数据上报")
    @WebLog(value = "温台舟使用量数据上报", modular = "数据上报-温台舟使用量数据上报")
    public String bulkCementThreeCityUsageDataUpload(@Valid @RequestBody ReqBulkCementThreeCityUsageDataUploadPO po) {
        return bulkCementThreeCityUsageBulletinManage.bulkCementThreeCityUsageDataUpload(po);
    }
    @PostMapping("/bulk-cement-three-city-usage/data/upload/list")
    @ApiOperation("温台舟使用量数据上报列表")
    public PageVo<ResDataUploadListVO> dataUploadList(@Valid @RequestBody ReqDataUploadListPO po) {
        return bulkCementThreeCityUsageBulletinManage.dataUploadList(po);
    }
}
