|
@@ -30,14 +30,17 @@ public class EcsInfoServiceImpl extends ServiceImpl<EcsInfoMapper, EcsInfo> impl
|
|
|
|
|
|
|
|
List<EcsInfo> list = new ArrayList<>();
|
|
List<EcsInfo> list = new ArrayList<>();
|
|
|
ecsInfos.forEach(ecsInfo -> {
|
|
ecsInfos.forEach(ecsInfo -> {
|
|
|
- String endOfExpiration = DateUtil.parseDateToStr(DateUtil.YYYY_MM_DD, ecsInfo.getNotAfter());
|
|
|
|
|
- String nowDateStr = DateUtil.parseDateToStr(DateUtil.YYYY_MM_DD, DateUtil.getNowDate());
|
|
|
|
|
|
|
+ if (ecsInfo.getNotAfter() != null) {
|
|
|
|
|
|
|
|
- Long[] longs = DateUtil.computeDate(nowDateStr, endOfExpiration);
|
|
|
|
|
- Long month = longs[0];
|
|
|
|
|
- Long day = longs[1];
|
|
|
|
|
- if (month == 0 && day < 20) {
|
|
|
|
|
- list.add(ecsInfo);
|
|
|
|
|
|
|
+ String endOfExpiration = DateUtil.parseDateToStr(DateUtil.YYYY_MM_DD, ecsInfo.getNotAfter());
|
|
|
|
|
+ String nowDateStr = DateUtil.parseDateToStr(DateUtil.YYYY_MM_DD, DateUtil.getNowDate());
|
|
|
|
|
+
|
|
|
|
|
+ Long[] longs = DateUtil.computeDate(nowDateStr, endOfExpiration);
|
|
|
|
|
+ Long month = longs[0];
|
|
|
|
|
+ Long day = longs[1];
|
|
|
|
|
+ if (month == 0 && day < 20) {
|
|
|
|
|
+ list.add(ecsInfo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -47,10 +50,9 @@ public class EcsInfoServiceImpl extends ServiceImpl<EcsInfoMapper, EcsInfo> impl
|
|
|
if (!list.isEmpty()) {
|
|
if (!list.isEmpty()) {
|
|
|
for (String number : Constants.SEND_MSG_NUMBER) {
|
|
for (String number : Constants.SEND_MSG_NUMBER) {
|
|
|
list.forEach(i -> {
|
|
list.forEach(i -> {
|
|
|
- JSONObject entries = new JSONObject();
|
|
|
|
|
- entries.set("name",i.getUrl());
|
|
|
|
|
|
|
+ String str = i.getUrl();
|
|
|
try {
|
|
try {
|
|
|
- SMSUtil.sendMsg(number,"天目智能科技","SMS_475345133",entries.toString());
|
|
|
|
|
|
|
+ SMSUtil.sendMsg(number,"天目智能科技","SMS_475345133","{\"name\":\""+str+"\"}");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("短信发送失败:{}",e);
|
|
log.error("短信发送失败:{}",e);
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|