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 确认信息 * @param deviceEventInfo 确认信息
*/ */
@PostMapping("/confirm") @PostMapping("/confirm")
public R<Void> confirmEvent(@RequestBody DeviceEventInfo deviceEventInfo){ public R<Void> confirmEvent(@RequestBody List<DeviceEventInfo> deviceEventInfoList){
eventService.confirmEvent(deviceEventInfo); eventService.confirmEvent(deviceEventInfoList);
return R.success(); return R.success();
} }
} }

View File

@ -9,5 +9,5 @@ import java.util.List;
public interface EventService { public interface EventService {
List<DeviceEventInfo> queryEvent(EventQueryParam param); 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 @Override
public void confirmEvent(DeviceEventInfo deviceEventInfo) { public void confirmEvent(List<DeviceEventInfo> deviceEventInfoList) {
Long confirmTime = System.currentTimeMillis(); Long confirmTime = System.currentTimeMillis();
deviceEventInfo.setConfirmTime(confirmTime); for (DeviceEventInfo deviceEventInfo : deviceEventInfoList){
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY); deviceEventInfo.setConfirmTime(confirmTime);
deviceEventInfo.setConfirmAccount(sysUserVo.getAccount()); SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
tdEngineService.confirmEvent(deviceEventInfo); deviceEventInfo.setConfirmAccount(sysUserVo.getAccount());
tdEngineService.confirmEvent(deviceEventInfo);
}
} }
} }