This commit is contained in:
邱贞招 2025-01-10 20:15:08 +08:00
parent fa7f3d2fb4
commit 2e69d54674
2 changed files with 31 additions and 7 deletions

View File

@ -165,6 +165,24 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
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){
SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
//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);
log.info("【根据sn号查询车辆实时信息】============logEntry转换后的对象: logEntry---【{}】" , JSON.toJSONString(logEntry));
LogEntry.LocationValue value = logEntry.getValue();
// 坐标转换 WGS84 GCJ02
double[] doubles = CommonUtil.coordinateConvert(value.getLon(),value.getLat());
BigDecimal lon = BigDecimal.valueOf(doubles[1]).setScale(8, RoundingMode.HALF_UP);
BigDecimal lat = BigDecimal.valueOf(doubles[0]).setScale(8, RoundingMode.HALF_UP);
asDevice.setLongitude(lon.toString());
asDevice.setLatitude(lat.toString());
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);
BigDecimal lat = BigDecimal.valueOf(doubles[0]).setScale(8, RoundingMode.HALF_UP);
// todo 0E-8 排除
asDevice.setLongitude(lon.toString());
asDevice.setLatitude(lat.toString());
}else{
asDevice.setLongitude(null);
asDevice.setLatitude(null);
}
asDevice.setLastLocationTime(new Date(logEntry.getAt()));
}
//正在进行中的订单

View File

@ -748,7 +748,7 @@ public class SysDeptServiceImpl implements ISysDeptService
order.setPayFee(etCapitalFlow.getAmount().add(etCapitalFlow.getHandlingCharge()));
order.setTotalFee(etCapitalFlow.getAmount());
List<Long> longs = etOperatingAreaService.selectAreaListByDeptId(etCapitalFlow.getOwnerId());
if(longs.size() == 0){
if(longs.isEmpty()){
throw new ServiceException("【管理员提现失败】提现失败未找到该运营区运营商id:"+etCapitalFlow.getOwnerId());
}
order.setAreaId(longs.get(0));