package digital.laboratory.platform.imr.controller;


import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.imr.query.DrugStatisticQuery;
import digital.laboratory.platform.imr.service.DrugHandingOverStatisticService;
import digital.laboratory.platform.imr.vo.DrugStatisticVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.annotation.Resource;

@RestController
@RequestMapping("/drugStatistic")
@Api(value = "DrugHandingOverStatisticController", tags = "毒品库送缴量统计相关接口")
public class DrugHandingOverStatisticController {

    @Resource
    private DrugHandingOverStatisticService drugHandingOverStatisticService;

    @ApiOperation("获取统计图的数据， 根据时间范围, 送缴单位，毒品种类返回数据")
    @PostMapping()
    public R statistic(@RequestBody DrugStatisticQuery query) {
        DrugStatisticVO vo = drugHandingOverStatisticService.statistic(query);
        return R.ok(vo);
    }

}
