feat:修改数据存储时间
This commit is contained in:
parent
3cbc798b60
commit
1b8c78f792
@ -30,7 +30,7 @@ public class HaiWeiController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有水肥设备
|
* 获取所有海为设备
|
||||||
*/
|
*/
|
||||||
@GetMapping("/devices")
|
@GetMapping("/devices")
|
||||||
@ApiOperation("获取所有海为设备")
|
@ApiOperation("获取所有海为设备")
|
||||||
@ -39,7 +39,7 @@ public class HaiWeiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取农作物产量统计
|
* 获取海为设备缓存信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/cache/{deviceId}")
|
@GetMapping("/cache/{deviceId}")
|
||||||
@ApiOperation("获取海为设备缓存信息")
|
@ApiOperation("获取海为设备缓存信息")
|
||||||
@ -48,7 +48,7 @@ public class HaiWeiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向grm设备下发指令
|
* 向海为设备下发指令
|
||||||
*/
|
*/
|
||||||
@ApiOperation("向海为设备下发指令")
|
@ApiOperation("向海为设备下发指令")
|
||||||
@PostMapping("/cmd")
|
@PostMapping("/cmd")
|
||||||
|
@ -194,9 +194,9 @@ public class QxtrTask {
|
|||||||
if (deviceLogEntityList.size() > 0) {
|
if (deviceLogEntityList.size() > 0) {
|
||||||
String key = DeviceCacheConstants.getDeviceInsertDb(deviceEntity.getDeviceId());
|
String key = DeviceCacheConstants.getDeviceInsertDb(deviceEntity.getDeviceId());
|
||||||
Object cacheObject = redisCache.getCacheObject(key);
|
Object cacheObject = redisCache.getCacheObject(key);
|
||||||
//10分钟插入数据库一次
|
//1分钟插入数据库一次
|
||||||
if (null == cacheObject) {
|
if (null == cacheObject) {
|
||||||
redisCache.setCacheObject(key, 0, 10, TimeUnit.MINUTES);
|
redisCache.setCacheObject(key, 0, 1, TimeUnit.MINUTES);
|
||||||
TdLogDto dto = new TdLogDto();
|
TdLogDto dto = new TdLogDto();
|
||||||
dto.setSerialNumber(deviceEntity.getSerialNumber());
|
dto.setSerialNumber(deviceEntity.getSerialNumber());
|
||||||
dto.setList(deviceLogEntityList);
|
dto.setList(deviceLogEntityList);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user