package com.njcn.prepare.executor;

import com.njcn.prepare.harmonic.service.mysql.device.DeviceAbnormalStatisticsService;
import com.njcn.prepare.harmonic.service.mysql.line.OnlineRateService;
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;


/**
 * @author hongawen
 * @version 1.0.0
 * @date 2023年11月06日 15:59
 */
@LiteflowComponent
@RequiredArgsConstructor
public class DeviceExecutor extends BaseExecutor {

    private final OnlineRateService onlineRateService;

    private final DeviceAbnormalStatisticsService deviceAbnormaStatisticsService;

    /**
     * 算法名: 暂无-----终端在线率_日表(r_stat_onlinerate_d)
     *
     * @author xuyang
     * @date 2023年11月30日 10:25
     */
    @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "deviceOnlineRate", nodeType = NodeTypeEnum.COMMON)
    public boolean deviceOnlineRateAccess(NodeComponent bindCmp) {
        return isAccess(bindCmp);
    }
    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "deviceOnlineRate", nodeType = NodeTypeEnum.COMMON)
    public void deviceOnlineRateProcess(NodeComponent bindCmp) {
        onlineRateService.deviceOnlineRate(bindCmp.getRequestData());
    }

    /**
     * 算法名: 暂无-----终端异常通告功能-日表(pqs_top_msg)
     *
     * @author xuyang
     * @date 2023年11月30日 13:25
     */
    @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "pqsTopMsg", nodeType = NodeTypeEnum.COMMON)
    public boolean pqsTopMsgAccess(NodeComponent bindCmp) {
        return isAccess(bindCmp);
    }
    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "pqsTopMsg", nodeType = NodeTypeEnum.COMMON)
    public void pqsTopMsgProcess(NodeComponent bindCmp) {
        deviceAbnormaStatisticsService.deviceAbnormaStatisticsD(bindCmp.getRequestData());
    }
}
