添加流量计设备实时数据相关接口以及定时任务,统计流量计设备在线数量等

This commit is contained in:
蒾酒
2024-12-30 02:54:13 +08:00
parent 3aac79e169
commit b590dfa9fa
20 changed files with 855 additions and 28 deletions

View File

@ -83,15 +83,22 @@ public class DeviceOtherMsgConsumer {
//收到定时报文
if(JSONUtil.parseObj(data1).get("action").equals("timeMsg")){
pumpUsageRecords.setMessageContent(JSONUtil.toJsonStr(jsonObject));
int i = ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(pumpUsageRecords);
if(i<1){
System.err.println("--------------------------保存使用记录失败!---------------------------");
}
// int i = ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(pumpUsageRecords);
// if(i<1){
// System.err.println("--------------------------保存使用记录失败!---------------------------");
// }
}else if(JSONUtil.parseObj(data1).get("action").equals("safeMsg")){
//续费在线状态
updateDeviceOnlineStatus( productId,serialNumber);
//保存数据
pumpUsageRecords.setMessageContent(JSONUtil.toJsonStr(jsonObject));
// int i = ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(pumpUsageRecords);
// if(i<1){
// System.err.println("--------------------------保存使用记录失败!---------------------------");
// }
}//开阀门,关阀门
else if(JSONUtil.parseObj(data1).get("action").equals("startPump")||JSONUtil.parseObj(data1).get("action").equals("stopPump")){
int i = ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(pumpUsageRecords);
if(i<1){
System.err.println("--------------------------保存使用记录失败!---------------------------");