定时获取卸料平台数据

This commit is contained in:
guo 2024-01-22 09:33:18 +08:00
parent cde5ab179c
commit e58cce6201
2 changed files with 6 additions and 2 deletions

View File

@ -299,6 +299,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/xmgl/workerInfo/selectPersonTypeAndEduStatistics").permitAll()
.antMatchers("/xmgl/taskProgressRt/queryById").permitAll()
.antMatchers("/xmgl/frontierProtectionNoNetData/alaDeviceSubscribe").permitAll()
.antMatchers("/xmgl/highSlopeCurrentData/exportData").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
.and()

View File

@ -85,7 +85,7 @@ public class DischargingPlatformCurrentDataTask {
map.put("pageNum", "1");
map.put("startTime", DateUtil.formatDateTime(DateUtil.offsetMinute(now, -5)));
map.put("endTime", DateUtil.formatDateTime(now));
JSONObject realTimeData = xiwonUtil.postForm("/unload/listRealUnloadData", project.getXiwonAppId(), project.getXiwonAppSecret(), map, JSONObject.class, (() -> {
JSONObject realTimeData = xiwonUtil.postForm("/unloading/realTimeData", project.getXiwonAppId(), project.getXiwonAppSecret(), map, JSONObject.class, (() -> {
map.put("deviceSn", devSn);
return map;
}));
@ -96,7 +96,10 @@ public class DischargingPlatformCurrentDataTask {
JSONArray dataArray = realTimeData.getJSONArray("data");
if (CollUtil.isNotEmpty(dataArray)) {
DischargingPlatformDev platformDev = dischargingPlatformDevMapper.selectOne(new LambdaQueryWrapper<DischargingPlatformDev>()
.eq(DischargingPlatformDev::getDevSn, dev));
.eq(DischargingPlatformDev::getDevSn, devSn));
if (platformDev == null) {
return;
}
// 解析请求到的参数保存到我们的数据库
for (Object o : dataArray) {
DischargingPlatformCurrentDataDto dto = BeanUtil.toBean(o, DischargingPlatformCurrentDataDto.class);