feat:修改数据存储时间

This commit is contained in:
listom 2024-08-16 14:07:57 +08:00
parent 3cbc798b60
commit 1b8c78f792
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ public class HaiWeiController {
/**
* 获取所有水肥设备
* 获取所有海为设备
*/
@GetMapping("/devices")
@ApiOperation("获取所有海为设备")
@ -39,7 +39,7 @@ public class HaiWeiController {
}
/**
* 获取农作物产量统计
* 获取海为设备缓存信息
*/
@GetMapping("/cache/{deviceId}")
@ApiOperation("获取海为设备缓存信息")
@ -48,7 +48,7 @@ public class HaiWeiController {
}
/**
* grm设备下发指令
* 海为设备下发指令
*/
@ApiOperation("向海为设备下发指令")
@PostMapping("/cmd")

View File

@ -194,9 +194,9 @@ public class QxtrTask {
if (deviceLogEntityList.size() > 0) {
String key = DeviceCacheConstants.getDeviceInsertDb(deviceEntity.getDeviceId());
Object cacheObject = redisCache.getCacheObject(key);
//10分钟插入数据库一次
//1分钟插入数据库一次
if (null == cacheObject) {
redisCache.setCacheObject(key, 0, 10, TimeUnit.MINUTES);
redisCache.setCacheObject(key, 0, 1, TimeUnit.MINUTES);
TdLogDto dto = new TdLogDto();
dto.setSerialNumber(deviceEntity.getSerialNumber());
dto.setList(deviceLogEntityList);