package com.heyu.api.schedule.impl;


import com.heyu.api.data.dao.vv.VvPackageDao;
import com.heyu.api.data.entity.vv.VvPackageEntity;
import com.heyu.api.data.enums.RoleEnums;
import com.heyu.api.data.service.vv.VvPackageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Component("packageUpdateJob")
@Slf4j
public class PackageUpdateJob {


    @Autowired
    private VvPackageDao vvPackageDao;


    @Autowired
    private VvPackageService vvPackageService;

    public void run() {


        List<VvPackageEntity> vvPackageEntityList = vvPackageDao.selectVvPackageByIsCheckNotIN(Arrays.asList("2", "3"));

        for (VvPackageEntity vvPackageEntity : vvPackageEntityList) {

            vvPackageService.selectVvKuaidiAndUpdateData(vvPackageEntity.getTrackNumber(), RoleEnums.job.getRole());
        }


    }
}
