package init;
import	java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import com.kiisoo.ic.app.IcApplication;
import com.kiisoo.ic.store.service.StorePromotionDataService;
import com.kiisoo.ic.utils.DateUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 *  组织数据初始化
 * Created by hc on 2020/4/21
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = IcApplication.class)
public class laheiinit {


    @Autowired
    private StorePromotionDataService storePromotionDataService;

    @Test
    public void initData() throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        List<Date> getdays = DateUtils.getdays(sdf.parse("2020-04-01"), sdf.parse("2020-05-08"));
        for (Date date:getdays){
            storePromotionDataService.syncCustomerBlackListByDate(date,date);
        }

    }

}
