Explorar el Código

fix: 修改了device_used表相关的类

龙三郎 hace 3 años
padre
commit
0e7d7809ba

+ 49 - 0
coffee-admin/logs/sys-info.2022-04-06.log

@@ -0,0 +1,49 @@
+2022-04-06 18:08:24 [main] INFO  com.coffee.admin.AliyunTest - Starting AliyunTest using Java 14.0.1 on DESKTOP-NLH890S with PID 38940 (started by Administrator in E:\git\java\NB_NetPump\coffee-admin)
+2022-04-06 18:08:24 [main] INFO  com.coffee.admin.AliyunTest - The following profiles are active: dev
+2022-04-06 18:08:24 [background-preinit] INFO  o.h.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.0.Final
+2022-04-06 18:08:30 [main] INFO  c.c.a.AliyunConsumerGroupService - 订阅禁止
+2022-04-06 18:08:35 [Thread-2] INFO  o.t.w.s.TioWebSocketServerBootstrap - Initializing Tio WebSocket Server
+2022-04-06 18:08:35 [Thread-2] INFO  org.tio.server.TioServer - 
+|----------------------------------------------------------------------------------------|
+| t-io site         | https://www.t-io.org                                               |
+| t-io on gitee     | https://gitee.com/tywo45/t-io                                      |
+| t-io on github    | https://github.com/tywo45/t-io                                     |
+| t-io version      | 3.6.0.v20200315-RELEASE                                            |
+| ---------------------------------------------------------------------------------------|
+| TioConfig name    | tio-websocket-spring-boot-starter                                  |
+| Started at        | 2022-04-06 18:08:35                                                |
+| Listen on         | 0.0.0.0:9000                                                       |
+| Main Class        | java.lang.Thread                                                   |
+| Jvm start time    | 11980ms                                                            |
+| Tio start time    | 8ms                                                                |
+| Pid               | 38940                                                              |
+|----------------------------------------------------------------------------------------|
+
+2022-04-06 18:08:36 [main] INFO  com.coffee.admin.AliyunTest - Started AliyunTest in 12.056 seconds (JVM running for 13.306)
+2022-04-06 18:08:37 [main] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
+2022-04-06 18:08:40 [SpringApplicationShutdownHook] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} closing ...
+2022-04-06 18:08:40 [SpringApplicationShutdownHook] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} closed
+2022-04-06 18:10:48 [main] INFO  com.coffee.admin.AliyunTest - Starting AliyunTest using Java 14.0.1 on DESKTOP-NLH890S with PID 36056 (started by Administrator in E:\git\java\NB_NetPump\coffee-admin)
+2022-04-06 18:10:48 [main] INFO  com.coffee.admin.AliyunTest - The following profiles are active: dev
+2022-04-06 18:10:48 [background-preinit] INFO  o.h.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.0.Final
+2022-04-06 18:10:53 [main] INFO  c.c.a.AliyunConsumerGroupService - 订阅禁止
+2022-04-06 18:10:58 [Thread-2] INFO  o.t.w.s.TioWebSocketServerBootstrap - Initializing Tio WebSocket Server
+2022-04-06 18:10:58 [Thread-2] INFO  org.tio.server.TioServer - 
+|----------------------------------------------------------------------------------------|
+| t-io site         | https://www.t-io.org                                               |
+| t-io on gitee     | https://gitee.com/tywo45/t-io                                      |
+| t-io on github    | https://github.com/tywo45/t-io                                     |
+| t-io version      | 3.6.0.v20200315-RELEASE                                            |
+| ---------------------------------------------------------------------------------------|
+| TioConfig name    | tio-websocket-spring-boot-starter                                  |
+| Started at        | 2022-04-06 18:10:58                                                |
+| Listen on         | 0.0.0.0:9000                                                       |
+| Main Class        | java.lang.Thread                                                   |
+| Jvm start time    | 11838ms                                                            |
+| Tio start time    | 8ms                                                                |
+| Pid               | 36056                                                              |
+|----------------------------------------------------------------------------------------|
+
+2022-04-06 18:10:59 [main] INFO  com.coffee.admin.AliyunTest - Started AliyunTest in 11.943 seconds (JVM running for 13.135)
+2022-04-06 18:11:00 [task-5] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
+2022-04-06 18:11:08 [tio-timer-checkheartbeat-1-Tio Websocket Server] INFO  org.tio.server.ServerTioConfig - tio-websocket-spring-boot-starter, 用户取消了框架层面的心跳检测,如果业务需要,请用户自己去完成心跳检测

+ 7 - 1
coffee-admin/src/main/resources/application.yml

@@ -61,4 +61,10 @@ mybatis-plus:
     dbConfig:
       idType: ASSIGN_ID
   configuration:
-    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+# 阿里云对接配置
+aliyun:
+  data-access:
+    enable: false  # 是否开启阿里云物联网订阅
+

+ 14 - 0
coffee-admin/src/test/java/com/coffee/admin/AliyunTest.java

@@ -1,7 +1,9 @@
 package com.coffee.admin;
 
+import com.coffee.bus.entity.BusDeviceUsedEntity;
 import com.coffee.bus.entity.BusDeviceUsingEntity;
 import com.coffee.bus.listener.event.bean.DeviceInfoEvent;
+import com.coffee.bus.service.LocalBusDeviceUsedService;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +24,9 @@ public class AliyunTest {
     @Autowired
     private ApplicationContext applicationContext;
 
+    @Autowired
+    private LocalBusDeviceUsedService localBusDeviceUsedService;
+
     @Test
     public void test001(){
         BusDeviceUsingEntity pump = new BusDeviceUsingEntity();
@@ -36,4 +41,13 @@ public class AliyunTest {
         }
     }
 
+    @Test
+    public void test002(){
+        BusDeviceUsedEntity deviceUsedEntity = new BusDeviceUsedEntity();
+        deviceUsedEntity.setTenantId("123456");
+
+        localBusDeviceUsedService.save(deviceUsedEntity);
+        System.out.println(deviceUsedEntity);
+    }
+
 }

+ 1 - 0
coffee-common/src/main/java/com/coffee/common/cache/ConfigStorage.java

@@ -3,6 +3,7 @@ package com.coffee.common.cache;
 
 import com.coffee.common.cache.value.Value;
 
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Map;
 

+ 49 - 36
coffee-system/src/main/java/com/coffee/aliyun/AliyunConsumerGroupService.java

@@ -2,11 +2,13 @@ package com.coffee.aliyun;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.coffee.bus.entity.BusPumpEntity;
+import com.coffee.bus.entity.BusDeviceUsingEntity;
 import com.coffee.bus.listener.event.bean.DeviceInfoEvent;
+import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 
@@ -32,52 +34,35 @@ import java.util.concurrent.TimeUnit;
 @Slf4j
 public class AliyunConsumerGroupService {
 
-    @Autowired
-    private ApplicationContext applicationContext;
+    private final ApplicationContext applicationContext;
 
-    @Value("${aliyun.data-access.enable:false}")
-    private boolean isEnable;
-
-    static {
+    // 初始化订阅客户端
+    // 阿里云账号信息
+    private final AliyunIotSubscribeClient client;
 
+    public AliyunConsumerGroupService(ApplicationContext applicationContext, AliyunIotSubscribeClient client) {
+        this.applicationContext = applicationContext;
+        this.client = client;
     }
 
+    @Value("${aliyun.data-access.enable:false}")
+    private boolean isEnable;
+
     // 开启服务端订阅
     @PostConstruct
     public void subscribe(){
-        if (isEnable){
-            log.info("允许开启订阅");
-        }else {
+        if (!isEnable){
             log.info("订阅禁止");
             return;
         }
-
-        // 获取ip地址
-        InetAddress addr = null;
-        try {
-            addr = InetAddress.getLocalHost();
-        } catch (UnknownHostException e) {
-            e.printStackTrace();
-        }
-        String ip = addr.getHostAddress();
-        // 初始化订阅客户端
-        // 阿里云账号信息
-        AliyunIotSubscribeClient client =
-                new AliyunIotSubscribeClient(
-                        "LTAI4FhB19MgQuviGxwA3aod",
-                        "cQQVkATR0yv2G9CEtfjAhEGBepPDRs",
-                        "cn-shanghai",
-                        "DEFAULT_GROUP",
-                        "1177450762772738",
-                        "","DEFAULT_GROUP" + ip
-                );
+        log.info("允许开启订阅");
         try {
             // 开启订阅
             client.start(messageListener);
         } catch (Exception e) {
             e.printStackTrace();
         }
-        System.out.println("订阅成功。。。。。。。。。。。");
+        log.info("阿里云物联网订阅成功。。。。。。。。。。。");
     }
 
 
@@ -113,6 +98,7 @@ public class AliyunConsumerGroupService {
     private static final String ITEMS = "items";
     private static final String VALUE = "value";
     private static final String STATUS = "status";
+
     private synchronized void processMessage(Message message) {
 
         PlatformDataLog dataLog = new PlatformDataLog();
@@ -122,9 +108,12 @@ public class AliyunConsumerGroupService {
             String contentString = new String(body);
             String topic = message.getStringProperty(TOPIC);
             String messageId = message.getStringProperty(MESSAGEID);
-            platformData.put("topic",topic);
-            platformData.put("messageId",messageId);
+            platformData.put(TOPIC,topic);
+            platformData.put(MESSAGEID,messageId);
             platformData.put("content",contentString);
+
+            log.info("阿里云物联网发送的数据:"+JSON.toJSONString(platformData));
+
             /**
              * platformData:
              * {
@@ -175,11 +164,35 @@ public class AliyunConsumerGroupService {
                 }
             }else if (topic.matches("[\\w\\/]*event/property/post$")){//设备属性上报
                 // 设备属性上报
-                DeviceInfoEvent deviceInfoEvent = new DeviceInfoEvent(this,new BusPumpEntity(),"123456");
+
+
+                // 发布设备信息事件
+                DeviceInfoEvent deviceInfoEvent = new DeviceInfoEvent(this,new BusDeviceUsingEntity(),"123456");
                 applicationContext.publishEvent(deviceInfoEvent);
 
-            }else{// 其他的topic
-                System.out.println("未知topic:"+topic);
+            }else if(topic.matches("[\\w\\/]+thing/liftcycle$")){// 设备生命周期
+
+                /**
+                 * 生命周期,删除设备
+                 * {"topic":"/a1M7k1TAECc/456789/thing/lifecycle",
+                 * "messageId":"1511903665358296576",
+                 * "content":"{\"iotId\":\"hGMEfTMBv9O6gyvpMSvi000000\",\"action\":\"delete\",
+                 * \"messageCreateTime\":1649300898278,\"productKey\":\"a1M7k1TAECc\",
+                 * \"deviceName\":\"456789\"}"}
+                 *
+                 * 生命周期,添加设备
+                 * {"topic":"/a1M7k1TAECc/ceshidevice007/thing/lifecycle",
+                 * "messageId":"1511904535630241792",
+                 * "content":"{\"iotId\":\"KsCWSsSf86fjD6ux16sC000000\",
+                 * \"deviceSecret\":\"989561a8d3bd939bfb8321bafc61b64c\",
+                 * \"action\":\"create\",\"messageCreateTime\":1649301105776,
+                 * \"productKey\":\"a1M7k1TAECc\",\"deviceName\":\"ceshidevice007\"}"}
+                 *
+                 */
+
+
+            }else {
+                log.info("未知topic:"+topic);
             }
 
         } catch (Exception e) {

+ 4 - 12
coffee-system/src/main/java/com/coffee/aliyun/AliyunIotSdk.java

@@ -37,16 +37,11 @@ public class AliyunIotSdk {
         this.accessSecret = accessSecret;
         this.regionId = regionId;
     }
-    public AliyunIotSdk(AliyunParams aliyunParams){
-        this.accessKey = aliyunParams.getAccessKey();
-        this.accessSecret = aliyunParams.getAccessKeySecret();
-        this.regionId = aliyunParams.getRegionId();
-    }
 
     public AliyunIotSdk(PlatformAccount platformAccount) {
-        this.accessKey = platformAccount.getConfiguration().get(ACCESSKEY).toString();
-        this.accessSecret = platformAccount.getConfiguration().get(ACCESSSECRET).toString();
-        this.regionId = platformAccount.getConfiguration().get(REFIONID).toString();
+        this.accessKey = platformAccount.getAccessKey();
+        this.accessSecret = platformAccount.getAccessSecret();
+        this.regionId = platformAccount.getRegionId();
     }
 
     /**
@@ -110,9 +105,6 @@ public class AliyunIotSdk {
 
         // 获取阿里云SDK客户端
         DefaultAcsClient client = this.getAliyuniotClient();
-        List<QueryDeviceResponse.DeviceInfo> list = new ArrayList<>();
-        Integer pageSize = 100,currentPage = 1;
-
         RegisterDeviceRequest request = new RegisterDeviceRequest();
         // 产品key,必需
         request.setProductKey(productKey);
@@ -121,7 +113,7 @@ public class AliyunIotSdk {
         try {
             RegisterDeviceResponse response = client.getAcsResponse(request);
             System.out.println(response.getSuccess());
-            // 获取失败直接跳出循环
+            // 获取失败直接跳出
             if (!response.getSuccess()){
                 return null;
             }

+ 32 - 15
coffee-system/src/main/java/com/coffee/aliyun/AliyunIotSubscribeClient.java

@@ -6,13 +6,18 @@ import org.apache.commons.codec.binary.Base64;
 import org.apache.qpid.jms.JmsConnection;
 import org.apache.qpid.jms.JmsConnectionListener;
 import org.apache.qpid.jms.message.JmsInboundMessageDispatch;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
 
 import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
 import javax.jms.*;
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import java.net.InetAddress;
 import java.net.URI;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.List;
@@ -23,28 +28,40 @@ import java.util.List;
  * @Version 1.0
  * @Description XXX
  */
+@Configuration
+@EnableConfigurationProperties(PlatformAccount.class)
 @Slf4j
 public class AliyunIotSubscribeClient {
 
+    private final PlatformAccount platformAccount;
+
+    public AliyunIotSubscribeClient(PlatformAccount platformAccount) {
+        this.platformAccount = platformAccount;
+        this.accessKey = platformAccount.getAccessKey();
+        this.accessSecret = platformAccount.getAccessSecret();
+        this.regionId = platformAccount.getRegionId();
+        this.consumerGroupId = platformAccount.getConsumerGroupId();
+        this.aliyunUid = platformAccount.getAliyunUid();
+        this.iotInstanceId = platformAccount.getIotInstanceId();
+        //
+        setClientIdAndHost();
+    }
+
+    // 设置客户端id和host
+    private void setClientIdAndHost(){
+        // 获取ip地址
+        InetAddress addr = null;
+        try {
+            addr = InetAddress.getLocalHost();
+        } catch (UnknownHostException e) {
+            e.printStackTrace();
+        }
+        String ip = addr.getHostAddress();
 
-    public AliyunIotSubscribeClient(String accessKey,
-                                    String accessSecret,
-                                    String regionId,
-                                    String consumerGroupId,
-                                    String aliyunUid,
-                                    String iotInstanceId,
-                                    String clientId) {
-        this.accessKey = accessKey;
-        this.accessSecret = accessSecret;
-        this.regionId = regionId;
-        this.consumerGroupId = consumerGroupId;
-        this.aliyunUid = aliyunUid;
-        this.iotInstanceId = iotInstanceId;
-        this.clientId = clientId;
+        this.clientId = consumerGroupId + ip;
         this.host = aliyunUid+".iot-amqp."+ regionId +".aliyuncs.com";
     }
 
-
     private String accessKey = "LTAI4FhB19MgQuviGxwA3aod";
     private String accessSecret = "cQQVkATR0yv2G9CEtfjAhEGBepPDRs";
     private String consumerGroupId = "DEFAULT_GROUP";

+ 0 - 16
coffee-system/src/main/java/com/coffee/aliyun/AliyunParams.java

@@ -1,16 +0,0 @@
-package com.coffee.aliyun;
-
-import lombok.Data;
-
-/**
- * @Author XX
- * @Date 2022-02-11 16:58:55
- * @Version 1.0
- * @Description XXX
- */
-@Data
-public class AliyunParams {
-    private String regionId;
-    private String accessKey;
-    private String accessKeySecret;
-}

+ 0 - 29
coffee-system/src/main/java/com/coffee/aliyun/Platform.java

@@ -1,29 +0,0 @@
-package com.coffee.aliyun;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
-import lombok.Data;
-
-import java.util.Map;
-
-/**
- * @Author XX
- * @Date 2022-01-05 17:33:29
- * @Version 1.0
- * @Description XXX
- */
-@Data
-public class Platform {
-    @TableId(value = "id",type = IdType.AUTO)
-    private Long id;
-    private String code;
-    private String name;
-    @TableField(typeHandler = FastjsonTypeHandler.class)
-    private Map<String, Object> configuration;
-    private Long addTime;
-    private Long updateTime;
-    private String description;
-    private String isDelete;
-}

+ 11 - 16
coffee-system/src/main/java/com/coffee/aliyun/PlatformAccount.java

@@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
 
 /**
  * @Author XX
@@ -15,21 +18,13 @@ import lombok.Data;
  * @Description XXX
  */
 @Data
-@TableName(autoResultMap = true)
+@ConfigurationProperties(prefix = "aliyun")
 public class PlatformAccount {
-    @TableId(value = "id",type = IdType.AUTO)
-    private Long id;
-    private String code;
-    private String platformCode;
-    private String name;
-    @TableField(typeHandler = FastjsonTypeHandler.class)
-    private JSONObject configuration;
-    private Long addTime;
-    private Long updateTime;
-    private String description;
-    private String isDelete;
-
-    @TableField(exist = false)
-    private Platform platform;
-
+    private String accessKey = "LTAI4FhB19MgQuviGxwA3aod";
+    private String accessSecret = "cQQVkATR0yv2G9CEtfjAhEGBepPDRs";
+    private String consumerGroupId = "DEFAULT_GROUP";
+    private String aliyunUid = "1177450762772738";
+    private String regionId = "cn-shanghai";
+    //iotInstanceId:企业版实例请填写实例ID,公共实例请填空字符串""。
+    private String iotInstanceId = "";
 }

+ 0 - 6
coffee-system/src/main/java/com/coffee/aliyun/PlatformDataLog.java

@@ -31,10 +31,4 @@ public class PlatformDataLog {
     private Long updateTime;
     private String description;
     private String isDelete;
-
-    @TableField(exist = false)
-    private Platform platform;
-
-
-
 }

+ 0 - 26
coffee-system/src/main/java/com/coffee/aliyun/TestProgram.java

@@ -1,26 +0,0 @@
-package com.coffee.aliyun;
-
-import com.coffee.bus.entity.BusPumpEntity;
-import com.coffee.bus.listener.event.bean.DeviceInfoEvent;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-
-/**
- * @Author XX
- * @Date 2022-04-06 17:18:38
- * @Version 1.0
- * @Description XXX
- */
-
-public class TestProgram {
-
-    @Autowired
-    private ApplicationContext applicationContext;
-
-
-    public void test001() {
-        // 设备属性上报
-        DeviceInfoEvent deviceInfoEvent = new DeviceInfoEvent(this,new BusPumpEntity(),"123456");
-        applicationContext.publishEvent(deviceInfoEvent);
-    }
-}

+ 0 - 30
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceUseEntity.java

@@ -1,30 +0,0 @@
-package com.coffee.bus.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.coffee.common.entity.GenericEntity;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-/**
- * @author lifang
- * @version 1.0.0
- * @ClassName BusDeviceUseEntity.java
- * @Description TODO
- * @createTime 2022年03月30日 11:01:00
- */
-@Data
-//@TableName("bus_device_use")
-public class BusDeviceUseEntity extends GenericEntity<String> {
-    @ApiModelProperty("临床id")
-    private String clinicId;
-
-    @ApiModelProperty("设备id")
-    private String deviceId;
-
-    @ApiModelProperty("是否为主设备")
-    private Integer master;
-
-    @ApiModelProperty("设备类型,即网络泵、智能泵,暂不使用")
-    private String deviceType;
-}

+ 111 - 0
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceUsedEntity.java

@@ -0,0 +1,111 @@
+package com.coffee.bus.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.common.config.mybatis.DateToBigIntHandler;
+import com.coffee.common.entity.GenericEntity;
+import com.coffee.common.entity.TenantGenericEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.poi.hpsf.Decimal;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author 龙三郎
+ * @version 1.0.0
+ * @ClassName BusDeviceUseEntity.java
+ * @Description TODO
+ * @createTime 2022年03月30日 11:01:00
+ */
+@Data
+@TableName("bus_device_used")
+public class BusDeviceUsedEntity extends TenantGenericEntity<String,String> {
+    @ApiModelProperty("临床id")
+    private String clinicId;
+
+    @ApiModelProperty("设备id")
+    private String deviceId;
+
+    private String patientId;
+    private Short useStatus;
+
+    @TableField(typeHandler = DateToBigIntHandler.class)
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    @TableField(typeHandler = DateToBigIntHandler.class)
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+
+    @TableField(typeHandler = DateToBigIntHandler.class)
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startUseTime;
+
+    @TableField(typeHandler = DateToBigIntHandler.class)
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endUseTime;
+
+    private String classification;
+
+    private Integer dataNumber;
+
+    private Integer dataTotal;
+
+    @TableField(typeHandler = DateToBigIntHandler.class)
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date lastReceiveTime;
+
+    private String pumpType;
+    private String patientCode;
+    private String ward;
+    private String bedNo;
+    private Integer totalDose;
+    private BigDecimal finishedDose;
+    private BigDecimal flow;
+    private Integer firstDose;
+    private BigDecimal sigleDose;
+    private Integer lockTime;
+    private Integer pcaValid;
+    private Integer pcaInvalid;
+    private BigDecimal maxDose;
+    private Integer electricQuantity;
+    private Double maxFlow;
+    private Double minFlow;
+    private Integer flowAdjustRate;
+    private Integer flowUpPcaValid;
+    private Double flowUpTime;
+    private Double flowDownTime;
+    private Integer warnFlow;
+    private Integer pluseDose;
+    private Integer pluseLockTime;
+    private Integer pluseFirstLockTime;
+    private Integer runStatus;
+    private Integer alarmStatus;
+    private Short warnWillFinished;
+    private Short warnAnalgesicPoor;
+    private Short warnLowBattery;
+
+    @TableField(typeHandler = DateToBigIntHandler.class,fill = FieldFill.INSERT)
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @TableField(typeHandler = DateToBigIntHandler.class,fill = FieldFill.UPDATE)
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic(value = "0",delval = "1")
+    private Integer isDelete;
+
+}

+ 4 - 3
coffee-system/src/main/java/com/coffee/bus/mapper/BusDeviceUseMapper.java → coffee-system/src/main/java/com/coffee/bus/mapper/BusDeviceUsedMapper.java

@@ -1,16 +1,17 @@
 package com.coffee.bus.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.coffee.bus.entity.BusDeviceUseEntity;
+import com.coffee.bus.entity.BusDeviceUsedEntity;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
- * @author lifang
+ * @author 龙三郎
  * @version 1.0.0
  * @ClassName BusHospitalMapper.java
  * @Description TODO
  * @createTime 2022年03月19日 09:15:00
  */
 @Mapper
-public interface BusDeviceUseMapper extends BaseMapper<BusDeviceUseEntity> {
+public interface BusDeviceUsedMapper extends BaseMapper<BusDeviceUsedEntity> {
+
 }

+ 6 - 6
coffee-system/src/main/java/com/coffee/bus/service/LocalBusDeviceUseService.java → coffee-system/src/main/java/com/coffee/bus/service/LocalBusDeviceUsedService.java

@@ -1,26 +1,26 @@
 package com.coffee.bus.service;
 
-import com.coffee.bus.entity.BusDeviceUseEntity;
-import com.coffee.bus.mapper.BusDeviceUseMapper;
+import com.coffee.bus.entity.BusDeviceUsedEntity;
+import com.coffee.bus.mapper.BusDeviceUsedMapper;
 import com.coffee.common.crud.BaseService;
 import org.springframework.stereotype.Service;
 
 /**
- * @author lifang
+ * @author 龙三郎
  * @version 1.0.0
  * @ClassName LocalBusHospitalService.java
  * @Description 临床使用设备
  * @createTime 2022年03月19日 09:27:00
  */
 @Service
-public class LocalBusDeviceUseService extends BaseService<BusDeviceUseMapper, BusDeviceUseEntity,String> {
+public class LocalBusDeviceUsedService extends BaseService<BusDeviceUsedMapper, BusDeviceUsedEntity,String> {
     @Override
-    public void validateBeforeSave(BusDeviceUseEntity entity) {
+    public void validateBeforeSave(BusDeviceUsedEntity entity) {
 
     }
 
     @Override
-    public void validateBeforeUpdate(BusDeviceUseEntity entity) {
+    public void validateBeforeUpdate(BusDeviceUsedEntity entity) {
 
     }