package com.sckw.report.controller;

import com.sckw.core.web.response.HttpResult;
import com.sckw.report.model.vo.WbTOrderDataStsParam;
import com.sckw.report.service.KwOrderStatisticsService;
import lombok.AllArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @desc: 订单统计相关接口
 * @author: yzc
 * @date: 2023-09-11 14:31
 */
@AllArgsConstructor
@RestController
@RequestMapping("/kwOrderStatistics")
public class KwOrderStatisticsController {

    private final KwOrderStatisticsService kwOrderStatisticsService;

    /**
     * @desc: 工作台贸易订单数据统计
     * @author: yzc
     * @date: 2023-09-11 14:43
     * @Param params:
     * @return: com.sckw.core.web.response.HttpResult
     */
    @PostMapping(value = "/workbenchData", produces = MediaType.APPLICATION_JSON_VALUE)
    public HttpResult workbenchData(@RequestBody @Validated WbTOrderDataStsParam params) {
        return HttpResult.ok(kwOrderStatisticsService.workbenchData(params));
    }

    /**
     * @desc: 工作台采购订单列表
     * @author: yzc
     * @date: 2023-09-13 19:13
     * @return: com.sckw.core.web.response.HttpResult
     */
    @GetMapping(value = "/workbenchPurchaseList", produces = MediaType.APPLICATION_JSON_VALUE)
    public HttpResult workbenchPurchaseList() {
        return HttpResult.ok(kwOrderStatisticsService.workbenchPurchaseList());
    }

}
