Commit 409e1365 authored by ZWT's avatar ZWT

feat(能源管理系统): 邮件接收

1.添加天气数据邮件方式接收定时任务;
2.修改配置文件,增加新建定时任务,同时增加自定义参数;
3.创建天气邮件数据接收处理实现类,同时验证获取自定义参数方法;
4.添加收件工具类,验证是否能正常接收邮件;
5.天气邮件数据接收定时任务增加获取未读天气数据逻辑,增加附件文件临时存储方法并验证是否能正常读取文件数据同时转换为json数据;
6.增加查询运行中电站列表方法;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 08793d21
......@@ -30,8 +30,10 @@ import pps.core.common.utils.BaseUtils;
import xstartup.annotation.XService;
import xstartup.base.XContext;
import xstartup.base.XStartup;
import xstartup.base.exception.XServiceException;
import xstartup.base.util.XCopyUtils;
import xstartup.data.XServiceResult;
import xstartup.helper.XTransactionHelper;
import javax.mail.*;
import javax.mail.internet.MimeUtility;
......@@ -64,6 +66,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
String username = XStartup.getCurrent().getProperty("weather.mail.username");
String password = XStartup.getCurrent().getProperty("weather.mail.password");
String protocol = XStartup.getCurrent().getProperty("weather.mail.protocol");
return XTransactionHelper.begin(context, () -> {
//取未读邮件
Store store = null;
Folder folder = null;
......@@ -284,16 +287,17 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
}
}
} catch (MessagingException e) {
throw new RuntimeException(e);
throw new XServiceException(e);
} catch (IOException e) {
throw new RuntimeException(e);
throw new XServiceException(e);
} catch (Exception e) {
throw new RuntimeException(e);
throw new XServiceException(e);
} finally {
NioUtil.close(folder);
NioUtil.close(store);
}
return XServiceResult.OK;
});
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment