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.MaterialLogEquipStaManage;
import com.ningdatech.carapi.report.model.dto.ReqMaterialLogEquipStaDataUploadDTO;
import com.ningdatech.carapi.report.model.po.ReqDataUploadListPO;
import com.ningdatech.carapi.report.model.po.ReqMaterialLogEquipStaDataUploadPO;
import com.ningdatech.carapi.report.model.vo.ResDataUploadListVO;
import com.ningdatech.carapi.report.model.vo.ResMaterialLogEquipStaDataUploadDetailVO;
import com.ningdatech.carapi.report.model.vo.ResMaterialLogEquipStaRelatedDataVO;
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 MaterialLogEquipStaAnnualReportController {

    private final MaterialLogEquipStaManage materialLogEquipStaManage;

    @PostMapping("/get/material-log-equip-sta/related/data")
    @ApiOperation("获取散装水泥、预拌混凝土、干混砂浆物流装备统计年报相关数据")
    public ResMaterialLogEquipStaRelatedDataVO getConcreteSupplyRelatedData(@Valid @RequestBody ReqMaterialLogEquipStaDataUploadDTO dto) {
        return materialLogEquipStaManage.getMaterialLogEquipStaRelatedData(dto);
    }

    @PostMapping("/get/material-log-equip-sta/upload/data")
    @ApiOperation("获取散装水泥、预拌混凝土、干混砂浆物流装备统计年报计算数据")
    public ResMaterialLogEquipStaDataUploadDetailVO getBulkCementLogFacStaUploadData(@Valid @RequestBody ReqMaterialLogEquipStaDataUploadDTO dto) {
        return materialLogEquipStaManage.getMaterialLogEquipStaUploadData(dto);
    }
    @PostMapping("/material-log-equip-sta/data/upload")
    @ApiOperation("散装水泥、预拌混凝土、干混砂浆物流装备统计年报数据上报")
    @WebLog(value = "非禁现区散装水泥销售使用情况年报数据上报", modular = "数据上报-非禁现区散装水泥销售使用情况年报数据上报")
    public String bulkCementSupplyDataUpload(@Valid @RequestBody ReqMaterialLogEquipStaDataUploadPO po) {
        return materialLogEquipStaManage.materialLogEquipStaDataUpload(po);
    }
    @PostMapping("/material-log-equip-sta/data/upload/list")
    @ApiOperation("散装水泥、预拌混凝土、干混砂浆物流装备统计年报数据上报列表")
    public PageVo<ResDataUploadListVO> dataUploadList(@Valid @RequestBody ReqDataUploadListPO po) {
        return materialLogEquipStaManage.dataUploadList(po);
    }
}
