|
@@ -26,7 +26,7 @@ import org.springblade.core.cache.utils.CacheUtil;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
-import org.springblade.land.constant.LandConstant;
|
|
|
|
|
|
|
+import org.springblade.land.constant.LandConst;
|
|
|
import org.springblade.land.entity.TrackKey;
|
|
import org.springblade.land.entity.TrackKey;
|
|
|
import org.springblade.land.entity.TrackLog;
|
|
import org.springblade.land.entity.TrackLog;
|
|
|
import org.springblade.land.mapper.TrackLogMapper;
|
|
import org.springblade.land.mapper.TrackLogMapper;
|
|
@@ -57,7 +57,7 @@ public class TrackLogServiceImpl extends ServiceImpl<TrackLogMapper, TrackLog> i
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public List<Double> location(TrackLog trackLog) {
|
|
public List<Double> location(TrackLog trackLog) {
|
|
|
- TrackKey key = CacheUtil.get(LandConstant.LAND_CACHE, LandConstant.TRACK_TOKEN, AuthUtil.getTenantId(), TrackKey.class, false);
|
|
|
|
|
|
|
+ TrackKey key = CacheUtil.get(LandConst.LAND_CACHE, LandConst.TRACK_TOKEN, AuthUtil.getTenantId(), TrackKey.class, false);
|
|
|
if (ObjectUtil.isEmpty(key)) {
|
|
if (ObjectUtil.isEmpty(key)) {
|
|
|
throw new RuntimeException("获取请求token失败");
|
|
throw new RuntimeException("获取请求token失败");
|
|
|
}
|
|
}
|
|
@@ -72,7 +72,7 @@ public class TrackLogServiceImpl extends ServiceImpl<TrackLogMapper, TrackLog> i
|
|
|
map.put("vco", "2");
|
|
map.put("vco", "2");
|
|
|
|
|
|
|
|
DataExchangeService des = new DataExchangeService(5000, 8000);
|
|
DataExchangeService des = new DataExchangeService(5000, 8000);
|
|
|
- String res = des.postHttps(LandConstant.TRACK_LOCATION_URL, map);
|
|
|
|
|
|
|
+ String res = des.postHttps(LandConst.TRACK_LOCATION_URL, map);
|
|
|
System.out.println("RES::" + res);
|
|
System.out.println("RES::" + res);
|
|
|
trackLog.setDetail(res);
|
|
trackLog.setDetail(res);
|
|
|
|
|
|
|
@@ -98,7 +98,7 @@ public class TrackLogServiceImpl extends ServiceImpl<TrackLogMapper, TrackLog> i
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public List<List<Double>> track(TrackLog trackLog) {
|
|
public List<List<Double>> track(TrackLog trackLog) {
|
|
|
- TrackKey key = CacheUtil.get(LandConstant.LAND_CACHE, LandConstant.TRACK_TOKEN, AuthUtil.getTenantId(), TrackKey.class, false);
|
|
|
|
|
|
|
+ TrackKey key = CacheUtil.get(LandConst.LAND_CACHE, LandConst.TRACK_TOKEN, AuthUtil.getTenantId(), TrackKey.class, false);
|
|
|
if (ObjectUtil.isEmpty(key)) {
|
|
if (ObjectUtil.isEmpty(key)) {
|
|
|
throw new RuntimeException("获取请求token失败");
|
|
throw new RuntimeException("获取请求token失败");
|
|
|
}
|
|
}
|
|
@@ -115,7 +115,7 @@ public class TrackLogServiceImpl extends ServiceImpl<TrackLogMapper, TrackLog> i
|
|
|
map.put("qryEtm", DateUtil.formatDateTime(new Date()));
|
|
map.put("qryEtm", DateUtil.formatDateTime(new Date()));
|
|
|
|
|
|
|
|
DataExchangeService des = new DataExchangeService(5000, 8000);
|
|
DataExchangeService des = new DataExchangeService(5000, 8000);
|
|
|
- String res = des.postHttps(LandConstant.TRACK_TRACK_URL, map);
|
|
|
|
|
|
|
+ String res = des.postHttps(LandConst.TRACK_TRACK_URL, map);
|
|
|
System.out.println("RES::" + res);
|
|
System.out.println("RES::" + res);
|
|
|
trackLog.setDetail(res);
|
|
trackLog.setDetail(res);
|
|
|
|
|
|
|
@@ -145,7 +145,7 @@ public class TrackLogServiceImpl extends ServiceImpl<TrackLogMapper, TrackLog> i
|
|
|
|
|
|
|
|
private static JSONObject getData(String res) throws Exception {
|
|
private static JSONObject getData(String res) throws Exception {
|
|
|
JSONObject result = JSON.parseObject(res);
|
|
JSONObject result = JSON.parseObject(res);
|
|
|
- if (!LandConstant.TRACK_REQ_SUCCESS.equals(result.getString("status"))) {
|
|
|
|
|
|
|
+ if (!LandConst.TRACK_REQ_SUCCESS.equals(result.getString("status"))) {
|
|
|
throw new Exception("获取数据失败:" + result.getString("status"));
|
|
throw new Exception("获取数据失败:" + result.getString("status"));
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|