Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shadow-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ubocare
shadow-server
Commits
1fc057f5
Commit
1fc057f5
authored
Dec 06, 2019
by
003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.14 更新最近上下线时间
parent
cdcf17bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
DeviceInfoPO.java
src/main/java/com/shadow/iot/entity/DeviceInfoPO.java
+48
-0
DeviceStatusMQ.java
...a/com/shadow/mq/nats/consumer/process/DeviceStatusMQ.java
+5
-0
No files found.
src/main/java/com/shadow/iot/entity/DeviceInfoPO.java
View file @
1fc057f5
...
...
@@ -68,6 +68,30 @@ public class DeviceInfoPO implements Serializable {
@TableField
(
"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 {
@TableField
(
"update_time"
)
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
;
}
src/main/java/com/shadow/mq/nats/consumer/process/DeviceStatusMQ.java
View file @
1fc057f5
...
...
@@ -46,6 +46,11 @@ public class DeviceStatusMQ implements NatsMQProcess{
//如果数据库不一致则更新
if
(
null
!=
deviceInfoPO
&&
!
bean
.
getOnline
().
equals
(
deviceInfoPO
.
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
());
deviceService
.
updateById
(
deviceInfoPO
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment