DeviceService.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package com.aijiuyi.admin.service;
  2. import com.aijiuyi.admin.controller.dto.DeviceQueryDTO;
  3. import com.aijiuyi.admin.controller.dto.DeviceSaveDTO;
  4. import com.aijiuyi.admin.entity.Device;
  5. import com.aijiuyi.admin.entity.DeviceUserVO;
  6. import com.baomidou.mybatisplus.core.metadata.IPage;
  7. import com.baomidou.mybatisplus.extension.service.IService;
  8. import java.util.List;
  9. /**
  10. * 设备管理 Service 接口
  11. */
  12. public interface DeviceService extends IService<Device> {
  13. /**
  14. * 分页查询设备列表(联表聚合绑定用户信息)
  15. *
  16. * @param queryDTO 查询条件
  17. * @return 分页结果
  18. */
  19. IPage<Device> pageList(DeviceQueryDTO queryDTO);
  20. /**
  21. * 新增设备(可同时绑定初始用户)
  22. *
  23. * @param dto 设备信息
  24. */
  25. void addDevice(DeviceSaveDTO dto);
  26. /**
  27. * 修改设备信息(可同步更新绑定用户)
  28. *
  29. * @param dto 设备信息
  30. */
  31. void updateDevice(DeviceSaveDTO dto);
  32. /**
  33. * 删除设备(逻辑删除,同步解绑所有用户)
  34. *
  35. * @param id 设备ID
  36. */
  37. void deleteDevice(Long id);
  38. /**
  39. * 批量删除设备(逻辑删除,同步解绑所有用户)
  40. *
  41. * @param ids 设备ID列表
  42. */
  43. void batchDeleteDevices(List<Long> ids);
  44. /**
  45. * 批量导入设备(跳过编号已存在的记录)
  46. *
  47. * @param list 设备信息列表
  48. */
  49. void batchImport(List<Device> list);
  50. /**
  51. * 查询设备绑定的用户列表
  52. *
  53. * @param deviceId 设备ID
  54. * @return 绑定用户列表
  55. */
  56. List<DeviceUserVO> getDeviceUsers(Long deviceId);
  57. /**
  58. * 为设备添加绑定用户
  59. *
  60. * @param deviceId 设备ID
  61. * @param profileId 用户档案ID(user_profile.id)
  62. */
  63. void addDeviceUser(Long deviceId, Long profileId);
  64. /**
  65. * 解绑设备用户
  66. *
  67. * @param deviceId 设备ID
  68. * @param profileId 用户档案ID
  69. */
  70. void removeDeviceUser(Long deviceId, Long profileId);
  71. /**
  72. * 设为主用户(同一设备下只能有一个主用户)
  73. *
  74. * @param deviceId 设备ID
  75. * @param profileId 用户档案ID
  76. */
  77. void setDeviceUserPrimary(Long deviceId, Long profileId);
  78. /**
  79. * 批量解绑设备用户
  80. *
  81. * @param deviceId 设备ID
  82. * @param bindIds 绑定记录ID列表(user_device.id)
  83. */
  84. void batchRemoveDeviceUsers(Long deviceId, List<Long> bindIds);
  85. }