|
|
@@ -136,10 +136,12 @@ public class CamelDataUtil {
|
|
|
try{
|
|
|
JSONArray lines = JSONUtil.parseObj(scheduleVo.getPathInfo()).getJSONArray("pathLine");
|
|
|
List<JSONObject> lines1 = new ArrayList<>();
|
|
|
+ String text = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("sys.car.text");
|
|
|
RedisUtils.setCacheObject(StringUtils.format("car_{}_{}_current_station",carInfoVo1.getCarNum(),DateFormatUtils.format( scheduleVo.getScheduleDate(),DateUtils.YYYYMMDDHHMMSS)),"");
|
|
|
for (JSONObject jsonObject : lines.toList(JSONObject.class)) {
|
|
|
double distance = DistanceCalculator.calculateDistance(jsonObject.getStr("location"),StringUtils.format("{},{}", gpsData.getLng(),gpsData.getLat()));
|
|
|
String configdistance = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("sys.car.distance");
|
|
|
+
|
|
|
if(Double.parseDouble(configdistance)>distance){
|
|
|
String stations = RedisUtils.getCacheObject(StringUtils.format("car_{}_{}_current_station",carInfoVo1.getCarNum(),DateFormatUtils.format( scheduleVo.getScheduleDate(),DateUtils.YYYYMMDDHHMMSS)));
|
|
|
RedisUtils.setCacheObject(StringUtils.format("car_{}_{}_current_station",carInfoVo1.getCarNum(),DateFormatUtils.format( scheduleVo.getScheduleDate(),DateUtils.YYYYMMDDHHMMSS)),stations+","+jsonObject.getStr("stationName"));
|
|
|
@@ -210,7 +212,7 @@ public class CamelDataUtil {
|
|
|
|
|
|
|
|
|
//满足条件播报(led or 广播)
|
|
|
- String message = StringUtils.format("{}即将到达{},即将到达,请准备接货。", carInfoVo1.getCarNum(),stations.get(0).getDictLabel());
|
|
|
+ String message = StringUtils.format(text, carInfoVo1.getCarNum(),stations.get(0).getDictLabel());
|
|
|
if(StringUtils.isNotEmpty(stations.get(0).getRemark())){
|
|
|
List<JSONObject> devicedatas = JSONUtil.parseArray( stations.get(0).getRemark()).toList(JSONObject.class);
|
|
|
for (JSONObject i :devicedatas) {
|
|
|
@@ -237,13 +239,12 @@ public class CamelDataUtil {
|
|
|
log.error("---------------------");
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- else{
|
|
|
+ }else{
|
|
|
//无路线无排班车辆
|
|
|
|
|
|
String configdistance = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("sys.car5.distance");
|
|
|
String configtime = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("sys.car5.time");
|
|
|
+ String text = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("sys.car5.text");
|
|
|
if(StrUtil.isEmptyIfStr(configdistance)) configdistance="500";
|
|
|
if(StrUtil.isEmptyIfStr(configtime)) configtime="180000";
|
|
|
//查询所有站点经纬
|
|
|
@@ -272,8 +273,8 @@ public class CamelDataUtil {
|
|
|
}
|
|
|
}
|
|
|
if(canbobao){
|
|
|
- Long lastStationCode = RedisUtils.getCacheObject(StringUtils.format("car_{}_last_bb_station",carInfoVo1.getCarNum()));
|
|
|
- if(lastStationCode!=null && lastStationCode.equals(station.getDictCode())){
|
|
|
+ String lastStationCode = RedisUtils.getCacheObject(StringUtils.format("car_{}_last_bb_station",carInfoVo1.getCarNum()));
|
|
|
+ if(lastStationCode!=null && lastStationCode.equals(station.getDictCode().toString())){
|
|
|
canbobao = false;
|
|
|
}
|
|
|
}
|
|
|
@@ -282,10 +283,10 @@ public class CamelDataUtil {
|
|
|
//设置播报站播报时间
|
|
|
RedisUtils.setCacheObject(StringUtils.format("car_{}_{}_station",carInfoVo1.getCarNum(),station.getDictCode()),DateUtil.current());
|
|
|
//设置播报站
|
|
|
- RedisUtils.setCacheObject(StringUtils.format("car_{}_last_bb_station",carInfoVo1.getCarNum()),station.getDictCode());
|
|
|
+ RedisUtils.setCacheObject(StringUtils.format("car_{}_last_bb_station",carInfoVo1.getCarNum()),station.getDictCode().toString());
|
|
|
|
|
|
//满足条件播报(led or 广播)
|
|
|
- String message = StringUtils.format("{}即将到达{},即将到达,请准备接货。", carInfoVo1.getCarNum(),station.getDictLabel());
|
|
|
+ String message = StringUtils.format(text, carInfoVo1.getCarNum(),station.getDictLabel());
|
|
|
if(StringUtils.isNotEmpty(station.getRemark())){
|
|
|
List<JSONObject> devicedatas = JSONUtil.parseArray( station.getRemark()).toList(JSONObject.class);
|
|
|
for (JSONObject i :devicedatas) {
|