Ver Fonte

设备使用更新

15638522405 há 3 anos atrás
pai
commit
4f420e1c2a

+ 52 - 0
coffee-admin/src/test/java/com/coffee/admin/BusDeviceAlarmTest.java

@@ -0,0 +1,52 @@
+package com.coffee.admin;
+
+import com.coffee.bus.controller.BusDeviceController;
+import com.coffee.bus.controller.BusDeviceHistoryController;
+import com.coffee.bus.entity.BusDeviceEntity;
+import com.coffee.bus.mapper.BusDeviceAlarmMapper;
+import com.coffee.bus.service.LocalBusDeviceAlarmService;
+import com.coffee.bus.service.dto.DeviceAlarmQuery;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Date;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName BusDeviceAlarmTest.java
+ * @Description TODO
+ * @createTime 2022/5/218:42
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = AdminApplication.class)
+public class BusDeviceAlarmTest {
+
+    @Autowired
+    BusDeviceAlarmMapper busDeviceAlarmMapper;
+    @Autowired
+    LocalBusDeviceAlarmService service;
+    @Autowired
+    BusDeviceHistoryController controller;
+
+
+    @Test
+    public void test001(){
+        DeviceAlarmQuery query = new DeviceAlarmQuery();
+        query.setAlarmState(1);
+        System.out.println(query.getAlarmState());
+        busDeviceAlarmMapper.selectAlarmCount(query);
+       // System.out.println();
+    }
+    @Test
+    public void test002(){
+        System.out.println(service.selectCountAlarm(new DeviceAlarmQuery()));
+    }
+    @Test
+    public void test003(){
+        System.out.println(controller.deviceUse(new DeviceAlarmQuery()));
+    }
+}

+ 67 - 0
coffee-system/src/main/java/com/coffee/bus/service/dto/DeviceAlarmQuery.java

@@ -0,0 +1,67 @@
+package com.coffee.bus.service.dto;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.coffee.bus.enums.DeviceAlarmEnum;
+import com.coffee.bus.enums.DeviceTypeEnum;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName DeviceAlarmQuery.java
+ * @Description TODO
+ * @createTime 2022/5/1915:35
+ */
+@ApiModel("设备使用")
+@Data
+public class DeviceAlarmQuery implements Serializable {
+
+
+    @ApiModelProperty(value = "设备唯一编码")
+    private String deviceId;
+
+    @ApiModelProperty(value = "医院名称")
+    private String hositalName;
+
+    @ApiModelProperty(value = "报警时间最小值")
+    private Date uploadTimeMin;
+    @ApiModelProperty(value = "报警时间最大值")
+    private Date uploadTimeMax;
+
+    @ApiModelProperty(value = "是否为报警信息")
+    private Integer alarm;
+
+    @ApiModelProperty(value = "报警信息")
+    private Integer alarmState;
+
+    @ApiModelProperty(value = "输注即将结束提醒")
+    private Integer warnWillFinished;
+
+    @ApiModelProperty(value = "镇痛不足提醒")
+    private Integer warnAnalgesicPoor;
+
+    @ApiModelProperty(value = "电量偏低提醒")
+    private Integer warnLowBattery;
+
+    @ApiModelProperty(value = "设备类型")
+    private Integer type;
+
+    @ApiModelProperty(value = "医院ID")
+    private String tenantId;
+
+
+    @ApiModelProperty("分页查询")
+    @NotNull(message = "分页查询参数不可为空")
+    private Page<DeviceResult> page;
+
+}

+ 40 - 0
coffee-system/src/main/java/com/coffee/bus/service/dto/DeviceUse.java

@@ -0,0 +1,40 @@
+package com.coffee.bus.service.dto;
+
+import com.coffee.bus.enums.DeviceAlarmEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import jnr.ffi.annotations.In;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+import org.springframework.context.annotation.Bean;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName DeviceUse.java
+ * @Description 设备使用信息
+ * @createTime 2022/5/614:05
+ */
+@ApiModel("设备数量")
+@Data
+public class DeviceUse implements Serializable {
+    /**
+     * 医院地址
+     */
+    @ApiModelProperty(value = "医院地址")
+    private String address;
+
+    /**
+     * 医院名称
+     */
+    @ApiModelProperty(value = "医院名称")
+    private String name;
+
+
+    @ApiModelProperty(value = "报警数量")
+    private Map<String, Integer> deviceAlarms;
+
+}