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.basic.dto.EmployeeDTO;
import org.security.trans.dataStatistics.service.OutEmployeeDataService;
import org.security.trans.dataStatistics.vo.HistogramDataVO;
import org.security.trans.dataStatistics.vo.PieChartDataVO;
import org.security.trans.outsourcing.dto.OutEmployeeDTO;
import org.springblade.core.mp.support.Query;
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 11:32
 */
@RestController
@AllArgsConstructor
@RequestMapping("/out-employee-count")
public class OutEmployeeDataController {

	private final OutEmployeeDataService outEmployeeDataService;


	/**
	 * 性别构成饼图
	 */
	@GetMapping("/pie-sex")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "性别构成饼图", notes = "employeeDTO")
	public R<List<PieChartDataVO>> getSexData(OutEmployeeDTO outEmployeeDTO) {
		return R.data(outEmployeeDataService.getSexData(outEmployeeDTO));
	}


	/**
	 * 年龄结构柱状图
	 */
	@GetMapping("/histogram-age")
	@ApiOperationSupport(order = 2)
	@ApiOperation(value = "年龄结构柱状图", notes = "employeeDTO")
	public R<List<HistogramDataVO>> getAgeData(OutEmployeeDTO outEmployeeDTO) {
		return R.data(outEmployeeDataService.getAgeData(outEmployeeDTO));
	}


	/**
	 * 民族构成饼图
	 */
	@GetMapping("/pie-nation-type")
	@ApiOperationSupport(order = 3)
	@ApiOperation(value = "民族构成饼图", notes = "employeeDTO")
	public R<List<PieChartDataVO>> getNationTypeData(OutEmployeeDTO outEmployeeDTO) {
		return R.data(outEmployeeDataService.getNationTypeData(outEmployeeDTO));
	}

	/**
	 * 政治面貌构成饼图
	 */
	@GetMapping("/pie-political-outlook-type")
	@ApiOperationSupport(order = 4)
	@ApiOperation(value = "政治面貌构成饼图", notes = "employeeDTO")
	public R<List<PieChartDataVO>> getPoliticalOutlookTypeData(OutEmployeeDTO outEmployeeDTO) {
		return R.data(outEmployeeDataService.getPoliticalOutlookTypeData(outEmployeeDTO));
	}
}
