package com.mosty.qwzx.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.qwzx.TbQwSearchJlqdDto;
import com.mosty.base.model.entity.qwzx.TbQwBmjlbbJlmx;
import com.mosty.base.model.vo.qwzx.TbQwBmjlbbCountVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.base.model.dto.qwzx.TbQwSearchZgmfjDto;
import com.mosty.base.model.query.qwzx.TbQwBmjlbbCountQuery;
import com.mosty.base.model.query.qwzx.TbQwBmjlbbQuery;
import com.mosty.base.model.vo.qwzx.Gzqk;
import com.mosty.base.model.vo.qwzx.TbQwBmjlbbVo;
import com.mosty.qwzx.service.TbQwBmjlbbService;
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.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 部门每日警力报备表 前端控制器
 * </p>
 *
 * @author zengbo
 * @since 2022-06-27
 */
@Api(tags = "部门每日警力报备接口")
@RestController
@AllArgsConstructor
@RequestMapping("/tbQwBmjlbb")
public class TbQwBmjlbbController {

    private TbQwBmjlbbService tbQwBmjlbbService;

    @ApiOperation("大屏-查询在岗警力")
    @GetMapping("/selectOnCop")
    @JwtSysUser
    @Log(title = "查询在岗警力", businessType = BusinessType.OTHER)
    public ResponseResult<Gzqk> selectOnCop() {
        return ResponseResult.success(tbQwBmjlbbService.selectOnCop());
    }

    @ApiOperation("计算今日部门警力报备情况")
    @PostMapping("/setBmjlbbInfo")
    @JwtSysUser
    public ResponseResult<Void> setBmjlbbInfo(String time) {
        tbQwBmjlbbService.setBmjlbbInfo(time);
        return ResponseResult.success();
    }

    @ApiOperation("查询警力清单")
    @JwtSysUser
    @GetMapping("/getJlqdList")
    public ResponseResult<List<Map<String, Object>>> getJlqdList(TbQwSearchJlqdDto dto) {
        return ResponseResult.success(tbQwBmjlbbService.getJlqdList(dto));
    }

    @ApiOperation("查询警力清单,存入redis中")
    @JwtSysUser
    @GetMapping("/getJlqdListToRedis")
    public ResponseResult<List<Map<String, Object>>> getJlqdListToRedis(TbQwSearchJlqdDto dto) {
        return ResponseResult.success(tbQwBmjlbbService.getJlqdListToRedis(dto));
    }

    @ApiOperation("高新领导端--查询在岗警力数量")
    @GetMapping("/getZgjlCount")
    @JwtSysUser
    public ResponseResult<Map<String, Object>> getZgjlCount() {
        return ResponseResult.success(tbQwBmjlbbService.getZgjlCount());
    }

    @ApiOperation("值班统计")
    @GetMapping("/countCdepTree")
    @JwtSysUser
    public ResponseResult<List<Map<String, Object>>> countCdepTree(String ssbmdm) {
        return ResponseResult.success(tbQwBmjlbbService.countCdepTree(ssbmdm));
    }

}

