package com.ningdatech.pmapi.common.statemachine.util;

import com.google.common.collect.Maps;
import com.ningdatech.pmapi.common.statemachine.builder.*;
import com.ningdatech.pmapi.common.statemachine.contants.RegionContant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Map;

/**
 * 项目申报状态机
 *
 * @author CMM
 * @since 2023/02/07 15:56
 */
@Component
@Slf4j
public class MachineBuilderFounder {

    public final static Map<String,ProjectDeclareStateMachineBuilder> machineBuilderMap =
            Maps.newConcurrentMap();

    @Autowired
    private ProjectDeclareStateMachineSBJBuilder projectDeclareStateMachineSBJBuilder;

    @Autowired
    private ProjectDeclareStateMachineLDBuilder projectDeclareStateMachineLDBuilder;

    @Autowired
    private ProjectDeclareStateMachineQTBuilder projectDeclareStateMachineQTBuilder;

    @Autowired
    private ProjectDeclareStateMachineJYBuilder projectDeclareStateMachineJYBuilder;

    @Autowired
    private ProjectDeclareStateMachineSCBuilder projectDeclareStateMachineSCBuilder;

    @Autowired
    private ProjectDeclareStateMachineSYBuilder projectDeclareStateMachineSYBuilder;

    @Autowired
    private ProjectDeclareStateMachineYHBuilder projectDeclareStateMachineYHBuilder;

    @Autowired
    private ProjectDeclareStateMachineQYBuilder projectDeclareStateMachineQYBuilder;

    @Autowired
    private ProjectDeclareStateMachineJNBuilder projectDeclareStateMachineJNBuilder;

    @Autowired
    private ProjectDeclareStateMachineLQBuilder projectDeclareStateMachineLQBuilder;

    @Autowired
    private ProjectDeclareStateMachineKFQBuilder projectDeclareStateMachineKFQBuilder;

    @PostConstruct
    public void MachineBuilderFounder(){
        machineBuilderMap.put(RegionContant.LS_SBJ_CODE, projectDeclareStateMachineSBJBuilder);
        machineBuilderMap.put(RegionContant.LS_LD_CODE, projectDeclareStateMachineLDBuilder);
        machineBuilderMap.put(RegionContant.LS_QT_CODE, projectDeclareStateMachineQTBuilder);
        machineBuilderMap.put(RegionContant.LS_JY_CODE, projectDeclareStateMachineJYBuilder);
        machineBuilderMap.put(RegionContant.LS_SC_CODE, projectDeclareStateMachineSCBuilder);
        machineBuilderMap.put(RegionContant.LS_SY_CODE, projectDeclareStateMachineSYBuilder);
        machineBuilderMap.put(RegionContant.LS_YH_CODE, projectDeclareStateMachineYHBuilder);
        machineBuilderMap.put(RegionContant.LS_QY_CODE, projectDeclareStateMachineQYBuilder);
        machineBuilderMap.put(RegionContant.LS_JN_CODE, projectDeclareStateMachineJNBuilder);
        machineBuilderMap.put(RegionContant.LS_LQ_CODE, projectDeclareStateMachineLQBuilder);
        machineBuilderMap.put(RegionContant.LS_KFQ_CODE, projectDeclareStateMachineKFQBuilder);
    }
}
