package cn.iocoder.yudao.module.inspection.controller.admin;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
import cn.iocoder.yudao.module.inspection.service.StatisticsService;
import lombok.RequiredArgsConstructor;
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;

/**
 * @BelongsProject: lanan-system
 * @BelongsPackage: cn.iocoder.yudao.module.inspection.controller.admin
 * @Author: 许
 * @CreateTime: 2025-08-05  11:16
 * @Description: 数据统计接口
 * @Version: 1.0
 */
@RestController
@RequestMapping("/inspection/statistics")
@RequiredArgsConstructor
public class StatisticsController {

    private final StatisticsService statisticsService;

    /**
     * @description: 获取员工项目统计信息
     * @author: 许
     * @date: 2025/8/5 11:21
     * @param: [dlInspectionProject]
     * @return: cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
     **/
    @PostMapping("/queryStaffStatisticsInfo")
    public CommonResult<?> queryStaffStatisticsInfo(@RequestBody DlInspectionProject dlInspectionProject) {
        return CommonResult.success(statisticsService.queryStaffStatisticsInfo(dlInspectionProject));
    }

    /**
     * @description: 获取员工检测项目统计 （根据车型）
     * @author: 许
     * @date: 2025/8/5 14:28
     * @param: [dlInspectionProject]
     * @return: cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
     **/
    @PostMapping("/queryStaffStatisticsGroupByGoods")
    public CommonResult<?> queryStaffStatisticsGroupByGoods(@RequestBody DlInspectionProject dlInspectionProject) {
        return CommonResult.success(statisticsService.queryStaffCountGroupByGoods(dlInspectionProject));
    }
}
