浏览代码

添加温度和湿度报警信息

zhuoning 4 年之前
父节点
当前提交
ac1740fdf6

+ 2 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/controller/DeviceDataController.java

@@ -55,6 +55,8 @@ public class DeviceDataController {
             JSONObject deviceUpDataJson = JSONObject.parseObject(result);
             // 保存设备上传数据
             deviceDataService.saveDeviceChangedUpData(deviceUpDataJson);
+            // 判断并保存
+            deviceDataService.saveWarningInfo(deviceUpDataJson);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 92 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/entity/SetTemperatureEntity.java

@@ -0,0 +1,92 @@
+package com.huimv.devicedata.entity;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+@Entity
+@Table(name = "set_temperature")
+public class SetTemperatureEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id", nullable = false)
+    private Integer id;
+
+    @Column(name = "high_temperature")
+    private String highTemperature;
+
+    @Column(name = "low_temperature")
+    private String lowTemperature;
+
+    @Column(name = "create_timee")
+    private Timestamp createTimee;
+
+    @Column(name = "remark")
+    private String remark;
+
+    @Column(name = "updata_time")
+    private Timestamp updataTime;
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setHighTemperature(String highTemperature) {
+        this.highTemperature = highTemperature;
+    }
+
+    public String getHighTemperature() {
+        return highTemperature;
+    }
+
+    public void setLowTemperature(String lowTemperature) {
+        this.lowTemperature = lowTemperature;
+    }
+
+    public String getLowTemperature() {
+        return lowTemperature;
+    }
+
+    public void setCreateTimee(Timestamp createTimee) {
+        this.createTimee = createTimee;
+    }
+
+    public Timestamp getCreateTimee() {
+        return createTimee;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setUpdataTime(Timestamp updataTime) {
+        this.updataTime = updataTime;
+    }
+
+    public Timestamp getUpdataTime() {
+        return updataTime;
+    }
+
+    @Override
+    public String toString() {
+        return "SetTemperatureEntity{" +
+                "id=" + id + '\'' +
+                "highTemperature=" + highTemperature + '\'' +
+                "lowTemperature=" + lowTemperature + '\'' +
+                "createTimee=" + createTimee + '\'' +
+                "remark=" + remark + '\'' +
+                "updataTime=" + updataTime + '\'' +
+                '}';
+    }
+}

+ 179 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/entity/WarningInfoEntity.java

@@ -0,0 +1,179 @@
+package com.huimv.devicedata.entity;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+@Entity
+@Table(name = "warning_info")
+public class WarningInfoEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id", nullable = false)
+    private Integer id;
+
+    /**
+     * 温度
+     */
+    @Column(name = "temperature")
+    private Double temperature;
+
+    /**
+     * 湿度
+     */
+    @Column(name = "humidity")
+    private Integer humidity;
+
+    /**
+     * 上传时间
+     */
+    @Column(name = "upload_time")
+    private Timestamp uploadTime;
+
+    /**
+     * 报警类型
+     */
+    @Column(name = "type")
+    private String type;
+
+    /**
+     * 机器编号
+     */
+    @Column(name = "LQID")
+    private String LQID;
+
+    /**
+     * 报警类型,1:设备,2:环境,3生产数据
+     */
+    @Column(name = "warning_type")
+    private Integer warningType;
+
+    /**
+     * 0:显示,1:不显示
+     */
+    @Column(name = "show_status")
+    private Boolean showStatus;
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 温度
+     */
+    public void setTemperature(Double temperature) {
+        this.temperature = temperature;
+    }
+
+    /**
+     * 温度
+     */
+    public Double getTemperature() {
+        return temperature;
+    }
+
+    /**
+     * 湿度
+     */
+    public void setHumidity(Integer humidity) {
+        this.humidity = humidity;
+    }
+
+    /**
+     * 湿度
+     */
+    public Integer getHumidity() {
+        return humidity;
+    }
+
+    /**
+     * 上传时间
+     */
+    public void setUploadTime(Timestamp uploadTime) {
+        this.uploadTime = uploadTime;
+    }
+
+    /**
+     * 上传时间
+     */
+    public Timestamp getUploadTime() {
+        return uploadTime;
+    }
+
+    /**
+     * 报警类型
+     */
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    /**
+     * 报警类型
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * 机器编号
+     */
+    public void setLQID(String LQID) {
+        this.LQID = LQID;
+    }
+
+    /**
+     * 机器编号
+     */
+    public String getLQID() {
+        return LQID;
+    }
+
+    /**
+     * 报警类型,1:设备,2:环境,3生产数据
+     */
+    public void setWarningType(Integer warningType) {
+        this.warningType = warningType;
+    }
+
+    /**
+     * 报警类型,1:设备,2:环境,3生产数据
+     */
+    public Integer getWarningType() {
+        return warningType;
+    }
+
+    /**
+     * 0:显示,1:不显示
+     */
+    public void setShowStatus(Boolean showStatus) {
+        this.showStatus = showStatus;
+    }
+
+    /**
+     * 0:显示,1:不显示
+     */
+    public Boolean isShowStatus() {
+        return showStatus;
+    }
+
+    @Override
+    public String toString() {
+        return "WarningInfoEntity{" +
+                "id=" + id + '\'' +
+                "temperature=" + temperature + '\'' +
+                "humidity=" + humidity + '\'' +
+                "uploadTime=" + uploadTime + '\'' +
+                "type=" + type + '\'' +
+                "LQID=" + LQID + '\'' +
+                "warningType=" + warningType + '\'' +
+                "showStatus=" + showStatus + '\'' +
+                '}';
+    }
+}

