package com.ximai.mes.pro.schedule.impl.busi;

import com.ximai.mes.pro.schedule.impl.AlgorithmResultProcessImpl;
import com.ximai.mes.tm.service.ITmToolRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 排产生成刀具申请领用单
 */
@Component
public class ToolRequestBuild implements ScheduleBusiProcess{

    @Autowired
    private ITmToolRequestService tmToolRequestService;
    @Override
    public void execute(List<JobResult> jobResults) {
        jobResults.forEach(job->{
            job.getTaskResultList().forEach(task->{
                tmToolRequestService.addedToolRequestAppForm(task.getProTaskWorkunitList());
            });
        });
    }
}
