Alarms.java 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. package com.example.unusualsounds.project.vox.entity;
  2. import com.baomidou.mybatisplus.annotation.IdType;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import java.io.Serializable;
  7. import java.math.BigDecimal;
  8. import java.util.Date;
  9. import lombok.AllArgsConstructor;
  10. import lombok.Data;
  11. import lombok.NoArgsConstructor;
  12. /**
  13. * 告警信息表
  14. * @TableName alarms
  15. */
  16. @TableName(value ="alarms")
  17. @Data
  18. @AllArgsConstructor
  19. @NoArgsConstructor
  20. public class Alarms implements Serializable {
  21. /**
  22. * 自增id
  23. */
  24. @TableId(value = "id", type = IdType.AUTO)
  25. private Long id;
  26. /**
  27. * 告警id
  28. */
  29. @TableField(value = "uuid")
  30. private String uuid;
  31. /**
  32. * 创建时间
  33. */
  34. @TableField(value = "created_at")
  35. private Date createdAt;
  36. /**
  37. * 更新时间
  38. */
  39. @TableField(value = "updated_at")
  40. private Date updatedAt;
  41. /**
  42. * 删除时间
  43. */
  44. @TableField(value = "deleted_at")
  45. private Date deletedAt;
  46. /**
  47. * 部门ID
  48. */
  49. @TableField(value = "dept_uuid")
  50. private String deptUuid;
  51. /**
  52. * 组织ID
  53. */
  54. @TableField(value = "org_uuid")
  55. private String orgUuid;
  56. /**
  57. * 告警名称(设备异音、人声呼救)
  58. */
  59. @TableField(value = "name")
  60. private String name;
  61. /**
  62. * 告警描述 (摄像头信息+名称等简单拼接)
  63. */
  64. @TableField(value = "description")
  65. private String description;
  66. /**
  67. * created, reported, processing, finished, mistaken
  68. * 默认created
  69. */
  70. @TableField(value = "status")
  71. private String status;
  72. /**
  73. * pending, processing, finished, mistaken
  74. * 默认pending
  75. */
  76. @TableField(value = "display_status")
  77. private String displayStatus;
  78. /**
  79. * 告警等级
  80. * 算法回传
  81. */
  82. @TableField(value = "level")
  83. private Integer level;
  84. /**
  85. * 图片链接
  86. * minio中固定的图片url链接
  87. */
  88. @TableField(value = "image_url")
  89. private String imageUrl;
  90. /**
  91. * 缩略图url
  92. * minio中固定的图片url链接
  93. */
  94. @TableField(value = "thumbnail_url")
  95. private String thumbnailUrl;
  96. /**
  97. * 处理后的图片链接
  98. * 无,随机填值
  99. */
  100. @TableField(value = "image_draw_url")
  101. private String imageDrawUrl;
  102. /**
  103. * 视频片段链接
  104. * minio中固定的音频url链接
  105. */
  106. @TableField(value = "video_url")
  107. private String videoUrl;
  108. /**
  109. * 设备ID
  110. * 接口获取
  111. */
  112. @TableField(value = "device_uuid")
  113. private String deviceUuid;
  114. /**
  115. * 技能ID
  116. * 默认,异音检测
  117. */
  118. @TableField(value = "skill_uuid")
  119. private String skillUuid;
  120. /**
  121. * 模型的标注数据
  122. * 无
  123. */
  124. @TableField(value = "annotations_json")
  125. private String annotationsJson;
  126. /**
  127. * 剪切的图片列表
  128. * 无
  129. */
  130. @TableField(value = "snapshots_json")
  131. private String snapshotsJson;
  132. /**
  133. * 用户id
  134. * 无
  135. */
  136. @TableField(value = "user_uuid")
  137. private String userUuid;
  138. /**
  139. * 检测区域
  140. * 无
  141. */
  142. @TableField(value = "rois_json")
  143. private String roisJson;
  144. /**
  145. * 检测区域UUID
  146. * 无
  147. */
  148. @TableField(value = "rois_uuid")
  149. private String roisUuid;
  150. /**
  151. * 追踪ID
  152. * 无
  153. */
  154. @TableField(value = "track_uuid")
  155. private String trackUuid;
  156. /**
  157. * 传感器设备告警数据
  158. * 无
  159. */
  160. @TableField(value = "figures")
  161. private String figures;
  162. /**
  163. * 传感器告警或者是摄像头告警,camera or sensor
  164. * 视频,camera ,传感器 sensor
  165. */
  166. @TableField(value = "type")
  167. private String type;
  168. /**
  169. * 预警触发类型 自动(默认):auto 手动: manual
  170. */
  171. @TableField(value = "trigger_type")
  172. private String triggerType;
  173. /**
  174. * 机器人ID
  175. * 无
  176. */
  177. @TableField(value = "robot_uuid")
  178. private String robotUuid;
  179. /**
  180. * 预警位置
  181. * 无
  182. */
  183. @TableField(value = "location")
  184. private Double location;
  185. /**
  186. * 预警原因
  187. * 无
  188. */
  189. @TableField(value = "reason")
  190. private String reason;
  191. /**
  192. * 是否已消警
  193. * 默认0 未消警
  194. */
  195. @TableField(value = "is_canceled")
  196. private Integer isCanceled;
  197. /**
  198. * 是否已升级
  199. * 无
  200. */
  201. @TableField(value = "is_upgraded")
  202. private Integer isUpgraded;
  203. /**
  204. * 消警时间
  205. * 无
  206. */
  207. @TableField(value = "cancel_alarm_time")
  208. private Integer cancelAlarmTime;
  209. /**
  210. * 数据来源 cloud/node/aiBox
  211. * 默认cloud
  212. */
  213. @TableField(value = "data_source")
  214. private String dataSource;
  215. /**
  216. * 云台垂直角度
  217. * 无
  218. */
  219. @TableField(value = "ptz_pan_angle")
  220. private BigDecimal ptzPanAngle;
  221. /**
  222. * 云台水平角度
  223. * 无
  224. */
  225. @TableField(value = "ptz_title_angle")
  226. private BigDecimal ptzTitleAngle;
  227. /**
  228. * 是否为表计告警
  229. * 无
  230. */
  231. @TableField(value = "meter")
  232. private Integer meter;
  233. /**
  234. * 告警组id
  235. * 无
  236. */
  237. @TableField(value = "alarm_group_id")
  238. private String alarmGroupId;
  239. /**
  240. * 点位id
  241. * 无
  242. */
  243. @TableField(value = "spot_uuid")
  244. private String spotUuid;
  245. /**
  246. * 是否已发布
  247. * 无
  248. */
  249. @TableField(value = "is_published")
  250. private Integer isPublished;
  251. /**
  252. * 是否被收藏
  253. * 无
  254. */
  255. @TableField(value = "is_collected")
  256. private Integer isCollected;
  257. /**
  258. * 点位类型
  259. * 无
  260. */
  261. @TableField(value = "ponding_type")
  262. private String pondingType;
  263. /**
  264. * invalid.无效; efficient.有效;
  265. * 无
  266. */
  267. @TableField(value = "labels")
  268. private String labels;
  269. /**
  270. * 大模型复盘0.否;1.大模型复盘;2.人工审核;4.大模型
  271. * 无
  272. */
  273. @TableField(value = "ai_filter")
  274. private Integer aiFilter;
  275. /**
  276. * 智能过滤处理人
  277. * 无
  278. */
  279. @TableField(value = "process_user")
  280. private String processUser;
  281. /**
  282. * 传感器设置的阈值
  283. * 无
  284. */
  285. @TableField(value = "thresholds")
  286. private String thresholds;
  287. /**
  288. * 多模态技能ID
  289. * 无
  290. */
  291. @TableField(value = "multi_skill_uuid")
  292. private String multiSkillUuid;
  293. /**
  294. * 过滤任务ID
  295. * 无
  296. */
  297. @TableField(value = "filter_task_uuid")
  298. private String filterTaskUuid;
  299. /**
  300. * 云端分配给边缘的唯一uuid
  301. * 查询
  302. */
  303. @TableField(value = "edge_uuid")
  304. private String edgeUuid;
  305. @TableField(exist = false)
  306. private static final long serialVersionUID = 1L;
  307. private Alarms(Builder builder){
  308. this.id = builder.id;
  309. this.uuid = builder.uuid;
  310. this.createdAt = builder.createdAt;
  311. this.updatedAt = builder.updatedAt;
  312. this.deletedAt = builder.deletedAt;
  313. this.deptUuid = builder.deptUuid;
  314. this.orgUuid = builder.orgUuid;
  315. this.name = builder.name;
  316. this.description = builder.description;
  317. this.status = builder.status;
  318. this.displayStatus = builder.displayStatus;
  319. this.level = builder.level;
  320. this.imageUrl = builder.imageUrl;
  321. this.thumbnailUrl = builder.thumbnailUrl;
  322. this.imageDrawUrl = builder.imageDrawUrl;
  323. this.videoUrl = builder.videoUrl;
  324. this.deviceUuid = builder.deviceUuid;
  325. this.skillUuid = builder.skillUuid;
  326. this.annotationsJson = builder.annotationsJson;
  327. this.snapshotsJson = builder.snapshotsJson;
  328. this.userUuid = builder.userUuid;
  329. this.roisJson = builder.roisJson;
  330. this.roisUuid = builder.roisUuid;
  331. this.trackUuid = builder.trackUuid;
  332. this.figures = builder.figures;
  333. this.type = builder.type;
  334. this.triggerType = builder.triggerType;
  335. this.robotUuid = builder.robotUuid;
  336. this.location = builder.location;
  337. this.reason = builder.reason;
  338. this.isCanceled = builder.isCanceled;
  339. this.isUpgraded = builder.isUpgraded;
  340. this.cancelAlarmTime = builder.cancelAlarmTime;
  341. this.dataSource = builder.dataSource;
  342. this.ptzPanAngle = builder.ptzPanAngle;
  343. this.ptzTitleAngle = builder.ptzTitleAngle;
  344. this.meter = builder.meter;
  345. this.alarmGroupId = builder.alarmGroupId;
  346. this.spotUuid = builder.spotUuid;
  347. this.isPublished = builder.isPublished;
  348. this.isCollected = builder.isCollected;
  349. this.pondingType = builder.pondingType;
  350. this.labels = builder.labels;
  351. this.aiFilter = builder.aiFilter;
  352. this.processUser = builder.processUser;
  353. this.thresholds = builder.thresholds;
  354. this.multiSkillUuid = builder.multiSkillUuid;
  355. this.filterTaskUuid = builder.filterTaskUuid;
  356. this.edgeUuid = builder.edgeUuid;
  357. }
  358. /**
  359. * 默认值构建器
  360. */
  361. public static class Builder{
  362. private Long id = null;
  363. private String uuid = null;
  364. private Date createdAt = null;
  365. private Date updatedAt = null;
  366. private Date deletedAt = null;
  367. private String deptUuid = "";
  368. private String orgUuid = "";
  369. private String name = "";
  370. private String description = "";
  371. private String status = "created";
  372. private String displayStatus = "pending";
  373. private Integer level = 4;
  374. private String imageUrl = "s3://windmill/store/452b784fe34d42b1b3700b6aeb648e1e/alarm-images/cloud/2025-02-14/681082ce-31e3-4dcf-9393-cbc67e9c4749.jpeg";
  375. private String thumbnailUrl = "";
  376. private String imageDrawUrl = "";
  377. private String videoUrl = "";
  378. private String deviceUuid = "";
  379. private String skillUuid = ""; // 默认值
  380. private String annotationsJson = "";
  381. private String snapshotsJson = "";
  382. private String userUuid = "";
  383. private String roisJson = "";
  384. private String roisUuid = "";
  385. private String trackUuid = "";
  386. private String figures = "";
  387. private String type = "voice";
  388. private String triggerType = "auto";
  389. private String robotUuid = "";
  390. private Double location = 0.0;
  391. private String reason = "";
  392. private Integer isCanceled = 0; // 默认值
  393. private Integer isUpgraded = 0;
  394. private Integer cancelAlarmTime = 0;
  395. private String dataSource = "cloud"; // 默认值
  396. private BigDecimal ptzPanAngle = BigDecimal.valueOf(0.00);
  397. private BigDecimal ptzTitleAngle = BigDecimal.valueOf(0.00);
  398. private Integer meter = 0;
  399. private String alarmGroupId = "";
  400. private String spotUuid = "";
  401. private Integer isPublished = 0;
  402. private Integer isCollected = 0;
  403. private String pondingType = "";
  404. private String labels = "";
  405. private Integer aiFilter = 0;
  406. private String processUser = "";
  407. private String thresholds = null;
  408. private String multiSkillUuid = "";
  409. private String filterTaskUuid = "";
  410. private String edgeUuid = "";
  411. public Builder setId(Long id) { this.id = id; return this; }
  412. public Builder setUuid(String uuid) { this.uuid = uuid; return this; }
  413. public Builder setCreatedAt(Date createdAt) { this.createdAt = createdAt; return this; }
  414. public Builder setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; return this; }
  415. public Builder setDeletedAt(Date deletedAt) { this.deletedAt = deletedAt; return this; }
  416. public Builder setDeptUuid(String deptUuid) { this.deptUuid = deptUuid; return this; }
  417. public Builder setOrgUuid(String orgUuid) { this.orgUuid = orgUuid; return this; }
  418. public Builder setName(String name) { this.name = name; return this; }
  419. public Builder setDescription(String description) { this.description = description; return this; }
  420. public Builder setStatus(String status) { this.status = status; return this; }
  421. public Builder setDisplayStatus(String displayStatus) { this.displayStatus = displayStatus; return this; }
  422. public Builder setLevel(Integer level) { this.level = level; return this; }
  423. public Builder setImageUrl(String imageUrl) { this.imageUrl = imageUrl; return this; }
  424. public Builder setThumbnailUrl(String thumbnailUrl) { this.thumbnailUrl = thumbnailUrl; return this; }
  425. public Builder setImageDrawUrl(String imageDrawUrl) { this.imageDrawUrl = imageDrawUrl; return this; }
  426. public Builder setVideoUrl(String videoUrl) { this.videoUrl = videoUrl; return this; }
  427. public Builder setDeviceUuid(String deviceUuid) { this.deviceUuid = deviceUuid; return this; }
  428. public Builder setSkillUuid(String skillUuid) { this.skillUuid = skillUuid; return this; }
  429. public Builder setAnnotationsJson(String annotationsJson) { this.annotationsJson = annotationsJson; return this; }
  430. public Builder setSnapshotsJson(String snapshotsJson) { this.snapshotsJson = snapshotsJson; return this; }
  431. public Builder setUserUuid(String userUuid) { this.userUuid = userUuid; return this; }
  432. public Builder setRoisJson(String roisJson) { this.roisJson = roisJson; return this; }
  433. public Builder setRoisUuid(String roisUuid) { this.roisUuid = roisUuid; return this; }
  434. public Builder setTrackUuid(String trackUuid) { this.trackUuid = trackUuid; return this; }
  435. public Builder setFigures(String figures) { this.figures = figures; return this; }
  436. public Builder setType(String type) { this.type = type; return this; }
  437. public Builder setTriggerType(String triggerType) { this.triggerType = triggerType; return this; }
  438. public Builder setRobotUuid(String robotUuid) { this.robotUuid = robotUuid; return this; }
  439. public Builder setLocation(Double location) { this.location = location; return this; }
  440. public Builder setReason(String reason) { this.reason = reason; return this; }
  441. public Builder setIsCanceled(Integer isCanceled) { this.isCanceled = isCanceled; return this; }
  442. public Builder setIsUpgraded(Integer isUpgraded) { this.isUpgraded = isUpgraded; return this; }
  443. public Builder setCancelAlarmTime(Integer cancelAlarmTime) { this.cancelAlarmTime = cancelAlarmTime; return this; }
  444. public Builder setDataSource(String dataSource) { this.dataSource = dataSource; return this; }
  445. public Builder setPtzPanAngle(BigDecimal ptzPanAngle) { this.ptzPanAngle = ptzPanAngle; return this; }
  446. public Builder setPtzTitleAngle(BigDecimal ptzTitleAngle) { this.ptzTitleAngle = ptzTitleAngle; return this; }
  447. public Builder setMeter(Integer meter) { this.meter = meter; return this; }
  448. public Builder setAlarmGroupId(String alarmGroupId) { this.alarmGroupId = alarmGroupId; return this; }
  449. public Builder setSpotUuid(String spotUuid) { this.spotUuid = spotUuid; return this; }
  450. public Builder setIsPublished(Integer isPublished) { this.isPublished = isPublished; return this; }
  451. public Builder setIsCollected(Integer isCollected) { this.isCollected = isCollected; return this; }
  452. public Builder setPondingType(String pondingType) { this.pondingType = pondingType; return this; }
  453. public Builder setLabels(String labels) { this.labels = labels; return this; }
  454. public Builder setAiFilter(Integer aiFilter) { this.aiFilter = aiFilter; return this; }
  455. public Builder setProcessUser(String processUser) { this.processUser = processUser; return this; }
  456. public Builder setThresholds(String thresholds) { this.thresholds = thresholds; return this; }
  457. public Builder setMultiSkillUuid(String multiSkillUuid) { this.multiSkillUuid = multiSkillUuid; return this; }
  458. public Builder setFilterTaskUuid(String filterTaskUuid) { this.filterTaskUuid = filterTaskUuid; return this; }
  459. public Builder setEdgeUuid(String edgeUuid) { this.edgeUuid = edgeUuid; return this; }
  460. public Alarms build(){
  461. return new Alarms(this);
  462. }
  463. };
  464. }