Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
3a3584a7
Commit
3a3584a7
authored
Dec 19, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决循环依赖问题
parent
ea6f6147
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
54 deletions
+46
-54
UpdateQrCodeAction.java
...va/com/yeejoin/equipmanage/action/UpdateQrCodeAction.java
+9
-13
CarIotListener.java
...java/com/yeejoin/equipmanage/listener/CarIotListener.java
+4
-5
IEquipmentSpecificSerivce.java
...eejoin/equipmanage/service/IEquipmentSpecificSerivce.java
+2
-0
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+2
-4
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+0
-0
JxiopCarIotListerServiceImpl.java
...quipmanage/service/impl/JxiopCarIotListerServiceImpl.java
+4
-3
WlCarMileageServiceImpl.java
...oin/equipmanage/service/impl/WlCarMileageServiceImpl.java
+25
-29
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/action/UpdateQrCodeAction.java
View file @
3a3584a7
...
@@ -12,6 +12,7 @@ import com.yeejoin.equipmanage.service.ICarService;
...
@@ -12,6 +12,7 @@ import com.yeejoin.equipmanage.service.ICarService;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -25,27 +26,22 @@ import java.util.stream.Collectors;
...
@@ -25,27 +26,22 @@ import java.util.stream.Collectors;
/**
/**
* 赋码动作
* 赋码动作
*
* @author DELL
* @author DELL
*/
*/
@Component
@Component
@RuleActionBean
(
beanLabel
=
"动态预案"
)
@RuleActionBean
(
beanLabel
=
"动态预案"
)
@Slf4j
@Slf4j
public
class
UpdateQrCodeAction
{
public
class
UpdateQrCodeAction
{
@Autowired
private
ICarService
carService
;
@Autowired
private
IEquipmentSpecificSerivce
equipmentSpecificSerivce
;
private
final
String
SOURCE_ID
=
"sourceId"
;
private
final
String
SOURCE_CAR
=
"car"
;
private
final
String
SOURCE_EQUIP
=
"equip"
;
/**
/**
* 开闭区间正则表达式
* 开闭区间正则表达式
*/
*/
private
static
final
Pattern
NUM_RANGE_PATTERN
=
Pattern
.
compile
(
"[\\[|\\(]\\s?\\d+\\s?,\\s?\\d+\\s?[\\)|\\]]"
);
private
static
final
Pattern
NUM_RANGE_PATTERN
=
Pattern
.
compile
(
"[\\[|\\(]\\s?\\d+\\s?,\\s?\\d+\\s?[\\)|\\]]"
);
private
final
String
SOURCE_ID
=
"sourceId"
;
private
final
String
SOURCE_CAR
=
"car"
;
private
final
String
SOURCE_EQUIP
=
"equip"
;
@Autowired
private
IEquipmentSpecificSerivce
equipmentSpecificSerivce
;
@RuleMethod
(
methodLabel
=
"更新码"
,
project
=
"车辆更新码颜色"
)
@RuleMethod
(
methodLabel
=
"更新码"
,
project
=
"车辆更新码颜色"
)
public
void
updateCarQrCode
(
@MethodParam
(
paramLabel
=
"判断值"
)
String
value
,
@MethodParam
(
paramLabel
=
"赋码颜色"
)
String
color
,
public
void
updateCarQrCode
(
@MethodParam
(
paramLabel
=
"判断值"
)
String
value
,
@MethodParam
(
paramLabel
=
"赋码颜色"
)
String
color
,
...
@@ -86,7 +82,7 @@ public class UpdateQrCodeAction {
...
@@ -86,7 +82,7 @@ public class UpdateQrCodeAction {
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
switch
(
source
)
{
switch
(
source
)
{
case
SOURCE_CAR:
case
SOURCE_CAR:
carServi
ce
.
updateCarQrCode
(
collect
,
color
);
equipmentSpecificSeriv
ce
.
updateCarQrCode
(
collect
,
color
);
break
;
break
;
case
SOURCE_EQUIP:
case
SOURCE_EQUIP:
equipmentSpecificSerivce
.
updateEquipQrCode
(
collect
,
color
);
equipmentSpecificSerivce
.
updateEquipQrCode
(
collect
,
color
);
...
@@ -99,7 +95,7 @@ public class UpdateQrCodeAction {
...
@@ -99,7 +95,7 @@ public class UpdateQrCodeAction {
}
}
}
}
private
Map
<
String
,
String
>
getId
(
Map
<
String
,
String
>
map
,
String
rule
,
String
value
,
String
compareValue
)
{
private
Map
<
String
,
String
>
getId
(
Map
<
String
,
String
>
map
,
String
rule
,
String
value
,
String
compareValue
)
{
Map
<
String
,
String
>
mapNew
=
new
HashMap
<>();
Map
<
String
,
String
>
mapNew
=
new
HashMap
<>();
CalculationRulesEnum
anEnum
=
CalculationRulesEnum
.
getEnum
(
rule
);
CalculationRulesEnum
anEnum
=
CalculationRulesEnum
.
getEnum
(
rule
);
switch
(
anEnum
)
{
switch
(
anEnum
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/listener/CarIotListener.java
View file @
3a3584a7
...
@@ -7,7 +7,7 @@ import com.yeejoin.equipmanage.common.entity.Car;
...
@@ -7,7 +7,7 @@ import com.yeejoin.equipmanage.common.entity.Car;
import
com.yeejoin.equipmanage.common.entity.WlCarMileage
;
import
com.yeejoin.equipmanage.common.entity.WlCarMileage
;
import
com.yeejoin.equipmanage.common.utils.CoordinateUtil
;
import
com.yeejoin.equipmanage.common.utils.CoordinateUtil
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.
service.ICarService
;
import
com.yeejoin.equipmanage.
mapper.CarMapper
;
import
com.yeejoin.equipmanage.service.IWlCarMileageService
;
import
com.yeejoin.equipmanage.service.IWlCarMileageService
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -36,7 +36,7 @@ public class CarIotListener extends EmqxListener {
...
@@ -36,7 +36,7 @@ public class CarIotListener extends EmqxListener {
private
IWlCarMileageService
iWlCarMileageService
;
private
IWlCarMileageService
iWlCarMileageService
;
@Autowired
@Autowired
private
ICarService
iCarService
;
private
CarMapper
carMapper
;
@Autowired
@Autowired
private
IotFeign
iotFeign
;
private
IotFeign
iotFeign
;
...
@@ -154,7 +154,7 @@ public class CarIotListener extends EmqxListener {
...
@@ -154,7 +154,7 @@ public class CarIotListener extends EmqxListener {
int
direction
=
jsonObject
.
getIntValue
(
"direction"
);
int
direction
=
jsonObject
.
getIntValue
(
"direction"
);
// 地图推送消息
// 地图推送消息
Car
car
=
iCarService
.
ge
tOne
(
new
LambdaQueryWrapper
<
Car
>().
eq
(
Car:
:
getIotCode
,
iotCode
));
Car
car
=
carMapper
.
selec
tOne
(
new
LambdaQueryWrapper
<
Car
>().
eq
(
Car:
:
getIotCode
,
iotCode
));
if
(
car
!=
null
&&
startLongitude
!=
0
&&
startLatitude
!=
0
)
{
if
(
car
!=
null
&&
startLongitude
!=
0
&&
startLatitude
!=
0
)
{
JSONArray
sendArr
=
new
JSONArray
();
JSONArray
sendArr
=
new
JSONArray
();
JSONObject
sendObj
=
new
JSONObject
();
JSONObject
sendObj
=
new
JSONObject
();
...
@@ -169,7 +169,7 @@ public class CarIotListener extends EmqxListener {
...
@@ -169,7 +169,7 @@ public class CarIotListener extends EmqxListener {
mqttMessage
.
setPayload
(
sendArr
.
toJSONString
().
getBytes
());
mqttMessage
.
setPayload
(
sendArr
.
toJSONString
().
getBytes
());
car
.
setLongitude
(
startLongitude
);
car
.
setLongitude
(
startLongitude
);
car
.
setLatitude
(
startLatitude
);
car
.
setLatitude
(
startLatitude
);
iCarService
.
updateById
(
car
);
carMapper
.
updateById
(
car
);
emqkeeper
.
getMqttClient
().
publish
(
"car/location"
,
mqttMessage
);
emqkeeper
.
getMqttClient
().
publish
(
"car/location"
,
mqttMessage
);
}
}
}
}
...
@@ -186,7 +186,6 @@ public class CarIotListener extends EmqxListener {
...
@@ -186,7 +186,6 @@ public class CarIotListener extends EmqxListener {
StringBuilder
res
=
new
StringBuilder
();
StringBuilder
res
=
new
StringBuilder
();
BufferedReader
in
=
null
;
BufferedReader
in
=
null
;
try
{
try
{
System
.
out
.
println
(
api
.
toString
());
URL
url
=
new
URL
(
api
.
toString
());
URL
url
=
new
URL
(
api
.
toString
());
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
.
setDoOutput
(
true
);
conn
.
setDoOutput
(
true
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificSerivce.java
View file @
3a3584a7
...
@@ -299,4 +299,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
...
@@ -299,4 +299,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
String
getEquipRealtimeSignal
(
long
id
);
String
getEquipRealtimeSignal
(
long
id
);
EquipmentSpecific
getEquipSpecificEntityByCode
(
String
code
);
EquipmentSpecific
getEquipSpecificEntityByCode
(
String
code
);
void
updateCarQrCode
(
List
<
Map
<
String
,
String
>>
carIds
,
String
status
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
3a3584a7
...
@@ -68,8 +68,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -68,8 +68,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
@Autowired
@Autowired
EquipmentSpecificMapper
equipmentSpecificMapper
;
EquipmentSpecificMapper
equipmentSpecificMapper
;
@Autowired
IEquipmentSpecificSerivce
equipmentSpecificService
;
@Autowired
@Autowired
IEquipmentDetailService
iEquipmentDetailService
;
IEquipmentDetailService
iEquipmentDetailService
;
...
@@ -326,7 +324,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -326,7 +324,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
public
Map
<
String
,
Object
>
getSpecificInfoById
(
Long
id
)
{
public
Map
<
String
,
Object
>
getSpecificInfoById
(
Long
id
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
EquipmentSpecificAlarmLog
alarm
=
equipmentSpecificAlarmLogMapper
.
selectById
(
id
);
EquipmentSpecificAlarmLog
alarm
=
equipmentSpecificAlarmLogMapper
.
selectById
(
id
);
EquipmentSpecific
equipmentSpecific
=
equipmentSpecific
Service
.
ge
tById
(
alarm
.
getEquipmentSpecificId
());
EquipmentSpecific
equipmentSpecific
=
equipmentSpecific
Mapper
.
selec
tById
(
alarm
.
getEquipmentSpecificId
());
Map
<
String
,
Object
>
equipmentSpecificInfo
=
equipmentSpecificMapper
.
getEquipSpeInfo
(
alarm
.
getEquipmentSpecificId
());
Map
<
String
,
Object
>
equipmentSpecificInfo
=
equipmentSpecificMapper
.
getEquipSpeInfo
(
alarm
.
getEquipmentSpecificId
());
// equipmentSpecific.setFullqrCode("01#" + equipmentSpecific.getQrCode());
// equipmentSpecific.setFullqrCode("01#" + equipmentSpecific.getQrCode());
// EquipmentDetail equipmentDetail = iEquipmentDetailService.getOneById(equipmentSpecific.getEquipmentDetailId());
// EquipmentDetail equipmentDetail = iEquipmentDetailService.getOneById(equipmentSpecific.getEquipmentDetailId());
...
@@ -369,7 +367,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -369,7 +367,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
public
Map
<
String
,
Object
>
getSpecificInfoByCode
(
String
code
)
{
public
Map
<
String
,
Object
>
getSpecificInfoByCode
(
String
code
)
{
QueryWrapper
<
EquipmentSpecific
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
EquipmentSpecific
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"code"
,
code
);
queryWrapper
.
eq
(
"code"
,
code
);
EquipmentSpecific
equipmentSpecific
=
equipmentSpecific
Service
.
ge
tOne
(
queryWrapper
);
EquipmentSpecific
equipmentSpecific
=
equipmentSpecific
Mapper
.
selec
tOne
(
queryWrapper
);
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecific
))
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecific
))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Long
id
=
equipmentSpecific
.
getId
();
Long
id
=
equipmentSpecific
.
getId
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
3a3584a7
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/JxiopCarIotListerServiceImpl.java
View file @
3a3584a7
...
@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.common.entity.Car;
...
@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.common.entity.Car;
import
com.yeejoin.equipmanage.common.entity.CarSpeedWarningRecord
;
import
com.yeejoin.equipmanage.common.entity.CarSpeedWarningRecord
;
import
com.yeejoin.equipmanage.common.entity.WlCarMileage
;
import
com.yeejoin.equipmanage.common.entity.WlCarMileage
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.mapper.CarMapper
;
import
com.yeejoin.equipmanage.mapper.WlCarSpeedWaringRecordMapper
;
import
com.yeejoin.equipmanage.mapper.WlCarSpeedWaringRecordMapper
;
import
com.yeejoin.equipmanage.service.ICarService
;
import
com.yeejoin.equipmanage.service.ICarService
;
import
com.yeejoin.equipmanage.service.IWlCarMileageService
;
import
com.yeejoin.equipmanage.service.IWlCarMileageService
;
...
@@ -48,7 +49,7 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -48,7 +49,7 @@ public class JxiopCarIotListerServiceImpl {
@Autowired
@Autowired
private
IWlCarMileageService
iWlCarMileageService
;
private
IWlCarMileageService
iWlCarMileageService
;
@Autowired
@Autowired
private
ICarService
iCarService
;
private
CarMapper
carMapper
;
@Autowired
@Autowired
private
IotFeign
iotFeign
;
private
IotFeign
iotFeign
;
@Autowired
@Autowired
...
@@ -179,7 +180,7 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -179,7 +180,7 @@ public class JxiopCarIotListerServiceImpl {
}
}
}
}
// 地图推送消息
// 地图推送消息
Car
car
=
iCarService
.
ge
tOne
(
new
LambdaQueryWrapper
<
Car
>().
eq
(
Car:
:
getIotCode
,
iotCode
));
Car
car
=
carMapper
.
selec
tOne
(
new
LambdaQueryWrapper
<
Car
>().
eq
(
Car:
:
getIotCode
,
iotCode
));
if
(
car
!=
null
&&
startLongitude
!=
0
&&
startLatitude
!=
0
)
{
if
(
car
!=
null
&&
startLongitude
!=
0
&&
startLatitude
!=
0
)
{
JSONArray
sendArr
=
new
JSONArray
();
JSONArray
sendArr
=
new
JSONArray
();
JSONObject
sendObj
=
new
JSONObject
();
JSONObject
sendObj
=
new
JSONObject
();
...
@@ -200,7 +201,7 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -200,7 +201,7 @@ public class JxiopCarIotListerServiceImpl {
}
}
car
.
setExtra2
(
power
.
toString
());
car
.
setExtra2
(
power
.
toString
());
logger
.
info
(
"----------------更新车辆电池电量信息成功----------------"
);
logger
.
info
(
"----------------更新车辆电池电量信息成功----------------"
);
iCarService
.
updateById
(
car
);
carMapper
.
updateById
(
car
);
logger
.
info
(
"车牌号::"
+
car
.
getCarNum
()
+
"最大车速:"
+
maxSpeed
+
"当前车速::"
+
speed
);
logger
.
info
(
"车牌号::"
+
car
.
getCarNum
()
+
"最大车速:"
+
maxSpeed
+
"当前车速::"
+
speed
);
if
((
speed
-
maxSpeed
)>
0
)
{
if
((
speed
-
maxSpeed
)>
0
)
{
List
<
CarSpeedWarningRecord
>
list
=
wlCarSpeedWaringRecordMapper
.
selectList
(
new
QueryWrapper
<
CarSpeedWarningRecord
>().
eq
(
"car_num"
,
car
.
getCarNum
()).
List
<
CarSpeedWarningRecord
>
list
=
wlCarSpeedWaringRecordMapper
.
selectList
(
new
QueryWrapper
<
CarSpeedWarningRecord
>().
eq
(
"car_num"
,
car
.
getCarNum
()).
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/WlCarMileageServiceImpl.java
View file @
3a3584a7
...
@@ -74,9 +74,9 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -74,9 +74,9 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
@Autowired
@Autowired
IotFeign
iotFeign
;
IotFeign
iotFeign
;
@Autowired
@Autowired
ICarService
iCarService
;
@Autowired
WlCarMileageMapper
wlCarMileageMapper
;
WlCarMileageMapper
wlCarMileageMapper
;
@Autowired
CarMapper
carMapper
;
@Value
(
"${car.max.speed:100}"
)
@Value
(
"${car.max.speed:100}"
)
private
Integer
CAR_MAX_SPEED
;
private
Integer
CAR_MAX_SPEED
;
@Value
(
"${mileage.parameter}"
)
@Value
(
"${mileage.parameter}"
)
...
@@ -84,12 +84,8 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -84,12 +84,8 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
@Resource
@Resource
private
EmqKeeper
emqKeeper
;
private
EmqKeeper
emqKeeper
;
@Autowired
@Autowired
@Lazy
private
IWlCarMileageService
iWlCarMileageService
;
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
CarMapper
carMapper
;
public
static
List
<
String
>
getDayByMonth
(
Date
date
)
{
public
static
List
<
String
>
getDayByMonth
(
Date
date
)
{
List
<
String
>
data
=
new
ArrayList
<>();
List
<
String
>
data
=
new
ArrayList
<>();
try
{
try
{
...
@@ -268,7 +264,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -268,7 +264,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
public
Map
<
String
,
Boolean
>
getCalender
(
long
id
,
Date
date
)
{
public
Map
<
String
,
Boolean
>
getCalender
(
long
id
,
Date
date
)
{
List
<
String
>
daylist
=
new
ArrayList
<
String
>();
List
<
String
>
daylist
=
new
ArrayList
<
String
>();
Map
<
String
,
Boolean
>
map
=
new
HashMap
<>();
Map
<
String
,
Boolean
>
map
=
new
HashMap
<>();
Car
car
=
iCarService
.
ge
tById
(
id
);
Car
car
=
carMapper
.
selec
tById
(
id
);
if
(
car
==
null
||
car
.
getIotCode
()
==
null
||
date
==
null
)
{
if
(
car
==
null
||
car
.
getIotCode
()
==
null
||
date
==
null
)
{
return
map
;
return
map
;
}
}
...
@@ -378,21 +374,21 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -378,21 +374,21 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
// 里程耗时
// 里程耗时
long
takeTime
=
(
date
.
getTime
())
-
(
item
.
getStartTime
().
getTime
());
long
takeTime
=
(
date
.
getTime
())
-
(
item
.
getStartTime
().
getTime
());
// 查询车辆最新位置
// 查询车辆最新位置
// 修改0点未结束里程记录
// 修改0点未结束里程记录
item
.
setEndSpeed
(
v
.
intValue
());
item
.
setEndSpeed
(
v
.
intValue
());
item
.
setEndTime
(
date
);
item
.
setEndTime
(
date
);
item
.
setEndLatitude
(
startLatitude
);
item
.
setEndLatitude
(
startLatitude
);
item
.
setEndLongitude
(
startLongitude
);
item
.
setEndLongitude
(
startLongitude
);
item
.
setEndName
(
"无效坐标"
);
item
.
setEndName
(
"无效坐标"
);
if
(
travel
>
0.5
)
{
if
(
travel
>
0.5
)
{
String
address
=
getAddress
(
startLongitude
,
startLatitude
);
String
address
=
getAddress
(
startLongitude
,
startLatitude
);
item
.
setEndName
(
address
);
item
.
setEndName
(
address
);
}
}
item
.
setTravel
(
new
BigDecimal
(
travel
/
1000
).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
item
.
setTravel
(
new
BigDecimal
(
travel
/
1000
).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
item
.
setTakeTime
(
takeTime
);
item
.
setTakeTime
(
takeTime
);
this
.
getBaseMapper
().
updateById
(
item
);
this
.
getBaseMapper
().
updateById
(
item
);
log
.
info
(
"-----------跨天轨迹切分任更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
log
.
info
(
"-----------跨天轨迹切分任更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
}
}
});
});
...
@@ -407,7 +403,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -407,7 +403,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
if
(
ObjectUtils
.
isEmpty
(
redisTemplate
.
opsForValue
().
get
(
item
.
getIotCode
())))
{
if
(
ObjectUtils
.
isEmpty
(
redisTemplate
.
opsForValue
().
get
(
item
.
getIotCode
())))
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getIotCode
())
&&
item
.
getIotCode
().
length
()
>
8
)
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getIotCode
())
&&
item
.
getIotCode
().
length
()
>
8
)
{
// 查询车辆上报信息
// 查询车辆上报信息
Date
date
=
new
Date
();
Date
date
=
new
Date
();
ResponseModel
<
List
<
Object
>>
result
=
iotFeign
.
getLiveData
(
item
.
getIotCode
().
substring
(
0
,
8
),
item
.
getIotCode
().
substring
(
8
),
ResponseModel
<
List
<
Object
>>
result
=
iotFeign
.
getLiveData
(
item
.
getIotCode
().
substring
(
0
,
8
),
item
.
getIotCode
().
substring
(
8
),
item
.
getStartTime
(),
new
Date
(
new
Date
().
getTime
()
+
2000
));
item
.
getStartTime
(),
new
Date
(
new
Date
().
getTime
()
+
2000
));
List
<
Object
>
list1
=
result
.
getResult
();
List
<
Object
>
list1
=
result
.
getResult
();
...
@@ -459,15 +455,15 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -459,15 +455,15 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
item
.
setEndLatitude
(
startLatitude
);
item
.
setEndLatitude
(
startLatitude
);
item
.
setEndLongitude
(
startLongitude
);
item
.
setEndLongitude
(
startLongitude
);
item
.
setEndName
(
"无效坐标"
);
item
.
setEndName
(
"无效坐标"
);
if
(
travel
>
0.5
)
{
if
(
travel
>
0.5
)
{
String
address
=
getAddress
(
startLongitude
,
startLatitude
);
String
address
=
getAddress
(
startLongitude
,
startLatitude
);
item
.
setEndName
(
address
);
item
.
setEndName
(
address
);
}
}
item
.
setTravel
(
new
BigDecimal
(
travel
/
1000
).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
item
.
setTravel
(
new
BigDecimal
(
travel
/
1000
).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
item
.
setTakeTime
(
takeTime
);
item
.
setTakeTime
(
takeTime
);
if
(
travel
>
0.5
)
{
if
(
travel
>
0.5
)
{
this
.
getBaseMapper
().
updateById
(
item
);
this
.
getBaseMapper
().
updateById
(
item
);
}
else
{
}
else
{
this
.
getBaseMapper
().
deleteById
(
item
.
getId
());
this
.
getBaseMapper
().
deleteById
(
item
.
getId
());
}
}
log
.
info
(
"-----------正常结束轨迹更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
log
.
info
(
"-----------正常结束轨迹更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
...
@@ -535,7 +531,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -535,7 +531,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
wrapper
.
isNotNull
(
WlCarMileage:
:
getEndTime
);
wrapper
.
isNotNull
(
WlCarMileage:
:
getEndTime
);
wrapper
.
isNotNull
(
WlCarMileage:
:
getStartTime
);
wrapper
.
isNotNull
(
WlCarMileage:
:
getStartTime
);
wrapper
.
like
(
WlCarMileage:
:
getStartTime
,
date
);
wrapper
.
like
(
WlCarMileage:
:
getStartTime
,
date
);
List
<
WlCarMileage
>
list
=
iWlCarMileageService
.
list
(
wrapper
);
List
<
WlCarMileage
>
list
=
this
.
list
(
wrapper
);
for
(
WlCarMileage
wl
:
list
)
{
for
(
WlCarMileage
wl
:
list
)
{
//判断当前车辆全程是否异常,如果时速小于阈值 则对数据进行返回 否则不予返回
//判断当前车辆全程是否异常,如果时速小于阈值 则对数据进行返回 否则不予返回
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTakeTime
())
&&
!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTravel
())
&&
((
wl
.
getTravel
()
/
(
wl
.
getTakeTime
()
/
3600000.0
))
<
CAR_MAX_SPEED
))
{
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTakeTime
())
&&
!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTravel
())
&&
((
wl
.
getTravel
()
/
(
wl
.
getTakeTime
()
/
3600000.0
))
<
CAR_MAX_SPEED
))
{
...
@@ -555,7 +551,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
...
@@ -555,7 +551,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
wrapper
.
isNotNull
(
WlCarMileage:
:
getStartTime
);
wrapper
.
isNotNull
(
WlCarMileage:
:
getStartTime
);
wrapper
.
ge
(
WlCarMileage:
:
getDate
,
startDate
);
wrapper
.
ge
(
WlCarMileage:
:
getDate
,
startDate
);
wrapper
.
le
(
WlCarMileage:
:
getDate
,
endDate
);
wrapper
.
le
(
WlCarMileage:
:
getDate
,
endDate
);
List
<
WlCarMileage
>
list
=
iWlCarMileageService
.
list
(
wrapper
);
List
<
WlCarMileage
>
list
=
this
.
list
(
wrapper
);
for
(
WlCarMileage
wl
:
list
)
{
for
(
WlCarMileage
wl
:
list
)
{
//判断当前车辆全程是否异常,如果时速小于阈值 则对数据进行返回 否则不予返回
//判断当前车辆全程是否异常,如果时速小于阈值 则对数据进行返回 否则不予返回
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTakeTime
())
&&
!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTravel
())
&&
((
wl
.
getTravel
()
/
(
wl
.
getTakeTime
()
/
3600000.0
))
<
CAR_MAX_SPEED
))
{
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTakeTime
())
&&
!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
wl
.
getTravel
())
&&
((
wl
.
getTravel
()
/
(
wl
.
getTakeTime
()
/
3600000.0
))
<
CAR_MAX_SPEED
))
{
...
...
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