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
0063426a
Commit
0063426a
authored
Dec 12, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.车辆管理-日志调整
parent
e900428d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
66 deletions
+10
-66
CarMapper.java
...c/main/java/com/yeejoin/equipmanage/mapper/CarMapper.java
+3
-0
JxiopCarIotListerServiceImpl.java
...quipmanage/service/impl/JxiopCarIotListerServiceImpl.java
+0
-1
WlCarMileageServiceImpl.java
...oin/equipmanage/service/impl/WlCarMileageServiceImpl.java
+7
-65
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/CarMapper.java
View file @
0063426a
...
...
@@ -12,6 +12,7 @@ import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentOnCarAppVO
;
import
com.yeejoin.equipmanage.common.vo.EquipStateOnCarVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -89,4 +90,6 @@ public interface CarMapper extends BaseMapper<Car> {
List
<
CarEquipAlarmInfoDto
>
getCarEquipAlarmInfo
(
Integer
batteryNumber
);
void
updateStatusByIds
(
List
<
String
>
carIds
,
String
status
);
@Update
(
"update wl_car set latitude = #{latitude} , longitude = #{longitude} where iot_code = #{iotCode}"
)
void
updateCarLocationByIotCode
(
String
iotCode
,
Double
latitude
,
Double
longitude
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/JxiopCarIotListerServiceImpl.java
View file @
0063426a
...
...
@@ -118,7 +118,6 @@ public class JxiopCarIotListerServiceImpl {
StringBuilder
res
=
new
StringBuilder
();
BufferedReader
in
=
null
;
try
{
System
.
out
.
println
(
api
.
toString
());
URL
url
=
new
URL
(
api
.
toString
());
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
.
setDoOutput
(
true
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/WlCarMileageServiceImpl.java
View file @
0063426a
...
...
@@ -17,6 +17,7 @@ import com.yeejoin.equipmanage.common.utils.RedisUtil;
import
com.yeejoin.equipmanage.controller.Coordinate
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.listener.CarIotNewListener
;
import
com.yeejoin.equipmanage.mapper.CarMapper
;
import
com.yeejoin.equipmanage.mapper.WlCarMileageMapper
;
import
com.yeejoin.equipmanage.service.ICarService
;
import
com.yeejoin.equipmanage.service.IWlCarMileageService
;
...
...
@@ -87,7 +88,8 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
private
IWlCarMileageService
iWlCarMileageService
;
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
CarMapper
carMapper
;
public
static
List
<
String
>
getDayByMonth
(
Date
date
)
{
List
<
String
>
data
=
new
ArrayList
<>();
try
{
...
...
@@ -320,24 +322,8 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
log
.
info
(
"轨迹切分定时任务数据过滤时间.............{}"
,
nowDate
);
List
<
WlCarMileage
>
list
=
this
.
baseMapper
.
list
(
nowDate
);
log
.
info
(
"需要切分数据, {}"
,
list
);
//销毁所有线程和所有上次坐标
//销毁所有线程
// log.info("销毁所有有效线程开始");
// JxiopCarIotListerServiceImpl.deviceInfo.keySet().forEach(s -> {
// try {
// JxiopCarIotListerServiceImpl.deviceInfo.get(s).interrupt();
// } catch (Exception e) {
// log.info("销毁有效线程失败" + e.getMessage());
// }
// });
// JxiopCarIotListerServiceImpl.deviceInfo.clear();
// log.info("销毁所有有效线程成功");
// //销毁所有的坐标信息
// log.info("销毁所有坐标信息开始");
// JxiopCarIotListerServiceImpl.deviceLastInfo.clear();
log
.
info
(
"销毁所有坐标信息成功"
);
log
.
info
(
"------------------开始切分里程-------------------------------"
);
log
.
info
(
"------------------
跨天轨迹切分任
开始切分里程-------------------------------"
);
list
.
forEach
(
item
->
{
redisTemplate
.
delete
(
item
.
getIotCode
());
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -407,49 +393,10 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
item
.
setTravel
(
new
BigDecimal
(
travel
/
1000
).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
item
.
setTakeTime
(
takeTime
);
this
.
getBaseMapper
().
updateById
(
item
);
log
.
info
(
"-----------结束里程成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
// // 从0点开启新里程
// item.setStartName(address);
// item.setDate(date);
// item.setId(null);
// item.setEndSpeed(null);
// item.setEndTime(null);
// item.setEndLatitude(null);
// item.setEndLongitude(null);
// item.setEndName(null);
// item.setTravel(null);
// item.setTakeTime(null);
// item.setStartSpeed(v.intValue());
// item.setStartTime(item.getDate());
// item.setStartLongitude(startLongitude);
// item.setStartLatitude(startLatitude);
// this.baseMapper.insert(item);
// HashMap<String,String> messageMap = new HashMap<>();
// messageMap.put("FireCar_Latitude", String.valueOf(startLatitude));
// messageMap.put("FireCar_Longitude", String.valueOf(startLongitude));
// messageMap.put("FireCar_Speed",String.valueOf(v.intValue()));
// messageMap.put("time",String.valueOf(item.getDate().getTime()));
// messageMap.put("name","轨迹切分消息!!!");
// log.info("-----------新增开始里程成功:::"+JSONObject.toJSONString(item)+"-----------------");
// try {
// emqKeeper.getMqttClient().publish(item.getIotCode().substring(0, 8)+"/"+item.getIotCode().substring(8)+"/property",JSON.toJSON(messageMap).toString().getBytes("UTF-8"),1,false);
// } catch (Exception e) {
// }
//根据iotcode获取车辆并且同步经纬度到车辆
Car
car
=
iCarService
.
getOne
(
new
QueryWrapper
<
Car
>().
eq
(
"iot_code"
,
item
.
getIotCode
()));
car
.
setLongitude
(
startLongitude
);
car
.
setLatitude
(
startLatitude
);
iCarService
.
saveOrUpdate
(
car
);
log
.
info
(
"-----------更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
log
.
info
(
"-----------跨天轨迹切分任更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
}
});
log
.
info
(
"轨迹切分任务执行完成.............."
);
// log.info("-------------------对于切割完成的数据进行倒计时操作----------------------------------");
// ThreadCarMileageTreatment threadCarMileageTreatment = new ThreadCarMileageTreatment(this,iCarService , iotFeign);
// log.info("-------------------对于切割完成的数据进行倒计时开始----------------------------------");
// threadCarMileageTreatment.start();
// log.info("-------------------对于切割完成的数据进行倒计时结束----------------------------------");
log
.
info
(
"-------------------跨天轨迹切分任务执行完成.............."
);
}
@Scheduled
(
cron
=
"${mileage.splitmileage.cron}"
)
...
...
@@ -523,12 +470,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
}
else
{
this
.
getBaseMapper
().
deleteById
(
item
.
getId
());
}
log
.
info
(
"-----------结束里程成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
Car
car
=
iCarService
.
getOne
(
new
QueryWrapper
<
Car
>().
eq
(
"iot_code"
,
item
.
getIotCode
()));
car
.
setLongitude
(
startLongitude
);
car
.
setLatitude
(
startLatitude
);
iCarService
.
saveOrUpdate
(
car
);
log
.
info
(
"-----------更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
log
.
info
(
"-----------正常结束轨迹更新车辆坐标成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
}
}
});
...
...
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