对获取用户信息进行优化

This commit is contained in:
15856 2024-08-15 15:03:26 +08:00
parent 67b80c13f3
commit 581ddd9582
1 changed files with 9 additions and 3 deletions

View File

@ -501,10 +501,16 @@ public class IotMachineServiceImpl implements IotMachineService {
@Scheduled(fixedRate = 10800000)
public int alarmPush() {
log.info("开始获取报警信息====");
List<MaTypeKeeper> maTypeKeeperList = new ArrayList<>();
//获取当前登录用户的所有信息
try {
Long userId = SecurityUtils.getLoginUser().getUserid();
//查看当前用户名下有哪些类型的设备
List<MaTypeKeeper> maTypeKeeperList = maTypeMapper.selectMaTypeByUserId(userId);
maTypeKeeperList = maTypeMapper.selectMaTypeByUserId(userId);
} catch (Exception e) {
log.error("获取用户信息有误!!");
return 0;
}
List<IotLocationVo> iotLocationVoAll = new ArrayList<>();
for (int i = 0; i < maTypeKeeperList.size(); i++) {
//查询该类机具有哪些设备绑定的iot设备