package com.zcloud.fire.check.app;


import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.fire.check.api.FireCheckListServiceI;
import com.zcloud.fire.check.dto.*;
import com.zcloud.fire.check.dto.clientobject.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * web-adapter
 *
 * @Author zhaokai
 * @Date 2025-11-28 10:32:08
 */
@Api(tags = "App消防点位检查表")
@RequestMapping("/${application.gateway}/app/fireCheckList")
@RestController
@AllArgsConstructor
public class AppFireCheckListController {
    private final FireCheckListServiceI fireCheckListService;


    @ApiOperation("获取待排查分页")
    @PostMapping("/checkList")
    public PageResponse<FireCheckListCO> checkList(@RequestBody FireCheckListPageQry qry) {
        return fireCheckListService.appCheckList(qry);
    }
    @ApiOperation("获取待排查数量和打回数量")
    @PostMapping("/checkListCount")
    public SingleResponse<Integer> checkListCount(@RequestBody FireCheckListPageQry qry) {
        return SingleResponse.of(fireCheckListService.checkListCount(qry));
    }


    @ApiOperation("开始检查-获取消防点检列表")
    @PostMapping("/getCheckPointList")
    public MultiResponse<FireCheckPointListCO> getCheckPointList(@RequestBody CheckPointListQry qry) {
        return MultiResponse.of(fireCheckListService.getCheckPointList(qry));
    }
    @ApiOperation("开始检查-校验是否存在器材标准")
    @PostMapping("/checkStandard")
    public SingleResponse<FireCheckPointListCO> checkStandard(@RequestBody CheckPointListQry qry) {
        fireCheckListService.checkStandard(qry);
        return SingleResponse.buildSuccess();
    }

    @ApiOperation("已打回-获取消防点检检查列表")
    @PostMapping("/getBackChecKList")
    public PageResponse<FireBackCheckListCO> getBackChecKList(@RequestBody FireBackCheckListPageQry qry) {
        return fireCheckListService.getBackChecKList(qry);
    }

    @ApiOperation(value = "点检记录首页-点检表查询")
    @PostMapping("/getCheckListRecord")
    @PreAuthorize("@pms.hasAnyPermission('dwjcjl')")
    public PageResponse<FireCheckListCO> getCheckListRecord(@RequestBody CheckListRecordPageQry qry) {
        return fireCheckListService.getCheckListRecord(qry);
    }

    @ApiOperation("点位统计-点击企业-点位分布")
    @PostMapping("/pointDistribution")
    public PageResponse<PointDistributionCO> pointDistributionStatistic(@RequestBody @Validated PointDistributionPageQry qry) {
        return fireCheckListService.pointDistributionStatistic(qry);
    }

/* 使用pc端接口
  @ApiOperation("点位统计-风险分布-首页")
    @PostMapping("/riskDistribution")
    public PageResponse<RiskDistributionCO> riskDistribution(@RequestBody RiskDistributionPageQry qry) {
        return fireCheckListService.riskDistribution(qry);
    }
    @ApiOperation("点位统计-风险分布总统计-首页")
    @PostMapping("/riskDistributionStatistic")
    public SingleResponse<RiskDistributionStasticCO> riskDistributionStatistic() {
        return SingleResponse.of(fireCheckListService.riskDistributionStatistic());
    }*/






}

