package com.njcn.prepare.executor;

import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
import com.njcn.prepare.harmonic.service.mysql.line.PollutionService;
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationService;
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationVoltageMPOService;
import com.njcn.prepare.harmonic.service.mysql.send.ConverterDetailStatisticsPOService;
import com.njcn.prepare.harmonic.service.mysql.upload.IRUploadSubstationStatisticalDataDService;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod;
import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
import com.yomahub.liteflow.enums.NodeTypeEnum;
import lombok.RequiredArgsConstructor;

import java.util.Objects;

/**
 * @Description:
 * @Author: wr
 * @Date: 2024/2/27 13:50
 */
@LiteflowComponent
@RequiredArgsConstructor
public class OrgSubStationExecutor extends BaseExecutor{


    private final RStatSubstationVoltageMPOService rStatSubstationVoltageMPOService;


    @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "rStatSubstationVoltage", nodeType = NodeTypeEnum.COMMON)
    public boolean rStatSubstationVoltageAccess(NodeComponent bindCmp) {
        return isAccess(bindCmp);
    }
    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "rStatSubstationVoltage", nodeType = NodeTypeEnum.COMMON)
    public void rStatSubstationVoltageProcess(NodeComponent bindCmp) {
        String tag = bindCmp.getTag();
        CalculatedParam calculatedParam = bindCmp.getRequestData();
        if (Objects.equals(tag,"r_stat_substation_voltage_m")){
            rStatSubstationVoltageMPOService.handler(calculatedParam);
        }
    }
}
