Commit 1fc057f5 authored by 003's avatar 003

1.14 更新最近上下线时间

parent cdcf17bd
...@@ -68,6 +68,30 @@ public class DeviceInfoPO implements Serializable { ...@@ -68,6 +68,30 @@ public class DeviceInfoPO implements Serializable {
@TableField("locked") @TableField("locked")
private Integer locked; private Integer locked;
/**
* 省代码
*/
@TableField("province_code")
private String provinceCode;
/**
* 市代码
*/
@TableField("city_code")
private String cityCode;
/**
* 区代码
*/
@TableField("area_code")
private String areaCode;
/**
* 门店编号
*/
@TableField("store_num")
private String storeNum;
/** /**
* 创建时间 * 创建时间
*/ */
...@@ -80,5 +104,29 @@ public class DeviceInfoPO implements Serializable { ...@@ -80,5 +104,29 @@ public class DeviceInfoPO implements Serializable {
@TableField("update_time") @TableField("update_time")
private LocalDateTime updateTime; private LocalDateTime updateTime;
/**
* 最近一次上线时间
*/
@TableField("last_online_time")
private LocalDateTime lastOnlineTime;
/**
* 最近一次下线时间
*/
@TableField("last_offline_time")
private LocalDateTime lastOfflineTime;
/**
* 首单时间
*/
@TableField("first_order_time")
private LocalDateTime firstOrderTime;
/**
* 首单订单号
*/
@TableField("first_order_num")
private String firstOrderNum;
} }
...@@ -46,6 +46,11 @@ public class DeviceStatusMQ implements NatsMQProcess{ ...@@ -46,6 +46,11 @@ public class DeviceStatusMQ implements NatsMQProcess{
//如果数据库不一致则更新 //如果数据库不一致则更新
if(null != deviceInfoPO && !bean.getOnline().equals(deviceInfoPO.getOnline())){ if(null != deviceInfoPO && !bean.getOnline().equals(deviceInfoPO.getOnline())){
deviceInfoPO.setOnline(null == bean.getOnline()?0:bean.getOnline()); deviceInfoPO.setOnline(null == bean.getOnline()?0:bean.getOnline());
if(deviceInfoPO.getOnline().intValue()==0){
deviceInfoPO.setLastOfflineTime(LocalDateTime.now());
}else{
deviceInfoPO.setLastOnlineTime(LocalDateTime.now());
}
deviceInfoPO.setUpdateTime(LocalDateTime.now()); deviceInfoPO.setUpdateTime(LocalDateTime.now());
deviceService.updateById(deviceInfoPO); deviceService.updateById(deviceInfoPO);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment