Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6981ec12
authored
Dec 23, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
调试BUG
1 parent
353acb15
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
262 additions
and
25 deletions
src/main/java/cn/com/glsx/admin/modules/controller/FinalPositioningController.java
src/main/java/cn/com/glsx/admin/modules/model/export/DeviceActiveExprot.java
src/main/java/cn/com/glsx/admin/modules/model/export/FinalPositioningExport.java
src/main/java/cn/com/glsx/admin/modules/model/export/JourneyDetailExport.java
src/main/java/cn/com/glsx/admin/modules/model/export/JourneyExport.java
src/main/java/cn/com/glsx/admin/modules/multithread/AsyncTasks.java
src/main/java/cn/com/glsx/admin/modules/service/DeviceActiveService.java
src/main/resources/mapper/VehicleMapper.xml
src/test/java/cn/com/glsx/admin/modules/service/HomeServiceTest.java
src/test/java/cn/com/glsx/admin/modules/service/JudgmentServiceTest.java
src/test/java/cn/com/glsx/admin/modules/service/OfflineServiceTest.java
src/test/java/cn/com/glsx/admin/modules/service/TearDownAlarmSeviceTest.java
src/main/java/cn/com/glsx/admin/modules/controller/FinalPositioningController.java
View file @
6981ec1
...
...
@@ -37,7 +37,7 @@ public class FinalPositioningController {
@GetMapping
(
"/search"
)
@ApiOperation
(
value
=
"查询最后定位报表"
)
public
R
<
List
<
DeviceActiveExpro
t
>>
findFinalPositioningList
(
FinalPositioningSearch
finalPositioningSearch
)
{
public
R
<
List
<
FinalPositioningExpor
t
>>
findFinalPositioningList
(
FinalPositioningSearch
finalPositioningSearch
)
{
Page
<
Object
>
page
=
PageHelper
.
startPage
(
finalPositioningSearch
.
getPageNumber
(),
finalPositioningSearch
.
getPageSize
(),
true
);
List
<
FinalPositioningExport
>
finalPositioningList
=
finalPositioningService
.
findFinalPositioningList
(
finalPositioningSearch
);
return
R
.
ok
().
putPageData
(
finalPositioningList
,
page
.
getTotal
());
...
...
src/main/java/cn/com/glsx/admin/modules/model/export/DeviceActiveExprot.java
View file @
6981ec1
...
...
@@ -53,7 +53,7 @@ public class DeviceActiveExprot {
private
Integer
source
;
/**
* 是否有源 1 有源 0无源 字符串
* 是否有源 1 有源 0无源 字符串
类型
*/
private
String
sourceStr
;
...
...
@@ -66,7 +66,7 @@ public class DeviceActiveExprot {
* 是否在线 1在线 2离线 字符串
**/
@ExcelProperty
(
"是否在线"
)
private
Integer
isOnLineStr
;
private
String
isOnLineStr
;
/**
* 车辆归属
...
...
@@ -86,17 +86,32 @@ public class DeviceActiveExprot {
private
Integer
validateBy
;
/**
* 经度
*
Gps
经度
**/
private
String
l
ng
;
private
String
gpsL
ng
;
/**
* 纬度
*
Gps
纬度
**/
private
String
l
at
;
private
String
gpsL
at
;
/**
* 首次激活地址
*
Gps
首次激活地址
**/
private
String
firstAddress
;
private
String
firstGpsAddress
;
/**
* Gps经度
**/
private
String
bsLng
;
/**
* Gps纬度
**/
private
String
bsLat
;
/**
* Gps首次激活地址
**/
private
String
firstBsAddress
;
}
src/main/java/cn/com/glsx/admin/modules/model/export/FinalPositioningExport.java
View file @
6981ec1
package
cn
.
com
.
glsx
.
admin
.
modules
.
model
.
export
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
lombok.Data
;
/**
...
...
@@ -8,60 +10,107 @@ import lombok.Data;
* @author yll
*/
@Data
@ExcelIgnoreUnannotated
public
class
FinalPositioningExport
{
/**
* 工单号
*/
@ExcelProperty
(
"工单号"
)
private
String
workOrderNo
;
/**
* 店面名称
*/
@ExcelProperty
(
"店面名称"
)
private
String
shopName
;
/**
* 姓名
*/
@ExcelProperty
(
"姓名"
)
private
String
ownerName
;
/**
* 车架号
*/
@ExcelProperty
(
"车架号"
)
private
String
vin
;
/**
* 设备号
*/
@ExcelProperty
(
"设备号"
)
private
String
sn
;
/**
* 激活时间
*/
@ExcelProperty
(
"激活时间"
)
private
String
activeDate
;
/**
* 最后GPS定位时间
*/
@ExcelProperty
(
"最后GPS定位时间"
)
private
String
finalGpsTime
;
/**
* 最后基站定位时间
*/
@ExcelProperty
(
"最后基站定位时间"
)
private
String
finalBsTime
;
/**
* 最后定位时间
*/
@ExcelProperty
(
"最后定位时间"
)
private
String
lastPoiTime
;
/**
* 最后定位类型
*/
@ExcelProperty
(
"最后定位类型"
)
private
String
poiType
;
/**
* 最后定位位置
*/
@ExcelProperty
(
"最后定位位置"
)
private
String
lastPoiAddress
;
/**
* 是否有源 1 有源 0无源
*/
private
Integer
source
;
/**
* Gps经度
**/
private
String
gpsLng
;
/**
* Gps纬度
**/
private
String
gpsLat
;
/**
* Gps首次激活地址
**/
private
String
firstGpsAddress
;
/**
* Gps经度
**/
private
String
bsLng
;
/**
* Gps纬度
**/
private
String
bsLat
;
/**
* Gps首次激活地址
**/
private
String
firstBsAddress
;
}
src/main/java/cn/com/glsx/admin/modules/model/export/JourneyDetailExport.java
View file @
6981ec1
package
cn
.
com
.
glsx
.
admin
.
modules
.
model
.
export
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
lombok.Data
;
/**
...
...
@@ -9,44 +11,53 @@ import lombok.Data;
* @author yll
*/
@Data
@ExcelIgnoreUnannotated
public
class
JourneyDetailExport
{
/**
* 工单号
*/
@ExcelProperty
(
"工单号"
)
private
String
workOrderNo
;
/**
* 姓名
*/
@ExcelProperty
(
"姓名"
)
private
String
ownerName
;
/**
* 设备号
*/
@ExcelProperty
(
"设备号"
)
private
String
sn
;
/**
* 车架号
*/
@ExcelProperty
(
"车架号"
)
private
String
vin
;
/**
* 行程开始时间
*/
@ExcelProperty
(
"行程开始时间"
)
private
String
journeyStartTime
;
/**
* 行程结束时间
*/
@ExcelProperty
(
"行程结束时间"
)
private
String
journeyEndTime
;
/**
* 行驶时长
*/
@ExcelProperty
(
"行驶时长"
)
private
String
durationStr
;
/**
* 行驶里程km
*/
@ExcelProperty
(
"行驶里程km"
)
private
Double
distance
;
}
src/main/java/cn/com/glsx/admin/modules/model/export/JourneyExport.java
View file @
6981ec1
package
cn
.
com
.
glsx
.
admin
.
modules
.
model
.
export
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
lombok.Data
;
@Data
@ExcelIgnoreUnannotated
public
class
JourneyExport
{
/**
* 工单号
*/
@ExcelProperty
(
"工单号"
)
protected
String
workOrderNo
;
/**
* 姓名
*/
@ExcelProperty
(
"姓名"
)
protected
String
ownerName
;
/**
* 设备号
*/
@ExcelProperty
(
"设备号"
)
protected
String
sn
;
/**
* 车架号
*/
@ExcelProperty
(
"车架号"
)
protected
String
vin
;
/**
* 总行驶次数
*/
@ExcelProperty
(
"总行驶次数"
)
private
Integer
tripCount
;
/**
* 总行驶里程(km)
*/
@ExcelProperty
(
"总行驶里程(km)"
)
private
Double
distance
;
}
src/main/java/cn/com/glsx/admin/modules/multithread/AsyncTasks.java
View file @
6981ec1
...
...
@@ -12,6 +12,8 @@ import cn.com.glsx.devicemonitor.api.dto.request.GpsBsFirstBatchRequest;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsBsData
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsLocation
;
import
cn.com.glsx.devicemonitor.api.dto.response.JourneyDetailDTO
;
import
cn.com.glsx.devicemonitor.api.enums.DeviceTypeRelationEnum
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.glsx.plat.common.utils.DateUtils
;
import
com.glsx.warehouse.biz.mileage.response.Mileage
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -126,17 +128,24 @@ public class AsyncTasks {
GpsBsFirstBatchRequest
gpsBsFirstBatchRequest
=
new
GpsBsFirstBatchRequest
();
gpsBsFirstBatchRequest
.
setSn
(
deviceActive
.
getSn
());
gpsBsFirstBatchRequest
.
setActiveDate
(
deviceActive
.
getActiveDate
());
gpsBsFirstBatchRequest
.
setDeviceTypeRelationEnum
(
DeviceTypeRelationEnum
.
GPS
);
gpsBsFirstBatchRequestList
.
add
(
gpsBsFirstBatchRequest
);
});
Map
<
String
,
GpsBsData
>
gpsBsDataMap
=
remoteGpsBsService
.
getFirstGpsBsBatch
(
gpsBsFirstBatchRequestList
);
deviceActiveList
.
forEach
(
deviceActiveExprot
->
{
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
deviceActiveExprot
.
getSn
());
if
(
gpsBsData
!=
null
)
{
if
(
ObjectUtil
.
isNotNull
(
gpsBsData
)
)
{
GpsLocation
gpsLocation
=
gpsBsData
.
getGpsLocation
();
if
(
gpsLocation
!=
null
)
{
deviceActiveExprot
.
setLng
(
gpsLocation
.
getLng
());
deviceActiveExprot
.
setLat
(
gpsLocation
.
getLat
());
deviceActiveExprot
.
setFirstAddress
(
gpsLocation
.
getAddress
());
if
(
ObjectUtil
.
isNotNull
(
gpsLocation
))
{
deviceActiveExprot
.
setGpsLat
(
gpsLocation
.
getLng
());
deviceActiveExprot
.
setGpsLng
(
gpsLocation
.
getLat
());
deviceActiveExprot
.
setFirstGpsAddress
(
gpsLocation
.
getAddress
());
}
GpsLocation
bsLocation
=
gpsBsData
.
getBsLocation
();
if
(
ObjectUtil
.
isNotNull
(
bsLocation
))
{
deviceActiveExprot
.
setBsLat
(
bsLocation
.
getLat
());
deviceActiveExprot
.
setBsLng
(
bsLocation
.
getLng
());
deviceActiveExprot
.
setFirstBsAddress
(
bsLocation
.
getAddress
());
}
}
});
...
...
@@ -193,6 +202,17 @@ public class AsyncTasks {
finalPositioningExport
.
setLastPoiAddress
(
bsLocation
.
getAddress
());
}
}
// 封装GPS和基站数据
if
(
gpsLocation
!=
null
)
{
finalPositioningExport
.
setGpsLat
(
gpsLocation
.
getLng
());
finalPositioningExport
.
setGpsLng
(
gpsLocation
.
getLat
());
finalPositioningExport
.
setFirstGpsAddress
(
gpsLocation
.
getAddress
());
}
if
(
bsLocation
!=
null
)
{
finalPositioningExport
.
setBsLat
(
bsLocation
.
getLat
());
finalPositioningExport
.
setBsLng
(
bsLocation
.
getLng
());
finalPositioningExport
.
setFirstBsAddress
(
bsLocation
.
getAddress
());
}
}
});
}
catch
(
Exception
e
)
{
...
...
src/main/java/cn/com/glsx/admin/modules/service/DeviceActiveService.java
View file @
6981ec1
...
...
@@ -59,7 +59,7 @@ public class DeviceActiveService {
deviceActiveList
.
forEach
(
deviceActiveExprot
->
{
deviceActiveExprot
.
setDeviceTypeStr
(
TypeConverseEunm
.
DeviceTypeEnum
.
getStrByDeviceType
(
deviceActiveExprot
.
getDeviceType
()));
deviceActiveExprot
.
setSourceStr
(
TypeConverseEunm
.
SourceEnum
.
getStrBySourceType
(
deviceActiveExprot
.
getSource
()));
deviceActiveExprot
.
set
Sourc
eStr
(
TypeConverseEunm
.
OnLineEnum
.
getStrByonLineType
(
deviceActiveExprot
.
getIsOnLine
()));
deviceActiveExprot
.
set
IsOnLin
eStr
(
TypeConverseEunm
.
OnLineEnum
.
getStrByonLineType
(
deviceActiveExprot
.
getIsOnLine
()));
});
return
deviceActiveList
;
}
...
...
src/main/resources/mapper/VehicleMapper.xml
View file @
6981ec1
...
...
@@ -519,7 +519,8 @@
tvd.sn as sn,
tvd.created_date as activeDate,
tdl.last_gps_time as finalGpsTime,
tdl.last_bs_time as finalBsTime
tdl.last_bs_time as finalBsTime,
td.source as `source`
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_device td on td.sn = tvd.sn
...
...
@@ -729,14 +730,18 @@
</select>
<select
id=
"getBindDeviceInfoWithAuth"
resultType=
"cn.com.glsx.admin.modules.model.DeviceBindVo"
>
SELECT count(0) AS bindDeviceNumber,
DATE_FORMAT(tvd.created_date, '%Y-%m-%d') as bindDate
FROM t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
WHERE tvd.bind_status = 1
and tv.del_flag = 0
and tvd.del_flag = 0
${appendSql}
GROUP BY DATE_FORMAT(tvd.created_date, '%Y-%m-%d')
SELECT count(temp.id) AS bindDeviceNumber,
DATE_FORMAT(temp.created_date, '%Y-%m-%d') as bindDate
FROM (
SELECT distinct tv.id,
tvd.created_date
FROM t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
WHERE tvd.bind_status = 1
and tv.del_flag = 0
and tvd.del_flag = 0
${appendSql}
) temp
GROUP BY DATE_FORMAT(temp.created_date, '%Y-%m-%d')
</select>
</mapper>
\ No newline at end of file
src/test/java/cn/com/glsx/admin/modules/service/HomeServiceTest.java
0 → 100644
View file @
6981ec1
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.admin.common.constants.Constants
;
import
cn.com.glsx.admin.modules.model.ActiveDeviceVo
;
import
cn.com.glsx.admin.modules.model.DeviceBindVo
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
public
class
HomeServiceTest
{
@Autowired
private
HomeService
homeService
;
@Test
public
void
authUserOrg
()
{
Map
<
String
,
Boolean
>
authUserOrg
=
homeService
.
authUserOrg
();
System
.
out
.
println
(
"authUserOrg = "
+
JSON
.
toJSONString
(
authUserOrg
));
}
@Test
public
void
getDeviceNumber
()
{
Map
<
String
,
Object
>
deviceNumber
=
homeService
.
getDeviceNumber
();
System
.
out
.
println
(
"deviceNumber = "
+
JSON
.
toJSONString
(
deviceNumber
));
}
@Test
public
void
getAlarmNumber
()
{
Map
<
String
,
Object
>
alarmNumber
=
homeService
.
getAlarmNumber
();
System
.
out
.
println
(
"alarmNumber = "
+
JSON
.
toJSONString
(
alarmNumber
));
}
@Test
public
void
getActiveDeviceInfo
()
throws
ParseException
{
List
<
ActiveDeviceVo
>
activeDeviceInfo
=
homeService
.
getActiveDeviceInfo
(
Constants
.
TIMETYPE_TODAY
);
System
.
out
.
println
(
"activeDeviceInfo = "
+
JSON
.
toJSONString
(
activeDeviceInfo
));
}
@Test
public
void
getNewBindDeviceInfo
()
throws
ParseException
{
List
<
DeviceBindVo
>
newBindDeviceInfo
=
homeService
.
getNewBindDeviceInfo
();
System
.
out
.
println
(
"newBindDeviceInfo = "
+
JSON
.
toJSONString
(
newBindDeviceInfo
));
}
}
\ No newline at end of file
src/test/java/cn/com/glsx/admin/modules/service/JudgmentServiceTest.java
0 → 100644
View file @
6981ec1
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.admin.modules.model.param.JudgmentSearch
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
public
class
JudgmentServiceTest
{
@Autowired
private
JudgmentService
judgmentService
;
@Test
public
void
findJudgmentList
()
{
JudgmentSearch
judgmentSearch
=
new
JudgmentSearch
();
judgmentSearch
.
setPageNumber
(
1
);
judgmentSearch
.
setPageSize
(
10
);
PageInfo
judgmentList
=
judgmentService
.
findJudgmentList
(
judgmentSearch
);
System
.
out
.
println
(
"judgmentList = "
+
JSON
.
toJSONString
(
judgmentList
));
}
@Test
public
void
exportJudgmentList
()
{
}
}
\ No newline at end of file
src/test/java/cn/com/glsx/admin/modules/service/OfflineServiceTest.java
0 → 100644
View file @
6981ec1
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.admin.modules.model.export.OfflineExport
;
import
cn.com.glsx.admin.modules.model.param.OfflineSearch
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.util.List
;
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
public
class
OfflineServiceTest
{
@Autowired
private
OfflineService
offlineService
;
@Test
public
void
findOfflineList
()
{
OfflineSearch
offlineSearch
=
new
OfflineSearch
();
offlineSearch
.
setPageNumber
(
1
);
offlineSearch
.
setPageSize
(
10
);
List
<
OfflineExport
>
offlineList
=
offlineService
.
findOfflineList
(
offlineSearch
);
System
.
out
.
println
(
"offlineList = "
+
JSON
.
toJSONString
(
offlineList
));
}
@Test
public
void
exportOfflineList
()
{
}
}
\ No newline at end of file
src/test/java/cn/com/glsx/admin/modules/service/TearDownAlarmSeviceTest.java
View file @
6981ec1
...
...
@@ -21,6 +21,8 @@ public class TearDownAlarmSeviceTest {
@Test
public
void
searchTearDownAlarmList
()
{
TearDownQueryBo
tearDownQueryBo
=
new
TearDownQueryBo
();
tearDownQueryBo
.
setPageNumber
(
1
);
tearDownQueryBo
.
setPageSize
(
10
);
PageInfo
pageInfo
=
tearDownAlarmSevice
.
searchTearDownAlarmList
(
tearDownQueryBo
);
System
.
out
.
println
(
"pageInfo = "
+
JSON
.
toJSONString
(
pageInfo
));
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment