Commit 6dee70d4 by huangjy

Merge remote-tracking branch 'origin/dev'

parents 112276c4 b9813778
package com.makeit.external.strategy;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -82,7 +83,7 @@ public class HuiNengStrategy implements OpenApiBaseStrategy {
reportInfo.setTurnState(bodymove.equals("0") ? "0" : "1");
data.add(reportInfo);
dto.setData(data);
String reqJson = JSON.toJSONString(dto);
String reqJson = JSONUtil.toJsonStr(dto);
String url = platTenant.getOpenApiUrl() + "/admin-api/v1/HealthMonitoringEquipment/TimingdataPush?token=aHVpbmVuZ2dhbnpoaV9wdXNoc2V0";
log.info("请求url:{},参数:{}", url, reqJson);
String result = HttpUtil.createPost(url)
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
......@@ -93,7 +94,9 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
public List<PlatElderBreatheAnalysis> elderHeartRespiratoryAnalysisTask(Integer month,Integer day) {
// 12-06,12-18 12-07、 12-12(70分)
LocalDate nowDate = LocalDate.now();
// LocalDate nowDate = LocalDate.of(2023, month, day);
if (month != null && day != null) {
nowDate = LocalDate.of(2023, month, day);
}
LocalDate yesDate = nowDate.minusDays(1);
LocalDateTime yesStart = LocalDateTimeUtils.getDayStart(yesDate);
......@@ -120,6 +123,11 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
.orderByDesc(BaseEntity::getCreateBy)
.last("limit 1"));
Map<String, PlatElderBreatheAnalysis> analysisMap = StreamUtil.toMapDep(platElderBreatheAnalysisService.list(Wrappers.<PlatElderBreatheAnalysis>lambdaQuery()
.in(PlatElderBreatheAnalysis::getElderId, elderIdList)
.eq(PlatElderBreatheAnalysis::getHappenDate, yesDate).last("limit 1")), PlatElderBreatheAnalysis::getElderId);
// 呼吸率
int breatheThresholdMin = Integer.parseInt(analysisModel.getBreatheThresholdMin());
int breatheThresholdMax = Integer.parseInt(analysisModel.getBreatheThresholdMax());
......@@ -443,9 +451,15 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
platElderBreatheAnalysis.setHappenDate(String.valueOf(yesDate));
platElderBreatheAnalysis.setTenantId(platElder.getTenantId());
platElderBreatheAnalysis.setBreatheEvaluate(diseaseReport == null ? "" : diseaseReport.getEvaluate());
platElderBreatheAnalysisService.save(platElderBreatheAnalysis);
// platElderBreatheAnalysis.setRemake(String.format("normalFlag:%s,hrFastFlag:%s,brStopFlag:%s,brFastFlag:%s,brSlowFlag:%s,hrSlowFlag:%s",
// normalFlag, hrFastFlag, brStopFlag, brFastFlag, brSlowFlag, hrSlowFlag));
// 修复数据
PlatElderBreatheAnalysis breatheAnalysis = analysisMap.get(platElder.getId());
if (breatheAnalysis != null) {
platElderBreatheAnalysis.setId(breatheAnalysis.getId());
platElderBreatheAnalysisService.updateById(platElderBreatheAnalysis);
} else {
platElderBreatheAnalysisService.save(platElderBreatheAnalysis);
}
result.add(platElderBreatheAnalysis);
}
......
......@@ -111,7 +111,7 @@ public class PushCallback implements MqttCallback {
// 收到消息并设置返回字符串格式
String payload = new String(message.getPayload(), "UTF-8");
logger.info("接收消息内容:payload格式:{}", payload);
//logger.info("接收消息内容:payload格式:{}", payload);
// 解析数据
DeviceInfo device = JSON.parseObject(payload, DeviceInfo.class);
......@@ -210,13 +210,13 @@ public class PushCallback implements MqttCallback {
PlatDevice platDevice = deviceCacheUtil.get(deviceId + ":" + iot_tenantId);
if (platDevice == null) {
logger.error("获取设备信息异常,设备iot-id,iot_tenantId:" + deviceId+","+iot_tenantId);
return;
continue;
}
List<PlatAlarmConfig> deviceAlarmConfigList = alarmConfigCacheUtil.getDeviceAlarmConfigMap(platDevice);
deviceAlarmConfigList.removeIf(Objects::isNull);
if (CollectionUtils.isEmpty(deviceAlarmConfigList)) {
logger.error("该设备没有告警配置,设备iot-id,iot_tenantId:" + deviceId+","+iot_tenantId);
return;
continue;
}
handleOffBed(platDevice,properties,messageType);
......
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 sign in to comment