111
This commit is contained in:
parent
fa7f3d2fb4
commit
2e69d54674
|
@ -165,6 +165,24 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
||||||
device.setRemainingMileage(CommonUtil.getRemainingMileage(device.getVoltage(),model.getFullVoltage(),model.getLowVoltage(),model.getFullEndurance()));
|
device.setRemainingMileage(CommonUtil.getRemainingMileage(device.getVoltage(),model.getFullVoltage(),model.getLowVoltage(),model.getFullEndurance()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String msg = redisCache.getCacheObject(CacheConstants.CACHE_DEVICE_KEY + device.getMac());
|
||||||
|
if(StrUtil.isNotBlank(msg)){
|
||||||
|
LogEntry logEntry = JSONObject.parseObject(msg, LogEntry.class);
|
||||||
|
LogEntry.LocationValue value = logEntry.getValue();
|
||||||
|
if(!"0.0".equals(value.getLon()) && !"0.0".equals(value.getLat())){
|
||||||
|
// 坐标转换 WGS84 转 GCJ02
|
||||||
|
double[] doubles = CommonUtil.coordinateConvert(value.getLon(),value.getLat());
|
||||||
|
BigDecimal lon = BigDecimal.valueOf(doubles[1]).setScale(8, RoundingMode.HALF_UP);
|
||||||
|
// todo 0E-8 排除
|
||||||
|
BigDecimal lat = BigDecimal.valueOf(doubles[0]).setScale(8, RoundingMode.HALF_UP);
|
||||||
|
device.setLongitude(lon.toString());
|
||||||
|
device.setLatitude(lat.toString());
|
||||||
|
}else{
|
||||||
|
device.setLongitude(null);
|
||||||
|
device.setLatitude(null);
|
||||||
|
}
|
||||||
|
device.setLastLocationTime(new Date(logEntry.getAt()));
|
||||||
|
}
|
||||||
if(ObjectUtil.isNotNull(areaId) && areaId!=0){
|
if(ObjectUtil.isNotNull(areaId) && areaId!=0){
|
||||||
SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
|
SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
|
||||||
//https://dianche.chuantewulian.cn?sn=https://dche.ccttiot.com?sn=3000900
|
//https://dianche.chuantewulian.cn?sn=https://dche.ccttiot.com?sn=3000900
|
||||||
|
@ -232,12 +250,18 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
||||||
LogEntry logEntry = JSONObject.parseObject(msg, LogEntry.class);
|
LogEntry logEntry = JSONObject.parseObject(msg, LogEntry.class);
|
||||||
log.info("【根据sn号查询车辆实时信息】============logEntry转换后的对象: logEntry---【{}】" , JSON.toJSONString(logEntry));
|
log.info("【根据sn号查询车辆实时信息】============logEntry转换后的对象: logEntry---【{}】" , JSON.toJSONString(logEntry));
|
||||||
LogEntry.LocationValue value = logEntry.getValue();
|
LogEntry.LocationValue value = logEntry.getValue();
|
||||||
// 坐标转换 WGS84 转 GCJ02
|
if(!"0.0".equals(value.getLon()) && !"0.0".equals(value.getLat())){
|
||||||
double[] doubles = CommonUtil.coordinateConvert(value.getLon(),value.getLat());
|
// 坐标转换 WGS84 转 GCJ02
|
||||||
BigDecimal lon = BigDecimal.valueOf(doubles[1]).setScale(8, RoundingMode.HALF_UP);
|
double[] doubles = CommonUtil.coordinateConvert(value.getLon(),value.getLat());
|
||||||
BigDecimal lat = BigDecimal.valueOf(doubles[0]).setScale(8, RoundingMode.HALF_UP);
|
BigDecimal lon = BigDecimal.valueOf(doubles[1]).setScale(8, RoundingMode.HALF_UP);
|
||||||
asDevice.setLongitude(lon.toString());
|
BigDecimal lat = BigDecimal.valueOf(doubles[0]).setScale(8, RoundingMode.HALF_UP);
|
||||||
asDevice.setLatitude(lat.toString());
|
// todo 0E-8 排除
|
||||||
|
asDevice.setLongitude(lon.toString());
|
||||||
|
asDevice.setLatitude(lat.toString());
|
||||||
|
}else{
|
||||||
|
asDevice.setLongitude(null);
|
||||||
|
asDevice.setLatitude(null);
|
||||||
|
}
|
||||||
asDevice.setLastLocationTime(new Date(logEntry.getAt()));
|
asDevice.setLastLocationTime(new Date(logEntry.getAt()));
|
||||||
}
|
}
|
||||||
//正在进行中的订单
|
//正在进行中的订单
|
||||||
|
|
|
@ -748,7 +748,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
order.setPayFee(etCapitalFlow.getAmount().add(etCapitalFlow.getHandlingCharge()));
|
order.setPayFee(etCapitalFlow.getAmount().add(etCapitalFlow.getHandlingCharge()));
|
||||||
order.setTotalFee(etCapitalFlow.getAmount());
|
order.setTotalFee(etCapitalFlow.getAmount());
|
||||||
List<Long> longs = etOperatingAreaService.selectAreaListByDeptId(etCapitalFlow.getOwnerId());
|
List<Long> longs = etOperatingAreaService.selectAreaListByDeptId(etCapitalFlow.getOwnerId());
|
||||||
if(longs.size() == 0){
|
if(longs.isEmpty()){
|
||||||
throw new ServiceException("【管理员提现失败】提现失败,未找到该运营区,运营商id:"+etCapitalFlow.getOwnerId());
|
throw new ServiceException("【管理员提现失败】提现失败,未找到该运营区,运营商id:"+etCapitalFlow.getOwnerId());
|
||||||
}
|
}
|
||||||
order.setAreaId(longs.get(0));
|
order.setAreaId(longs.get(0));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user