package com.api.customization.qc3189074.util; import com.engine.kq.biz.KQFormatData; import com.wbi.util.Util; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Map; public class ThreadUtil implements Runnable { Map> scheduleMap; public ThreadUtil(Map> scheduleMap) { this.scheduleMap = scheduleMap; } @Override public void run() { DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); for (Map.Entry> entry : scheduleMap.entrySet()) { String key = entry.getKey(); Map shceduleData = entry.getValue(); String validatefrom = Util.null2String(shceduleData.get("validatefrom")); String validateto = Util.null2String(shceduleData.get("validateto")); LocalDate fromLocal = LocalDate.parse(validatefrom); LocalDate toLocal = LocalDate.parse(validateto); if(!toLocal.isBefore(fromLocal)){ long betweenDays = toLocal.toEpochDay() - fromLocal.toEpochDay(); for (int j = 0; j <= betweenDays; j++) { LocalDate curLocalDate = fromLocal.plusDays(j); String shiftDate = curLocalDate.format(dateFormatter); new KQFormatData().formatKqDateByLock(key, shiftDate,17); } } } } }