package com.huatek.busi.task;

import com.huatek.busi.common.SiteConstants;
import com.huatek.busi.service.BusiSiteTreeService;
import com.huatek.busi.service.gis.GisAssessService;
import com.huatek.busi.vo.BusiTreeNodeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.script.ScriptException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

@Slf4j
@Component("gisAssessTask")
public class GisAssessTask {
    @Autowired
    private BusiSiteTreeService busiSiteTreeService;
    @Autowired
    private GisAssessService gisAssessService;

    /**
     * gis评测任务
     * 
     * @throws IOException
     * @throws ScriptException
     * @throws NoSuchMethodException
     * @throws FileNotFoundException
     * @throws Exception
     */
    public void execute() {
        String mainEquipments = SiteConstants.SiteTreeEnum.GIS_HL_EQM.getValue();
        List<BusiTreeNodeVo> list = busiSiteTreeService.findGisMainEquipmentList(mainEquipments);
        gisAssessService.assessmentForGis(list);
    }
}
