fix: 外部标准发新认证车型实施到期消息
This commit is contained in:
+17
-6
@@ -22,6 +22,7 @@ import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -79,7 +80,7 @@ public class ReplaceImplementationDateMsgJob implements Job {
|
||||
cal.add(Calendar.DAY_OF_YEAR, 1);
|
||||
Date tomorrowMidnight = cal.getTime();
|
||||
|
||||
// 根据新认证车实施日期筛选出已经到期的标准
|
||||
// 根据实施日期筛选出已经到期的标准
|
||||
for (LawsEnterpriseStandard es : standardList) {
|
||||
Date implementationDate = es.getImplementationDate();
|
||||
if (implementationDate == null) {
|
||||
@@ -168,14 +169,24 @@ public class ReplaceImplementationDateMsgJob implements Job {
|
||||
Date tomorrowMidnight = cal.getTime();
|
||||
|
||||
// 根据新认证车实施日期筛选出已经到期的标准
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
for (LawsDomesticStandard gb : standardList) {
|
||||
Date implementationDate = gb.getImplementationDate();
|
||||
if (implementationDate == null) {
|
||||
String newAuthImplDate = gb.getNewAuthImplDate();
|
||||
if (StrUtil.isBlank(newAuthImplDate)) {
|
||||
continue;
|
||||
}
|
||||
String[] dateStrList = newAuthImplDate.split(",");
|
||||
// 判断实施日期大于今天0点小于明天0点
|
||||
if (implementationDate.equals(todayMidnight) && implementationDate.before(tomorrowMidnight)) {
|
||||
allExpireStandardNumberList.add(gb.getStandardNumber());
|
||||
for (String dateStr : dateStrList) {
|
||||
try {
|
||||
Date date = sdf.parse(dateStr);
|
||||
if (date.equals(todayMidnight) && date.before(tomorrowMidnight)) {
|
||||
allExpireStandardNumberList.add(gb.getStandardNumber());
|
||||
break;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
log.error("日期转换异常", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +216,7 @@ public class ReplaceImplementationDateMsgJob implements Job {
|
||||
Map<String, String> sendMap = new HashMap<>();
|
||||
sendMap.put("standardNumber", mainStandard.getStandardNumber());
|
||||
sendMap.put("standardName", mainStandard.getStandardName());
|
||||
sendMap.put("implementationDate", simpleDateFormat.format(mainStandard.getImplementationDate()));
|
||||
sendMap.put("implementationDate", simpleDateFormat.format(new Date()));
|
||||
|
||||
Set<String> userIdSet = new HashSet<>();
|
||||
// 拼接发送人员
|
||||
|
||||
Reference in New Issue
Block a user