package cn.cecep.talroad.data.analyse.task.factory.label.change;

import cn.cecep.talroad.domain.dto.FactoryLabelChangeDTO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Frank
 * @createTime: 2023年06月28日 16:13:36
 * @version:
 * @Description:
 */
@Service
@AllArgsConstructor
public class FactoryLabelChangeServiceContext {

    private final List<AbstractFactoryLabelChangeService> abstractFactoryLabelChangeServices;

    public void execute(FactoryLabelChangeDTO factoryLabelChangeDTO) {
        for (AbstractFactoryLabelChangeService abstractWorkNumberSerivce : abstractFactoryLabelChangeServices) {
            if (abstractWorkNumberSerivce.support(factoryLabelChangeDTO.getEnumId())) {
                abstractWorkNumberSerivce.execute(factoryLabelChangeDTO);
            }
        }
    }
}
