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
d4d16490
Commit
d4d16490
authored
Oct 22, 2019
by
dufafei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dac9c849
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
11 deletions
+20
-11
src/main/resources/ignite.xml
+1
-0
src/main/scala/com/hikcreate/data/client/IgniteClient.scala
+1
-1
src/main/scala/com/hikcreate/data/constant/Const.scala
+1
-1
src/main/scala/com/hikcreate/data/offline/FullSync.scala
+17
-9
No files found.
src/main/resources/ignite.xml
View file @
d4d16490
...
...
@@ -18,6 +18,7 @@
<property
name=
"zkConnectionString"
value=
"10.197.236.211:2181,10.197.236.212:2181,10.197.236.213:2181"
/>
<property
name=
"sessionTimeout"
value=
"30000"
/>
<property
name=
"zkRootPath"
value=
"/apacheIgnite"
/>
<!--<property name="zkRootPath" value="/Ignite"/>-->
<property
name=
"joinTimeout"
value=
"0"
/>
</bean>
</property>
...
...
src/main/scala/com/hikcreate/data/client/IgniteClient.scala
View file @
d4d16490
...
...
@@ -211,7 +211,7 @@ object IgniteClient {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
dailyAlarmNumberCache
.
clear
(
)
//ignite.cacheNames().asScala.foreach(x=>ignite.destroyCache(x)
)
ignite
.
close
()
}
...
...
src/main/scala/com/hikcreate/data/constant/Const.scala
View file @
d4d16490
...
...
@@ -26,7 +26,7 @@ object Const {
val
warnTypes
:
Array
[
String
]
=
Config
.
getString
(
"warnTypes"
).
split
(
","
)
val
tableMap
=
Map
(
val
tableMap
:
Map
[
TableKey
,
String
]
=
Map
(
//链路管理
TableKey
(
Some
(
"0x1001"
),
None
)->
Config
.
getString
(
"hive.UP_CONNECT_REQ.table"
),
//主链路登录
TableKey
(
Some
(
"0x1003"
),
None
)->
Config
.
getString
(
"hive.UP_DISCONNECT_REQ.table"
),
//主链路注销
...
...
src/main/scala/com/hikcreate/data/offline/FullSync.scala
View file @
d4d16490
...
...
@@ -61,15 +61,23 @@ object FullSync extends Sparking{
val
status
=
row
.
getString
(
row
.
fieldIndex
(
"status"
))
val
vehicle_brand
=
row
.
getString
(
row
.
fieldIndex
(
"vehicle_brand"
))
val
enterpriseInfo
=
Tools
.
getEnterpriseInfo
(
enterprise_code
)
val
province
=
enterpriseInfo
.
map
(
x
=>
x
.
getProvince
).
getOrElse
(
""
)
val
city
=
enterpriseInfo
.
map
(
x
=>
x
.
getCity
).
getOrElse
(
""
)
val
area
=
enterpriseInfo
.
map
(
x
=>
x
.
getArea
).
getOrElse
(
""
)
val
value
=
new
VehicleInfo
(
id
,
vehicle_code
,
plate_num
,
plate_color
,
into_time
,
business_scope
,
business_scope_detail
,
indentifier
,
into_status
,
status
,
operating_certificate_no
,
class_line
,
use_nature
,
enterprise_code
,
driving_permit_no
,
vehicle_brand
,
""
,
province
,
city
,
area
)
IgniteClient
.
basicVehicleInfo
.
withKeepBinary
().
put
(
id
,
value
)
/*val province = enterpriseInfo.map(x => x.getProvince).getOrElse("")
val city = enterpriseInfo.map(x => x.getCity).getOrElse("")*/
val
code
=
enterpriseInfo
.
map
(
x
=>
x
.
getArea
).
getOrElse
(
""
)
if
(
code
.
length
==
6
)
{
val
province
=
code
.
substring
(
0
,
2
)
val
city
=
code
.
substring
(
2
,
4
)
val
area
=
code
.
substring
(
4
,
6
)
val
value
=
new
VehicleInfo
(
id
,
vehicle_code
,
plate_num
,
plate_color
,
into_time
,
business_scope
,
business_scope_detail
,
indentifier
,
into_status
,
status
,
operating_certificate_no
,
class_line
,
use_nature
,
enterprise_code
,
driving_permit_no
,
vehicle_brand
,
""
,
province
,
city
,
area
)
IgniteClient
.
basicVehicleInfo
.
withKeepBinary
().
put
(
id
,
value
)
}
}
//报警类型配置基础表
sparkSession
.
sqlContext
.
read
.
format
(
"jdbc"
).
options
(
Map
(
...
...
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