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.ConcreteSupplyBulletinManage;
import com.ningdatech.carapi.report.model.po.ReqConcreteSupplyDataUploadPO;
import com.ningdatech.carapi.report.model.po.ReqDataUploadListPO;
import com.ningdatech.carapi.report.model.vo.ResConcreteSupplyDataUploadDetailVO;
import com.ningdatech.carapi.report.model.vo.ResConcreteSupplyRelatedDataVO;
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 ConcreteSupplyBulletinController {

    private final ConcreteSupplyBulletinManage concreteSupplyBulletinManage;

    @PostMapping("/get/concrete-supply/related/data")
    @ApiOperation("获取混凝土供应量相关数据")
    public ResConcreteSupplyRelatedDataVO getConcreteSupplyRelatedData(@Valid @RequestBody ReqConcreteSupplyDataUploadPO po) {
        return concreteSupplyBulletinManage.getConcreteSupplyRelatedData(po);
    }
    @PostMapping("/get/concrete-supply/upload/data")
    @ApiOperation("获取混凝土供应量快报计算数据")
    public ResConcreteSupplyDataUploadDetailVO getConcreteSupplyUploadData(@Valid @RequestBody ReqConcreteSupplyDataUploadPO po) {
        return concreteSupplyBulletinManage.getConcreteSupplyUploadData(po);
    }
    @PostMapping("/concrete-supply/data/upload")
    @ApiOperation("混凝土供应量快报数据上报")
    @WebLog(value = "混凝土供应量快报数据上报", modular = "数据上报-混凝土供应量快报数据上报")
    public String concreteSupplyDataUpload(@Valid @RequestBody ReqConcreteSupplyDataUploadPO po) {
        return concreteSupplyBulletinManage.concreteSupplyDataUpload(po);
    }
    @PostMapping("/concrete-supply/data/upload/list")
    @ApiOperation("混凝土供应量数据上报列表")
    public PageVo<ResDataUploadListVO> dataUploadList(@Valid @RequestBody ReqDataUploadListPO po) {
        return concreteSupplyBulletinManage.dataUploadList(po);
    }
}
