Merge remote-tracking branch 'origin/main'

This commit is contained in:
houwei 2024-11-05 16:31:16 +08:00
commit 851c332df8
3 changed files with 10 additions and 8 deletions

View File

@ -46,8 +46,8 @@ public class EventController {
* @param deviceEventInfo 确认信息
*/
@PostMapping("/confirm")
public R<Void> confirmEvent(@RequestBody DeviceEventInfo deviceEventInfo){
eventService.confirmEvent(deviceEventInfo);
public R<Void> confirmEvent(@RequestBody List<DeviceEventInfo> deviceEventInfoList){
eventService.confirmEvent(deviceEventInfoList);
return R.success();
}
}

View File

@ -9,5 +9,5 @@ import java.util.List;
public interface EventService {
List<DeviceEventInfo> queryEvent(EventQueryParam param);
void confirmEvent(DeviceEventInfo deviceEventInfo);
void confirmEvent(List<DeviceEventInfo> deviceEventInfoList);
}

View File

@ -31,11 +31,13 @@ public class EventServiceImpl implements EventService {
}
@Override
public void confirmEvent(DeviceEventInfo deviceEventInfo) {
public void confirmEvent(List<DeviceEventInfo> deviceEventInfoList) {
Long confirmTime = System.currentTimeMillis();
deviceEventInfo.setConfirmTime(confirmTime);
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
deviceEventInfo.setConfirmAccount(sysUserVo.getAccount());
tdEngineService.confirmEvent(deviceEventInfo);
for (DeviceEventInfo deviceEventInfo : deviceEventInfoList){
deviceEventInfo.setConfirmTime(confirmTime);
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
deviceEventInfo.setConfirmAccount(sysUserVo.getAccount());
tdEngineService.confirmEvent(deviceEventInfo);
}
}
}