Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
TDLCloud
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
WitCloud
TDLCloud
Commits
3f1805ac
Commit
3f1805ac
authored
Dec 19, 2018
by
chenying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2018.12.19
(1)修改添加线路接口
parent
2190f566
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
11 deletions
+77
-11
CircuitABBController.java
src/main/java/com/example/tdl/web/CircuitABBController.java
+76
-11
messages_zh_CN.properties
src/main/resources/i18n/messages_zh_CN.properties
+1
-0
No files found.
src/main/java/com/example/tdl/web/CircuitABBController.java
View file @
3f1805ac
...
...
@@ -407,7 +407,7 @@ public class CircuitABBController {
ResultTDLDeviceVo
tdlDeviceVo
=
tdlDeviceService
.
getByTDLSN
(
addCircuitForABBVo
.
getTdlAlarmList
().
get
(
j
).
getTDLSN
());
if
(
tdlDeviceVo
==
null
){
fb
.
setCode
(
0
);
Object
[]
args
={
addCircuitForABBVo
.
getTdlAlarmList
().
get
(
j
).
getTDLSN
()};
Object
[]
args
={
addCircuitForABBVo
.
getTdlAlarmList
().
get
(
j
).
getTDLSN
()};
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
args
,
"tdlExist"
));
return
gson
.
toJson
(
fb
);
}
...
...
@@ -423,7 +423,12 @@ public class CircuitABBController {
return
gson
.
toJson
(
fb
);
}
//获取阈值信息
ResultAlarmVo
resultAlarmVo
=
alarmService
.
getByType
(
addCircuitForABBVo
.
getTdlAlarmList
().
get
(
j
).
getAlarmType
(),
user
.
getCompanyNo
());
ResultAlarmVo
resultAlarmVo
=
alarmService
.
getByType
(
addCircuitForABBVo
.
getTdlAlarmList
().
get
(
j
).
getAlarmType
(),
user
.
getCompanyNo
());
if
(
resultAlarmVo
==
null
){
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"alarmTypeEmpty"
));
return
gson
.
toJson
(
fb
);
}
tempL
.
add
(
resultAlarmVo
.
getTemMin
());
tempH
.
add
(
resultAlarmVo
.
getTemMax
());
humiL
.
add
(
resultAlarmVo
.
getHumidityMin
());
...
...
@@ -575,20 +580,80 @@ public class CircuitABBController {
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"inTransit"
));
return
gson
.
toJson
(
fb
);
}
int
a
=
circuitABBService
.
delCircuit
(
transportationNo
);
try
{
if
(
a
>
0
)
{
TDLLogVo
tdlLogVo
=
tdlLogService
.
getByTransportationNo
(
transportationNo
);
if
(
tdlLogVo
!=
null
&&
resultCircuitVo
.
getCircuitState
()
==
0
){
List
<
String
>
dev
=
tdlLogService
.
getTdlSN
(
transportationNo
);
if
(
dev
==
null
){
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"bindTDL"
));
return
gson
.
toJson
(
fb
);
}
List
<
String
>
devList
=
tdlDeviceService
.
getByGatewaySN
(
tdlLogVo
.
getgSN
(),
tdlLogVo
.
getgType
());
if
(
dev
==
null
){
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"bindTDL"
));
return
gson
.
toJson
(
fb
);
}
String
tdl
=
tdlDeviceService
.
getTdl
(
tdlLogVo
.
getgSN
(),
tdlLogVo
.
getgType
());
if
(
StringUtils
.
isEmpty
(
tdl
)){
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"bindTDL"
));
return
gson
.
toJson
(
fb
);
}
ConfigCMDVo
configCMDVo
;
ConfigVo
configVo
=
configService
.
getConfig
(
tdlLogVo
.
getgSN
(),
tdlLogVo
.
getgType
());
if
(
configVo
==
null
){
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"bindGateway"
));
return
gson
.
toJson
(
fb
);
}
if
(
StringUtils
.
isEmpty
(
configVo
.
getMessage
())){
configCMDVo
=
new
ConfigCMDVo
();
}
else
{
ConfigCMDVo
config
=
gson
.
fromJson
(
configVo
.
getMessage
(),
ConfigCMDVo
.
class
);
if
(
tdl
.
equals
(
tdlLogVo
.
getTDLSN
())){
configCMDVo
=
new
ConfigCMDVo
();
}
else
{
devList
.
removeAll
(
dev
);
configCMDVo
=
new
ConfigCMDVo
(
"config"
,
config
.
getGpsPeriod
(),
config
.
getGprsPeriod
(),
devList
,
config
.
getMode
(),
System
.
currentTimeMillis
()/
1000
l
);
}
}
//解绑gateway和tdl
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"transportationNo"
,
transportationNo
);
map
.
put
(
"gSN"
,
tdlLogVo
.
getgSN
());
map
.
put
(
"gType"
,
tdlLogVo
.
getgType
());
map
.
put
(
"endTime"
,
System
.
currentTimeMillis
());
map
.
put
(
"message"
,
gson
.
toJson
(
configCMDVo
));
circuitService
.
deleteCircuit
(
map
);
Map
<
Object
,
Object
>
msg
=
new
HashMap
<>();
msg
.
put
(
"msg"
,
map
.
get
(
"msg"
));
if
(
msg
.
get
(
"msg"
).
equals
(
"解除网关成功"
)){
fb
.
setCode
(
1
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"circuitDeleteSuccess"
));
}
else
{
String
key
=
"TDL/"
+
tdlLogVo
.
getgType
()+
"/"
+
tdlLogVo
.
getgSN
()
+
"/Data"
;
alarmRedisService
.
delKey
(
key
);
infoRedisService
.
delHashKey
(
"AlarmMqttConfig"
,
tdlLogVo
.
getgType
()+
"_"
+
tdlLogVo
.
getgSN
());
}
else
{
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"circuitDeleteFailure"
));
}
}
else
{
int
a
=
circuitABBService
.
delCircuit
(
transportationNo
);
try
{
if
(
a
>
0
)
{
fb
.
setCode
(
1
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"circuitDeleteSuccess"
));
}
else
{
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"circuitDeleteFailure"
));
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
e
.
toString
());
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"circuitDeleteFailure"
));
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
e
.
toString
());
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"circuitDeleteFailure"
));
}
return
gson
.
toJson
(
fb
);
}
...
...
src/main/resources/i18n/messages_zh_CN.properties
View file @
3f1805ac
#\u9884\u8B66\u7C7B\u578B
alarmType
=
\u9884\u
8B66
\u
7C7B
\u
578B
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
alarmTypeEmpty
=
\u
8BE5
\u9884\u
8B66
\u
7C7B
\u
578B
\u
4E0D
\u
5B58
\u5728
alarmScene
=
\u9884\u
8B66
\u
573A
\u
666F
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
wrongAlarmScene
=
\u
8BF7
\u9009\u
62E9
\u
6B63
\u
786E
\u7684\u9884\u
8B66
\u
573A
\u
666F
temMax
=
\u
6E29
\u
5EA6
\u
4E0A
\u9650\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
...
...
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