Commit 578223ad authored by AfirSraftGarrier's avatar AfirSraftGarrier

修改

parent 703116b2
...@@ -92,10 +92,9 @@ public class OperateController { ...@@ -92,10 +92,9 @@ public class OperateController {
@GetMapping("alarm/list") @GetMapping("alarm/list")
@MyLog(title = "获取告警列表", businessType = BusinessType.SELECT) @MyLog(title = "获取告警列表", businessType = BusinessType.SELECT)
public ResResult<List<AlarmVo>> getAlarmList() { public ResResult<List<AlarmVo>> getAlarmList() {
String userId = UserUtils.getLoginUserId(); String user = UserUtils.getLoginUserId();
String comeId = ESAPI.encoder().encodeForHTML(userId); int userI = Integer.valueOf(user);
int Id = Integer.valueOf(comeId); List<AlarmVo> alarmList = alarmService.getAlarmList(userI);
List<AlarmVo> alarmList = alarmService.getAlarmList(Id);
return ResResult.success().goRecord(alarmList); return ResResult.success().goRecord(alarmList);
} }
......
...@@ -25,11 +25,11 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements ...@@ -25,11 +25,11 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements
} }
@Override @Override
public List<AlarmVo> getAlarmList(int userId) { public List<AlarmVo> getAlarmList(int uI) {
if (userId == 0) { if (uI == 0) {
throw new IotLicenseException(ResultCode.VALIDATE_FAILED.getCode(), ResultCode.VALIDATE_FAILED.getMsg()); throw new IotLicenseException(ResultCode.VALIDATE_FAILED.getCode(), ResultCode.VALIDATE_FAILED.getMsg());
} }
List<AlarmVo> alarmVos = alarmMapper.getAlarmList(userId); List<AlarmVo> alarmVos = alarmMapper.getAlarmList(uI);
alarmVos = alarmVos.stream().sorted(Comparator.comparing(AlarmVo::getCreateTime, Comparator.reverseOrder())).collect(Collectors.toList()); alarmVos = alarmVos.stream().sorted(Comparator.comparing(AlarmVo::getCreateTime, Comparator.reverseOrder())).collect(Collectors.toList());
return alarmVos; return alarmVos;
} }
......
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 to comment