package org.security.trans.dataStatistics.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.security.trans.dataStatistics.dto.StatisticsDataDTO;
import org.security.trans.dataStatistics.service.ProjectDataService;
import org.security.trans.dataStatistics.vo.HistogramDataVO;
import org.security.trans.dataStatistics.vo.PieChartDataVO;
import org.security.trans.projectBudgetManagement.dto.ProjectDTO;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：wzf
 * @apiNote ：项目管理数据统计
 * @since ：Created in 2022/12/2 15:22
 */
@RestController
@AllArgsConstructor
@RequestMapping("/statistics/project")
public class ProjectDataController {

	private final ProjectDataService projectDataService;


	/**
	 * 项目类型饼图
	 */
	@GetMapping("/pie-type")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "项目类型饼图", notes = "statisticsDataDTO")
	public R<List<PieChartDataVO>> getProjectTypeData(StatisticsDataDTO statisticsDataDTO) {
		return R.data(projectDataService.getProjectTypeData(statisticsDataDTO));
	}


	/**
	 * 项目节点柱状图
	 */
	@GetMapping("/histogram-node")
	@ApiOperationSupport(order = 2)
	@ApiOperation(value = "项目节点柱状图", notes = "statisticsDataDTO")
	public R<List<HistogramDataVO>> getProjectNodeData(StatisticsDataDTO statisticsDataDTO) {
		return R.data(projectDataService.getProjectNodeData(statisticsDataDTO));
	}


	/**
	 * 项目合同金额饼图
	 */
	@GetMapping("/pie-concat-amt")
	@ApiOperationSupport(order = 3)
	@ApiOperation(value = "项目合同金额饼图", notes = "statisticsDataDTO")
	public R<List<PieChartDataVO>> getConcatAmtData(StatisticsDataDTO statisticsDataDTO) {
		return R.data(projectDataService.getConcatAmtData(statisticsDataDTO));
	}


	/**
	 * 项目支付计划-支付情况饼图
	 */
	@GetMapping("/pie-pay")
	@ApiOperationSupport(order = 4)
	@ApiOperation(value = "项目支付计划-支付情况饼图", notes = "statisticsDataDTO")
	public R<List<PieChartDataVO>> getPayData(StatisticsDataDTO statisticsDataDTO) {
		return R.data(projectDataService.getPayData(statisticsDataDTO));
	}
}
