package com.project.zcustom.logistics;


import com.project.zcustom.controller.core.AjaxResult;
import com.project.zcustom.service.logistics.ILargePlatAssetService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/large/asset")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class PlatAssetController {

    @Autowired
    private ILargePlatAssetService largePlatAssetService;

    /**
     * 楼宇各类资产占比
     */
    @GetMapping("/building")
    public AjaxResult getBuildingAssetRate(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getBuildingAssetRate(appOrg));
    }

    /**
     * 服务各类资产占比
     */
    @GetMapping("/service")
    public AjaxResult getServiceAssetRate(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getServiceAssetRate(appOrg));
    }

    /**
     * 办公各类资产占比
     */
    @GetMapping("/office")
    public AjaxResult getOfficeAssetRate(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getOfficeAssetRate(appOrg));
    }

    /**
     * 资产存量
     */
    @GetMapping("/stock")
    public AjaxResult getStockAssetNum(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getStockAssetNum(appOrg));
    }

    /**
     * 2025年度资产新增数量
     */
    @GetMapping("/new")
    public AjaxResult getNewAssetNum(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getNewAssetNum(appOrg));
    }

    /**
     * 资产报废数量
     */
    @GetMapping("/scrap")
    public AjaxResult getScrapAssetNum(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getScrapAssetNum(appOrg));
    }

    /**
     * 赋码率 -贴签率
     */
    @GetMapping("/codedAndLabelRate")
    public AjaxResult getCodedAndLabelRate(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getCodedAndLabelRate(appOrg));
    }

    /**
     * 三大类资产占比
     */
    @GetMapping("/mainlyRate")
    public AjaxResult getMainlyRate(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getMainlyRate(appOrg));
    }

    /**
     * 典型场景应用率
     */
    @GetMapping("/sceneRate")
    public AjaxResult getSceneRate(@RequestParam int flag) {
        return AjaxResult.success("查询成功", largePlatAssetService.getSceneRate(flag));
    }

    /**
     * 楼宇设备运行情况
     */
    @GetMapping("/operation")
    public AjaxResult getOperation(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatAssetService.getOperation(appOrg));
    }

    /**
     * 地市巡检执行数量
     */
    @GetMapping("/inspectionSchemeNumX")
    public AjaxResult getInspectionSchemeNumX() {
        return AjaxResult.success("查询成功", largePlatAssetService.getInspectionSchemeNumX());
    }

    /**
     * 直属单位巡检执行数量
     */
    @GetMapping("/inspectionSchemeNumY")
    public AjaxResult getInspectionSchemeNumY() {
        return AjaxResult.success("查询成功", largePlatAssetService.getInspectionSchemeNumY());
    }
}
