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
fb4377bf
Commit
fb4377bf
authored
Mar 28, 2018
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.28-修改线路新增接口以及查询接口,修改数据的返回格式
parent
beb6eca9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1217 additions
and
655 deletions
+1217
-655
RedisConfig.java
src/main/java/com/example/tdl/config/RedisConfig.java
+9
-0
AddCircuitVo.java
src/main/java/com/example/tdl/domain/vo/AddCircuitVo.java
+25
-15
AddressVo.java
src/main/java/com/example/tdl/domain/vo/AddressVo.java
+0
-11
AlarmRuleVo.java
src/main/java/com/example/tdl/domain/vo/AlarmRuleVo.java
+54
-0
BindingVo.java
src/main/java/com/example/tdl/domain/vo/BindingVo.java
+10
-0
CircuitMessageVo.java
...main/java/com/example/tdl/domain/vo/CircuitMessageVo.java
+1
-1
DataVo.java
src/main/java/com/example/tdl/domain/vo/DataVo.java
+26
-0
EndAddressVo.java
src/main/java/com/example/tdl/domain/vo/EndAddressVo.java
+74
-0
HistoryData.java
src/main/java/com/example/tdl/domain/vo/HistoryData.java
+24
-0
HistoryDataVo.java
src/main/java/com/example/tdl/domain/vo/HistoryDataVo.java
+25
-0
StartAddressVo.java
src/main/java/com/example/tdl/domain/vo/StartAddressVo.java
+75
-0
TDLAlarmVo.java
src/main/java/com/example/tdl/domain/vo/TDLAlarmVo.java
+24
-0
MqttListener.java
src/main/java/com/example/tdl/mqtt/MqttListener.java
+1
-0
AlarmRedisService.java
...java/com/example/tdl/service/redis/AlarmRedisService.java
+15
-0
CircuitController.java
src/main/java/com/example/tdl/web/CircuitController.java
+469
-337
DataController.java
src/main/java/com/example/tdl/web/DataController.java
+292
-239
EquipmentBindingController.java
.../java/com/example/tdl/web/EquipmentBindingController.java
+52
-1
CircuitMapper.xml
src/main/resources/mapper/CircuitMapper.xml
+15
-26
ConfigMapper.xml
src/main/resources/mapper/ConfigMapper.xml
+26
-25
No files found.
src/main/java/com/example/tdl/config/RedisConfig.java
View file @
fb4377bf
...
@@ -216,6 +216,13 @@ public class RedisConfig extends CachingConfigurerSupport{
...
@@ -216,6 +216,13 @@ public class RedisConfig extends CachingConfigurerSupport{
return
template
;
return
template
;
}
}
@Bean
public
RedisTemplate
<
String
,
String
>
alarmRedisTemplate
()
{
StringRedisTemplate
template
=
new
StringRedisTemplate
(
redisConnectionFactory
(
3
));
JsonRedisSerializer
(
template
,
false
);
return
template
;
}
@Bean
@Bean
public
RedisTemplate
<
String
,
String
>
tokenRedisTemplate
()
{
public
RedisTemplate
<
String
,
String
>
tokenRedisTemplate
()
{
StringRedisTemplate
template
=
new
StringRedisTemplate
(
redisConnectionFactory
(
15
));
StringRedisTemplate
template
=
new
StringRedisTemplate
(
redisConnectionFactory
(
15
));
...
@@ -223,5 +230,7 @@ public class RedisConfig extends CachingConfigurerSupport{
...
@@ -223,5 +230,7 @@ public class RedisConfig extends CachingConfigurerSupport{
return
template
;
return
template
;
}
}
}
}
src/main/java/com/example/tdl/domain/vo/AddCircuitVo.java
View file @
fb4377bf
...
@@ -5,13 +5,15 @@ import java.util.List;
...
@@ -5,13 +5,15 @@ import java.util.List;
public
class
AddCircuitVo
{
public
class
AddCircuitVo
{
private
StartAddressVo
startAddressVo
;
private
List
<
AddressVo
>
addressVoList
;
private
List
<
AddressVo
>
addressVoList
;
private
String
SN
;
private
EndAddressVo
endAddressVo
;
private
String
TDL
SN
;
private
String
SN
;
private
String
alarmType
;
private
List
<
TDLAlarmVo
>
tdlAlarmList
;
private
String
cargoNo
;
//货物编号
private
String
cargoNo
;
//货物编号
...
@@ -21,6 +23,14 @@ public class AddCircuitVo {
...
@@ -21,6 +23,14 @@ public class AddCircuitVo {
private
String
remark
;
private
String
remark
;
public
StartAddressVo
getStartAddressVo
()
{
return
startAddressVo
;
}
public
void
setStartAddressVo
(
StartAddressVo
startAddressVo
)
{
this
.
startAddressVo
=
startAddressVo
;
}
public
List
<
AddressVo
>
getAddressVoList
()
{
public
List
<
AddressVo
>
getAddressVoList
()
{
return
addressVoList
;
return
addressVoList
;
}
}
...
@@ -29,28 +39,28 @@ public class AddCircuitVo {
...
@@ -29,28 +39,28 @@ public class AddCircuitVo {
this
.
addressVoList
=
addressVoList
;
this
.
addressVoList
=
addressVoList
;
}
}
public
String
getSN
()
{
public
EndAddressVo
getEndAddressVo
()
{
return
SN
;
return
endAddressVo
;
}
}
public
void
set
SN
(
String
SN
)
{
public
void
set
EndAddressVo
(
EndAddressVo
endAddressVo
)
{
this
.
SN
=
SN
;
this
.
endAddressVo
=
endAddressVo
;
}
}
public
String
get
TDL
SN
()
{
public
String
getSN
()
{
return
TDL
SN
;
return
SN
;
}
}
public
void
set
TDLSN
(
String
TDL
SN
)
{
public
void
set
SN
(
String
SN
)
{
this
.
TDLSN
=
TDL
SN
;
this
.
SN
=
SN
;
}
}
public
String
getAlarmType
()
{
public
List
<
TDLAlarmVo
>
getTdlAlarmList
()
{
return
alarmType
;
return
tdlAlarmList
;
}
}
public
void
set
AlarmType
(
String
alarmType
)
{
public
void
set
TdlAlarmList
(
List
<
TDLAlarmVo
>
tdlAlarmList
)
{
this
.
alarmType
=
alarmType
;
this
.
tdlAlarmList
=
tdlAlarmList
;
}
}
public
String
getCargoNo
()
{
public
String
getCargoNo
()
{
...
...
src/main/java/com/example/tdl/domain/vo/AddressVo.java
View file @
fb4377bf
...
@@ -2,8 +2,6 @@ package com.example.tdl.domain.vo;
...
@@ -2,8 +2,6 @@ package com.example.tdl.domain.vo;
public
class
AddressVo
{
public
class
AddressVo
{
private
Integer
sequence
;
private
String
country
;
private
String
country
;
private
String
city
;
private
String
city
;
...
@@ -20,15 +18,6 @@ public class AddressVo {
...
@@ -20,15 +18,6 @@ public class AddressVo {
private
Long
compTime
;
//预计结束时间
private
Long
compTime
;
//预计结束时间
public
Integer
getSequence
()
{
return
sequence
;
}
public
void
setSequence
(
Integer
sequence
)
{
this
.
sequence
=
sequence
;
}
public
String
getCountry
()
{
public
String
getCountry
()
{
return
country
;
return
country
;
}
}
...
...
src/main/java/com/example/tdl/domain/vo/AlarmRuleVo.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
domain
.
vo
;
public
class
AlarmRuleVo
{
private
String
rule
;
private
String
maxval
;
private
String
minval
;
private
String
mode
;
private
String
priority
;
public
String
getRule
()
{
return
rule
;
}
public
void
setRule
(
String
rule
)
{
this
.
rule
=
rule
;
}
public
String
getMaxval
()
{
return
maxval
;
}
public
void
setMaxval
(
String
maxval
)
{
this
.
maxval
=
maxval
;
}
public
String
getMinval
()
{
return
minval
;
}
public
void
setMinval
(
String
minval
)
{
this
.
minval
=
minval
;
}
public
String
getMode
()
{
return
mode
;
}
public
void
setMode
(
String
mode
)
{
this
.
mode
=
mode
;
}
public
String
getPriority
()
{
return
priority
;
}
public
void
setPriority
(
String
priority
)
{
this
.
priority
=
priority
;
}
}
src/main/java/com/example/tdl/domain/vo/BindingVo.java
View file @
fb4377bf
...
@@ -14,6 +14,8 @@ public class BindingVo {
...
@@ -14,6 +14,8 @@ public class BindingVo {
private
String
warehouseNo
;
private
String
warehouseNo
;
private
String
alarmType
;
public
String
getSN
()
{
public
String
getSN
()
{
return
SN
;
return
SN
;
}
}
...
@@ -61,4 +63,12 @@ public class BindingVo {
...
@@ -61,4 +63,12 @@ public class BindingVo {
public
void
setWarehouseNo
(
String
warehouseNo
)
{
public
void
setWarehouseNo
(
String
warehouseNo
)
{
this
.
warehouseNo
=
warehouseNo
;
this
.
warehouseNo
=
warehouseNo
;
}
}
public
String
getAlarmType
()
{
return
alarmType
;
}
public
void
setAlarmType
(
String
alarmType
)
{
this
.
alarmType
=
alarmType
;
}
}
}
src/main/java/com/example/tdl/domain/vo/CircuitMessageVo.java
View file @
fb4377bf
...
@@ -18,7 +18,7 @@ public class CircuitMessageVo {
...
@@ -18,7 +18,7 @@ public class CircuitMessageVo {
private
List
<
ResultCityVo
>
list
;
private
List
<
ResultCityVo
>
list
;
List
<
ResultAlarmLog
>
alarmLogList
;
private
List
<
ResultAlarmLog
>
alarmLogList
;
public
CircuitMessageVo
()
{
public
CircuitMessageVo
()
{
}
}
...
...
src/main/java/com/example/tdl/domain/vo/DataVo.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
domain
.
vo
;
import
java.util.List
;
public
class
DataVo
{
private
String
description
;
private
List
<
HistoryDataVo
>
dataList
;
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
List
<
HistoryDataVo
>
getDataList
()
{
return
dataList
;
}
public
void
setDataList
(
List
<
HistoryDataVo
>
dataList
)
{
this
.
dataList
=
dataList
;
}
}
src/main/java/com/example/tdl/domain/vo/EndAddressVo.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
domain
.
vo
;
public
class
EndAddressVo
{
private
String
country
;
private
String
city
;
private
String
addressDetail
;
private
String
lng
;
private
String
lat
;
private
String
postCode
;
private
Long
compTime
;
//预计结束时间
public
String
getCountry
()
{
return
country
;
}
public
void
setCountry
(
String
country
)
{
this
.
country
=
country
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getAddressDetail
()
{
return
addressDetail
;
}
public
void
setAddressDetail
(
String
addressDetail
)
{
this
.
addressDetail
=
addressDetail
;
}
public
String
getLng
()
{
return
lng
;
}
public
void
setLng
(
String
lng
)
{
this
.
lng
=
lng
;
}
public
String
getLat
()
{
return
lat
;
}
public
void
setLat
(
String
lat
)
{
this
.
lat
=
lat
;
}
public
String
getPostCode
()
{
return
postCode
;
}
public
void
setPostCode
(
String
postCode
)
{
this
.
postCode
=
postCode
;
}
public
Long
getCompTime
()
{
return
compTime
;
}
public
void
setCompTime
(
Long
compTime
)
{
this
.
compTime
=
compTime
;
}
}
src/main/java/com/example/tdl/domain/vo/HistoryData.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
domain
.
vo
;
public
class
HistoryData
{
private
String
time
;
private
String
value
;
public
String
getTime
()
{
return
time
;
}
public
void
setTime
(
String
time
)
{
this
.
time
=
time
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
src/main/java/com/example/tdl/domain/vo/HistoryDataVo.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
domain
.
vo
;
import
java.util.List
;
public
class
HistoryDataVo
{
private
String
TDLSN
;
private
List
<
HistoryData
>
dataList
;
public
String
getTDLSN
()
{
return
TDLSN
;
}
public
void
setTDLSN
(
String
TDLSN
)
{
this
.
TDLSN
=
TDLSN
;
}
public
List
<
HistoryData
>
getDataList
()
{
return
dataList
;
}
public
void
setDataList
(
List
<
HistoryData
>
dataList
)
{
this
.
dataList
=
dataList
;
}
}
src/main/java/com/example/tdl/domain/vo/StartAddressVo.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
domain
.
vo
;
public
class
StartAddressVo
{
private
String
country
;
private
String
city
;
private
String
addressDetail
;
private
String
lng
;
private
String
lat
;
private
String
postCode
;
private
Long
expTime
;
public
String
getCountry
()
{
return
country
;
}
public
void
setCountry
(
String
country
)
{
this
.
country
=
country
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getAddressDetail
()
{
return
addressDetail
;
}
public
void
setAddressDetail
(
String
addressDetail
)
{
this
.
addressDetail
=
addressDetail
;
}
public
String
getLng
()
{
return
lng
;
}
public
void
setLng
(
String
lng
)
{
this
.
lng
=
lng
;
}
public
String
getLat
()
{
return
lat
;
}
public
void
setLat
(
String
lat
)
{
this
.
lat
=
lat
;
}
public
String
getPostCode
()
{
return
postCode
;
}
public
void
setPostCode
(
String
postCode
)
{
this
.
postCode
=
postCode
;
}
public
Long
getExpTime
()
{
return
expTime
;
}
public
void
setExpTime
(
Long
expTime
)
{
this
.
expTime
=
expTime
;
}
}
src/main/java/com/example/tdl/domain/vo/TDLAlarmVo.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
domain
.
vo
;
public
class
TDLAlarmVo
{
private
String
TDLSN
;
private
String
alarmType
;
public
String
getTDLSN
()
{
return
TDLSN
;
}
public
void
setTDLSN
(
String
TDLSN
)
{
this
.
TDLSN
=
TDLSN
;
}
public
String
getAlarmType
()
{
return
alarmType
;
}
public
void
setAlarmType
(
String
alarmType
)
{
this
.
alarmType
=
alarmType
;
}
}
src/main/java/com/example/tdl/mqtt/MqttListener.java
View file @
fb4377bf
...
@@ -204,4 +204,5 @@ public class MqttListener implements MqttCallback {
...
@@ -204,4 +204,5 @@ public class MqttListener implements MqttCallback {
return
1
;
//重发
return
1
;
//重发
}
}
}
}
}
}
src/main/java/com/example/tdl/service/redis/AlarmRedisService.java
0 → 100644
View file @
fb4377bf
package
com
.
example
.
tdl
.
service
.
redis
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
@Service
public
class
AlarmRedisService
extends
RedisService
{
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Autowired
public
AlarmRedisService
(
RedisTemplate
alarmRedisTemplate
)
{
super
(
alarmRedisTemplate
);
}
}
src/main/java/com/example/tdl/web/CircuitController.java
View file @
fb4377bf
This diff is collapsed.
Click to expand it.
src/main/java/com/example/tdl/web/DataController.java
View file @
fb4377bf
This diff is collapsed.
Click to expand it.
src/main/java/com/example/tdl/web/EquipmentBindingController.java
View file @
fb4377bf
...
@@ -3,12 +3,13 @@ package com.example.tdl.web;
...
@@ -3,12 +3,13 @@ package com.example.tdl.web;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.FloatArraySerializer
;
import
com.example.tdl.domain.dto.CommFeedback
;
import
com.example.tdl.domain.dto.CommFeedback
;
import
com.example.tdl.domain.vo.*
;
import
com.example.tdl.domain.vo.*
;
import
com.example.tdl.service.AlarmService
;
import
com.example.tdl.service.ConfigService
;
import
com.example.tdl.service.ConfigService
;
import
com.example.tdl.service.GatewayService
;
import
com.example.tdl.service.GatewayService
;
import
com.example.tdl.service.TDLDeviceService
;
import
com.example.tdl.service.TDLDeviceService
;
import
com.example.tdl.service.redis.AlarmRedisService
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
...
@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -44,6 +46,21 @@ public class EquipmentBindingController {
...
@@ -44,6 +46,21 @@ public class EquipmentBindingController {
@Autowired
@Autowired
private
TDLDeviceService
tdlDeviceService
;
private
TDLDeviceService
tdlDeviceService
;
@Autowired
private
AlarmRedisService
alarmRedisService
;
@Autowired
private
AlarmService
alarmService
;
List
<
String
>
list
=
new
ArrayList
<
String
>(){{
add
(
"T"
);
add
(
"h"
);
add
(
"a0"
);
add
(
"ta"
);
// add("");
// add("");
}};
@ApiOperation
(
value
=
"绑定gateWay和tdl"
,
notes
=
"绑定gateWay和tdl"
+
@ApiOperation
(
value
=
"绑定gateWay和tdl"
,
notes
=
"绑定gateWay和tdl"
+
" SN:gateWay编号,"
+
" SN:gateWay编号,"
+
" type:gateWay类型,"
+
" type:gateWay类型,"
+
...
@@ -86,6 +103,7 @@ public class EquipmentBindingController {
...
@@ -86,6 +103,7 @@ public class EquipmentBindingController {
map
.
put
(
"useScene"
,
bindingVo
.
getMode
());
map
.
put
(
"useScene"
,
bindingVo
.
getMode
());
map
.
put
(
"gSN"
,
bindingVo
.
getSN
());
map
.
put
(
"gSN"
,
bindingVo
.
getSN
());
map
.
put
(
"gType"
,
bindingVo
.
getType
());
map
.
put
(
"gType"
,
bindingVo
.
getType
());
map
.
put
(
"alarmType"
,
bindingVo
.
getAlarmType
());
map
.
put
(
"message"
,
gson
.
toJson
(
configCMDVo
));
map
.
put
(
"message"
,
gson
.
toJson
(
configCMDVo
));
map
.
put
(
"flag"
,
false
);
map
.
put
(
"flag"
,
false
);
map
.
put
(
"resp"
,
null
);
map
.
put
(
"resp"
,
null
);
...
@@ -99,6 +117,34 @@ public class EquipmentBindingController {
...
@@ -99,6 +117,34 @@ public class EquipmentBindingController {
if
(
msg
.
get
(
"msg"
).
equals
(
"配置网关成功"
)){
if
(
msg
.
get
(
"msg"
).
equals
(
"配置网关成功"
)){
fb
.
setCode
(
1
);
fb
.
setCode
(
1
);
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
//根据报警类型货报警信息
ResultAlarmVo
alarmVo
=
alarmService
.
getByTypeAndScene
(
bindingVo
.
getAlarmType
(),
"运输"
);
for
(
String
alias
:
list
){
List
<
AlarmRuleVo
>
alarmRuleVos
=
new
ArrayList
<>();
AlarmRuleVo
alarmRuleVo
=
new
AlarmRuleVo
();
if
(
alias
.
equals
(
"T"
)){
alarmRuleVo
.
setMinval
(
String
.
valueOf
(
alarmVo
.
getTemMin
()));
alarmRuleVo
.
setMaxval
(
String
.
valueOf
(
alarmVo
.
getTemMax
()));
alarmRuleVo
.
setMode
(
"twoway"
);
alarmRuleVo
.
setPriority
(
"1"
);
}
else
if
(
alias
.
equals
(
"h"
)){
alarmRuleVo
.
setMinval
(
String
.
valueOf
(
alarmVo
.
getHumidityMin
()));
alarmRuleVo
.
setMaxval
(
String
.
valueOf
(
alarmVo
.
getHumidityMax
()));
alarmRuleVo
.
setMode
(
"twoway"
);
alarmRuleVo
.
setPriority
(
"1"
);
}
else
if
(
alias
.
equals
(
"ta"
)){
alarmRuleVo
.
setMinval
(
String
.
valueOf
(
alarmVo
.
getTilt
()));
alarmRuleVo
.
setMode
(
"equal"
);
alarmRuleVo
.
setPriority
(
"1"
);
}
else
if
(
alias
.
equals
(
"a0"
)){
alarmRuleVo
.
setMinval
(
String
.
valueOf
(
alarmVo
.
getShock
()));
alarmRuleVo
.
setMode
(
"equal"
);
alarmRuleVo
.
setPriority
(
"1"
);
}
alarmRuleVos
.
add
(
alarmRuleVo
);
//向redis中写入报警信息
alarmRedisService
.
hmSet
(
"TDL/"
+
bindingVo
.
getType
()+
"/"
+
bindingVo
.
getSN
()+
"/Data"
,
"tdl-"
+
bindingVo
.
getTDLSN
()+
"_"
+
alias
,
gson
.
toJson
(
alarmRuleVos
));
}
}
else
{
}
else
{
fb
.
setCode
(
0
);
fb
.
setCode
(
0
);
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
...
@@ -106,6 +152,9 @@ public class EquipmentBindingController {
...
@@ -106,6 +152,9 @@ public class EquipmentBindingController {
return
gson
.
toJson
(
fb
);
return
gson
.
toJson
(
fb
);
}
}
@ApiOperation
(
value
=
"重置tdl"
,
notes
=
"重置tdl"
)
@ApiOperation
(
value
=
"重置tdl"
,
notes
=
"重置tdl"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"Account_token"
,
value
=
"token"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"Account_token"
,
value
=
"token"
,
required
=
true
,
dataType
=
"String"
),
...
@@ -141,6 +190,8 @@ public class EquipmentBindingController {
...
@@ -141,6 +190,8 @@ public class EquipmentBindingController {
if
(
msg
.
get
(
"msg"
).
equals
(
"解除网关成功"
)){
if
(
msg
.
get
(
"msg"
).
equals
(
"解除网关成功"
)){
fb
.
setCode
(
1
);
fb
.
setCode
(
1
);
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
String
key
=
"TDL/"
+
resultTDLDeviceVo
.
getGatewayType
()+
"/"
+
resultTDLDeviceVo
.
getGatewaySN
()
+
"/Data"
;
alarmRedisService
.
delKey
(
key
);
}
else
{
}
else
{
fb
.
setCode
(
0
);
fb
.
setCode
(
0
);
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
fb
.
setMessage
(
msg
.
get
(
"msg"
).
toString
());
...
...
src/main/resources/mapper/CircuitMapper.xml
View file @
fb4377bf
This diff is collapsed.
Click to expand it.
src/main/resources/mapper/ConfigMapper.xml
View file @
fb4377bf
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.example.tdl.mapper.ConfigMapper"
>
<mapper
namespace=
"com.example.tdl.mapper.ConfigMapper"
>
<!-- <!–绑定getway和tdl–>
<!--绑定getway和tdl-->
<insert
id=
"addConfig"
parameterType=
"java.util.Map"
statementType=
"CALLABLE"
>
<insert
id=
"addConfig"
parameterType=
"java.util.Map"
statementType=
"CALLABLE"
>
<![CDATA[
<![CDATA[
{
{
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#{useScene,mode=IN,jdbcType=INTEGER},
#{useScene,mode=IN,jdbcType=INTEGER},
#{gSN,mode=IN,jdbcType=VARCHAR},
#{gSN,mode=IN,jdbcType=VARCHAR},
#{gType,mode=IN,jdbcType=VARCHAR},
#{gType,mode=IN,jdbcType=VARCHAR},
#{alarmType,mode=IN,jdbcType=VARCHAR},
#{message,mode=IN,jdbcType=VARCHAR},
#{message,mode=IN,jdbcType=VARCHAR},
#{flag,mode=IN,jdbcType=INTEGER},
#{flag,mode=IN,jdbcType=INTEGER},
#{resp,mode=IN,jdbcType=INTEGER},
#{resp,mode=IN,jdbcType=INTEGER},
...
@@ -24,12 +25,12 @@
...
@@ -24,12 +25,12 @@
]]>
]]>
</insert>
</insert>
<!–获取绑定消息–>
<!--获取绑定消息-->
<select
id=
"getConfig"
parameterType=
"String"
resultType=
"com.example.tdl.domain.vo.ConfigVo"
>
<select
id=
"getConfig"
parameterType=
"String"
resultType=
"com.example.tdl.domain.vo.ConfigVo"
>
select gSN,gType,message,flag,resp,state,untie from config where gSN= #{gSN,jdbcType=VARCHAR} and gType=#{gType,jdbcType=VARCHAR} and state = 1;
select gSN,gType,message,flag,resp,state,untie from config where gSN= #{gSN,jdbcType=VARCHAR} and gType=#{gType,jdbcType=VARCHAR} and state = 1;
</select>
</select>
<!– 绑定回复–>
<!--绑定回复-->
<update
id=
"bindiSuccess"
>
<update
id=
"bindiSuccess"
>
update config set resp=#{resp,jdbcType=INTEGER},flag=true
update config set resp=#{resp,jdbcType=INTEGER},flag=true
where gSN= #{gSN,jdbcType=VARCHAR}
where gSN= #{gSN,jdbcType=VARCHAR}
...
@@ -37,7 +38,7 @@
...
@@ -37,7 +38,7 @@
and state = 1;
and state = 1;
</update>
</update>
<!–重置tdl–>
<!--重置tdl-->
<update
id=
"updateConfig"
parameterType=
"java.util.Map"
statementType=
"CALLABLE"
>
<update
id=
"updateConfig"
parameterType=
"java.util.Map"
statementType=
"CALLABLE"
>
<![CDATA[
<![CDATA[
{
{
...
@@ -54,28 +55,28 @@
...
@@ -54,28 +55,28 @@
]]>
]]>
</update>
</update>
<!–解绑成功–>
<!--解绑成功-->
<update
id=
"delConfig"
parameterType=
"String"
>
<update
id=
"delConfig"
parameterType=
"String"
>
update config set state = 0 where gSN= #{gSN,jdbcType=VARCHAR} and gType=#{gType,jdbcType=VARCHAR} and state = 1;
update config set state = 0 where gSN= #{gSN,jdbcType=VARCHAR} and gType=#{gType,jdbcType=VARCHAR} and state = 1;
</update>
-->
</update>
<!-- <insert id="addConfig" parameterType="com.example.tdl.domain.vo.ConfigVo"
>
<!--<insert id="addConfig" parameterType="com.example.tdl.domain.vo.ConfigVo">--
>
insert into config
<!--insert into config-->
values(
<!--values(-->
null,
<!--null,-->
#{gSN,jdbcType=VARCHAR},
<!--#{gSN,jdbcType=VARCHAR},-->
#{gType,jdbcType=VARCHAR},
<!--#{gType,jdbcType=VARCHAR},-->
#{message,jdbcType=VARCHAR},
<!--#{message,jdbcType=VARCHAR},-->
#{flag,jdbcType=INTEGER},
<!--#{flag,jdbcType=INTEGER},-->
#{resp,jdbcType=INTEGER},
<!--#{resp,jdbcType=INTEGER},-->
#{state,jdbcType=INTEGER},
<!--#{state,jdbcType=INTEGER},-->
#{untie,jdbcType=INTEGER}
<!--#{untie,jdbcType=INTEGER}-->
)
<!--)-->
</insert>-->
<
!--<
/insert>-->
<!--<update id="updateConfig">
<!--<update id="updateConfig">
-->
update config set untie=#{untie,jdbcType=INTEGER}
<!--update config set untie=#{untie,jdbcType=INTEGER}-->
where gSN= #{gSN,jdbcType=VARCHAR}
<!--where gSN= #{gSN,jdbcType=VARCHAR}-->
and gType=#{gType,jdbcType=VARCHAR}
<!--and gType=#{gType,jdbcType=VARCHAR}-->
and state = 1;
<!--and state = 1;-->
</update>-->
<
!--<
/update>-->
</mapper>
</mapper>
\ No newline at end of file
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