Commit 7bf13aaf by 汪志阳

modify:bug 修改

parent 97a45a95
......@@ -5,12 +5,15 @@ import com.alibaba.fastjson.JSONObject;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO;
import com.makeit.entity.platform.alarm.PlatAlarmConfig;
import com.makeit.entity.platform.alarm.PlatAlarmRecord;
import com.makeit.entity.platform.elder.ElderSleepAnalysisVO;
import com.makeit.entity.platform.elder.PlatElderBreatheAnalysis;
import com.makeit.entity.platform.elder.PlatElderSleepAnalysis;
import com.makeit.external.huineng.HuiNengService;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.alarm.PlatAlarmConfigService;
import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.platform.elder.*;
import com.makeit.vo.platform.elder.wakeUpAnalysisVO;
......@@ -19,6 +22,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -50,6 +54,10 @@ public class PlatElderSleepController {
private PlatElderBreatheHeartRateRecordService platElderBreatheHeartRateRecordService;
@Autowired
private HuiNengService huiNengService;
@Resource
private PlatAlarmRecordService platAlarmRecordService;
@Resource
private PlatAlarmConfigService alarmConfigService;
@ApiOperation("测试")
......@@ -152,5 +160,16 @@ public class PlatElderSleepController {
@RequestParam Integer day) {
return ApiResponseUtils.success(platElderBreatheAnalysisService.elderGetUpAnalysisTask(month, day));
}
@ApiOperation("测试")
@GetMapping("test11")
@AuthIgnore
@TenantIdIgnore
public ApiResponseEntity<Void> test11(@RequestParam String id) {
PlatAlarmRecord alarmRecord = platAlarmRecordService.getById(id);
PlatAlarmConfig alarmConfig = alarmConfigService.getById(alarmRecord.getAlarmId());
platAlarmRecordService.noticeDeviceAlarm(alarmConfig, alarmRecord);
return ApiResponseUtils.success();
}
}
......@@ -305,7 +305,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
log.error("通知家属异常",e);
}
//通知内部人员
noticeUser(alarmConfig, alarmRecord);
// noticeUser(alarmConfig, alarmRecord);
}
......@@ -471,7 +471,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
String[] tenantChannels = alertChannel.split(",");
List<String> tenantChannelList = Lists.newArrayList(Arrays.asList(tenantChannels));
String[] split = notifyChannel.split(",");
List<String> split = Arrays.stream(notifyChannel.split(",")).sorted(Comparator.reverseOrder())
.collect(Collectors.toList());
for (String sendType : split) {
//租户告警渠道 没配置的 就不发送
if(!tenantChannelList.contains(sendType)){
......@@ -507,7 +508,11 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
msgSendDTO.setAlarmType(alarmConfig.getAlarmType());
//todo 小程序消息
try {
msgUtil.send(msgSendDTO);
} catch (Exception e) {
log.error("发送消息失败!");
}
}
}
}
......
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