BusDeviceAlarmEntity.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package com.coffee.bus.entity;
  2. import com.baomidou.mybatisplus.annotation.TableName;
  3. import com.coffee.bus.enums.DeviceAlarmEnum;
  4. import com.coffee.common.entity.TenantGenericEntity;
  5. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  6. import io.swagger.annotations.ApiModel;
  7. import io.swagger.annotations.ApiModelProperty;
  8. import lombok.Data;
  9. import lombok.EqualsAndHashCode;
  10. import lombok.ToString;
  11. import java.util.Date;
  12. /**
  13. * @author lifang
  14. * @version 1.0.0
  15. * @ClassName BusDeviceAlarmEntity.java
  16. * @Description 设备报警信息
  17. * @createTime 2022年04月08日 16:18:00
  18. */
  19. @EqualsAndHashCode(callSuper = true)
  20. @Data
  21. @TableName(value = "bus_device_alarm",autoResultMap = true)
  22. @ApiModel(value="设备报警信息", description="设备报警信息记录")
  23. @ToString
  24. public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
  25. @ApiModelProperty(value = "设备唯一编码",readOnly = true)
  26. private String deviceId;
  27. @ApiModelProperty(value = "报警信息")
  28. private DeviceAlarmEnum alarm;
  29. @ApiModelProperty(value = "报警时间")
  30. private Date alarmTime;
  31. @ApiModelProperty(value = "报警原因")
  32. private String cause;
  33. @ApiModelProperty(value = "报警是否正在进行",hidden = true)
  34. @JsonIgnoreProperties(allowSetters = true)
  35. private Boolean doing;
  36. @ApiModelProperty(value = "是否已处理 0、未处理,1、已处理,暂未使用")
  37. private Boolean dealing;
  38. @ApiModelProperty(value = "报警记录所绑定的历史记录id,后续用于更新操作",hidden = true)
  39. @JsonIgnoreProperties(allowSetters = true)
  40. private String historyId;
  41. @ApiModelProperty(value = "输注记录")
  42. private String infusionId;
  43. @ApiModelProperty(value = "临床id",readOnly = true)
  44. private String clinicId;
  45. @ApiModelProperty(value = "设备标识",readOnly = true,hidden = true)
  46. @JsonIgnoreProperties(allowSetters = true)
  47. private String classification;
  48. public static BusDeviceAlarmEntity parseRunningInfo(BusDeviceHistoryEntity history){
  49. BusDeviceAlarmEntity entity = new BusDeviceAlarmEntity();
  50. entity.setDeviceId(history.getDeviceId());
  51. entity.setAlarm(history.getAlarm());
  52. entity.setAlarmTime(history.getUploadTime());
  53. entity.setHistoryId(history.getId());
  54. entity.setInfusionId(history.getInfusionId());
  55. entity.setClinicId(history.getClinicId());
  56. entity.setClassification(history.getClassification());
  57. entity.setTenantId(history.getTenantId());
  58. return entity;
  59. }
  60. }