package cn.com.ty.lift.batch.applet.controller;

import cn.com.ty.lift.batch.applet.dao.model.request.EmergencyRepairDataRequest;
import cn.com.ty.lift.batch.applet.service.EmergencyRepairDataService;
import cn.com.xwy.boot.web.dto.RestResponse;
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;

/**
 * @author huangyuan
 * @date 2020/2/3
 * @description 小程序急修数据统计
 */
@RestController
@RequestMapping("/applet/emergency")
public class EmergencyRepairDataStatisticsController {

    @Resource
    private EmergencyRepairDataService emergencyRepairDataService;

    /**
     * @param
     * @return
     * @description 获取急修台量
     * @date 2020/2/4 3:01 下午
     */
    @RequestMapping("/getEmergencyUnits")
    public RestResponse getEmergencyUnits(@RequestBody EmergencyRepairDataRequest emergencyRepairDataRequest) {
        return emergencyRepairDataService.getEachMonthUnits(emergencyRepairDataRequest);
    }

    /**
     * @param
     * @return
     * @description 急修时间统计：接单时间，到场时间，修梯时间
     * @date 2020/2/5 9:20 上午
     */
    @RequestMapping("/emergencyTimeStatistics")
    public RestResponse emergencyTimeStatistics(@RequestBody EmergencyRepairDataRequest emergencyRepairDataRequest) {
        return emergencyRepairDataService.emergencyTimeStatistics(emergencyRepairDataRequest);
    }

    /**
     * @param
     * @return
     * @description 急修状态统计
     * @date 2020/2/5 11:30 上午
     */
    @RequestMapping("/emergencyStatus")
    public RestResponse emergencyStatus(@RequestBody EmergencyRepairDataRequest emergencyRepairDataRequest) {
        return emergencyRepairDataService.emergencyStatus(emergencyRepairDataRequest);
    }

}
