package com.mosty.wzzx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.wzzx.WztjQuery;
import com.mosty.base.model.entity.wzzx.TbWzSblswz;
import com.mosty.base.model.entity.wzzx.TbWzXfwz;
import com.mosty.common.base.domain.BaseController;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.token.JwtSysUser;
import com.mosty.wzzx.service.WztjService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@AllArgsConstructor
@RestController
@Api(tags = "位置统计--原magic接口")
@RequestMapping("/wztj")
public class WztjController extends BaseController {

    private final WztjService wztjService;

    @GetMapping("/dt/rywz")
    @ApiOperation(value = "人员位置")
    @JwtSysUser
    public ResponseResult<List<Map<String, Object>>> rywz(WztjQuery dto) {
        return ResponseResult.success(this.wztjService.rywz(dto));
    }

    @GetMapping("/dt/xz")
    @ApiOperation(value = "巡组位置")
    @JwtSysUser
    public ResponseResult<List<Map<String, Object>>> xz(WztjQuery dto) {
        return ResponseResult.success(this.wztjService.xz(dto));
    }

    @GetMapping("/tj/jrlcs")
    @ApiOperation(value = "里程数")
    @JwtSysUser
    public ResponseResult<List<Map<String, Object>>> jrlcs(WztjQuery dto) {
        return ResponseResult.success(this.wztjService.jrlcs(dto));
    }

    @GetMapping("/tj/rslcxz")
    @ApiOperation(value = "人数里程巡组整合")
    @JwtSysUser
    public ResponseResult<List<Map<String, Object>>> rslcxz(WztjQuery dto) {
        return ResponseResult.success(this.wztjService.rslcxz(dto));
    }

    @GetMapping("/tj/jrwzrs")
    @ApiOperation(value = "位置人数")
    @JwtSysUser
    public ResponseResult<List<Map<String, Object>>> jrwzrs(WztjQuery dto) {
        return ResponseResult.success(this.wztjService.jrwzrs(dto));
    }

    @GetMapping("/tj/jrxzwzs")
    @ApiOperation(value = "巡组位置数")
    @JwtSysUser
    public ResponseResult<List<Map<String, Object>>> jrxzwzs(WztjQuery dto) {
        return ResponseResult.success(this.wztjService.jrxzwzs(dto));
    }

    @GetMapping("/wz/rywzlb")
    @ApiOperation(value = "人员位置列表")
    @JwtSysUser
    public ResponseResult<IPage<Map<String, Object>>> rywzlb(WztjQuery dto) {
        return ResponseResult.success(this.wztjService.rywzlb(dto));
    }

    @GetMapping("/tj/xfsltj")
    @ApiOperation(value = "巡组数量统计")
    @JwtSysUser
    @ApiImplicitParams({
       @ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天", required = true, dataType = "String"),
    })
    public ResponseResult<Map<String, Object>> xfsltj(String type) {
        return ResponseResult.success(this.wztjService.xfsltj(type));
    }

    @GetMapping("/tj/rysltj")
    @ApiOperation(value = "人员数量统计")
    @JwtSysUser
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天", required = true, dataType = "String"),
    })
    public ResponseResult<Map<String, Object>> rysltj(String type) {
        return ResponseResult.success(this.wztjService.rysltj(type));
    }

    @GetMapping("/tj/sblswz")
    @ApiOperation(value = "设备数量统计")
    @JwtSysUser
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天", required = true, dataType = "String"),
    })
    public ResponseResult<Map<String, Object>> sblswz(String type) {
        return ResponseResult.success(this.wztjService.sblswz(type));
    }


}


