package com.securitycontrol.system.base.controller;

import com.securitycontrol.common.core.web.controller.BaseController;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.common.core.web.page.TableDataInfo;
import com.securitycontrol.common.log.annotation.Log;
import com.securitycontrol.common.log.enums.OperationType;
import com.securitycontrol.entity.system.base.dto.GxPlanDto;
import com.securitycontrol.entity.system.base.dto.ProScheduleDto;
import com.securitycontrol.entity.system.base.vo.GxPlanProgressVo;
import com.securitycontrol.entity.system.base.vo.GxPlanVo;
import com.securitycontrol.entity.system.base.vo.ProScheduleVo;
import com.securitycontrol.system.base.service.IProScheduleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

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

/**
 * @author：cwchen
 * @date：2024-03-13-19:07
 * @version：1.0
 * @description：工程进度-web
 */
@RestController
@RequestMapping("/base/proSchedule/")
public class ProScheduleController extends BaseController {

    @Resource(name = "IProScheduleService")
    private IProScheduleService service;

    @ApiOperation(value = "获取工程进度列表")
    @GetMapping("getProScheduleLists")
    @Log(title = "基础管理", menu = "基础管理->工程进度管理", grade = OperationType.QUERY_BUSINESS, details = "查询工程进度", type = "业务日志")
    public TableDataInfo getProScheduleLists(ProScheduleDto dto) {
        startPage();
        List<ProScheduleVo> list = service.getProScheduleLists(dto);
        return getDataTable(list);
    }

    @ApiOperation(value = "获取工序计划列表")
    @GetMapping("getGxPlanLists")
    @Log(title = "基础管理", menu = "基础管理->工程进度管理", grade = OperationType.QUERY_BUSINESS, details = "查询工序计划", type = "业务日志")
    public TableDataInfo getGxPlanLists(GxPlanDto dto) {
        startPage();
        List<GxPlanVo> list = service.getGxPlanLists(dto);
        return getDataTable(list);
    }

    @ApiOperation(value = "工序计划延期提醒")
    @GetMapping("getGxPlansIsDela")
    public AjaxResult getGxPlansIsDela(ProScheduleDto dto){
        return service.getGxPlansIsDela(dto);
    }

    @ApiOperation(value = "获取工序计划进度列表")
    @GetMapping("getGxPlanProgressLists")
    @Log(title = "基础管理", menu = "基础管理->工程进度管理", grade = OperationType.QUERY_BUSINESS, details = "查询工序计划进度列表", type = "业务日志")
    public TableDataInfo getGxPlanProgressLists(ProScheduleDto dto) {
        startPage();
        List<GxPlanProgressVo> list = service.getGxPlanProgressLists(dto);
        return getDataTable(list);
    }

    @ApiOperation(value = "填报工序计划进度列表")
    @PostMapping("fillingGxProgress")
    @Log(title = "基础管理", menu = "基础管理->工程进度管理", grade = OperationType.ADD_BUSINESS, details = "填报工序计划进度", type = "业务日志")
    public AjaxResult fillingGxProgress(@RequestBody GxPlanProgressVo vo){
        return service.fillingGxProgress(vo);
    }
}
