package com.tofly.xrtygis.custom.controller.zsdata;

import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.service.zsdata.DataMonthPlanService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author FlashWJL
 * @date 2021/5/15 15:03
 */
@RestController
@RequestMapping("/monthPlan")
@AllArgsConstructor
@Api(tags = "制水成本--月度实时计划")
public class DataMonthPlanController {

    private final DataMonthPlanService dataMonthPlanService;

    @GetMapping("/makeWater")
    @ApiOperation("制水材料")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "years", value = "年月 如：2019-03", required = true, dataType = "string"),
            @ApiImplicitParam(name = "scid",value = "0:总量  1:一厂  2：二厂",readOnly = true,dataType = "string")
    })
    public ResultRespone makeWater(String scid, String years) {
        return ResultRespone.success(dataMonthPlanService.makeWater(scid,years));
    }

    @GetMapping("/costCalculate")
    @ApiOperation("成本核算")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "years", value = "年月 如：2019-03", required = true, dataType = "string"),
            @ApiImplicitParam(name = "scid",value = "0:总量,1:一厂  2：二厂",readOnly = true,dataType = "string")
    })
    public ResultRespone costCalculate(String scid, String years) {
        return ResultRespone.success(dataMonthPlanService.costCalculate(scid,years));
    }


}
