package com.project.zcustom.controller.engineering;

import com.project.common.core.controller.BaseController;
import com.project.common.core.domain.AjaxResult;
import com.project.zcustom.service.unit.ILargeProjectService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/large/production")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class PlatProjectProductionController extends BaseController {

    private final ILargeProjectService largeProjectService;

    /**
     * 已接入项目数量(在建)
     */
    @GetMapping("/getProjectNum/{appOrg}")
    public AjaxResult getProjectNum(@PathVariable String appOrg) {
        return AjaxResult.success("查询成功", largeProjectService.getProjectNum(appOrg));
    }

    /**
     * 已接入项目数量(审批)
     */
    @GetMapping("/getProjectNumX/{appOrg}")
    public AjaxResult getProjectNumX(@PathVariable String appOrg) {
        return AjaxResult.success("查询成功", largeProjectService.getProjectNumX(appOrg));
    }

    /**
     * 已接入项目数量(施工)
     */
    @GetMapping("/getProjectNumY/{appOrg}")
    public AjaxResult getProjectNumY(@PathVariable String appOrg) {
        return AjaxResult.success("查询成功", largeProjectService.getProjectNumY(appOrg));
    }

    /**
     * 查询对应市的项目信息
     */
    @GetMapping("/getProjectByAppOrg/{appOrg}")
    public AjaxResult getProjectByAppOrg(@PathVariable String appOrg) {
        return AjaxResult.success("查询成功", largeProjectService.getProjectByAppOrg(appOrg));
    }

    /**
     * 获取各个市的在建和施工项目数量
     */
    @GetMapping("/getProjectNumZ")
    public AjaxResult getProjectNumZ() {
        return AjaxResult.success("查询成功", largeProjectService.getProjectNumZ());
    }
}
