package com.liangjian.dataplatform.member.controller;

import com.liangjian.dataplatform.member.entity.po.primary.SqlEntity;
import com.liangjian.dataplatform.member.service.IOrderFormStatisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/orderFormStatis")
@Api(value = "订单统计控制器", tags = "订单统计控制器", description = "订单统计控制器")
public class OrderFormStatisController {

    @Autowired
    private IOrderFormStatisService orderFormStatisService;

    @PostMapping("/getTermain")
    @ApiOperation(value = "获取终端",notes = "获取终端")
    public Map<String, Object> getTermain(){
        return orderFormStatisService.getTermain();
    }


    @GetMapping("/orderProvCount")
    @ApiOperation(value = "获取省份销售额排名",notes = "获取省份销售额排名")
    public Map<String, Object> orderProvCount(@ApiParam(value = "终端")  String terminal, @ApiParam(value = "日期")  String date){
        return orderFormStatisService.orderProvCount(terminal, date);
    }

    @GetMapping("/orderDay")
    @ApiOperation(value = "获取订单最近动态",notes = "获取订单最近动态")
    public Map<String, Object> orderDay(@ApiParam(value = "天数") @RequestParam Integer mDay){
        return orderFormStatisService.orderDay(mDay);
    }


    @GetMapping("/orderCount")
    @ApiOperation(value = "获取订单各数据",notes = "获取订单各数据")
    public Map<String, Object> orderCount(@ApiParam(value = "日期") String zKey, @ApiParam(value = "终端code")  String tagKey){
        return orderFormStatisService.orderCount(zKey, tagKey);
    }
}
