Commit fb982d8b authored by ZWT's avatar ZWT

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

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

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 21684802
......@@ -114,26 +114,11 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
.collect(Collectors.groupingBy(BasePhotovoltaicPlantView::getCityCode));
PlantPredictedPowerDataMapper mapper = context.getBean(PlantPredictedPowerDataMapper.class);
List<String> timeList = Arrays.asList("15:00", "30:00", "45:00");
//读取附件
// for (Message message : messageList) {
// String tempFilePath = this.saveAttachment(message);
// FileReader fileReader = new FileReader(tempFilePath);
// String jsonString = fileReader.readString();
// JSONObject jsonObject = JSONObject.parseObject(jsonString);
// Map<String, List<DailyData>> cityDataMap = new HashMap<>(16);
// for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
// String key = entry.getKey();
// Object value = entry.getValue();
// if (value instanceof JSONArray) {
// cityDataMap.put(key, ((JSONArray) value).toJavaList(DailyData.class));
// }
// }
//
//
// FileUtil.del(tempFilePath);
// }
List<PlantPredictedPowerDataEnt> batchList = new ArrayList<>();
FileReader fileReader = new FileReader("D:\\home\\weather\\temp\\receive\\20231114\\1699943400000.json");
//读取附件
for (Message message : messageList) {
String tempFilePath = this.saveAttachment(message);
FileReader fileReader = new FileReader(tempFilePath);
String jsonString = fileReader.readString();
JSONObject jsonObject = JSON.parseObject(jsonString);
Map<String, List<DailyData>> cityDataMap = new HashMap<>(16);
......@@ -281,6 +266,8 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
}
}
}
FileUtil.del(tempFilePath);
}
PlantPredictedPowerDataViewMapper dataViewMapper = context.getBean(PlantPredictedPowerDataViewMapper.class);
if (CollUtil.isNotEmpty(batchList)) {
int size = batchList.size();
......@@ -294,6 +281,8 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
}
} catch (MessagingException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
NioUtil.close(folder);
NioUtil.close(store);
......
......@@ -144,7 +144,7 @@ spring.cloud.servicecomb.credentials.account.password=
spring.cloud.servicecomb.credentials.account.cipher=
# \u81EA\u5B9A\u4E49\u914D\u7F6E
weather.file.temp.path=D:\home\weather\temp\receive
weather.file.temp.path=D:\home\weather\temp\receive\
weather.mail.host=pop.163.com
weather.mail.username=zhaowentao0117@163.com
weather.mail.password=JPFHTZWASWSDSSZP
......
......@@ -232,7 +232,7 @@ spring.cloud.servicecomb.credentials.account.password=Xzypt@1020
spring.cloud.servicecomb.credentials.account.cipher=default
# \u81EA\u5B9A\u4E49\u914D\u7F6E
weather.file.temp.path=/home/weather-jar/temp/receive
weather.file.temp.path=/home/weather-jar/temp/receive/
weather.mail.host=pop.163.com
weather.mail.username=zhaowentao0117@163.com
weather.mail.password=JPFHTZWASWSDSSZP
......
......@@ -233,7 +233,7 @@ spring.cloud.servicecomb.credentials.account.password=
spring.cloud.servicecomb.credentials.account.cipher=
# \u81EA\u5B9A\u4E49\u914D\u7F6E
weather.file.temp.path=/home/weather-jar/temp/receive
weather.file.temp.path=/home/weather-jar/temp/receive/
weather.mail.host=pop.163.com
weather.mail.username=zhaowentao0117@163.com
weather.mail.password=JPFHTZWASWSDSSZP
......
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