Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
operating-vehicle
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杜发飞
operating-vehicle
Commits
ca707970
Commit
ca707970
authored
Oct 21, 2019
by
杜发飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bcc380a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
103 deletions
+9
-103
src/main/java/com/hikcreate/ignite/domain/alarm/DailyAlarm.java
+3
-3
src/main/java/com/hikcreate/ignite/domain/alarm/processor/DailyAlarmUpdate.java
+4
-4
src/main/resources/ignite.xml
+1
-1
src/main/scala/com/hikcreate/data/client/IgniteClient.scala
+1
-95
No files found.
src/main/java/com/hikcreate/ignite/domain/alarm/DailyAlarm.java
View file @
ca707970
...
@@ -25,14 +25,14 @@ public class DailyAlarm implements Serializable {
...
@@ -25,14 +25,14 @@ public class DailyAlarm implements Serializable {
private
String
date
;
//统计日期 - 当天
private
String
date
;
//统计日期 - 当天
@QuerySqlField
@QuerySqlField
private
Long
n
umber
;
//对应报警数
private
Long
alarmN
umber
;
//对应报警数
public
DailyAlarm
(
String
province
,
String
city
,
String
area
,
String
useNature
,
String
date
,
Long
n
umber
)
{
public
DailyAlarm
(
String
province
,
String
city
,
String
area
,
String
useNature
,
String
date
,
Long
alarmN
umber
)
{
this
.
province
=
province
;
this
.
province
=
province
;
this
.
city
=
city
;
this
.
city
=
city
;
this
.
area
=
area
;
this
.
area
=
area
;
this
.
useNature
=
useNature
;
this
.
useNature
=
useNature
;
this
.
date
=
date
;
this
.
date
=
date
;
this
.
number
=
n
umber
;
this
.
alarmNumber
=
alarmN
umber
;
}
}
}
}
src/main/java/com/hikcreate/ignite/domain/alarm/processor/DailyAlarmUpdate.java
View file @
ca707970
...
@@ -27,16 +27,16 @@ public class DailyAlarmUpdate implements CacheEntryProcessor<BinaryObject,Binary
...
@@ -27,16 +27,16 @@ public class DailyAlarmUpdate implements CacheEntryProcessor<BinaryObject,Binary
if
(
statisticalDate
.
isBefore
(
today
)){
//统计时间不是当前日,需要重置
if
(
statisticalDate
.
isBefore
(
today
)){
//统计时间不是当前日,需要重置
builder
.
setField
(
"date"
,
today
.
toString
(
"yyyy-MM-dd"
));
builder
.
setField
(
"date"
,
today
.
toString
(
"yyyy-MM-dd"
));
if
(
eventDate
.
equals
(
today
)){
if
(
eventDate
.
equals
(
today
)){
builder
.
setField
(
"
n
umber"
,
1L
);
builder
.
setField
(
"
alarmN
umber"
,
1L
);
mutableEntry
.
setValue
(
builder
.
build
());
mutableEntry
.
setValue
(
builder
.
build
());
}
else
{
}
else
{
builder
.
setField
(
"
n
umber"
,
0L
);
builder
.
setField
(
"
alarmN
umber"
,
0L
);
mutableEntry
.
setValue
(
builder
.
build
());
mutableEntry
.
setValue
(
builder
.
build
());
}
}
}
else
{
}
else
{
if
(
eventDate
.
equals
(
today
)){
if
(
eventDate
.
equals
(
today
)){
Long
old
=
value
.<
Long
>
field
(
"
n
umber"
);
Long
old
=
value
.<
Long
>
field
(
"
alarmN
umber"
);
builder
.
setField
(
"
n
umber"
,
old
+
1
);
builder
.
setField
(
"
alarmN
umber"
,
old
+
1
);
mutableEntry
.
setValue
(
builder
.
build
());
mutableEntry
.
setValue
(
builder
.
build
());
}
}
}
}
...
...
src/main/resources/ignite.xml
View file @
ca707970
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
>
http://www.springframework.org/schema/beans/spring-beans.xsd"
>
<bean
class=
"org.apache.ignite.configuration.IgniteConfiguration"
>
<bean
class=
"org.apache.ignite.configuration.IgniteConfiguration"
>
<property
name=
"igniteInstanceName"
value=
"
dff
"
/>
<property
name=
"igniteInstanceName"
value=
"
sparkIgnite
"
/>
<property
name=
"clientMode"
value=
"true"
/>
<property
name=
"clientMode"
value=
"true"
/>
<property
name=
"consistentId"
value=
"node"
/>
<property
name=
"consistentId"
value=
"node"
/>
<property
name=
"peerClassLoadingEnabled"
value=
"true"
/>
<property
name=
"peerClassLoadingEnabled"
value=
"true"
/>
...
...
src/main/scala/com/hikcreate/data/client/IgniteClient.scala
View file @
ca707970
...
@@ -211,102 +211,8 @@ object IgniteClient {
...
@@ -211,102 +211,8 @@ object IgniteClient {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
//ignite.cacheNames().asScala.foreach(println(_)
)
dailyAlarmNumberCache
.
clear
(
)
/*basicPlatformInfo.destroy()
basicEnterpriseInfo.destroy()
basicVehicleInfo.destroy()
basicAlarmTypeInfo.destroy()*/
/*mileageCache.destroy()
driverNumberCache.destroy()
vehicleNumberCache.destroy()
alarmNumberCache.destroy()*/
/*attachmentCache.destroy()
dailyAlarmNumberCache.destroy()
dailyAlarmDealCache.destroy()
dailyAlarmDetailCache.destroy()*/
/*ignite.destroyCache("DailyAlarmProcess")
IgniteClient.dailyAlarmDealCache.clear()
val value = new DailyAlarmDeal("01","2","","001","2019-10-20 10:00:00",true)
IgniteClient.dailyAlarmDealCache.withKeepBinary().putIfAbsent(getBinaryObject(new PrimaryKey("01","2","001")),value)
val value1 = new DailyAlarmDeal("01","2","","002","2019-10-20 12:00:00",true)
IgniteClient.dailyAlarmDealCache.withKeepBinary().putIfAbsent(getBinaryObject(new PrimaryKey("01","2","002")),value1)
val value2 = new DailyAlarmDeal("01","2","","003","2019-10-20 12:00:00",true)
IgniteClient.dailyAlarmDealCache.withKeepBinary().putIfAbsent(getBinaryObject(new PrimaryKey("01","2","003")),value2)*/
val
dailyAlarmDetail
=
new
DailyAlarmDetail
(
"33"
,
"01"
,
"01"
,
"01"
,
"2"
,
""
,
"0x00"
,
"2019-10-21 10:00:00"
,
119.980300
,
30.003100
,
1L
,
"CES"
)
IgniteClient
.
dailyAlarmDetailCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"01"
,
"2"
,
"2019-10-20 10:00:00"
)),
dailyAlarmDetail
)
val
attachmentInfo
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:00:00"
,
"1"
,
"2"
,
"1"
,
"group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx1"
)),
attachmentInfo
)
val
attachmentInfo1
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:00:00"
,
"1"
,
"2"
,
"2"
,
"group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx2"
)),
attachmentInfo1
)
val
dailyAlarmDetail1
=
new
DailyAlarmDetail
(
"33"
,
"01"
,
"01"
,
"01"
,
"2"
,
""
,
"0x00"
,
"2019-10-21 10:10:00"
,
119.980300
,
30.003100
,
1L
,
"CES1"
)
IgniteClient
.
dailyAlarmDetailCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"01"
,
"2"
,
"2019-10-21 10:10:00"
)),
dailyAlarmDetail1
)
val
attachmentInfo2
=
new
AttachmentInfo
(
"100"
,
"01"
,
"3"
,
"1"
,
"0x00"
,
"2019-10-21 10:10:00"
,
"1"
,
"2"
,
"1"
,
"group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx3"
)),
attachmentInfo2
)
val
attachmentInfo3
=
new
AttachmentInfo
(
"100"
,
"01"
,
"4"
,
"1"
,
"0x00"
,
"2019-10-21 10:10:00"
,
"1"
,
"2"
,
"2"
,
"group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx4"
)),
attachmentInfo3
)
val
dailyAlarmDetail2
=
new
DailyAlarmDetail
(
"33"
,
"01"
,
"01"
,
"01"
,
"2"
,
""
,
"0x00"
,
"2019-10-21 10:20:00"
,
119.981400
,
30.103200
,
1L
,
"CES2"
)
IgniteClient
.
dailyAlarmDetailCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"01"
,
"2"
,
"2019-10-20 10:20:00"
)),
dailyAlarmDetail2
)
val
attachmentInfo4
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:20:00"
,
"1"
,
"2"
,
"1"
,
"group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx5"
)),
attachmentInfo4
)
val
attachmentInfo5
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:20:00"
,
"1"
,
"2"
,
"2"
,
"group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx6"
)),
attachmentInfo5
)
val
dailyAlarmDetail3
=
new
DailyAlarmDetail
(
"33"
,
"01"
,
"01"
,
"01"
,
"2"
,
""
,
"0x00"
,
"2019-10-21 10:30:00"
,
119.990300
,
30.113100
,
1L
,
"CES"
)
IgniteClient
.
dailyAlarmDetailCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"01"
,
"2"
,
"2019-10-21 10:30:00"
)),
dailyAlarmDetail3
)
val
attachmentInfo6
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:30:00"
,
"1"
,
"2"
,
"1"
,
"group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx7"
)),
attachmentInfo6
)
val
attachmentInfo17
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:30:00"
,
"1"
,
"2"
,
"2"
,
"group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx8"
)),
attachmentInfo17
)
val
dailyAlarmDetail4
=
new
DailyAlarmDetail
(
"33"
,
"01"
,
"01"
,
"01"
,
"2"
,
""
,
"0x00"
,
"2019-10-21 10:40:00"
,
119.960300
,
30.113110
,
1L
,
"CES"
)
IgniteClient
.
dailyAlarmDetailCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"01"
,
"2"
,
"2019-10-21 10:40:00"
)),
dailyAlarmDetail4
)
val
attachmentInfo8
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:40:00"
,
"1"
,
"2"
,
"1"
,
"group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx9"
)),
attachmentInfo8
)
val
attachmentInfo19
=
new
AttachmentInfo
(
"100"
,
"01"
,
"2"
,
"1"
,
"0x00"
,
"2019-10-21 10:40:00"
,
"1"
,
"2"
,
"2"
,
"group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg"
,
""
)
attachmentCache
.
withKeepBinary
().
put
(
getBinaryObject
(
new
PrimaryKey
(
"xxxxxxxxxx10"
)),
attachmentInfo19
)
//val query = new SqlFieldsQuery("select count(*) from DailyAlarmDeal where isDeal = true")
/*val me = new DailyTravel("33","08","01","","2019-10-12",200.00,200.00,"2019-10-20 17:02:00",10.00,1L,"11","22","33")
dailyTravelCache.withKeepBinary().withKeepBinary().put(getBinaryObject(new PrimaryKey("111")),me)
val d = new VehicleNumber("33","01","01","")
vehicleNumberCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("1")),d)*/
ignite
.
close
()
ignite
.
close
()
}
}
}
}
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