+ 9 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/repo/SetTemperatureRepo.java

@@ -0,0 +1,9 @@
+package com.huimv.devicedata.repo;
+
+import com.huimv.devicedata.entity.SetTemperatureEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+public interface SetTemperatureRepo extends JpaRepository<SetTemperatureEntity, Integer>, JpaSpecificationExecutor<SetTemperatureEntity> {
+
+}

+ 9 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/repo/WarningInfoRepo.java

@@ -0,0 +1,9 @@
+package com.huimv.devicedata.repo;
+
+import com.huimv.devicedata.entity.WarningInfoEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+public interface WarningInfoRepo extends JpaRepository<WarningInfoEntity, Integer>, JpaSpecificationExecutor<WarningInfoEntity> {
+
+}

+ 11 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/service/IDeviceDataService.java

@@ -17,4 +17,15 @@ public interface IDeviceDataService {
      */
     void saveDeviceResponseData(JSONObject deviceResponseData);
 
+    /**
+     * @Method      : saveWarningInfo
+     * @Description : 
+     * @Params      : [deviceUpDataJson]
+     * @Return      : void
+     * 
+     * @Author      : ZhuoNing
+     * @Date        : 2021/5/29       
+     * @Time        : 14:46
+     */
+    void saveWarningInfo(JSONObject deviceUpDataJson);
 }

+ 89 - 1
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/service/impl/DeviceDataServiceImpl.java

@@ -4,8 +4,12 @@ import com.alibaba.fastjson.JSONObject;
 
 import com.huimv.devicedata.entity.DeviceResponseEntity;
 import com.huimv.devicedata.entity.DeviceUpdataEntity;
+import com.huimv.devicedata.entity.SetTemperatureEntity;
+import com.huimv.devicedata.entity.WarningInfoEntity;
 import com.huimv.devicedata.repo.DeviceResponseEntityRepository;
 import com.huimv.devicedata.repo.DeviceUpdataEntityRepository;
+import com.huimv.devicedata.repo.SetTemperatureRepo;
+import com.huimv.devicedata.repo.WarningInfoRepo;
 import com.huimv.devicedata.service.IDeviceDataService;
 import com.huimv.devicedata.utils.DateUtil;
 import com.huimv.devicedata.utils.MathUtil;
