package com.prolog.eis.service.createcontainertask.impl;

import com.prolog.eis.dto.createcontainertask.CCTContainerTaskDto;
import com.prolog.eis.dto.createcontainertask.CCTDispatchDto;
import com.prolog.eis.service.createcontainertask.CCTAlgorithmService;
import com.prolog.eis.service.createcontainertask.CCTDispatchService;
import com.prolog.eis.service.createcontainertask.CCTInitService;
import com.prolog.eis.service.createcontainertask.CCTSaveResultService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Version: 1.0
 * @Author: wuhan
 * @Created: 2024/7/31 11:03
 */
@Service
public class CCTDispatchServiceImpl implements CCTDispatchService {
    @Resource
    private CCTInitService cctInitService;

    @Resource
    private CCTAlgorithmService cctAlgorithmService;

    @Resource
    private CCTSaveResultService cctSaveResultService;

    @Override
    public void dispatch() {
        CCTDispatchDto dispatchDto = cctInitService.init();
        List<CCTContainerTaskDto> containerTaskList = cctAlgorithmService.computeContainerTask(dispatchDto);
        cctSaveResultService.saveResult(containerTaskList);
    }
}
