diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/EarlyWarningTask.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/EarlyWarningTask.java index 49333da7..a696763d 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/EarlyWarningTask.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/EarlyWarningTask.java @@ -13,9 +13,12 @@ import com.zdxt.code.service.IEnforcementRegistrationService; import com.zdxt.code.service.IEnterpriseInformationService; import com.zdxt.code.service.ILawEnforcementWarningListService; import com.zdxt.common.util.DateUtils; +import com.zdxt.flow.util.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -46,10 +49,18 @@ public class EarlyWarningTask { if(StrUtil.isEmpty(warn.getLevel())){ continue; } + // 获取当前日期 + LocalDate currentDate = LocalDate.now(); + // 创建格式化器 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); + // 使用格式化器格式化当前日期 + String formattedDate = currentDate.format(formatter); + //获取当前日期 LawEnforcementWarningList params = new LawEnforcementWarningList(); params.setEnterpriseNumber(warn.getEnterpriseNumber()); params.setWarningLevel(Integer.parseInt(warn.getLevel())); params.setWarnType(warn.getWarnType()); + params.setSearchDate(formattedDate); List res = lawEnforcementWarningListService.selectLawEnforcementWarningListList(params); if (null == res || res.size() < 1) { LawEnforcementWarningList warning = new LawEnforcementWarningList();