@@ -34,6 +38,10 @@ public class DeviceDataServiceImpl implements IDeviceDataService {
     private MathUtil mathUtil;
     @Autowired
     private DeviceResponseEntityRepository deviceResponseEntityRepo;
+    @Autowired
+    private SetTemperatureRepo setTemperatureRepo;
+    @Autowired
+    private WarningInfoRepo WarningInfoRepo;
 
     @Override
     public void saveDeviceChangedUpData(JSONObject deviceUpDataJo) {
@@ -74,6 +82,8 @@ public class DeviceDataServiceImpl implements IDeviceDataService {
         deviceUpdataEntity.setDataHumi(dataHumi);
         deviceUpdataEntity.setDataBat(dataBat);
         deviceUpdataEntity.setTenantId(tenantId);
+        System.out.println("dataTemp: "+dataTemp);
+        System.out.println("TempConvert: "+mathUtil.formatDecimalNumber(dataTemp*0.1,1));
         deviceUpdataEntity.setDataTempConvert(mathUtil.formatDecimalNumber(dataTemp*0.1,1));
         deviceUpdataEntity.setDataHumiConvert(mathUtil.formatDecimalNumber(dataHumi*0.1,1));
         deviceUpdataEntity.setDataBatConvert(mathUtil.formatDecimalNumber(dataBat*0.01,1));
@@ -114,9 +124,87 @@ public class DeviceDataServiceImpl implements IDeviceDataService {
         deviceResponseEntity.setResultCode(resultCode);
         deviceResponseEntity.setResultDetailLength(length);
         deviceResponseEntity.setResultDetailRspData(rspdata);
-
         //保存到数据库
         deviceResponseEntityRepo.saveAndFlush(deviceResponseEntity);
     }
+
+    @Override
+    public void saveWarningInfo(JSONObject deviceUpDataJo) {
+        String productId = deviceUpDataJo.getString("productId");
+        String deviceId = deviceUpDataJo.getString("deviceId");
+        long timestamp = deviceUpDataJo.getLong("timestamp");
+        String upDataDate = dateUtil.formatLongDate(timestamp);
+        String serviceId = deviceUpDataJo.getString("serviceId");
+        String imsi = deviceUpDataJo.getString("IMSI");
+        String imei = deviceUpDataJo.getString("IMEI");
+        String deviceType = deviceUpDataJo.getString("deviceType");
+        String messageType = deviceUpDataJo.getString("messageType");
+        String protocol = deviceUpDataJo.getString("protocol");
+        String tenantId = deviceUpDataJo.getString("tenantId");
+        JSONObject businessDataJo = deviceUpDataJo.getJSONObject("payload");
+        int dataVer = businessDataJo.getInteger("VER");
+        int dataTime = businessDataJo.getInteger("TIME");
+        int dataTemp = businessDataJo.getInteger("TEMP");
+        int dataStc = businessDataJo.getInteger("STC");
+        int dataRssi = businessDataJo.getInteger("RSSI");
+        int dataHumi = businessDataJo.getInteger("HUMI");
+        int dataBat = businessDataJo.getInteger("BAT");
+        Double tempVal = mathUtil.formatDecimalNumber(dataTemp*0.1,1);
+
+        // 读取温度参数阈值
+        SetTemperatureEntity setTemperatureEntity = setTemperatureRepo.getOne(2);
+        String high = setTemperatureEntity.getHighTemperature();
+        String low = setTemperatureEntity.getLowTemperature();
+        Double highVal = Double.parseDouble(high);
+        Double lowVal = Double.parseDouble(low);
+        if(tempVal>highVal){
+            // 生成高温报警
+            WarningInfoEntity warningInfoEntity = new WarningInfoEntity();
+            warningInfoEntity.setLQID(deviceId);
+            warningInfoEntity.setType("出现高温报警:"+tempVal);
+            warningInfoEntity.setUploadTime(dateUtil.getTimestamp());
+            warningInfoEntity.setWarningType(2);
+            warningInfoEntity.setShowStatus(true);
+            WarningInfoRepo.saveAndFlush(warningInfoEntity);
+        }
+        if(tempVal<lowVal){
+            // 生成低端报警
+            WarningInfoEntity warningInfoEntity = new WarningInfoEntity();
+            warningInfoEntity.setLQID(deviceId);
+            warningInfoEntity.setType("出现低温报警:"+tempVal);
+            warningInfoEntity.setUploadTime(dateUtil.getTimestamp());
+            warningInfoEntity.setWarningType(2);
+            warningInfoEntity.setShowStatus(true);
+            WarningInfoRepo.saveAndFlush(warningInfoEntity);
+        }
+        // 湿度数据
+        Double humiVal = mathUtil.formatDecimalNumber(dataHumi*0.1,1);
+        // 读取湿度参数阈值
+        SetTemperatureEntity setHumiEntity = setTemperatureRepo.getOne(3);
+        String highHumi = setHumiEntity.getHighTemperature();
+        String lowHumi = setHumiEntity.getLowTemperature();
+        Double highHumiVal = Double.parseDouble(highHumi);
+        Double lowHumiVal = Double.parseDouble(lowHumi);
+        if(humiVal>highHumiVal){
+            // 生成过高湿度报警
+            WarningInfoEntity warningInfoEntity = new WarningInfoEntity();
+            warningInfoEntity.setLQID(deviceId);
+            warningInfoEntity.setType("出现过高湿度报警:"+humiVal);
+            warningInfoEntity.setUploadTime(dateUtil.getTimestamp());
+            warningInfoEntity.setWarningType(2);
+            warningInfoEntity.setShowStatus(true);
+            WarningInfoRepo.saveAndFlush(warningInfoEntity);
+        }
+        if(humiVal<lowHumiVal){
+            // 生成过低湿度报警
+            WarningInfoEntity warningInfoEntity = new WarningInfoEntity();
+            warningInfoEntity.setLQID(deviceId);
+            warningInfoEntity.setType("出现过低湿度报警:"+humiVal);
+            warningInfoEntity.setUploadTime(dateUtil.getTimestamp());
+            warningInfoEntity.setWarningType(2);
+            warningInfoEntity.setShowStatus(true);
+            WarningInfoRepo.saveAndFlush(warningInfoEntity);
+        }
+    }
 }
 

+ 9 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/devicedata/utils/DateUtil.java

@@ -2,6 +2,8 @@ package com.huimv.devicedata.utils;
 
 import org.springframework.stereotype.Component;
 
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 
 /**
@@ -29,7 +31,14 @@ public class DateUtil {
         Date date = new Date(dateLong);
         java.text.SimpleDateFormat f = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         return f.format(date);
+    }
 
+    public String getNow(){
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
+        return df.format(new Date());
+    }
 
+    public Timestamp getTimestamp(){
+        return new Timestamp(new Date().getTime());
     }
 }

+ 226 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/production/datasource/dao/entity/TDeliveryEntity.java

@@ -0,0 +1,226 @@
+package com.huimv.production.datasource.dao.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Column;
+import javax.persistence.Table;
+import java.sql.Timestamp;
+import java.io.Serializable;
+import javax.persistence.Id;
+ 
+@Entity
+@Table(name = "TDelivery")
+public class TDeliveryEntity implements Serializable {
+
+private static final long serialVersionUID = 1L;
+
+@Id
+@Column(name = "FID", nullable = false)
+private String FID;
+
+@Column(name = "FLOGSOURCEE")
+private Integer FLOGSOURCEE;
+
+@Column(name = "FDATEDELIVERY")
+private Timestamp FDATEDELIVERY;
+
+@Column(name = "PIGHOUSEDID")
+private String PIGHOUSEDID;
+
+@Column(name = "FNUMBER")
+private String FNUMBER;
+
+@Column(name = "FDATEPREJUDGE")
+private Timestamp FDATEPREJUDGE;
+
+@Column(name = "FREMARKSTR")
+private String FREMARKSTR;
+
+@Column(name = "FLOGSTATEE")
+private Integer FLOGSTATEE;
+
+@Column(name = "LISTERDID")
+private String LISTERDID;
+
+@Column(name = "TECHNICIANDID")
+private String TECHNICIANDID;
+
+@Column(name = "SOURCELOGDID")
+private String SOURCELOGDID;
+
+@Column(name = "FDATEAUDITING")
+private Timestamp FDATEAUDITING;
+
+@Column(name = "FDATECREATE")
+private Timestamp FDATECREATE;
+
+@Column(name = "ASSESSORDID")
+private String ASSESSORDID;
+
+@Column(name = "HOGPENDID")
+private String HOGPENDID;
+
+@Column(name = "FDATECHECKUP")
+private Timestamp FDATECHECKUP;
+
+@Column(name = "FBORNSTATECHECK")
+private String FBORNSTATECHECK;
+
+public  void  setFID(String FID) {
+this.FID = FID;
+}
+
+public String getFID() {
+return FID;
+}
+
+public  void  setFLOGSOURCEE(Integer FLOGSOURCEE) {
+this.FLOGSOURCEE = FLOGSOURCEE;
+}
+
+public Integer getFLOGSOURCEE() {
+return FLOGSOURCEE;
+}
+
+public  void  setFDATEDELIVERY(Timestamp FDATEDELIVERY) {
+this.FDATEDELIVERY = FDATEDELIVERY;
+}
+
+public Timestamp getFDATEDELIVERY() {
+return FDATEDELIVERY;
+}
+
+public  void  setPIGHOUSEDID(String PIGHOUSEDID) {
+this.PIGHOUSEDID = PIGHOUSEDID;
+}
+
+public String getPIGHOUSEDID() {
+return PIGHOUSEDID;
+}
+
+public  void  setFNUMBER(String FNUMBER) {
+this.FNUMBER = FNUMBER;
+}
+
+public String getFNUMBER() {
+return FNUMBER;
+}
+
+public  void  setFDATEPREJUDGE(Timestamp FDATEPREJUDGE) {
+this.FDATEPREJUDGE = FDATEPREJUDGE;
+}
+
+public Timestamp getFDATEPREJUDGE() {
+return FDATEPREJUDGE;
+}
+
+public  void  setFREMARKSTR(String FREMARKSTR) {
+this.FREMARKSTR = FREMARKSTR;
+}
+
+public String getFREMARKSTR() {
+return FREMARKSTR;
+}
+
+public  void  setFLOGSTATEE(Integer FLOGSTATEE) {
+this.FLOGSTATEE = FLOGSTATEE;
+}
+
+public Integer getFLOGSTATEE() {
+return FLOGSTATEE;
+}
+
+public  void  setLISTERDID(String LISTERDID) {
+this.LISTERDID = LISTERDID;
+}
+
+public String getLISTERDID() {
+return LISTERDID;
+}
+
+public  void  setTECHNICIANDID(String TECHNICIANDID) {
+this.TECHNICIANDID = TECHNICIANDID;
+}
+
+public String getTECHNICIANDID() {
+return TECHNICIANDID;
+}
+
+public  void  setSOURCELOGDID(String SOURCELOGDID) {
+this.SOURCELOGDID = SOURCELOGDID;
+}
+
+public String getSOURCELOGDID() {
+return SOURCELOGDID;
+}
+
+public  void  setFDATEAUDITING(Timestamp FDATEAUDITING) {
+this.FDATEAUDITING = FDATEAUDITING;
+}
+
+public Timestamp getFDATEAUDITING() {
+return FDATEAUDITING;
+}
+
+public  void  setFDATECREATE(Timestamp FDATECREATE) {
+this.FDATECREATE = FDATECREATE;
+}
+
+public Timestamp getFDATECREATE() {
+return FDATECREATE;
+}
+
+public  void  setASSESSORDID(String ASSESSORDID) {
+this.ASSESSORDID = ASSESSORDID;
+}
+
+public String getASSESSORDID() {
+return ASSESSORDID;
+}
+
+public  void  setHOGPENDID(String HOGPENDID) {
+this.HOGPENDID = HOGPENDID;
+}
+
+public String getHOGPENDID() {
+return HOGPENDID;
+}
+
+public  void  setFDATECHECKUP(Timestamp FDATECHECKUP) {
+this.FDATECHECKUP = FDATECHECKUP;
+}
+
+public Timestamp getFDATECHECKUP() {
+return FDATECHECKUP;
+}
+
+public  void  setFBORNSTATECHECK(String FBORNSTATECHECK) {
+this.FBORNSTATECHECK = FBORNSTATECHECK;
+}
+
+public String getFBORNSTATECHECK() {
+return FBORNSTATECHECK;
+}
+
+@Override
+public String toString() {
+return "TDeliveryEntity{" +
+    "FID=" + FID + '\'' +
+    "FLOGSOURCEE=" + FLOGSOURCEE + '\'' +
+    "FDATEDELIVERY=" + FDATEDELIVERY + '\'' +
+    "PIGHOUSEDID=" + PIGHOUSEDID + '\'' +
+    "FNUMBER=" + FNUMBER + '\'' +
+    "FDATEPREJUDGE=" + FDATEPREJUDGE + '\'' +
+    "FREMARKSTR=" + FREMARKSTR + '\'' +
+    "FLOGSTATEE=" + FLOGSTATEE + '\'' +
+    "LISTERDID=" + LISTERDID + '\'' +
+    "TECHNICIANDID=" + TECHNICIANDID + '\'' +
+    "SOURCELOGDID=" + SOURCELOGDID + '\'' +
+    "FDATEAUDITING=" + FDATEAUDITING + '\'' +
+    "FDATECREATE=" + FDATECREATE + '\'' +
+    "ASSESSORDID=" + ASSESSORDID + '\'' +
+    "HOGPENDID=" + HOGPENDID + '\'' +
+    "FDATECHECKUP=" + FDATECHECKUP + '\'' +
+    "FBORNSTATECHECK=" + FBORNSTATECHECK + '\'' +
+    '}';
+}
+}

+ 9 - 0
huimv-test-platform/huimv-ctwing/src/main/java/com/huimv/production/datasource/dao/repo/TDeliveryRepo.java

@@ -0,0 +1,9 @@
+package com.huimv.production.datasource.dao.repo;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import com.huimv.production.datasource.dao.entity.TDeliveryEntity;
+
+public interface TDeliveryRepo extends JpaRepository<TDeliveryEntity, String>, JpaSpecificationExecutor<TDeliveryEntity> {
+
+}

+ 31 - 0
huimv-test-platform/huimv-ctwing/src/main/resources/application-prod.yml

@@ -0,0 +1,31 @@
+server:
+  port: 8075
+spring:
+  application:
+    name: huimv-ctwing
+
+  datasource:
+    url: jdbc:mysql://localhost:3306/huimv_ql_farm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+  jpa:
+    show-sql: true
+    database: mysql
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+    open-in-view: true
+
+    #  redis:
+#    database: 0
+#    host: 119.3.84.55
+#    port: 6379
+#    password: hm123456
+#    jedis:
+#      pool:
+#        max-active: 20
+#        max-wait: -1
+#        max-idle: 10
+#        min-idle: 0
+#    timeout: 5000

+ 1 - 1
huimv-test-platform/huimv-ctwing/src/main/resources/application.properties

@@ -1 +1 @@
-spring.profiles.active=dev
+spring.profiles.active=prod

+ 9 - 0
huimv-test-platform/huimv-ctwing/src/test/java/com/huimv/devicedata/ConvertUtil.java

@@ -1,5 +1,6 @@
 package com.huimv.devicedata;
 
+import com.huimv.devicedata.utils.DateUtil;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -20,6 +21,8 @@ import java.math.BigDecimal;
 @RunWith(SpringRunner.class)
 @SpringBootTest
 public class ConvertUtil {
+    @Autowired
+    private DateUtil dateUtil;
 
     @Test
     public void testIntConvert(){
@@ -30,4 +33,10 @@ public class ConvertUtil {
         double   f1   =   b.setScale(1,   BigDecimal.ROUND_HALF_UP).doubleValue();
         System.out.println(f1);
     }
+
+    @Test
+    public void testFormatTimestamp(){
+        long timestamp = 1622016010072L;
+        System.out.println("timestamp:"+dateUtil.formatLongDate(timestamp));
+    }
 }