Browse Source

提交预警信息定时任务修改,添加时间查询

v4
chenrui 2 years ago
parent
commit
5d127f88af
  1. 11
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/EarlyWarningTask.java

11
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.IEnterpriseInformationService;
import com.zdxt.code.service.ILawEnforcementWarningListService; import com.zdxt.code.service.ILawEnforcementWarningListService;
import com.zdxt.common.util.DateUtils; import com.zdxt.common.util.DateUtils;
import com.zdxt.flow.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
/** /**
@ -46,10 +49,18 @@ public class EarlyWarningTask {
if(StrUtil.isEmpty(warn.getLevel())){ if(StrUtil.isEmpty(warn.getLevel())){
continue; continue;
} }
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 创建格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
// 使用格式化器格式化当前日期
String formattedDate = currentDate.format(formatter);
//获取当前日期
LawEnforcementWarningList params = new LawEnforcementWarningList(); LawEnforcementWarningList params = new LawEnforcementWarningList();
params.setEnterpriseNumber(warn.getEnterpriseNumber()); params.setEnterpriseNumber(warn.getEnterpriseNumber());
params.setWarningLevel(Integer.parseInt(warn.getLevel())); params.setWarningLevel(Integer.parseInt(warn.getLevel()));
params.setWarnType(warn.getWarnType()); params.setWarnType(warn.getWarnType());
params.setSearchDate(formattedDate);
List<LawEnforcementWarningList> res = lawEnforcementWarningListService.selectLawEnforcementWarningListList(params); List<LawEnforcementWarningList> res = lawEnforcementWarningListService.selectLawEnforcementWarningListList(params);
if (null == res || res.size() < 1) { if (null == res || res.size() < 1) {
LawEnforcementWarningList warning = new LawEnforcementWarningList(); LawEnforcementWarningList warning = new LawEnforcementWarningList();

Loading…
Cancel
Save