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
85400688
Commit
85400688
authored
Mar 23, 2018
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.23--修改数据查询的逻辑以及绑定tdl,解绑tdl
parent
497ef35e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
462 additions
and
156 deletions
+462
-156
LocationMessageVo.java
...ain/java/com/example/tdl/domain/vo/LocationMessageVo.java
+6
-6
ResultAlarmLog.java
src/main/java/com/example/tdl/domain/vo/ResultAlarmLog.java
+54
-0
ResultCircuit.java
src/main/java/com/example/tdl/domain/vo/ResultCircuit.java
+9
-9
ResultCircuitVo.java
src/main/java/com/example/tdl/domain/vo/ResultCircuitVo.java
+76
-76
AlarmLogMapper.java
src/main/java/com/example/tdl/mapper/AlarmLogMapper.java
+2
-1
TDLLogMapper.java
src/main/java/com/example/tdl/mapper/TDLLogMapper.java
+11
-0
MqttListener.java
src/main/java/com/example/tdl/mqtt/MqttListener.java
+2
-1
AlarmLogService.java
src/main/java/com/example/tdl/service/AlarmLogService.java
+2
-1
TDLLogService.java
src/main/java/com/example/tdl/service/TDLLogService.java
+19
-0
InfoRedisService.java
.../java/com/example/tdl/service/redis/InfoRedisService.java
+1
-0
CircuitController.java
src/main/java/com/example/tdl/web/CircuitController.java
+2
-2
DataController.java
src/main/java/com/example/tdl/web/DataController.java
+261
-55
EquipmentBindingController.java
.../java/com/example/tdl/web/EquipmentBindingController.java
+1
-3
AlarmLogMapper.xml
src/main/resources/mapper/AlarmLogMapper.xml
+4
-1
CircuitMapper.xml
src/main/resources/mapper/CircuitMapper.xml
+1
-1
ConfigMapper.xml
src/main/resources/mapper/ConfigMapper.xml
+1
-0
TDLLogMapper.xml
src/main/resources/mapper/TDLLogMapper.xml
+9
-0
mybatis-config.xml
src/main/resources/mybatis-config.xml
+1
-0
No files found.
src/main/java/com/example/tdl/domain/vo/LocationMessageVo.java
View file @
85400688
...
...
@@ -14,9 +14,9 @@ public class LocationMessageVo {
private
String
endCity
;
private
Stri
ng
startTime
;
private
Lo
ng
startTime
;
private
Stri
ng
endTime
;
private
Lo
ng
endTime
;
private
Long
alarmTime
;
...
...
@@ -68,19 +68,19 @@ public class LocationMessageVo {
this
.
endCity
=
endCity
;
}
public
Stri
ng
getStartTime
()
{
public
Lo
ng
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Stri
ng
startTime
)
{
public
void
setStartTime
(
Lo
ng
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Stri
ng
getEndTime
()
{
public
Lo
ng
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Stri
ng
endTime
)
{
public
void
setEndTime
(
Lo
ng
endTime
)
{
this
.
endTime
=
endTime
;
}
...
...
src/main/java/com/example/tdl/domain/vo/ResultAlarmLog.java
0 → 100644
View file @
85400688
package
com
.
example
.
tdl
.
domain
.
vo
;
public
class
ResultAlarmLog
{
private
String
transportationNo
;
private
String
routeName
;
private
String
description
;
private
Float
data
;
private
Long
alarmTime
;
public
String
getTransportationNo
()
{
return
transportationNo
;
}
public
void
setTransportationNo
(
String
transportationNo
)
{
this
.
transportationNo
=
transportationNo
;
}
public
String
getRouteName
()
{
return
routeName
;
}
public
void
setRouteName
(
String
routeName
)
{
this
.
routeName
=
routeName
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
Float
getData
()
{
return
data
;
}
public
void
setData
(
Float
data
)
{
this
.
data
=
data
;
}
public
Long
getAlarmTime
()
{
return
alarmTime
;
}
public
void
setAlarmTime
(
Long
alarmTime
)
{
this
.
alarmTime
=
alarmTime
;
}
}
src/main/java/com/example/tdl/domain/vo/ResultCircuit.java
View file @
85400688
...
...
@@ -6,12 +6,12 @@ public class ResultCircuit {
private
String
startCity
;
private
Stri
ng
startTime
;
private
Lo
ng
startTime
;
private
String
endCity
;
private
Stri
ng
endTime
;
private
Lo
ng
endTime
;
private
String
gatewaySN
;
...
...
@@ -19,7 +19,7 @@ public class ResultCircuit {
private
String
TDLSN
;
private
String
B
atteryVoltage
;
private
String
b
atteryVoltage
;
private
String
lastTime
;
...
...
@@ -43,11 +43,11 @@ public class ResultCircuit {
this
.
startCity
=
startCity
;
}
public
Stri
ng
getStartTime
()
{
public
Lo
ng
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Stri
ng
startTime
)
{
public
void
setStartTime
(
Lo
ng
startTime
)
{
this
.
startTime
=
startTime
;
}
...
...
@@ -59,11 +59,11 @@ public class ResultCircuit {
this
.
endCity
=
endCity
;
}
public
Stri
ng
getEndTime
()
{
public
Lo
ng
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Stri
ng
endTime
)
{
public
void
setEndTime
(
Lo
ng
endTime
)
{
this
.
endTime
=
endTime
;
}
...
...
@@ -92,11 +92,11 @@ public class ResultCircuit {
}
public
String
getBatteryVoltage
()
{
return
B
atteryVoltage
;
return
b
atteryVoltage
;
}
public
void
setBatteryVoltage
(
String
batteryVoltage
)
{
B
atteryVoltage
=
batteryVoltage
;
this
.
b
atteryVoltage
=
batteryVoltage
;
}
public
String
getLastTime
()
{
...
...
src/main/java/com/example/tdl/domain/vo/ResultCircuitVo.java
View file @
85400688
...
...
@@ -15,7 +15,7 @@ public class ResultCircuitVo {
private
String
startAddress
;
private
Stri
ng
startTime
;
private
Lo
ng
startTime
;
private
String
endLongitude
;
...
...
@@ -25,7 +25,7 @@ public class ResultCircuitVo {
private
String
endAddress
;
private
Stri
ng
endTime
;
private
Lo
ng
endTime
;
private
String
transport
;
...
...
@@ -43,34 +43,34 @@ public class ResultCircuitVo {
private
String
remark
;
private
Stri
ng
createTime
;
private
Lo
ng
createTime
;
private
String
evaluate
;
private
String
evaluateRemark
;
public
String
get
Evaluate
()
{
return
evaluate
;
public
String
get
TransportationNo
()
{
return
transportationNo
;
}
public
void
set
Evaluate
(
String
evaluate
)
{
this
.
evaluate
=
evaluate
;
public
void
set
TransportationNo
(
String
transportationNo
)
{
this
.
transportationNo
=
transportationNo
;
}
public
String
get
EvaluateRemark
()
{
return
evaluateRemark
;
public
String
get
RouteNumber
()
{
return
routeNumber
;
}
public
void
set
EvaluateRemark
(
String
evaluateRemark
)
{
this
.
evaluateRemark
=
evaluateRemark
;
public
void
set
RouteNumber
(
String
routeNumber
)
{
this
.
routeNumber
=
routeNumber
;
}
public
String
get
CreateTi
me
()
{
return
createTi
me
;
public
String
get
RouteNa
me
()
{
return
routeNa
me
;
}
public
void
set
CreateTime
(
String
createTi
me
)
{
this
.
createTime
=
createTi
me
;
public
void
set
RouteName
(
String
routeNa
me
)
{
this
.
routeName
=
routeNa
me
;
}
public
String
getStartLongitude
()
{
...
...
@@ -89,6 +89,14 @@ public class ResultCircuitVo {
this
.
startLatitude
=
startLatitude
;
}
public
String
getStartCity
()
{
return
startCity
;
}
public
void
setStartCity
(
String
startCity
)
{
this
.
startCity
=
startCity
;
}
public
String
getStartAddress
()
{
return
startAddress
;
}
...
...
@@ -97,6 +105,14 @@ public class ResultCircuitVo {
this
.
startAddress
=
startAddress
;
}
public
Long
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Long
startTime
)
{
this
.
startTime
=
startTime
;
}
public
String
getEndLongitude
()
{
return
endLongitude
;
}
...
...
@@ -113,6 +129,14 @@ public class ResultCircuitVo {
this
.
endLatitude
=
endLatitude
;
}
public
String
getEndCity
()
{
return
endCity
;
}
public
void
setEndCity
(
String
endCity
)
{
this
.
endCity
=
endCity
;
}
public
String
getEndAddress
()
{
return
endAddress
;
}
...
...
@@ -121,6 +145,14 @@ public class ResultCircuitVo {
this
.
endAddress
=
endAddress
;
}
public
Long
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Long
endTime
)
{
this
.
endTime
=
endTime
;
}
public
String
getTransport
()
{
return
transport
;
}
...
...
@@ -129,6 +161,14 @@ public class ResultCircuitVo {
this
.
transport
=
transport
;
}
public
String
getAlarmType
()
{
return
alarmType
;
}
public
void
setAlarmType
(
String
alarmType
)
{
this
.
alarmType
=
alarmType
;
}
public
String
getBoxNo
()
{
return
boxNo
;
}
...
...
@@ -161,83 +201,43 @@ public class ResultCircuitVo {
this
.
transportationType
=
transportationType
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getTransportationNo
()
{
return
transportationNo
;
}
public
void
setTransportationNo
(
String
transportationNo
)
{
this
.
transportationNo
=
transportationNo
;
}
public
String
getRouteNumber
()
{
return
routeNumber
;
}
public
void
setRouteNumber
(
String
routeNumber
)
{
this
.
routeNumber
=
routeNumber
;
}
public
String
getRouteName
()
{
return
routeName
;
}
public
void
setRouteName
(
String
routeName
)
{
this
.
routeName
=
routeName
;
}
public
String
getStartCity
()
{
return
startCity
;
}
public
void
setStartCity
(
String
startCity
)
{
this
.
startCity
=
startCity
;
}
public
String
getStartTime
()
{
return
startTime
;
public
int
getCircuitState
()
{
return
circuitState
;
}
public
void
set
StartTime
(
String
startTim
e
)
{
this
.
startTime
=
startTim
e
;
public
void
set
CircuitState
(
int
circuitStat
e
)
{
this
.
circuitState
=
circuitStat
e
;
}
public
String
get
EndCity
()
{
return
endCity
;
public
String
get
Remark
()
{
return
remark
;
}
public
void
set
EndCity
(
String
endCity
)
{
this
.
endCity
=
endCity
;
public
void
set
Remark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getEnd
Time
()
{
return
end
Time
;
public
Long
getCreate
Time
()
{
return
create
Time
;
}
public
void
set
EndTime
(
String
end
Time
)
{
this
.
endTime
=
end
Time
;
public
void
set
CreateTime
(
Long
create
Time
)
{
this
.
createTime
=
create
Time
;
}
public
String
get
AlarmTyp
e
()
{
return
alarmTyp
e
;
public
String
get
Evaluat
e
()
{
return
evaluat
e
;
}
public
void
set
AlarmType
(
String
alarmTyp
e
)
{
this
.
alarmType
=
alarmTyp
e
;
public
void
set
Evaluate
(
String
evaluat
e
)
{
this
.
evaluate
=
evaluat
e
;
}
public
int
getCircuitState
()
{
return
circuitState
;
public
String
getEvaluateRemark
()
{
return
evaluateRemark
;
}
public
void
set
CircuitState
(
int
circuitState
)
{
this
.
circuitState
=
circuitState
;
public
void
set
EvaluateRemark
(
String
evaluateRemark
)
{
this
.
evaluateRemark
=
evaluateRemark
;
}
}
}
\ No newline at end of file
src/main/java/com/example/tdl/mapper/AlarmLogMapper.java
View file @
85400688
...
...
@@ -2,6 +2,7 @@ package com.example.tdl.mapper;
import
com.example.tdl.domain.vo.AddAlarmLogVo
;
import
com.example.tdl.domain.vo.AlarmLogVo
;
import
com.example.tdl.domain.vo.ResultAlarmLog
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
...
...
@@ -17,7 +18,7 @@ public interface AlarmLogMapper {
//新增报警数据
int
addAlarmLog
(
AddAlarmLogVo
addAlarmLogVo
);
List
<
AlarmLogVo
>
getByTransportationNo
(
String
transportationNo
);
List
<
ResultAlarmLog
>
getByTransportationNo
(
String
transportationNo
);
Integer
getCount
();
}
src/main/java/com/example/tdl/mapper/TDLLogMapper.java
0 → 100644
View file @
85400688
package
com
.
example
.
tdl
.
mapper
;
import
com.example.tdl.domain.vo.ResultGatewayVo
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
TDLLogMapper
{
ResultGatewayVo
getByNo
(
String
transportationNo
);
}
src/main/java/com/example/tdl/mqtt/MqttListener.java
View file @
85400688
...
...
@@ -11,6 +11,7 @@ import com.google.gson.Gson;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
com.google.gson.JsonSyntaxException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.expression.spel.ast.NullLiteral
;
...
...
@@ -179,7 +180,7 @@ public class MqttListener implements MqttCallback {
//checkIn数据解析,true即发送休眠信息;false发送config信息
public
Integer
parseData
(
String
message
,
String
SN
,
String
Type
){
CheckInVo
checkInVo
=
new
Gson
().
fromJson
(
message
,
CheckInVo
.
class
);
if
(
checkInVo
.
getDevList
().
size
()
==
0
){
if
(
StringUtils
.
isEmpty
(
checkInVo
.
getDevList
()==
null
?
""
:
checkInVo
.
getDevList
().
toString
())
){
return
1
;
//重发
}
//有设备信息
...
...
src/main/java/com/example/tdl/service/AlarmLogService.java
View file @
85400688
...
...
@@ -2,6 +2,7 @@ package com.example.tdl.service;
import
com.example.tdl.domain.vo.AddAlarmLogVo
;
import
com.example.tdl.domain.vo.AlarmLogVo
;
import
com.example.tdl.domain.vo.ResultAlarmLog
;
import
com.example.tdl.mapper.AlarmLogMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -26,7 +27,7 @@ public class AlarmLogService {
return
alarmLogMapper
.
addAlarmLog
(
addAlarmLogVo
);
}
public
List
<
AlarmLogVo
>
getByTransportationNo
(
String
transportationNo
){
public
List
<
ResultAlarmLog
>
getByTransportationNo
(
String
transportationNo
){
return
alarmLogMapper
.
getByTransportationNo
(
transportationNo
);
}
...
...
src/main/java/com/example/tdl/service/TDLLogService.java
0 → 100644
View file @
85400688
package
com
.
example
.
tdl
.
service
;
import
com.example.tdl.domain.vo.ResultGatewayVo
;
import
com.example.tdl.mapper.TDLLogMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
TDLLogService
{
@Autowired
private
TDLLogMapper
tdlLogMapper
;
public
ResultGatewayVo
getByNo
(
String
transportationNo
){
return
tdlLogMapper
.
getByNo
(
transportationNo
);
}
}
src/main/java/com/example/tdl/service/redis/InfoRedisService.java
View file @
85400688
...
...
@@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
@Service
public
class
InfoRedisService
extends
RedisService
{
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Autowired
public
InfoRedisService
(
RedisTemplate
infoRedisTemplate
)
{
...
...
src/main/java/com/example/tdl/web/CircuitController.java
View file @
85400688
...
...
@@ -230,7 +230,7 @@ public class CircuitController {
}
if
(
StringUtils
.
isEmpty
(
addCircuitVo
.
getContainerNo
())){
fb
.
setCode
(
0
);
fb
.
setMessage
(
"集装箱号不能为空"
);
fb
.
setMessage
(
"集装箱号
/车牌号
不能为空"
);
return
gson
.
toJson
(
fb
);
}
if
(
StringUtils
.
isEmpty
(
addCircuitVo
.
getDeliveryAddress
())){
...
...
@@ -506,7 +506,7 @@ public class CircuitController {
}
if
(
StringUtils
.
isEmpty
(
updateCircuitInfo
.
getContainerNo
())){
fb
.
setCode
(
0
);
fb
.
setMessage
(
"集装箱号不能为空"
);
fb
.
setMessage
(
"集装箱号
/车牌号
不能为空"
);
return
gson
.
toJson
(
fb
);
}
if
(
StringUtils
.
isEmpty
(
updateCircuitInfo
.
getDeliveryAddress
())){
...
...
src/main/java/com/example/tdl/web/DataController.java
View file @
85400688
This diff is collapsed.
Click to expand it.
src/main/java/com/example/tdl/web/EquipmentBindingController.java
View file @
85400688
...
...
@@ -106,9 +106,6 @@ public class EquipmentBindingController {
return
gson
.
toJson
(
fb
);
}
@ApiOperation
(
value
=
"重置tdl"
,
notes
=
"重置tdl"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"Account_token"
,
value
=
"token"
,
required
=
true
,
dataType
=
"String"
),
...
...
@@ -137,6 +134,7 @@ public class EquipmentBindingController {
map
.
put
(
"message"
,
gson
.
toJson
(
configCMDVo
));
map
.
put
(
"untie"
,
untie
);
map
.
put
(
"TDLSN"
,
TDLSN
);
map
.
put
(
"endTime"
,
System
.
currentTimeMillis
());
configService
.
updateConfig
(
map
);
Map
<
Object
,
Object
>
msg
=
new
HashMap
<>();
msg
.
put
(
"msg"
,
map
.
get
(
"msg"
));
...
...
src/main/resources/mapper/AlarmLogMapper.xml
View file @
85400688
...
...
@@ -6,6 +6,10 @@
select routeName,description,data,alarmTime from alarm_log order by alarmTime desc limit 10;
</select>
<select
id=
"getByTransportationNo"
resultType=
"com.example.tdl.domain.vo.ResultAlarmLog"
parameterType=
"String"
>
select transportationNo,routeName,description,data,alarmTime from alarm_log where transportationNo=#{transportationNo,jdbcType=VARCHAR};
</select>
<!--根据条件获取报警数据-->
<select
id=
"getAlarmLog"
resultType=
"com.example.tdl.domain.vo.AlarmLogVo"
>
select routeName,description,data,alarmTime
...
...
@@ -26,7 +30,6 @@
)
</insert>
<select
id=
"getCount"
resultType=
"java.lang.Integer"
>
select count(DISTINCT transportationNo) from alarm_log
</select>
...
...
src/main/resources/mapper/CircuitMapper.xml
View file @
85400688
...
...
@@ -179,7 +179,7 @@
GROUP BY routes
order BY c.id
</select>
<select
id=
"getByContainerNo"
parameterType=
"String"
resultType=
"com.example.tdl.domain.vo.ResultCircuitVo"
>
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity,
startAddress,startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,endAddress,endTime,transport,
...
...
src/main/resources/mapper/ConfigMapper.xml
View file @
85400688
...
...
@@ -47,6 +47,7 @@
#{message,mode=IN,jdbcType=VARCHAR},
#{untie,mode=IN,jdbcType=INTEGER},
#{TDLSN,mode=IN,jdbcType=VARCHAR},
#{endTime,mode=IN,jdbcType=BIGINT},
#{msg,mode=OUT,jdbcType=VARCHAR}
)
}
...
...
src/main/resources/mapper/TDLLogMapper.xml
0 → 100644
View file @
85400688
<?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">
<mapper
namespace=
"com.example.tdl.mapper.TDLLogMapper"
>
<select
id=
"getByNo"
parameterType=
"String"
resultType=
"com.example.tdl.domain.vo.ResultGatewayVo"
>
select gatewaySN SN,gatewayType type from tdl_gateway_log
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
GROUP BY gatewaySN
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis-config.xml
View file @
85400688
...
...
@@ -47,6 +47,7 @@
<mapper
resource=
"mapper/TopicMapper.xml"
/>
<mapper
resource=
"mapper/TopicConfigMapper.xml"
/>
<mapper
resource=
"mapper/CityConfigMapper.xml"
/>
<mapper
resource=
"mapper/TDLLogMapper.xml"
/>
<mapper
resource=
"mapper/UserRouteMapper.xml"
/>
</mappers>
</configuration>
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