package com.njcn.harmonic.controller.upload;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.harmonic.pojo.param.upload.PmsTemUserParam;
import com.njcn.harmonic.pojo.po.upload.PmsTemProcessReport;
import com.njcn.harmonic.pojo.po.upload.PmsTemUserPO;
import com.njcn.harmonic.service.upload.IPmsTemProcessReportService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import com.njcn.web.controller.BaseController;

import java.util.List;

/**
 * <p>
 * 电能质量全过程月报 前端控制器
 * </p>
 *
 * @author cdf
 * @since 2024-10-09
 */
@RestController
@RequestMapping("/process/pmsTemProcessReport")
@RequiredArgsConstructor
public class PmsTemProcessReportController extends BaseController {

    private final IPmsTemProcessReportService iPmsTemProcessReportService;



    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/upGwReport")
    @ApiOperation("上送国网")
    public HttpResult<Boolean> upGwReport(@RequestBody List<String> ids) {
        String methodDescribe = getMethodDescribe("upGwReport");
        iPmsTemProcessReportService.upGw(ids);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
    }


    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getList")
    @ApiOperation("查询月报")
    public HttpResult<List<PmsTemProcessReport>> pageList(@RequestBody PmsTemUserParam.QueryPmsTemUserParam param) {
        String methodDescribe = getMethodDescribe("getList");
        List<PmsTemProcessReport> result = iPmsTemProcessReportService.getList(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }



    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/dayCalReport")
    @ApiOperation("每日计算评估问题")
    public HttpResult<Boolean> dayCalReport(@RequestParam("date") String date) {
        String methodDescribe = getMethodDescribe("dayCalReport");
        iPmsTemProcessReportService.dayCalReport(date);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
    }
}

